/// export declare type MockableFunction = (...args: any[]) => any; export declare type MethodKeysOf = { [K in keyof T]: T[K] extends MockableFunction ? K : never; }[keyof T]; export declare type PropertyKeysOf = { [K in keyof T]: T[K] extends MockableFunction ? never : K; }[keyof T]; export declare type ArgumentsOf = T extends (...args: infer A) => any ? A : never; export declare type ConstructorArgumentsOf = T extends new (...args: infer A) => any ? A : never; export interface MockWithArgs extends jest.MockInstance, ArgumentsOf> { new (...args: ConstructorArgumentsOf): T; (...args: ArgumentsOf): ReturnType; } export declare type MaybeMockedConstructor = T extends new (...args: any[]) => infer R ? jest.MockInstance> : T; export declare type MockedFunction = MockWithArgs & { [K in keyof T]: T[K]; }; export declare type MockedFunctionDeep = MockWithArgs & MockedObjectDeep; export declare type MockedObject = MaybeMockedConstructor & { [K in MethodKeysOf]: T[K] extends MockableFunction ? MockedFunction : T[K]; } & { [K in PropertyKeysOf]: T[K]; }; export declare type MockedObjectDeep = MaybeMockedConstructor & { [K in MethodKeysOf]: T[K] extends MockableFunction ? MockedFunctionDeep : T[K]; } & { [K in PropertyKeysOf]: MaybeMockedDeep; }; export declare type MaybeMockedDeep = T extends MockableFunction ? MockedFunctionDeep : T extends object ? MockedObjectDeep : T; export declare type MaybeMocked = T extends MockableFunction ? MockedFunction : T extends object ? MockedObject : T; export declare function mocked(item: T, deep?: false): MaybeMocked; export declare function mocked(item: T, deep: true): MaybeMockedDeep;