Skip to content

Commit d5fc6b5

Browse files
niikckerr
authored andcommitted
fix: Special case ReadableStream type to mean Node.js ReadableStream (#99)
* Special case ReadableStream type to mean Node.js ReadableStream * doh, typo
1 parent 8eb892f commit d5fc6b5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/utils.js

+6
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ const typify = (type) => {
9999
return 'string'
100100
case 'touchbaritem':
101101
return '(TouchBarButton | TouchBarColorPicker | TouchBarGroup | TouchBarLabel | TouchBarPopover | TouchBarScrubber | TouchBarSegmentedControl | TouchBarSlider | TouchBarSpacer | null)'
102+
case 'readablestream':
103+
// See StreamProtocolResponse.data which accepts a Node.js readable stream.
104+
// The ReadableStream type unfortunately conflicts with the ReadableStream interface
105+
// defined in the Streams standard (https://streams.spec.whatwg.org/#rs-class) so
106+
// we'll have to qualify it with the Node.js namespace.
107+
return 'NodeJS.ReadableStream'
102108
}
103109
// if (type.substr(0, 8) === 'TouchBar' && type !== 'TouchBar') {
104110
// return `Electron.${type}`

0 commit comments

Comments
 (0)