-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Hello,
Since I found your module helpful I'd like to contribute with the Typescript type declarations. This is my first go at this so, not entirely sure it's 100% correct, but it seems to work fine for me. I wrote this so Typescript compiler would stops bugging me. Maybe it will be helpful to others, as well.
declare module 'test-console' {
type Callback = (output: string) => void;
type Output = string[];
type Options = {
[key: string]: any;
isTTY?: boolean;
};
type Inspector = {
output: Output;
restore(): void;
};
export const stdout: {
inspect(options?: Options): Inspector,
inspectSync(fn: Callback);
inspectSync(options: Options, fn?: Callback): Output,
ignore(options?: Options): void,
ignoreSync(fn: Callback): void,
ignoreSync(options: Options, fn?: Callback): void,
};
export const stderr: {
inspect(options?: Options): Inspector,
inspectSync(fn: Callback): Output,
inspectSync(options: Options, fn?: Callback): Output,
ignore(options?: Options): void,
ignoreSync(fn: Callback): string,
ignoreSync(options: Options, fn?: Callback): string,
};
}Thanks!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels