Changes NodeJS.WritableStream to NodeJS.WriteStream and NodeJS.ReadableStream to NodeJS.ReadStream to correctly type check process.stdin, process.stdout, and process.stderr

This commit is contained in:
Keith Kelly
2018-06-17 19:04:50 -04:00
parent f8dbafddf5
commit 9ba0229a92

View File

@@ -22,8 +22,12 @@ declare namespace inquirer {
| Question<T>
| ReadonlyArray<Question<T>>
| Rx.Observable<Question<T>>;
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