From 9ba0229a929fe8fccdcacff0212822dcaec05ebd Mon Sep 17 00:00:00 2001 From: Keith Kelly Date: Sun, 17 Jun 2018 19:04:50 -0400 Subject: [PATCH] Changes NodeJS.WritableStream to NodeJS.WriteStream and NodeJS.ReadableStream to NodeJS.ReadStream to correctly type check process.stdin, process.stdout, and process.stderr --- types/inquirer/index.d.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/types/inquirer/index.d.ts b/types/inquirer/index.d.ts index 90697f2423..9f23ad21aa 100644 --- a/types/inquirer/index.d.ts +++ b/types/inquirer/index.d.ts @@ -22,8 +22,12 @@ declare namespace inquirer { | Question | ReadonlyArray> | Rx.Observable>; - type OutputStreamOption = {output: NodeJS.WritableStream}; - type InputStreamOption = {input: NodeJS.ReadableStream}; + interface OutputStreamOption { + output: NodeJS.WriteStream + } + interface InputStreamOption { + input: NodeJS.ReadStream + } type StreamOptions = InputStreamOption | OutputStreamOption | (InputStreamOption & OutputStreamOption); interface Inquirer { @@ -38,7 +42,7 @@ declare namespace inquirer { * Create a new self-contained prompt module. * @param opt Object specifying input and output streams for the prompt */ - createPromptModule(opt?: StreamOptions): PromptModule; + createPromptModule(opt?: OutputStreamOption): PromptModule; /** * Public CLI helper interface * @param questions Questions settings array