Merge pull request #33385 from BendingBender/ora

[ora] Update types to v3.1
This commit is contained in:
Jesse Trinity
2019-02-26 13:04:35 -08:00
committed by GitHub
2 changed files with 19 additions and 1 deletions
+16 -1
View File
@@ -1,4 +1,4 @@
// Type definitions for ora 3.0
// Type definitions for ora 3.1
// Project: https://github.com/sindresorhus/ora
// Definitions by: Basarat Ali Syed <https://github.com/basarat>
// Christian Rackerseder <https://github.com/screendriver>
@@ -45,6 +45,16 @@ declare namespace ora {
*/
color: Color;
/**
* Change the spinner.
*/
spinner: SpinnerName | Spinner;
/**
* Change the spinner indent.
*/
indent: number;
/**
* Start the spinner.
*
@@ -149,6 +159,11 @@ declare namespace ora {
* @default true
*/
hideCursor?: boolean;
/**
* Indent the spinner with the given number of spaces.
* @default 0
*/
indent?: number;
/**
* Interval between each frame.
*
+3
View File
@@ -9,6 +9,7 @@ ora({ spinner: { interval: 80, frames: ['-', '+', '-'] } });
ora({ color: 'cyan' });
ora({ color: 'foo' }); // $ExpectError
ora({ hideCursor: true });
ora({ indent: 1 });
ora({ interval: 80 });
ora({ stream: new PassThrough() });
ora({ isEnabled: true });
@@ -17,6 +18,8 @@ spinner.color = 'yellow';
spinner.text = 'Loading rainbows';
spinner.isSpinning; // $ExpectType boolean
spinner.isSpinning = true; // $ExpectError
spinner.spinner = 'dots';
spinner.indent = 5;
spinner.start();
spinner.start('Test text');