import when = require('saywhen');

when(jasmine.createSpy('test')); // $ExpectType CallHandler<Spy>
when(jasmine.createSpy('test')).isCalled; // $ExpectType Proxy<Spy>

when.captor();	// $ExpectType MatcherProxy<{}>
when.captor(jasmine.any(Number));	// $ExpectType MatcherProxy<Any>
when.noConflict();	// $ExpectType void

import when = require('saywhen');

// This interface is needed to get around the fact that the new jasmine
// `createSpy` method takes a generic type while the old typings don't.
// That means that in Typescript 3.0 the spy will be `Spy` and in 3.1 it
// will be `Spy<InferableFunction>`. This interface matches both and is
// what dtslint will expect the type to be.
interface JasmineSpy extends jasmine.Spy {
    (...params: any[]): any;
}
const spy: JasmineSpy = jasmine.createSpy('test');

when(spy); // $ExpectType CallHandler<JasmineSpy>
when(spy).isCalled; // $ExpectType Proxy<JasmineSpy>

when.captor();	// $ExpectType MatcherProxy<{}>
when.captor(jasmine.any(Number));	// $ExpectType MatcherProxy<Any>
when.noConflict();	// $ExpectType void

Fix the build with a hack
Fix the build with a hack
