mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-20 12:46:36 +08:00
ora: promise method should belong to oraFactory, not Ora class.
This commit is contained in:
5
types/ora/index.d.ts
vendored
5
types/ora/index.d.ts
vendored
@@ -3,6 +3,7 @@
|
||||
// Definitions by: Basarat Ali Syed <https://github.com/basarat>
|
||||
// Christian Rackerseder <https://github.com/screendriver>
|
||||
// BendingBender <https://github.com/BendingBender>
|
||||
// Aleh Zasypkin <https://github.com/azasypkin>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
@@ -118,14 +119,14 @@ declare class Ora {
|
||||
text: string;
|
||||
|
||||
color: Color;
|
||||
|
||||
promise(action: PromiseLike<any>, options?: Options | string): Ora;
|
||||
}
|
||||
|
||||
interface oraFactory {
|
||||
(options?: Options | string): Ora;
|
||||
|
||||
new (options?: Options | string): Ora;
|
||||
|
||||
promise(action: PromiseLike<any>, options?: Options | string): Ora;
|
||||
}
|
||||
|
||||
declare const ora: oraFactory;
|
||||
|
||||
@@ -41,7 +41,7 @@ spinner.stopAndPersist({text: 'all done'});
|
||||
spinner.stopAndPersist({symbol: '@', text: 'all done'});
|
||||
|
||||
const resolves = Promise.resolve(1);
|
||||
spinner.promise(resolves, {
|
||||
Ora.promise(resolves, {
|
||||
stream: new PassThrough(),
|
||||
text: 'foo',
|
||||
color: 'blue',
|
||||
|
||||
Reference in New Issue
Block a user