@angular/common 21.0.0-next.9 → 21.0.0-rc.0
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 +2042 -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 +1135 -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 -2
- package/types/testing.d.ts +88 -62
- package/types/upgrade.d.ts +1 -1
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.0
|
|
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