1 | /**
|
2 | * @license
|
3 | * Copyright Google Inc. All Rights Reserved.
|
4 | *
|
5 | * Use of this source code is governed by an MIT-style license that can be
|
6 | * found in the LICENSE file at https://angular.io/license
|
7 | */
|
8 | import { ReadyState, RequestMethod, ResponseContentType, ResponseType } from './enums';
|
9 | import { Headers } from './headers';
|
10 | import { Request } from './static_request';
|
11 | import { URLSearchParams } from './url_search_params';
|
12 | /**
|
13 | * Abstract class from which real backends are derived.
|
14 | *
|
15 | * The primary purpose of a `ConnectionBackend` is to create new connections to fulfill a given
|
16 | * {@link Request}.
|
17 | *
|
18 | * @deprecated see https://angular.io/guide/http
|
19 | * @publicApi
|
20 | */
|
21 | export declare abstract class ConnectionBackend {
|
22 | abstract createConnection(request: any): Connection;
|
23 | }
|
24 | /**
|
25 | * Abstract class from which real connections are derived.
|
26 | *
|
27 | * @deprecated see https://angular.io/guide/http
|
28 | * @publicApi
|
29 | */
|
30 | export declare abstract class Connection {
|
31 | readyState: ReadyState;
|
32 | request: Request;
|
33 | response: any;
|
34 | }
|
35 | /**
|
36 | * An XSRFStrategy configures XSRF protection (e.g. via headers) on an HTTP request.
|
37 | *
|
38 | * @deprecated see https://angular.io/guide/http
|
39 | * @publicApi
|
40 | */
|
41 | export declare abstract class XSRFStrategy {
|
42 | abstract configureRequest(req: Request): void;
|
43 | }
|
44 | /**
|
45 | * Interface for options to construct a RequestOptions, based on
|
46 | * [RequestInit](https://fetch.spec.whatwg.org/#requestinit) from the Fetch spec.
|
47 | *
|
48 | * @deprecated see https://angular.io/guide/http
|
49 | * @publicApi
|
50 | */
|
51 | export interface RequestOptionsArgs {
|
52 | url?: string | null;
|
53 | method?: string | RequestMethod | null;
|
54 | /** @deprecated from 4.0.0. Use params instead. */
|
55 | search?: string | URLSearchParams | {
|
56 | [key: string]: any | any[];
|
57 | } | null;
|
58 | params?: string | URLSearchParams | {
|
59 | [key: string]: any | any[];
|
60 | } | null;
|
61 | headers?: Headers | null;
|
62 | body?: any;
|
63 | withCredentials?: boolean | null;
|
64 | responseType?: ResponseContentType | null;
|
65 | }
|
66 | /**
|
67 | * Required structure when constructing new Request();
|
68 | */
|
69 | export interface RequestArgs extends RequestOptionsArgs {
|
70 | url: string | null;
|
71 | }
|
72 | /**
|
73 | * Interface for options to construct a Response, based on
|
74 | * [ResponseInit](https://fetch.spec.whatwg.org/#responseinit) from the Fetch spec.
|
75 | *
|
76 | * @deprecated see https://angular.io/guide/http
|
77 | * @publicApi
|
78 | */
|
79 | export interface ResponseOptionsArgs {
|
80 | body?: string | Object | FormData | ArrayBuffer | Blob | null;
|
81 | status?: number | null;
|
82 | statusText?: string | null;
|
83 | headers?: Headers | null;
|
84 | type?: ResponseType | null;
|
85 | url?: string | null;
|
86 | }
|