@angular/common 20.0.0-next.1 → 20.0.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/common.mjs +227 -252
- package/fesm2022/common.mjs.map +1 -1
- package/fesm2022/http/testing.mjs +10 -14
- package/fesm2022/http/testing.mjs.map +1 -1
- package/fesm2022/http.mjs +65 -113
- package/fesm2022/http.mjs.map +1 -1
- package/fesm2022/testing.mjs +22 -41
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/upgrade.mjs +7 -23
- package/fesm2022/upgrade.mjs.map +1 -1
- package/http/index.d.ts +2803 -2858
- package/http/testing/index.d.ts +74 -79
- package/index.d.ts +2393 -2617
- package/package.json +2 -2
- package/testing/index.d.ts +55 -64
- package/upgrade/index.d.ts +137 -146
package/http/testing/index.d.ts
CHANGED
|
@@ -1,40 +1,89 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.0.0-next.
|
|
2
|
+
* @license Angular v20.0.0-next.2
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
import { HttpEvent } from '@angular/common/http';
|
|
9
|
-
import { HttpHeaders } from '@angular/common/http';
|
|
10
|
-
import { HttpRequest } from '@angular/common/http';
|
|
11
|
-
import * as i0 from '@angular/core';
|
|
12
7
|
import * as i1 from '@angular/common/http';
|
|
8
|
+
import { HttpRequest, HttpEvent, HttpHeaders } from '@angular/common/http';
|
|
13
9
|
import { Observer } from 'rxjs';
|
|
10
|
+
import * as i0 from '@angular/core';
|
|
14
11
|
import { Provider } from '@angular/core';
|
|
15
12
|
|
|
16
13
|
/**
|
|
17
|
-
*
|
|
14
|
+
* Type that describes options that can be used to create an error
|
|
15
|
+
* in `TestRequest`.
|
|
16
|
+
*/
|
|
17
|
+
type TestRequestErrorOptions = {
|
|
18
|
+
headers?: HttpHeaders | {
|
|
19
|
+
[name: string]: string | string[];
|
|
20
|
+
};
|
|
21
|
+
status?: number;
|
|
22
|
+
statusText?: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* A mock requests that was received and is ready to be answered.
|
|
18
26
|
*
|
|
19
|
-
*
|
|
27
|
+
* This interface allows access to the underlying `HttpRequest`, and allows
|
|
28
|
+
* responding with `HttpEvent`s or `HttpErrorResponse`s.
|
|
20
29
|
*
|
|
21
30
|
* @publicApi
|
|
22
|
-
*
|
|
23
|
-
* @deprecated Add `provideHttpClientTesting()` to your providers instead.
|
|
24
31
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
declare class TestRequest {
|
|
33
|
+
request: HttpRequest<any>;
|
|
34
|
+
private observer;
|
|
35
|
+
/**
|
|
36
|
+
* Whether the request was cancelled after it was sent.
|
|
37
|
+
*/
|
|
38
|
+
get cancelled(): boolean;
|
|
39
|
+
constructor(request: HttpRequest<any>, observer: Observer<HttpEvent<any>>);
|
|
40
|
+
/**
|
|
41
|
+
* Resolve the request by returning a body plus additional HTTP information (such as response
|
|
42
|
+
* headers) if provided.
|
|
43
|
+
* If the request specifies an expected body type, the body is converted into the requested type.
|
|
44
|
+
* Otherwise, the body is converted to `JSON` by default.
|
|
45
|
+
*
|
|
46
|
+
* Both successful and unsuccessful responses can be delivered via `flush()`.
|
|
47
|
+
*/
|
|
48
|
+
flush(body: ArrayBuffer | Blob | boolean | string | number | Object | (boolean | string | number | Object | null)[] | null, opts?: {
|
|
49
|
+
headers?: HttpHeaders | {
|
|
50
|
+
[name: string]: string | string[];
|
|
51
|
+
};
|
|
52
|
+
status?: number;
|
|
53
|
+
statusText?: string;
|
|
54
|
+
}): void;
|
|
55
|
+
/**
|
|
56
|
+
* Resolve the request by returning an `ErrorEvent` (e.g. simulating a network failure).
|
|
57
|
+
* @deprecated Http requests never emit an `ErrorEvent`. Please specify a `ProgressEvent`.
|
|
58
|
+
*/
|
|
59
|
+
error(error: ErrorEvent, opts?: TestRequestErrorOptions): void;
|
|
60
|
+
/**
|
|
61
|
+
* Resolve the request by returning an `ProgressEvent` (e.g. simulating a network failure).
|
|
62
|
+
*/
|
|
63
|
+
error(error: ProgressEvent, opts?: TestRequestErrorOptions): void;
|
|
64
|
+
/**
|
|
65
|
+
* Deliver an arbitrary `HttpEvent` (such as a progress event) on the response stream for this
|
|
66
|
+
* request.
|
|
67
|
+
*/
|
|
68
|
+
event(event: HttpEvent<any>): void;
|
|
29
69
|
}
|
|
30
70
|
|
|
71
|
+
/**
|
|
72
|
+
* Defines a matcher for requests based on URL, method, or both.
|
|
73
|
+
*
|
|
74
|
+
* @publicApi
|
|
75
|
+
*/
|
|
76
|
+
interface RequestMatch {
|
|
77
|
+
method?: string;
|
|
78
|
+
url?: string;
|
|
79
|
+
}
|
|
31
80
|
/**
|
|
32
81
|
* Controller to be injected into tests, that allows for mocking and flushing
|
|
33
82
|
* of requests.
|
|
34
83
|
*
|
|
35
84
|
* @publicApi
|
|
36
85
|
*/
|
|
37
|
-
|
|
86
|
+
declare abstract class HttpTestingController {
|
|
38
87
|
/**
|
|
39
88
|
* Search for requests that match the given parameter, without any expectations.
|
|
40
89
|
*/
|
|
@@ -113,75 +162,21 @@ export declare abstract class HttpTestingController {
|
|
|
113
162
|
}): void;
|
|
114
163
|
}
|
|
115
164
|
|
|
116
|
-
export declare function provideHttpClientTesting(): Provider[];
|
|
117
|
-
|
|
118
165
|
/**
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
* @publicApi
|
|
122
|
-
*/
|
|
123
|
-
export declare interface RequestMatch {
|
|
124
|
-
method?: string;
|
|
125
|
-
url?: string;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* A mock requests that was received and is ready to be answered.
|
|
166
|
+
* Configures `HttpClientTestingBackend` as the `HttpBackend` used by `HttpClient`.
|
|
130
167
|
*
|
|
131
|
-
*
|
|
132
|
-
* responding with `HttpEvent`s or `HttpErrorResponse`s.
|
|
168
|
+
* Inject `HttpTestingController` to expect and flush requests in your tests.
|
|
133
169
|
*
|
|
134
170
|
* @publicApi
|
|
171
|
+
*
|
|
172
|
+
* @deprecated Add `provideHttpClientTesting()` to your providers instead.
|
|
135
173
|
*/
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
* Whether the request was cancelled after it was sent.
|
|
141
|
-
*/
|
|
142
|
-
get cancelled(): boolean;
|
|
143
|
-
constructor(request: HttpRequest<any>, observer: Observer<HttpEvent<any>>);
|
|
144
|
-
/**
|
|
145
|
-
* Resolve the request by returning a body plus additional HTTP information (such as response
|
|
146
|
-
* headers) if provided.
|
|
147
|
-
* If the request specifies an expected body type, the body is converted into the requested type.
|
|
148
|
-
* Otherwise, the body is converted to `JSON` by default.
|
|
149
|
-
*
|
|
150
|
-
* Both successful and unsuccessful responses can be delivered via `flush()`.
|
|
151
|
-
*/
|
|
152
|
-
flush(body: ArrayBuffer | Blob | boolean | string | number | Object | (boolean | string | number | Object | null)[] | null, opts?: {
|
|
153
|
-
headers?: HttpHeaders | {
|
|
154
|
-
[name: string]: string | string[];
|
|
155
|
-
};
|
|
156
|
-
status?: number;
|
|
157
|
-
statusText?: string;
|
|
158
|
-
}): void;
|
|
159
|
-
/**
|
|
160
|
-
* Resolve the request by returning an `ErrorEvent` (e.g. simulating a network failure).
|
|
161
|
-
* @deprecated Http requests never emit an `ErrorEvent`. Please specify a `ProgressEvent`.
|
|
162
|
-
*/
|
|
163
|
-
error(error: ErrorEvent, opts?: TestRequestErrorOptions): void;
|
|
164
|
-
/**
|
|
165
|
-
* Resolve the request by returning an `ProgressEvent` (e.g. simulating a network failure).
|
|
166
|
-
*/
|
|
167
|
-
error(error: ProgressEvent, opts?: TestRequestErrorOptions): void;
|
|
168
|
-
/**
|
|
169
|
-
* Deliver an arbitrary `HttpEvent` (such as a progress event) on the response stream for this
|
|
170
|
-
* request.
|
|
171
|
-
*/
|
|
172
|
-
event(event: HttpEvent<any>): void;
|
|
174
|
+
declare class HttpClientTestingModule {
|
|
175
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HttpClientTestingModule, never>;
|
|
176
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<HttpClientTestingModule, never, [typeof i1.HttpClientModule], never>;
|
|
177
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<HttpClientTestingModule>;
|
|
173
178
|
}
|
|
174
179
|
|
|
175
|
-
|
|
176
|
-
* Type that describes options that can be used to create an error
|
|
177
|
-
* in `TestRequest`.
|
|
178
|
-
*/
|
|
179
|
-
declare type TestRequestErrorOptions = {
|
|
180
|
-
headers?: HttpHeaders | {
|
|
181
|
-
[name: string]: string | string[];
|
|
182
|
-
};
|
|
183
|
-
status?: number;
|
|
184
|
-
statusText?: string;
|
|
185
|
-
};
|
|
180
|
+
declare function provideHttpClientTesting(): Provider[];
|
|
186
181
|
|
|
187
|
-
export { }
|
|
182
|
+
export { HttpClientTestingModule, HttpTestingController, type RequestMatch, TestRequest, provideHttpClientTesting };
|