Skip to content
This repository has been archived by the owner on Feb 1, 2022. It is now read-only.

Commit

Permalink
fix: ActionBase typings
Browse files Browse the repository at this point in the history
  • Loading branch information
RasPhilCo committed Jul 11, 2019
1 parent bb00e09 commit ac5c1bc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/action/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}
}
4 changes: 2 additions & 2 deletions src/action/spinner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
))
Expand Down
22 changes: 11 additions & 11 deletions src/deps.ts
Original file line number Diff line number Diff line change
@@ -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 = {}
Expand Down

0 comments on commit ac5c1bc

Please sign in to comment.