mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 08:26:35 +08:00
26 lines
694 B
TypeScript
26 lines
694 B
TypeScript
// Type definitions for ora
|
|
// Project: https://github.com/sindresorhus/ora
|
|
// Definitions by: Basarat Ali Syed <https://github.com/basarat/>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
|
|
type Color = 'black' | 'red' | 'green' | 'yellow' | 'blue' | 'magenta' | 'cyan' | 'white' | 'gray';
|
|
type Text = string;
|
|
interface Options {
|
|
text?: Text;
|
|
spinner?: string | { interval?: number; frames: string[]; }
|
|
color?: Color;
|
|
stream?: any;
|
|
}
|
|
interface Instance {
|
|
start(): void;
|
|
stop(): void;
|
|
clear(): void;
|
|
frame(): void;
|
|
render(): void;
|
|
text: Text;
|
|
color: Color;
|
|
}
|
|
declare function ora(options: Options | Text): Instance;
|
|
export = ora;
|