-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.d.ts
47 lines (38 loc) · 929 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
export declare const originalConsole: Console;
type Options = {
isSilent?: boolean;
stripAnsi?: boolean;
};
export enum ConsoleLevels {
log,
info,
warn,
error,
}
export type TestingConsole = Console;
export type TestingConsoleInstance = {
log: string;
logs: [ConsoleLevels, string][];
levels: {
log: string;
info: string;
warn: string;
error: string;
};
stderr: string;
stdout: string;
getRecord: (method: string) => string;
silence: boolean;
};
export function createConsole(options?: Options): TestingConsole;
export function mockConsole(
testingConsole: TestingConsole,
targetConsoleParent?: typeof globalThis,
targetConsoleKey?: string
): () => void;
export function getLog(testingConsole?: TestingConsole): TestingConsoleInstance;
export function silenceConsole(
testingConsole?: TestingConsole,
shouldSilent?: boolean
): void;
export function restore(): void;