From 80cbd12aaeae90ca444161862f5fa979828e91e1 Mon Sep 17 00:00:00 2001 From: SomaticIT Date: Wed, 5 Feb 2014 20:32:04 +0100 Subject: [PATCH] Update SinonJS Definitions to 1.8.1 --- sinon/sinon.d.ts | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/sinon/sinon.d.ts b/sinon/sinon.d.ts index 7d207ef2ac..f9b33c082c 100644 --- a/sinon/sinon.d.ts +++ b/sinon/sinon.d.ts @@ -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 // 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;