I'm trying to merge the Matchers interface from jasmine. The interface is declare inside the jasmine namespace.
I have created .d.ts file and added the following:
declare namespace jasmine {
interface Matchers {
toBeSuccessful(): boolean;
}
}
This works, but if I try to add an import statement to the .d.ts file it doesn't work. The toBeSuccessful function is not recognized.
I also tried to add this portion of the code inside my implementation of the function and not inside of the d.ts file, but then, other members of the namespace are not available anymore, for instance in this code:
class ToBeSuccessfulMatcher implements jasmine.CustomMatcher {
compare<T>(actual: Result<T>): jasmine.CustomMatcherResult {
}
}
The interfaces CustomMatcher and CustomMatcherResult are not available anymore.
What am I missing?