@angular/common 21.0.0-next.9 → 21.0.0-rc.1
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_module-chunk.mjs +3050 -4380
- package/fesm2022/_common_module-chunk.mjs.map +1 -1
- package/fesm2022/_location-chunk.mjs +392 -588
- package/fesm2022/_location-chunk.mjs.map +1 -1
- package/fesm2022/_module-chunk.mjs +2035 -3001
- package/fesm2022/_module-chunk.mjs.map +1 -1
- package/fesm2022/_platform_navigation-chunk.mjs +30 -16
- package/fesm2022/_platform_navigation-chunk.mjs.map +1 -1
- package/fesm2022/_xhr-chunk.mjs +10 -16
- package/fesm2022/_xhr-chunk.mjs.map +1 -1
- package/fesm2022/common.mjs +1133 -1837
- package/fesm2022/common.mjs.map +1 -1
- package/fesm2022/http-testing.mjs +259 -310
- package/fesm2022/http-testing.mjs.map +1 -1
- package/fesm2022/http.mjs +302 -370
- package/fesm2022/http.mjs.map +1 -1
- package/fesm2022/testing.mjs +596 -552
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/upgrade.mjs +601 -838
- package/fesm2022/upgrade.mjs.map +1 -1
- package/package.json +2 -2
- package/types/_common_module-chunk.d.ts +1 -1
- package/types/_module-chunk.d.ts +33 -1
- package/types/_platform_location-chunk.d.ts +1 -1
- package/types/_xhr-chunk.d.ts +1 -1
- package/types/common.d.ts +34 -4
- package/types/http-testing.d.ts +1 -1
- package/types/http.d.ts +13 -4
- package/types/testing.d.ts +88 -62
- package/types/upgrade.d.ts +1 -1
package/types/http.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.0.0-
|
|
2
|
+
* @license Angular v21.0.0-rc.1
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -3892,8 +3892,6 @@ declare class FetchBackend implements HttpBackend {
|
|
|
3892
3892
|
private readonly fetchImpl;
|
|
3893
3893
|
private readonly ngZone;
|
|
3894
3894
|
private readonly destroyRef;
|
|
3895
|
-
private destroyed;
|
|
3896
|
-
constructor();
|
|
3897
3895
|
handle(request: HttpRequest<any>): Observable<HttpEvent<any>>;
|
|
3898
3896
|
private doRequest;
|
|
3899
3897
|
private parseBody;
|
|
@@ -4008,6 +4006,8 @@ type HttpInterceptorFn = (req: HttpRequest<unknown>, next: HttpHandlerFn) => Obs
|
|
|
4008
4006
|
* A multi-provider token that represents the array of registered
|
|
4009
4007
|
* `HttpInterceptor` objects.
|
|
4010
4008
|
*
|
|
4009
|
+
* @see [HTTP Guide](guide/http/interceptors)
|
|
4010
|
+
*
|
|
4011
4011
|
* @publicApi
|
|
4012
4012
|
*/
|
|
4013
4013
|
declare const HTTP_INTERCEPTORS: InjectionToken<readonly HttpInterceptor[]>;
|
|
@@ -4124,7 +4124,7 @@ interface HttpFeature<KindT extends HttpFeatureKind> {
|
|
|
4124
4124
|
* ```
|
|
4125
4125
|
*
|
|
4126
4126
|
* </div>
|
|
4127
|
-
*
|
|
4127
|
+
* @see [HTTP Client](guide/http/setup)
|
|
4128
4128
|
* @see {@link withInterceptors}
|
|
4129
4129
|
* @see {@link withInterceptorsFromDi}
|
|
4130
4130
|
* @see {@link withXsrfConfiguration}
|
|
@@ -4197,6 +4197,7 @@ declare function withJsonpSupport(): HttpFeature<HttpFeatureKind.JsonpSupport>;
|
|
|
4197
4197
|
* "bubble up" until either reaching the root level or an `HttpClient` which was not configured with
|
|
4198
4198
|
* this option.
|
|
4199
4199
|
*
|
|
4200
|
+
* @see [HTTP client setup](guide/http/setup#withrequestsmadeviaparent)
|
|
4200
4201
|
* @see {@link provideHttpClient}
|
|
4201
4202
|
* @publicApi 19.0
|
|
4202
4203
|
*/
|
|
@@ -4206,6 +4207,8 @@ declare function withRequestsMadeViaParent(): HttpFeature<HttpFeatureKind.Reques
|
|
|
4206
4207
|
*
|
|
4207
4208
|
* Note: The Fetch API doesn't support progress report on uploads.
|
|
4208
4209
|
*
|
|
4210
|
+
* @see [Advanced fetch Options](guide/http/making-requests#advanced-fetch-options)
|
|
4211
|
+
*
|
|
4209
4212
|
* @publicApi
|
|
4210
4213
|
*/
|
|
4211
4214
|
declare function withFetch(): HttpFeature<HttpFeatureKind.Fetch>;
|
|
@@ -4519,6 +4522,8 @@ declare const httpResource: HttpResourceFn;
|
|
|
4519
4522
|
* @param includeRequestsWithAuthHeaders Enables caching of requests containing either `Authorization`
|
|
4520
4523
|
* or `Proxy-Authorization` headers. By default, these requests are excluded from caching.
|
|
4521
4524
|
*
|
|
4525
|
+
* @see [Configuring the caching options](guide/ssr#configuring-the-caching-options)
|
|
4526
|
+
*
|
|
4522
4527
|
* @publicApi
|
|
4523
4528
|
*/
|
|
4524
4529
|
type HttpTransferCacheOptions = {
|
|
@@ -4564,6 +4569,8 @@ declare const HTTP_TRANSFER_CACHE_ORIGIN_MAP: InjectionToken<Record<string, stri
|
|
|
4564
4569
|
* bootstrapping of the application in the browser thus avoiding duplicate requests and reducing
|
|
4565
4570
|
* load time.
|
|
4566
4571
|
*
|
|
4572
|
+
* @see [Caching data when using HttpClient](guide/ssr#configuring-the-caching-options)
|
|
4573
|
+
*
|
|
4567
4574
|
*/
|
|
4568
4575
|
declare function withHttpTransferCache(cacheOptions: HttpTransferCacheOptions): Provider[];
|
|
4569
4576
|
|
|
@@ -4576,7 +4583,9 @@ declare function withHttpTransferCache(cacheOptions: HttpTransferCacheOptions):
|
|
|
4576
4583
|
*/
|
|
4577
4584
|
declare class HttpXhrBackend implements HttpBackend {
|
|
4578
4585
|
private xhrFactory;
|
|
4586
|
+
private readonly tracingService;
|
|
4579
4587
|
constructor(xhrFactory: XhrFactory);
|
|
4588
|
+
private maybePropagateTrace;
|
|
4580
4589
|
/**
|
|
4581
4590
|
* Processes a request and returns a stream of response events.
|
|
4582
4591
|
* @param req The request object.
|
package/types/testing.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v21.0.0-
|
|
2
|
+
* @license Angular v21.0.0-rc.1
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.dev/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -7,74 +7,15 @@
|
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
8
|
import { Provider, InjectionToken } from '@angular/core';
|
|
9
9
|
export { ɵFakeNavigation } from '@angular/core/testing';
|
|
10
|
+
import { PlatformLocation, LocationChangeListener } from './_platform_location-chunk.js';
|
|
10
11
|
import { Location, LocationStrategy } from '@angular/common';
|
|
11
12
|
import { SubscriptionLike } from 'rxjs';
|
|
12
|
-
import { PlatformLocation, LocationChangeListener } from './_platform_location-chunk.js';
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Return a provider for the `FakeNavigation` in place of the real Navigation API.
|
|
16
16
|
*/
|
|
17
17
|
declare function provideFakePlatformNavigation(): Provider[];
|
|
18
18
|
|
|
19
|
-
/**
|
|
20
|
-
* A spy for {@link Location} that allows tests to fire simulated location events.
|
|
21
|
-
*
|
|
22
|
-
* @publicApi
|
|
23
|
-
*/
|
|
24
|
-
declare class SpyLocation implements Location {
|
|
25
|
-
urlChanges: string[];
|
|
26
|
-
private _history;
|
|
27
|
-
private _historyIndex;
|
|
28
|
-
/** @docs-private */
|
|
29
|
-
ngOnDestroy(): void;
|
|
30
|
-
setInitialPath(url: string): void;
|
|
31
|
-
setBaseHref(url: string): void;
|
|
32
|
-
path(): string;
|
|
33
|
-
getState(): unknown;
|
|
34
|
-
isCurrentPathEqualTo(path: string, query?: string): boolean;
|
|
35
|
-
simulateUrlPop(pathname: string): void;
|
|
36
|
-
simulateHashChange(pathname: string): void;
|
|
37
|
-
prepareExternalUrl(url: string): string;
|
|
38
|
-
go(path: string, query?: string, state?: any): void;
|
|
39
|
-
replaceState(path: string, query?: string, state?: any): void;
|
|
40
|
-
forward(): void;
|
|
41
|
-
back(): void;
|
|
42
|
-
historyGo(relativePosition?: number): void;
|
|
43
|
-
onUrlChange(fn: (url: string, state: unknown) => void): VoidFunction;
|
|
44
|
-
subscribe(onNext: (value: any) => void, onThrow?: ((error: any) => void) | null, onReturn?: (() => void) | null): SubscriptionLike;
|
|
45
|
-
normalize(url: string): string;
|
|
46
|
-
private pushHistory;
|
|
47
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SpyLocation, never>;
|
|
48
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<SpyLocation>;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* A mock implementation of {@link LocationStrategy} that allows tests to fire simulated
|
|
53
|
-
* location events.
|
|
54
|
-
*
|
|
55
|
-
* @publicApi
|
|
56
|
-
*/
|
|
57
|
-
declare class MockLocationStrategy extends LocationStrategy {
|
|
58
|
-
internalBaseHref: string;
|
|
59
|
-
internalPath: string;
|
|
60
|
-
internalTitle: string;
|
|
61
|
-
urlChanges: string[];
|
|
62
|
-
private stateChanges;
|
|
63
|
-
constructor();
|
|
64
|
-
simulatePopState(url: string): void;
|
|
65
|
-
path(includeHash?: boolean): string;
|
|
66
|
-
prepareExternalUrl(internal: string): string;
|
|
67
|
-
pushState(ctx: any, title: string, path: string, query: string): void;
|
|
68
|
-
replaceState(ctx: any, title: string, path: string, query: string): void;
|
|
69
|
-
onPopState(fn: (value: any) => void): void;
|
|
70
|
-
getBaseHref(): string;
|
|
71
|
-
back(): void;
|
|
72
|
-
forward(): void;
|
|
73
|
-
getState(): unknown;
|
|
74
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<MockLocationStrategy, never>;
|
|
75
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<MockLocationStrategy>;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
19
|
/**
|
|
79
20
|
* Mock platform location config
|
|
80
21
|
*
|
|
@@ -135,6 +76,91 @@ declare class MockPlatformLocation implements PlatformLocation {
|
|
|
135
76
|
static ɵfac: i0.ɵɵFactoryDeclaration<MockPlatformLocation, [{ optional: true; }]>;
|
|
136
77
|
static ɵprov: i0.ɵɵInjectableDeclaration<MockPlatformLocation>;
|
|
137
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Mock implementation of URL state.
|
|
81
|
+
*/
|
|
82
|
+
declare class FakeNavigationPlatformLocation implements PlatformLocation {
|
|
83
|
+
private readonly _platformNavigation;
|
|
84
|
+
constructor();
|
|
85
|
+
private config;
|
|
86
|
+
getBaseHrefFromDOM(): string;
|
|
87
|
+
onPopState(fn: LocationChangeListener): VoidFunction;
|
|
88
|
+
onHashChange(fn: LocationChangeListener): VoidFunction;
|
|
89
|
+
get href(): string;
|
|
90
|
+
get protocol(): string;
|
|
91
|
+
get hostname(): string;
|
|
92
|
+
get port(): string;
|
|
93
|
+
get pathname(): string;
|
|
94
|
+
get search(): string;
|
|
95
|
+
get hash(): string;
|
|
96
|
+
pushState(state: any, title: string, url: string): void;
|
|
97
|
+
replaceState(state: any, title: string, url: string): void;
|
|
98
|
+
forward(): void;
|
|
99
|
+
back(): void;
|
|
100
|
+
historyGo(relativePosition?: number): void;
|
|
101
|
+
getState(): unknown;
|
|
102
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FakeNavigationPlatformLocation, never>;
|
|
103
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FakeNavigationPlatformLocation>;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* A spy for {@link Location} that allows tests to fire simulated location events.
|
|
108
|
+
*
|
|
109
|
+
* @publicApi
|
|
110
|
+
*/
|
|
111
|
+
declare class SpyLocation implements Location {
|
|
112
|
+
urlChanges: string[];
|
|
113
|
+
private _history;
|
|
114
|
+
private _historyIndex;
|
|
115
|
+
/** @docs-private */
|
|
116
|
+
ngOnDestroy(): void;
|
|
117
|
+
setInitialPath(url: string): void;
|
|
118
|
+
setBaseHref(url: string): void;
|
|
119
|
+
path(): string;
|
|
120
|
+
getState(): unknown;
|
|
121
|
+
isCurrentPathEqualTo(path: string, query?: string): boolean;
|
|
122
|
+
simulateUrlPop(pathname: string): void;
|
|
123
|
+
simulateHashChange(pathname: string): void;
|
|
124
|
+
prepareExternalUrl(url: string): string;
|
|
125
|
+
go(path: string, query?: string, state?: any): void;
|
|
126
|
+
replaceState(path: string, query?: string, state?: any): void;
|
|
127
|
+
forward(): void;
|
|
128
|
+
back(): void;
|
|
129
|
+
historyGo(relativePosition?: number): void;
|
|
130
|
+
onUrlChange(fn: (url: string, state: unknown) => void): VoidFunction;
|
|
131
|
+
subscribe(onNext: (value: any) => void, onThrow?: ((error: any) => void) | null, onReturn?: (() => void) | null): SubscriptionLike;
|
|
132
|
+
normalize(url: string): string;
|
|
133
|
+
private pushHistory;
|
|
134
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SpyLocation, never>;
|
|
135
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<SpyLocation>;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* A mock implementation of {@link LocationStrategy} that allows tests to fire simulated
|
|
140
|
+
* location events.
|
|
141
|
+
*
|
|
142
|
+
* @publicApi
|
|
143
|
+
*/
|
|
144
|
+
declare class MockLocationStrategy extends LocationStrategy {
|
|
145
|
+
internalBaseHref: string;
|
|
146
|
+
internalPath: string;
|
|
147
|
+
internalTitle: string;
|
|
148
|
+
urlChanges: string[];
|
|
149
|
+
private stateChanges;
|
|
150
|
+
constructor();
|
|
151
|
+
simulatePopState(url: string): void;
|
|
152
|
+
path(includeHash?: boolean): string;
|
|
153
|
+
prepareExternalUrl(internal: string): string;
|
|
154
|
+
pushState(ctx: any, title: string, path: string, query: string): void;
|
|
155
|
+
replaceState(ctx: any, title: string, path: string, query: string): void;
|
|
156
|
+
onPopState(fn: (value: any) => void): void;
|
|
157
|
+
getBaseHref(): string;
|
|
158
|
+
back(): void;
|
|
159
|
+
forward(): void;
|
|
160
|
+
getState(): unknown;
|
|
161
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MockLocationStrategy, never>;
|
|
162
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MockLocationStrategy>;
|
|
163
|
+
}
|
|
138
164
|
|
|
139
165
|
/**
|
|
140
166
|
* Returns mock providers for the `Location` and `LocationStrategy` classes.
|
|
@@ -144,5 +170,5 @@ declare class MockPlatformLocation implements PlatformLocation {
|
|
|
144
170
|
*/
|
|
145
171
|
declare function provideLocationMocks(): Provider[];
|
|
146
172
|
|
|
147
|
-
export { MOCK_PLATFORM_LOCATION_CONFIG, MockLocationStrategy, MockPlatformLocation, SpyLocation, provideLocationMocks, provideFakePlatformNavigation as ɵprovideFakePlatformNavigation };
|
|
173
|
+
export { MOCK_PLATFORM_LOCATION_CONFIG, MockLocationStrategy, MockPlatformLocation, SpyLocation, provideLocationMocks, FakeNavigationPlatformLocation as ɵFakeNavigationPlatformLocation, provideFakePlatformNavigation as ɵprovideFakePlatformNavigation };
|
|
148
174
|
export type { MockPlatformLocationConfig };
|
package/types/upgrade.d.ts
CHANGED