From d37b75e068f68a389f7be5c54f99f1ad6d06482c Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Tue, 5 Mar 2019 17:52:03 +0700 Subject: [PATCH] Minor TS definition tweak --- index.d.ts | 4 ++-- index.test-d.ts | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/index.d.ts b/index.d.ts index c191802..f2006f3 100644 --- a/index.d.ts +++ b/index.d.ts @@ -1,5 +1,5 @@ /// -import {Writable} from 'stream'; +import {Writable as WritableStream} from 'stream'; import {SpinnerName} from 'cli-spinners'; export type Spinner = Readonly<{ @@ -76,7 +76,7 @@ export type Options = Readonly<{ * * @default process.stderr */ - stream?: Writable; + stream?: WritableStream; /** * Force enable/disable the spinner. If not specified, the spinner will be enabled if the `stream` is being run inside a TTY context (not spawned or piped) and/or not in a CI environment. diff --git a/index.test-d.ts b/index.test-d.ts index 8c2e6b7..21468b1 100644 --- a/index.test-d.ts +++ b/index.test-d.ts @@ -1,5 +1,5 @@ import {expectType} from 'tsd-check'; -import {PassThrough} from 'stream'; +import {PassThrough as PassThroughStream} from 'stream'; import ora, {promise} from '.'; const spinner = ora('Loading unicorns'); @@ -11,7 +11,7 @@ ora({color: 'cyan'}); ora({hideCursor: true}); ora({indent: 1}); ora({interval: 80}); -ora({stream: new PassThrough()}); +ora({stream: new PassThroughStream()}); ora({isEnabled: true}); spinner.color = 'yellow'; @@ -41,7 +41,7 @@ spinner.frame(); const resolves = Promise.resolve(1); promise(resolves, 'foo'); promise(resolves, { - stream: new PassThrough(), + stream: new PassThroughStream(), text: 'foo', color: 'blue', isEnabled: true