mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
* @types/test-console: Add types for test-console * @types/test-console: callbacks as required * @types/test-console: exporting all types and interfaces
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
// Type definitions for test-console 1.1
|
|
// Project: https://github.com/jamesshore/test-console
|
|
// Definitions by: Roberto Soares <https://github.com/roberto>
|
|
// Pedro Guidoux <https://github.com/guidoux>
|
|
// Guilherme Moretti <https://github.com/gbmoretti>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
|
|
export const stdout: TestStream;
|
|
export const stderr: TestStream;
|
|
|
|
export type Output = ReadonlyArray<string>;
|
|
export type OutputCallback = (output: Output) => void;
|
|
export type NoOutputCallback = () => void;
|
|
export type Restore = () => void;
|
|
|
|
export interface Options {
|
|
isTTY?: boolean;
|
|
}
|
|
|
|
export interface Inspector {
|
|
output: Output;
|
|
restore: Restore;
|
|
}
|
|
|
|
export interface TestStream {
|
|
inspect(options?: Options): Inspector;
|
|
inspectSync(fn: OutputCallback): Output;
|
|
inspectSync(options: Options, fn: OutputCallback): Output;
|
|
ignore(options?: Options): Restore;
|
|
ignoreSync(fn: NoOutputCallback): void;
|
|
ignoreSync(options: Options, fn: NoOutputCallback): void;
|
|
}
|