From 57e5129e2f02ecc852c724e08c9f8d32e1b08a3b Mon Sep 17 00:00:00 2001 From: Markus Olsson Date: Wed, 9 May 2018 14:55:08 +0200 Subject: [PATCH 1/2] Special case ReadableStream type to mean Node.js ReadableStream --- lib/utils.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/utils.js b/lib/utils.js index 374f811..4e65208 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -92,13 +92,19 @@ const typify = (type) => { case 'buffer': return 'Buffer' case 'buffer[]': - return 'Buffer[]' + return 'Buffer['] case 'promise': return 'Promise' case 'url': return 'string' case 'touchbaritem': return '(TouchBarButton | TouchBarColorPicker | TouchBarGroup | TouchBarLabel | TouchBarPopover | TouchBarScrubber | TouchBarSegmentedControl | TouchBarSlider | TouchBarSpacer | null)' + case 'readablestream': + // See StreamProtocolResponse.data which accepts a Node.js readable stream. + // The ReadableStream type unfortunately conflicts with the ReadableStream interface + // defined in the Streams standard (https://streams.spec.whatwg.org/#rs-class) so + // we'll have to qualify it with the Node.js namespace. + return 'NodeJS.ReadableStream' } // if (type.substr(0, 8) === 'TouchBar' && type !== 'TouchBar') { // return `Electron.${type}` From 982f4e994eface79c67801a9c53919ec294caed7 Mon Sep 17 00:00:00 2001 From: Markus Olsson Date: Wed, 9 May 2018 15:05:49 +0200 Subject: [PATCH 2/2] doh, typo --- lib/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils.js b/lib/utils.js index 4e65208..7f4e2dd 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -92,7 +92,7 @@ const typify = (type) => { case 'buffer': return 'Buffer' case 'buffer[]': - return 'Buffer['] + return 'Buffer[]' case 'promise': return 'Promise' case 'url':