forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery-mockjax.d.ts
49 lines (44 loc) · 1.29 KB
/
jquery-mockjax.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Type definitions for jQuery Mockjax 2.0.1
// Project: https://github.com/jakerella/jquery-mockjax
// Definitions by: Laszlo Jakab <https://github.com/laszlojakab/>, Vladimir Đokić <https://github.com/vladeck/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
interface MockJaxSettingsHeaders {
[key: string]: string;
}
interface MockJaxSettings {
url?: string | RegExp;
urlParams?: string[];
data?: any;
type?: string;
headers?: MockJaxSettingsHeaders;
logging?: boolean;
status?: number;
statusText?: string;
responseTime?: number;
isTimeout?: boolean;
dataType?: string;
contentType?: string;
response?: (settings: any) => void;
responseText?: string | Object;
responseXml?: string;
proxy?: string;
proxyType?: string;
lastModified?: string;
etag?: string;
onAfterSuccess?: Function;
onAfterError?: Function;
onAfterComplete?: Function;
}
interface MockJaxStatic {
(options: MockJaxSettings): number;
handler(id?: number): any;
clear(id?: number): void;
mockedAjaxCalls(): any[];
unfiredHandlers(): any[];
unmockedAjaxCalls(): any[];
}
interface JQueryStatic {
mockjax: MockJaxStatic;
mockjaxSettings: MockJaxSettings;
}