diff --git a/src/action/base.ts b/src/action/base.ts index 4fd77f2f..9efbf7a1 100644 --- a/src/action/base.ts +++ b/src/action/base.ts @@ -182,6 +182,6 @@ export class ActionBase { * write to the real stdout/stderr */ protected _write(std: 'stdout' | 'stderr', s: string | string[]) { - this.stdmockOrigs[std].apply(process[std], _.castArray(s)) + this.stdmockOrigs[std].apply(process[std], _.castArray(s) as [string]) } } diff --git a/src/action/spinner.ts b/src/action/spinner.ts index 91e772ae..7c3896a1 100644 --- a/src/action/spinner.ts +++ b/src/action/spinner.ts @@ -31,8 +31,8 @@ export default class SpinnerAction extends ActionBase { this._reset() if (this.spinner) clearInterval(this.spinner) this._render() - let interval: any = (this.spinner = setInterval( - this._render.bind(this), + let interval: any = (this.spinner = setInterval(icon => + this._render.bind(this)(icon), process.platform === 'win32' ? 500 : 100, 'spinner', )) diff --git a/src/deps.ts b/src/deps.ts index bfe24a5f..d201c5e7 100644 --- a/src/deps.ts +++ b/src/deps.ts @@ -1,18 +1,18 @@ export const deps = { - get stripAnsi(): typeof import ('strip-ansi') { return fetch('strip-ansi') }, - get ansiStyles(): typeof import ('ansi-styles') { return fetch('ansi-styles') }, + get stripAnsi(): (string: string) => string { return fetch('strip-ansi') }, + get ansiStyles(): typeof import('ansi-styles') { return fetch('ansi-styles') }, get ansiEscapes(): any { return fetch('ansi-escapes') }, get passwordPrompt(): any { return fetch('password-prompt') }, - get screen(): typeof import ('@oclif/screen') { return fetch('@oclif/screen') }, + get screen(): typeof import('@oclif/screen') { return fetch('@oclif/screen') }, - get open(): typeof import ('./open').default { return fetch('./open').default }, - get prompt(): typeof import ('./prompt') { return fetch('./prompt') }, - get styledObject(): typeof import ('./styled/object').default { return fetch('./styled/object').default }, - get styledHeader(): typeof import ('./styled/header').default { return fetch('./styled/header').default }, - get styledJSON(): typeof import ('./styled/json').default { return fetch('./styled/json').default }, - get table(): typeof import ('./styled/table').table { return fetch('./styled/table').table }, - get tree(): typeof import ('./styled/tree').default { return fetch('./styled/tree').default }, - get wait(): typeof import ('./wait').default { return fetch('./wait').default }, + get open(): typeof import('./open').default { return fetch('./open').default }, + get prompt(): typeof import('./prompt') { return fetch('./prompt') }, + get styledObject(): typeof import('./styled/object').default { return fetch('./styled/object').default }, + get styledHeader(): typeof import('./styled/header').default { return fetch('./styled/header').default }, + get styledJSON(): typeof import('./styled/json').default { return fetch('./styled/json').default }, + get table(): typeof import('./styled/table').table { return fetch('./styled/table').table }, + get tree(): typeof import('./styled/tree').default { return fetch('./styled/tree').default }, + get wait(): typeof import('./wait').default { return fetch('./wait').default }, } const cache: any = {}