mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-14 12:09:04 +08:00
Merge pull request #1667 from SomaticIT/update-sinon
Update SinonJS Definitions to 1.8.1
This commit is contained in:
27
sinon/sinon.d.ts
vendored
27
sinon/sinon.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for Sinon 1.5
|
||||
// Type definitions for Sinon 1.8.1
|
||||
// Project: http://sinonjs.org/
|
||||
// Definitions by: William Sears <https://github.com/mrbigdog2u>
|
||||
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
|
||||
@@ -189,6 +189,19 @@ interface SinonStatic {
|
||||
clock: SinonFakeTimers;
|
||||
}
|
||||
|
||||
interface SinonFakeUploadProgress {
|
||||
eventListeners: {
|
||||
progress: any[];
|
||||
load: any[];
|
||||
abort: any[];
|
||||
error: any[];
|
||||
};
|
||||
|
||||
addEventListener(event: string, listener: (e: Event) => any): void;
|
||||
removeEventListener(event: string, listener: (e: Event) => any): void;
|
||||
dispatchEvent(event: Event): void;
|
||||
}
|
||||
|
||||
interface SinonFakeXMLHttpRequest {
|
||||
// Properties
|
||||
onCreate: (xhr: SinonFakeXMLHttpRequest) => void;
|
||||
@@ -200,7 +213,9 @@ interface SinonFakeXMLHttpRequest {
|
||||
statusText: string;
|
||||
async: boolean;
|
||||
username: string;
|
||||
password: string;
|
||||
password: string;
|
||||
withCredentials: boolean;
|
||||
upload: SinonFakeUploadProgress;
|
||||
responseXML: Document;
|
||||
getResponseHeader(header: string): string;
|
||||
getAllResponseHeaders(): any;
|
||||
@@ -378,15 +393,17 @@ interface SinonTestWrapper extends SinonSandbox {
|
||||
}
|
||||
|
||||
interface SinonStatic {
|
||||
config: SinonTestConfig;
|
||||
test(fn: (...args: any[]) => any): SinonTestWrapper;
|
||||
testCase(tests: any): any;
|
||||
config: SinonTestConfig;
|
||||
test(fn: (...args: any[]) => any): SinonTestWrapper;
|
||||
testCase(tests: any): any;
|
||||
}
|
||||
|
||||
// Utility overridables
|
||||
interface SinonStatic {
|
||||
createStubInstance: (constructor: any) => SinonStub;
|
||||
format: (obj: any) => string;
|
||||
log: (message: string) => void;
|
||||
restore(object: any): void;
|
||||
}
|
||||
|
||||
declare var sinon: SinonStatic;
|
||||
|
||||
Reference in New Issue
Block a user