forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
jquery.pjax.d.ts
189 lines (184 loc) · 8.55 KB
/
jquery.pjax.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
// Type definitions for jquery.pjax.ts by falsandtru
// Project: https://github.com/falsandtru/jquery.pjax.js/
// Definitions by: 新ゝ月 NewNotMoon <http://new.not-moon.net/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/// <reference path="../jquery/jquery.d.ts" />
interface PjaxSetting {
gns?: string;
ns?: string;
area?: any; // string, array, function( event, param, origUrl, destUrl )
link?: string;
filter?: any; // string, function()
form?: string;
scope?: Object;
state?: any; // any, function(event, param, origUrl, destUrl )
scrollTop?: any; // number, function( event, param, origUrl, destUrl ), null, false
scrollLeft?: any; // number, function( event, param, origUrl, destUrl ), null, false
scroll?: {
delay?: number;
record?: boolean //internal
queue?: number[] //internal
};
ajax?: JQueryAjaxSettings;
contentType?: string;
load?: {
head?: string;
css?: boolean;
script?: boolean;
execute?: boolean;
reload?: string;
ignore?: string;
sync?: boolean;
ajax?: JQueryAjaxSettings;
rewrite?: (element: any) => any;
redirect?: boolean;
};
interval?: number;
cache?: {
click?: boolean;
submit?: boolean;
popstate?: boolean;
get?: boolean;
post?: boolean;
page?: boolean;
size?: number;
mix?: number;
expires?: {
min?: number;
max?: number;
};
};
wait?: any; // number, function( event, param, origUrl, destUrl ): number
fallback?: any; // boolean, function( event, param, origUrl, destUrl ): boolean
fix?: {
location?: boolean;
history?: boolean;
scroll?: boolean;
reset?: boolean;
};
database?: boolean;
server?: {
query?: any; // string, object
header?: {
area?: boolean;
head?: boolean;
css?: boolean;
script?: boolean;
};
};
callback?: (event: JQueryEventObject, param: any) => any;
callbacks?: {
before?: (event: JQueryEventObject, param: any) => any;
after?: (event: JQueryEventObject, param: any) => any;
ajax?: {
xhr?: (event: JQueryEventObject, param: any) => any;
beforeSend?: (event: JQueryEventObject, param: any, data: any, ajaxSettings: any) => any;
dataFilter?: (event: JQueryEventObject, param: any, data: any, dataType: any) => any;
success?: (event: JQueryEventObject, param: any, data: any, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any;
error?: (event: JQueryEventObject, param: any, XMLHttpRequest: XMLHttpRequest, textStatus: string, errorThrown: any) => any;
complete?: (event: JQueryEventObject, param: any, XMLHttpRequest: XMLHttpRequest, textStatus: string) => any;
done?: (event: JQueryEventObject, param: any, data: any, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any;
fail?: (event: JQueryEventObject, param: any, XMLHttpRequest: XMLHttpRequest, textStatus: string, errorThrown: any) => any;
always?: (event: JQueryEventObject, param: any, XMLHttpRequest: XMLHttpRequest, textStatus: string) => any;
};
update?: {
before?: (event: JQueryEventObject, param: any, data: any, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any;
after?: (event: JQueryEventObject, param: any, data: any, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any;
cache?: {
before?: (event: JQueryEventObject, param: any, cache: any) => any;
after?: (event: JQueryEventObject, param: any, cache: any) => any;
};
redirect?: {
before?: (event: JQueryEventObject, param: any, data: any, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any;
after?: (event: JQueryEventObject, param: any, data: any, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any;
};
url?: {
before?: (event: JQueryEventObject, param: any, data: any, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any;
after?: (event: JQueryEventObject, param: any, data: any, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any;
};
title?: {
before?: (event: JQueryEventObject, param: any, data: any, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any;
after?: (event: JQueryEventObject, param: any, data: any, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any;
};
head?: {
before?: (event: JQueryEventObject, param: any, data: any, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any;
after?: (event: JQueryEventObject, param: any, data: any, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any;
};
content?: {
before?: (event: JQueryEventObject, param: any, data: any, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any;
after?: (event: JQueryEventObject, param: any, data: any, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any;
};
scroll?: {
before?: (event: JQueryEventObject, param: any) => any;
after?: (event: JQueryEventObject, param: any) => any;
};
css?: {
before?: (event: JQueryEventObject, param: any, data: any, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any;
after?: (event: JQueryEventObject, param: any, data: any, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any;
};
script?: {
before?: (event: JQueryEventObject, param: any, data: any, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any;
after?: (event: JQueryEventObject, param: any, data: any, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any;
};
render?: {
before?: (event: JQueryEventObject, param: any) => any;
after?: (event: JQueryEventObject, param: any) => any;
};
verify?: {
before?: (event: JQueryEventObject, param: any) => any;
after?: (event: JQueryEventObject, param: any) => any;
};
success?: (event: JQueryEventObject, param: any, data: any, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any;
error?: (event: JQueryEventObject, param: any, data: any, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any;
complete?: (event: JQueryEventObject, param: any, data: any, textStatus: string, XMLHttpRequest: XMLHttpRequest) => any;
};
param?: any;
// internal
uuid?: string;
nss?: {
name?: string;
event?: string[];
click?: string;
submit?: string;
popstate?: string;
scroll?: string;
data?: string;
class4html?: string;
requestHeader?: string;
};
origLocation?: HTMLAnchorElement;
destLocation?: HTMLAnchorElement;
retry?: boolean;
speedcheck?: boolean;
disable?: boolean;
option?: any;
};
}
interface JQueryStatic {
pjax: {
(setting?: PjaxSetting): any;
enable(): any;
disable(): any;
click(url: string, attr: { href?: string; }): any;
click(url: HTMLAnchorElement, attr: { href?: string; }): any;
click(url: JQuery, attr: { href?: string; }): any;
click(url: any, attr: { href?: string; }): any;
submit(url: string, attr: { action?: string; method?: string; }, data: any): any;
submit(url: HTMLFormElement, attr?: { action?: string; method?: string; }, data?: any): any;
submit(url: JQuery, attr?: { action?: string; method?: string; }, data?: any): any;
submit(url: any, attr?: { action?: string; method?: string; }, data?: any): any;
follow(event: JQueryEventObject, ajax: JQueryXHR, timeStamp?: number): boolean;
setCache(): any;
setCache(url: string): any;
setCache(url: string, data: string): any;
setCache(url: string, data: string, textStatus: string, XMLHttpRequest: XMLHttpRequest): any;
getCache(): any;
getCache(url: string): any;
removeCache(url: string): any;
removeCache(): any;
clearCache(): any;
};
}
interface JQuery {
pjax(setting?: PjaxSetting): any;
}