Skip to content

Commit 552fe5d

Browse files
committed
Merge pull request DefinitelyTyped#8496 from DefinitelyTyped/def/ora
ora 🌹 🕐 🕑
2 parents 0144ad5 + a660bd5 commit 552fe5d

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

ora/ora-tests.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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);

ora/ora.d.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
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+
}

0 commit comments

Comments
 (0)