File tree 2 files changed +37
-0
lines changed
2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change
1
+ /// <reference path="ora.d.ts" />
2
+
3
+ import ora = require( 'ora' ) ;
4
+ const spinner = ora ( 'Loading unicorns' ) ;
5
+
6
+ spinner . start ( ) ;
7
+
8
+ setTimeout ( ( ) => {
9
+ spinner . color = 'yellow' ;
10
+ spinner . text = 'Loading rainbows' ;
11
+ } , 1000 ) ;
Original file line number Diff line number Diff line change
1
+ // Type definitions for ora
2
+ // Project: https://github.com/sindresorhus/ora
3
+ // Definitions by: Basarat Ali Syed <https://github.com/basarat/>
4
+ // Definitions: https://github.com/borisyankov/DefinitelyTyped
5
+
6
+ declare module 'ora' {
7
+ type Color = 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'gray' ;
8
+ type Text = string ;
9
+ interface Options {
10
+ text ?: Text ;
11
+ spinner ?: string | { interval ?: number ; frames : string [ ] ; }
12
+ color ?: Color ;
13
+ stream ?: any ;
14
+ }
15
+ interface Instance {
16
+ start ( ) : void ;
17
+ stop ( ) : void ;
18
+ clear ( ) : void ;
19
+ frame ( ) : void ;
20
+ render ( ) : void ;
21
+ text : Text ;
22
+ color : Color ;
23
+ }
24
+ function ora ( options : Options | Text ) : Instance ;
25
+ export = ora ;
26
+ }
You can’t perform that action at this time.
0 commit comments