/** Credit: Valentin Buryakov */ import { FactoryProvider, Type, AbstractType } from '@angular/core'; type Writable = { -readonly [P in keyof T]: T[P]; }; declare type UnknownFunction = (...args: any[]) => any; /** * @publicApi */ export interface CompatibleSpy extends jasmine.Spy<(...args: Parameters) => ReturnType> { /** * By chaining the spy with and.returnValue, all calls to the function will return a specific * value. */ andReturn(val: ReturnType): void; /** * By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied * function. */ andCallFake(fn: F): this; /** * removes all recorded calls */ reset(): void; } /** * @publicApi */ export type SpyObject = T & { [P in keyof T]: T[P] extends UnknownFunction ? T[P] & CompatibleSpy : T[P]; } & { /** * Casts to type without readonly properties */ castToWritable(): Writable; }; /** * @internal */ export declare function installProtoMethods(mock: any, proto: any, createSpyFn: Function): void; /** * @publicApi */ export declare function createSpyObject(type: Type | AbstractType, template?: Partial>): SpyObject; /** * @publicApi */ export declare function mockProvider(type: Type | AbstractType, properties?: Partial>): FactoryProvider; /** * @publicApi */ export type MockProvider = typeof mockProvider; export {};