-
Notifications
You must be signed in to change notification settings - Fork 24.8k
/
http.d.ts
259 lines (231 loc) · 7.25 KB
/
http.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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
/** @deprecated */
export declare class BaseRequestOptions extends RequestOptions {
constructor();
}
/** @deprecated */
export declare class BaseResponseOptions extends ResponseOptions {
constructor();
}
/** @deprecated */
export declare class BrowserXhr {
constructor();
build(): any;
}
/** @deprecated */
export declare abstract class Connection {
readyState: ReadyState;
request: Request;
response: any;
}
/** @deprecated */
export declare abstract class ConnectionBackend {
abstract createConnection(request: any): Connection;
}
/** @deprecated */
export declare class CookieXSRFStrategy implements XSRFStrategy {
constructor(_cookieName?: string, _headerName?: string);
configureRequest(req: Request): void;
}
/** @deprecated */
export declare class Headers {
constructor(headers?: Headers | {
[name: string]: any;
} | null);
append(name: string, value: string): void;
delete(name: string): void;
entries(): void;
forEach(fn: (values: string[], name: string | undefined, headers: Map<string, string[]>) => void): void;
get(name: string): string | null;
getAll(name: string): string[] | null;
has(name: string): boolean;
keys(): string[];
set(name: string, value: string | string[]): void;
toJSON(): {
[name: string]: any;
};
values(): string[][];
static fromResponseHeaderString(headersString: string): Headers;
}
/** @deprecated */
export declare class Http {
protected _backend: ConnectionBackend;
protected _defaultOptions: RequestOptions;
constructor(_backend: ConnectionBackend, _defaultOptions: RequestOptions);
delete(url: string, options?: RequestOptionsArgs): Observable<Response>;
get(url: string, options?: RequestOptionsArgs): Observable<Response>;
head(url: string, options?: RequestOptionsArgs): Observable<Response>;
options(url: string, options?: RequestOptionsArgs): Observable<Response>;
patch(url: string, body: any, options?: RequestOptionsArgs): Observable<Response>;
post(url: string, body: any, options?: RequestOptionsArgs): Observable<Response>;
put(url: string, body: any, options?: RequestOptionsArgs): Observable<Response>;
request(url: string | Request, options?: RequestOptionsArgs): Observable<Response>;
}
/** @deprecated */
export declare class HttpModule {
}
/** @deprecated */
export declare class Jsonp extends Http {
constructor(backend: ConnectionBackend, defaultOptions: RequestOptions);
request(url: string | Request, options?: RequestOptionsArgs): Observable<Response>;
}
/** @deprecated */
export declare class JSONPBackend extends ConnectionBackend {
createConnection(request: Request): JSONPConnection;
}
/** @deprecated */
export declare class JSONPConnection implements Connection {
readyState: ReadyState;
request: Request;
response: Observable<Response>;
finished(data?: any): void;
}
/** @deprecated */
export declare class JsonpModule {
}
/** @deprecated */
export declare class QueryEncoder {
encodeKey(key: string): string;
encodeValue(value: string): string;
}
/** @deprecated */
export declare enum ReadyState {
Unsent = 0,
Open = 1,
HeadersReceived = 2,
Loading = 3,
Done = 4,
Cancelled = 5
}
/** @deprecated */
export declare class Request extends ɵangular_packages_http_http_f {
headers: Headers;
method: RequestMethod;
responseType: ResponseContentType;
url: string;
withCredentials: boolean;
constructor(requestOptions: ɵangular_packages_http_http_d);
detectContentType(): ContentType;
detectContentTypeFromBody(): ContentType;
getBody(): any;
}
/** @deprecated */
export declare enum RequestMethod {
Get = 0,
Post = 1,
Put = 2,
Delete = 3,
Options = 4,
Head = 5,
Patch = 6
}
/** @deprecated */
export declare class RequestOptions {
body: any;
headers: Headers | null;
method: RequestMethod | string | null;
params: URLSearchParams;
responseType: ResponseContentType | null;
/** @deprecated */ get search(): URLSearchParams;
/** @deprecated */ set search(params: URLSearchParams);
url: string | null;
withCredentials: boolean | null;
constructor(opts?: RequestOptionsArgs);
merge(options?: RequestOptionsArgs): RequestOptions;
}
/** @deprecated */
export declare interface RequestOptionsArgs {
body?: any;
headers?: Headers | null;
method?: string | RequestMethod | null;
params?: string | URLSearchParams | {
[key: string]: any | any[];
} | null;
responseType?: ResponseContentType | null;
/** @deprecated */ search?: string | URLSearchParams | {
[key: string]: any | any[];
} | null;
url?: string | null;
withCredentials?: boolean | null;
}
/** @deprecated */
export declare class Response extends ɵangular_packages_http_http_f {
bytesLoaded: number;
headers: Headers | null;
ok: boolean;
status: number;
statusText: string | null;
totalBytes: number;
type: ResponseType;
url: string;
constructor(responseOptions: ResponseOptions);
toString(): string;
}
/** @deprecated */
export declare enum ResponseContentType {
Text = 0,
Json = 1,
ArrayBuffer = 2,
Blob = 3
}
/** @deprecated */
export declare class ResponseOptions {
body: string | Object | ArrayBuffer | Blob | null;
headers: Headers | null;
status: number | null;
url: string | null;
constructor(opts?: ResponseOptionsArgs);
merge(options?: ResponseOptionsArgs): ResponseOptions;
}
/** @deprecated */
export declare interface ResponseOptionsArgs {
body?: string | Object | FormData | ArrayBuffer | Blob | null;
headers?: Headers | null;
status?: number | null;
statusText?: string | null;
type?: ResponseType | null;
url?: string | null;
}
/** @deprecated */
export declare enum ResponseType {
Basic = 0,
Cors = 1,
Default = 2,
Error = 3,
Opaque = 4
}
/** @deprecated */
export declare class URLSearchParams {
paramsMap: Map<string, string[]>;
rawParams: string;
constructor(rawParams?: string, queryEncoder?: QueryEncoder);
append(param: string, val: string): void;
appendAll(searchParams: URLSearchParams): void;
clone(): URLSearchParams;
delete(param: string): void;
get(param: string): string | null;
getAll(param: string): string[];
has(param: string): boolean;
replaceAll(searchParams: URLSearchParams): void;
set(param: string, val: string): void;
setAll(searchParams: URLSearchParams): void;
toString(): string;
}
/** @deprecated */
export declare const VERSION: Version;
/** @deprecated */
export declare class XHRBackend implements ConnectionBackend {
constructor(_browserXHR: BrowserXhr, _baseResponseOptions: ResponseOptions, _xsrfStrategy: XSRFStrategy);
createConnection(request: Request): XHRConnection;
}
/** @deprecated */
export declare class XHRConnection implements Connection {
readyState: ReadyState;
request: Request;
response: Observable<Response>;
constructor(req: Request, browserXHR: BrowserXhr, baseResponseOptions?: ResponseOptions);
setDetectedContentType(req: any /** TODO Request */, _xhr: any /** XMLHttpRequest */): void;
}
/** @deprecated */
export declare abstract class XSRFStrategy {
abstract configureRequest(req: Request): void;
}