1 | import * as sinon from "sinon";
|
2 | export declare type StubbedInstance<T> = sinon.SinonStubbedInstance<T> & T;
|
3 | export declare type AllowedKeys<T, Condition> = {
|
4 | [Key in keyof T]: T[Key] extends Condition ? Key : never;
|
5 | }[keyof T];
|
6 | export declare type ObjectMethodsKeys<T> = AllowedKeys<T, (...args: any[]) => any>[];
|
7 | export declare type ObjectMethodsMap<T> = {
|
8 | [Key in keyof T]?: T[Key] extends (...args: any[]) => any ? ReturnType<T[Key]> : never;
|
9 | };
|
10 | export declare function stubObject<T extends object>(object: T, methods?: ObjectMethodsKeys<T> | ObjectMethodsMap<T>): StubbedInstance<T>;
|
11 | export declare function stubConstructor<T extends new (...args: any[]) => any>(constructor: T, ...constructorArgs: ConstructorParameters<T> | undefined[]): StubbedInstance<InstanceType<T>>;
|
12 | export declare function stubInterface<T extends object>(methods?: ObjectMethodsMap<T>): StubbedInstance<T>;
|
13 | export default sinon;
|