ora: promise method should belong to oraFactory, not Ora class.

This commit is contained in:
Aleh Zasypkin
2018-02-16 12:53:09 +01:00
parent 423ace8fe7
commit 0a53cd74f5
2 changed files with 4 additions and 3 deletions

View File

@@ -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;

View File

@@ -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',