UNPKG

657 BTypeScriptView Raw
1// Type definitions for jest-mock-console 0.3.7
2// Project: jest-mock-console
3// Definitions by: Quentin Golsteyn https://github.com/qgolsteyn
4
5type DefaultConsole = Console;
6type ConsoleProps = keyof DefaultConsole;
7
8declare module 'jest-mock-console' {
9 export default function MockConsole(): RestoreConsole;
10 export default function MockConsole(mockArg: ConsoleProps): RestoreConsole;
11 export default function MockConsole(mockArg: ConsoleProps[]): RestoreConsole;
12 export default function MockConsole(mockArg: MockObj): RestoreConsole;
13
14 type MockObj = {[key in ConsoleProps]?: DefaultConsole[key]};
15 type RestoreConsole = () => void;
16}
\No newline at end of file