@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/common",
3
- "version": "20.0.0-next.1",
3
+ "version": "20.0.0-next.2",
4
4
  "description": "Angular - commonly needed directives and services",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -44,7 +44,7 @@
44
44
  }
45
45
  },
46
46
  "peerDependencies": {
47
- "@angular/core": "20.0.0-next.1",
47
+ "@angular/core": "20.0.0-next.2",
48
48
  "rxjs": "^6.5.3 || ^7.4.0"
49
49
  },
50
50
  "repository": {
@@ -1,26 +1,51 @@
1
1
  /**
2
- * @license Angular v20.0.0-next.1
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
7
  import * as i0 from '@angular/core';
9
- import { InjectionToken } from '@angular/core';
10
- import { Location as Location_2 } from '@angular/common';
11
- import { LocationChangeListener } from '@angular/common';
12
- import { LocationStrategy } from '@angular/common';
13
- import { PlatformLocation } from '@angular/common';
14
- import { Provider } from '@angular/core';
8
+ import { Provider, InjectionToken } from '@angular/core';
9
+ export { ɵFakeNavigation } from '@angular/core/testing';
10
+ import { Location, LocationStrategy, PlatformLocation, LocationChangeListener } from '@angular/common';
15
11
  import { SubscriptionLike } from 'rxjs';
16
- import { ɵFakeNavigation } from '@angular/core/testing';
17
12
 
18
13
  /**
19
- * Provider for mock platform location config
14
+ * Return a provider for the `FakeNavigation` in place of the real Navigation API.
15
+ */
16
+ declare function provideFakePlatformNavigation(): Provider[];
17
+
18
+ /**
19
+ * A spy for {@link Location} that allows tests to fire simulated location events.
20
20
  *
21
21
  * @publicApi
22
22
  */
23
- export declare const MOCK_PLATFORM_LOCATION_CONFIG: InjectionToken<MockPlatformLocationConfig>;
23
+ declare class SpyLocation implements Location {
24
+ urlChanges: string[];
25
+ private _history;
26
+ private _historyIndex;
27
+ /** @nodoc */
28
+ ngOnDestroy(): void;
29
+ setInitialPath(url: string): void;
30
+ setBaseHref(url: string): void;
31
+ path(): string;
32
+ getState(): unknown;
33
+ isCurrentPathEqualTo(path: string, query?: string): boolean;
34
+ simulateUrlPop(pathname: string): void;
35
+ simulateHashChange(pathname: string): void;
36
+ prepareExternalUrl(url: string): string;
37
+ go(path: string, query?: string, state?: any): void;
38
+ replaceState(path: string, query?: string, state?: any): void;
39
+ forward(): void;
40
+ back(): void;
41
+ historyGo(relativePosition?: number): void;
42
+ onUrlChange(fn: (url: string, state: unknown) => void): VoidFunction;
43
+ subscribe(onNext: (value: any) => void, onThrow?: ((error: any) => void) | null, onReturn?: (() => void) | null): SubscriptionLike;
44
+ normalize(url: string): string;
45
+ private pushHistory;
46
+ static ɵfac: i0.ɵɵFactoryDeclaration<SpyLocation, never>;
47
+ static ɵprov: i0.ɵɵInjectableDeclaration<SpyLocation>;
48
+ }
24
49
 
25
50
  /**
26
51
  * A mock implementation of {@link LocationStrategy} that allows tests to fire simulated
@@ -28,7 +53,7 @@ export declare const MOCK_PLATFORM_LOCATION_CONFIG: InjectionToken<MockPlatformL
28
53
  *
29
54
  * @publicApi
30
55
  */
31
- export declare class MockLocationStrategy extends LocationStrategy {
56
+ declare class MockLocationStrategy extends LocationStrategy {
32
57
  internalBaseHref: string;
33
58
  internalPath: string;
34
59
  internalTitle: string;
@@ -49,12 +74,27 @@ export declare class MockLocationStrategy extends LocationStrategy {
49
74
  static ɵprov: i0.ɵɵInjectableDeclaration<MockLocationStrategy>;
50
75
  }
51
76
 
77
+ /**
78
+ * Mock platform location config
79
+ *
80
+ * @publicApi
81
+ */
82
+ interface MockPlatformLocationConfig {
83
+ startUrl?: string;
84
+ appBaseHref?: string;
85
+ }
86
+ /**
87
+ * Provider for mock platform location config
88
+ *
89
+ * @publicApi
90
+ */
91
+ declare const MOCK_PLATFORM_LOCATION_CONFIG: InjectionToken<MockPlatformLocationConfig>;
52
92
  /**
53
93
  * Mock implementation of URL state.
54
94
  *
55
95
  * @publicApi
56
96
  */
57
- export declare class MockPlatformLocation implements PlatformLocation {
97
+ declare class MockPlatformLocation implements PlatformLocation {
58
98
  private baseHref;
59
99
  private hashUpdate;
60
100
  private popStateSubject;
@@ -95,61 +135,12 @@ export declare class MockPlatformLocation implements PlatformLocation {
95
135
  static ɵprov: i0.ɵɵInjectableDeclaration<MockPlatformLocation>;
96
136
  }
97
137
 
98
- /**
99
- * Mock platform location config
100
- *
101
- * @publicApi
102
- */
103
- export declare interface MockPlatformLocationConfig {
104
- startUrl?: string;
105
- appBaseHref?: string;
106
- }
107
-
108
138
  /**
109
139
  * Returns mock providers for the `Location` and `LocationStrategy` classes.
110
140
  * The mocks are helpful in tests to fire simulated location events.
111
141
  *
112
142
  * @publicApi
113
143
  */
114
- export declare function provideLocationMocks(): Provider[];
115
-
116
- /**
117
- * A spy for {@link Location} that allows tests to fire simulated location events.
118
- *
119
- * @publicApi
120
- */
121
- export declare class SpyLocation implements Location_2 {
122
- urlChanges: string[];
123
- private _history;
124
- private _historyIndex;
125
- /** @nodoc */
126
- ngOnDestroy(): void;
127
- setInitialPath(url: string): void;
128
- setBaseHref(url: string): void;
129
- path(): string;
130
- getState(): unknown;
131
- isCurrentPathEqualTo(path: string, query?: string): boolean;
132
- simulateUrlPop(pathname: string): void;
133
- simulateHashChange(pathname: string): void;
134
- prepareExternalUrl(url: string): string;
135
- go(path: string, query?: string, state?: any): void;
136
- replaceState(path: string, query?: string, state?: any): void;
137
- forward(): void;
138
- back(): void;
139
- historyGo(relativePosition?: number): void;
140
- onUrlChange(fn: (url: string, state: unknown) => void): VoidFunction;
141
- subscribe(onNext: (value: any) => void, onThrow?: ((error: any) => void) | null, onReturn?: (() => void) | null): SubscriptionLike;
142
- normalize(url: string): string;
143
- private pushHistory;
144
- static ɵfac: i0.ɵɵFactoryDeclaration<SpyLocation, never>;
145
- static ɵprov: i0.ɵɵInjectableDeclaration<SpyLocation>;
146
- }
147
-
148
- export { ɵFakeNavigation }
149
-
150
- /**
151
- * Return a provider for the `FakeNavigation` in place of the real Navigation API.
152
- */
153
- export declare function ɵprovideFakePlatformNavigation(): Provider[];
144
+ declare function provideLocationMocks(): Provider[];
154
145
 
155
- export { }
146
+ export { MOCK_PLATFORM_LOCATION_CONFIG, MockLocationStrategy, MockPlatformLocation, type MockPlatformLocationConfig, SpyLocation, provideLocationMocks, provideFakePlatformNavigation as ɵprovideFakePlatformNavigation };
@@ -1,18 +1,134 @@
1
1
  /**
2
- * @license Angular v20.0.0-next.1
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 * as i0 from '@angular/core';
9
7
  import * as i1 from '@angular/common';
10
- import { InjectionToken } from '@angular/core';
11
- import { Location as Location_2 } from '@angular/common';
12
- import { LocationStrategy } from '@angular/common';
13
- import { ModuleWithProviders } from '@angular/core';
14
- import { PlatformLocation } from '@angular/common';
8
+ import { Location, PlatformLocation, LocationStrategy } from '@angular/common';
15
9
  import { UpgradeModule } from '@angular/upgrade/static';
10
+ import * as i0 from '@angular/core';
11
+ import { InjectionToken, ModuleWithProviders } from '@angular/core';
12
+
13
+ /**
14
+ * A codec for encoding and decoding URL parts.
15
+ *
16
+ * @publicApi
17
+ **/
18
+ declare abstract class UrlCodec {
19
+ /**
20
+ * Encodes the path from the provided string
21
+ *
22
+ * @param path The path string
23
+ */
24
+ abstract encodePath(path: string): string;
25
+ /**
26
+ * Decodes the path from the provided string
27
+ *
28
+ * @param path The path string
29
+ */
30
+ abstract decodePath(path: string): string;
31
+ /**
32
+ * Encodes the search string from the provided string or object
33
+ *
34
+ * @param path The path string or object
35
+ */
36
+ abstract encodeSearch(search: string | {
37
+ [k: string]: unknown;
38
+ }): string;
39
+ /**
40
+ * Decodes the search objects from the provided string
41
+ *
42
+ * @param path The path string
43
+ */
44
+ abstract decodeSearch(search: string): {
45
+ [k: string]: unknown;
46
+ };
47
+ /**
48
+ * Encodes the hash from the provided string
49
+ *
50
+ * @param path The hash string
51
+ */
52
+ abstract encodeHash(hash: string): string;
53
+ /**
54
+ * Decodes the hash from the provided string
55
+ *
56
+ * @param path The hash string
57
+ */
58
+ abstract decodeHash(hash: string): string;
59
+ /**
60
+ * Normalizes the URL from the provided string
61
+ *
62
+ * @param path The URL string
63
+ */
64
+ abstract normalize(href: string): string;
65
+ /**
66
+ * Normalizes the URL from the provided string, search, hash, and base URL parameters
67
+ *
68
+ * @param path The URL path
69
+ * @param search The search object
70
+ * @param hash The has string
71
+ * @param baseUrl The base URL for the URL
72
+ */
73
+ abstract normalize(path: string, search: {
74
+ [k: string]: unknown;
75
+ }, hash: string, baseUrl?: string): string;
76
+ /**
77
+ * Checks whether the two strings are equal
78
+ * @param valA First string for comparison
79
+ * @param valB Second string for comparison
80
+ */
81
+ abstract areEqual(valA: string, valB: string): boolean;
82
+ /**
83
+ * Parses the URL string based on the base URL
84
+ *
85
+ * @param url The full URL string
86
+ * @param base The base for the URL
87
+ */
88
+ abstract parse(url: string, base?: string): {
89
+ href: string;
90
+ protocol: string;
91
+ host: string;
92
+ search: string;
93
+ hash: string;
94
+ hostname: string;
95
+ port: string;
96
+ pathname: string;
97
+ };
98
+ }
99
+ /**
100
+ * A `UrlCodec` that uses logic from AngularJS to serialize and parse URLs
101
+ * and URL parameters.
102
+ *
103
+ * @publicApi
104
+ */
105
+ declare class AngularJSUrlCodec implements UrlCodec {
106
+ encodePath(path: string): string;
107
+ encodeSearch(search: string | {
108
+ [k: string]: unknown;
109
+ }): string;
110
+ encodeHash(hash: string): string;
111
+ decodePath(path: string, html5Mode?: boolean): string;
112
+ decodeSearch(search: string): {
113
+ [k: string]: unknown;
114
+ };
115
+ decodeHash(hash: string): string;
116
+ normalize(href: string): string;
117
+ normalize(path: string, search: {
118
+ [k: string]: unknown;
119
+ }, hash: string, baseUrl?: string): string;
120
+ areEqual(valA: string, valB: string): boolean;
121
+ parse(url: string, base?: string): {
122
+ href: string;
123
+ protocol: string;
124
+ host: string;
125
+ search: string;
126
+ hash: string;
127
+ hostname: string;
128
+ port: string;
129
+ pathname: string;
130
+ };
131
+ }
16
132
 
17
133
  /**
18
134
  * Location service that provides a drop-in replacement for the $location service
@@ -22,7 +138,7 @@ import { UpgradeModule } from '@angular/upgrade/static';
22
138
  *
23
139
  * @publicApi
24
140
  */
25
- export declare class $locationShim {
141
+ declare class $locationShim {
26
142
  private location;
27
143
  private platformLocation;
28
144
  private urlCodec;
@@ -43,7 +159,7 @@ export declare class $locationShim {
43
159
  private cachedState;
44
160
  private urlChanges;
45
161
  private readonly removeOnUrlChangeFn;
46
- constructor($injector: any, location: Location_2, platformLocation: PlatformLocation, urlCodec: UrlCodec, locationStrategy: LocationStrategy);
162
+ constructor($injector: any, location: Location, platformLocation: PlatformLocation, urlCodec: UrlCodec, locationStrategy: LocationStrategy);
47
163
  private initialize;
48
164
  private resetBrowserUpdate;
49
165
  private lastHistoryState;
@@ -246,20 +362,19 @@ export declare class $locationShim {
246
362
  state(): unknown;
247
363
  state(state: unknown): this;
248
364
  }
249
-
250
365
  /**
251
366
  * The factory function used to create an instance of the `$locationShim` in Angular,
252
367
  * and provides an API-compatible `$locationProvider` for AngularJS.
253
368
  *
254
369
  * @publicApi
255
370
  */
256
- export declare class $locationShimProvider {
371
+ declare class $locationShimProvider {
257
372
  private ngUpgrade;
258
373
  private location;
259
374
  private platformLocation;
260
375
  private urlCodec;
261
376
  private locationStrategy;
262
- constructor(ngUpgrade: UpgradeModule, location: Location_2, platformLocation: PlatformLocation, urlCodec: UrlCodec, locationStrategy: LocationStrategy);
377
+ constructor(ngUpgrade: UpgradeModule, location: Location, platformLocation: PlatformLocation, urlCodec: UrlCodec, locationStrategy: LocationStrategy);
263
378
  /**
264
379
  * Factory method that returns an instance of the $locationShim
265
380
  */
@@ -276,53 +391,12 @@ export declare class $locationShimProvider {
276
391
  html5Mode(mode?: any): void;
277
392
  }
278
393
 
279
- /**
280
- * A `UrlCodec` that uses logic from AngularJS to serialize and parse URLs
281
- * and URL parameters.
282
- *
283
- * @publicApi
284
- */
285
- export declare class AngularJSUrlCodec implements UrlCodec {
286
- encodePath(path: string): string;
287
- encodeSearch(search: string | {
288
- [k: string]: unknown;
289
- }): string;
290
- encodeHash(hash: string): string;
291
- decodePath(path: string, html5Mode?: boolean): string;
292
- decodeSearch(search: string): {
293
- [k: string]: unknown;
294
- };
295
- decodeHash(hash: string): string;
296
- normalize(href: string): string;
297
- normalize(path: string, search: {
298
- [k: string]: unknown;
299
- }, hash: string, baseUrl?: string): string;
300
- areEqual(valA: string, valB: string): boolean;
301
- parse(url: string, base?: string): {
302
- href: string;
303
- protocol: string;
304
- host: string;
305
- search: string;
306
- hash: string;
307
- hostname: string;
308
- port: string;
309
- pathname: string;
310
- };
311
- }
312
-
313
- /**
314
- * A provider token used to configure the location upgrade module.
315
- *
316
- * @publicApi
317
- */
318
- export declare const LOCATION_UPGRADE_CONFIGURATION: InjectionToken<LocationUpgradeConfig>;
319
-
320
394
  /**
321
395
  * Configuration options for LocationUpgrade.
322
396
  *
323
397
  * @publicApi
324
398
  */
325
- export declare interface LocationUpgradeConfig {
399
+ interface LocationUpgradeConfig {
326
400
  /**
327
401
  * Configures whether the location upgrade module should use the `HashLocationStrategy`
328
402
  * or the `PathLocationStrategy`
@@ -345,7 +419,12 @@ export declare interface LocationUpgradeConfig {
345
419
  */
346
420
  appBaseHref?: string;
347
421
  }
348
-
422
+ /**
423
+ * A provider token used to configure the location upgrade module.
424
+ *
425
+ * @publicApi
426
+ */
427
+ declare const LOCATION_UPGRADE_CONFIGURATION: InjectionToken<LocationUpgradeConfig>;
349
428
  /**
350
429
  * `NgModule` used for providing and configuring Angular's Unified Location Service for upgrading.
351
430
  *
@@ -353,99 +432,11 @@ export declare interface LocationUpgradeConfig {
353
432
  *
354
433
  * @publicApi
355
434
  */
356
- export declare class LocationUpgradeModule {
435
+ declare class LocationUpgradeModule {
357
436
  static config(config?: LocationUpgradeConfig): ModuleWithProviders<LocationUpgradeModule>;
358
437
  static ɵfac: i0.ɵɵFactoryDeclaration<LocationUpgradeModule, never>;
359
438
  static ɵmod: i0.ɵɵNgModuleDeclaration<LocationUpgradeModule, never, [typeof i1.CommonModule], never>;
360
439
  static ɵinj: i0.ɵɵInjectorDeclaration<LocationUpgradeModule>;
361
440
  }
362
441
 
363
-
364
- /**
365
- * A codec for encoding and decoding URL parts.
366
- *
367
- * @publicApi
368
- **/
369
- export declare abstract class UrlCodec {
370
- /**
371
- * Encodes the path from the provided string
372
- *
373
- * @param path The path string
374
- */
375
- abstract encodePath(path: string): string;
376
- /**
377
- * Decodes the path from the provided string
378
- *
379
- * @param path The path string
380
- */
381
- abstract decodePath(path: string): string;
382
- /**
383
- * Encodes the search string from the provided string or object
384
- *
385
- * @param path The path string or object
386
- */
387
- abstract encodeSearch(search: string | {
388
- [k: string]: unknown;
389
- }): string;
390
- /**
391
- * Decodes the search objects from the provided string
392
- *
393
- * @param path The path string
394
- */
395
- abstract decodeSearch(search: string): {
396
- [k: string]: unknown;
397
- };
398
- /**
399
- * Encodes the hash from the provided string
400
- *
401
- * @param path The hash string
402
- */
403
- abstract encodeHash(hash: string): string;
404
- /**
405
- * Decodes the hash from the provided string
406
- *
407
- * @param path The hash string
408
- */
409
- abstract decodeHash(hash: string): string;
410
- /**
411
- * Normalizes the URL from the provided string
412
- *
413
- * @param path The URL string
414
- */
415
- abstract normalize(href: string): string;
416
- /**
417
- * Normalizes the URL from the provided string, search, hash, and base URL parameters
418
- *
419
- * @param path The URL path
420
- * @param search The search object
421
- * @param hash The has string
422
- * @param baseUrl The base URL for the URL
423
- */
424
- abstract normalize(path: string, search: {
425
- [k: string]: unknown;
426
- }, hash: string, baseUrl?: string): string;
427
- /**
428
- * Checks whether the two strings are equal
429
- * @param valA First string for comparison
430
- * @param valB Second string for comparison
431
- */
432
- abstract areEqual(valA: string, valB: string): boolean;
433
- /**
434
- * Parses the URL string based on the base URL
435
- *
436
- * @param url The full URL string
437
- * @param base The base for the URL
438
- */
439
- abstract parse(url: string, base?: string): {
440
- href: string;
441
- protocol: string;
442
- host: string;
443
- search: string;
444
- hash: string;
445
- hostname: string;
446
- port: string;
447
- pathname: string;
448
- };
449
- }
450
-
451
- export { }
442
+ export { $locationShim, $locationShimProvider, AngularJSUrlCodec, LOCATION_UPGRADE_CONFIGURATION, type LocationUpgradeConfig, LocationUpgradeModule, UrlCodec };