-
Notifications
You must be signed in to change notification settings - Fork 1
/
hajax.d.ts
78 lines (73 loc) · 1.53 KB
/
hajax.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
declare interface Config {
baseURL: string
url: string
method: string
headers: object
params: object
mode: string
retryLimit: number
retryBuffer: number
debounceTime: number
throttleTime: number
data: any
timeout: number
withCredentials: boolean
responseType: any
}
declare interface HAjax {
_requestDealTarget: HRequest
_responseDealTarget: HResponse
store: object
throttleStore: object
debounceStore: object
requestQueue: Queue
responseQueue: Queue
requestInterceptor: Function
responseInterceptor: Function
requestPool: object
storeStrategy: Array<Strategy> | Strategy
config: Config
}
declare interface HRequest {
_uuid: number
_onFulfilled: Function
_onFailed: Function
url: string
method: string
baseURL: string
fullURL: string
headers: object
params: object
data: object
timeout: number
withCredentials: boolean
responseType: string
xhr: XMLHttpRequest
config: Config
withRushStore: boolean
hajaxInstance: HAjax
aborted: boolean
retryLimit: number
retryBuffer: number
mode: string
debounceTime: number
throttleTime: number
}
declare interface HResponse {
data: any
status: number
statusText: string
headers: object
config: Config
request: HRequest
}
declare interface Strategy {
urlExp: any
bufferTime: number
}
declare interface Queue {
_queue: Array<any>
enqueue(item: any)
unqueue(): any
hasNext(): boolean
}