// Type definitions for saywhen 1.1 // Project: https://github.com/pushtechnology/saywhen // Definitions by: Sean Sobey // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 /// type Func = (...args: any[]) => any; declare function when(spy: T & jasmine.Spy): CallHandler; declare namespace when { function captor(val?: T): MatcherProxy; function noConflict(): void; function is(val: T): boolean; } interface CallHandler { readonly isCalled: Proxy; isCalledWith(...args: any[]): Proxy; } interface Proxy { then(fn: T): Proxy; thenReturn(val: any): Proxy; thenThrow(err: Error): Proxy; } interface MatcherProxy { (arg: T): boolean; readonly latest: T; values(): T[]; } export = when;