UNPKG

@types/test-console

Version:
51 lines (41 loc) 1.82 kB
# Installation > `npm install --save @types/test-console` # Summary This package contains type definitions for test-console (https://github.com/jamesshore/test-console). # Details Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/test-console. ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/test-console/index.d.ts) ````ts export const stdout: TestStream; export const stderr: TestStream; export type Output = readonly string[]; export type OutputCallback = (output: Output) => void; export type AsyncOutputCallback = (output: Output) => Promise<void>; export type NoOutputCallback = () => void; export type AsyncNoOutputCallback = () => Promise<void>; export type Restore = () => void; export interface Options { isTTY?: boolean | undefined; } export interface Inspector { output: Output; restore: Restore; } export interface TestStream { inspect(options?: Options): Inspector; inspectSync(fn: OutputCallback): Output; inspectSync(options: Options, fn: OutputCallback): Output; inspectAsync(fn: AsyncOutputCallback): Promise<Output>; inspectAsync(options: Options, fn: AsyncOutputCallback): Promise<Output>; ignore(options?: Options): Restore; ignoreSync(fn: NoOutputCallback): void; ignoreSync(options: Options, fn: NoOutputCallback): void; ignoreAsync(fn: AsyncNoOutputCallback): Promise<void>; ignoreAsync(options: Options, fn: AsyncNoOutputCallback): Promise<void>; } ```` ### Additional Details * Last updated: Mon, 20 Nov 2023 23:36:24 GMT * Dependencies: none # Credits These definitions were written by [ Roberto Soares](https://github.com/roberto), [Pedro Guidoux](https://github.com/guidoux), and [Guilherme Moretti](https://github.com/gbmoretti).