@angular/core 19.2.0-rc.0 → 20.0.0-next.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.
Files changed (40) hide show
  1. package/fesm2022/core.mjs +474 -290
  2. package/fesm2022/core.mjs.map +1 -1
  3. package/fesm2022/primitives/event-dispatch.mjs +1 -1
  4. package/fesm2022/primitives/signals.mjs +1 -1
  5. package/fesm2022/rxjs-interop.mjs +1 -1
  6. package/fesm2022/testing.mjs +707 -5
  7. package/fesm2022/testing.mjs.map +1 -1
  8. package/index.d.ts +197 -22
  9. package/package.json +1 -1
  10. package/primitives/event-dispatch/index.d.ts +1 -1
  11. package/primitives/signals/index.d.ts +1 -1
  12. package/rxjs-interop/index.d.ts +1 -1
  13. package/schematics/bundles/{apply_import_manager-a930fcf1.js → apply_import_manager-0959b78c.js} +3 -3
  14. package/schematics/bundles/{checker-2eecc677.js → checker-cf6f7980.js} +121 -16
  15. package/schematics/bundles/cleanup-unused-imports.js +7 -7
  16. package/schematics/bundles/{compiler_host-c280a924.js → compiler_host-cc1379e9.js} +2 -2
  17. package/schematics/bundles/control-flow-migration.js +3 -3
  18. package/schematics/bundles/explicit-standalone-flag.js +5 -5
  19. package/schematics/bundles/{imports-abe29092.js → imports-31a38653.js} +1 -1
  20. package/schematics/bundles/{index-24a2ad1e.js → index-42d84d69.js} +4 -4
  21. package/schematics/bundles/{index-3891dd55.js → index-6675d6bc.js} +4 -4
  22. package/schematics/bundles/inject-migration.js +7 -7
  23. package/schematics/bundles/{leading_space-d190b83b.js → leading_space-6e7a8ec6.js} +1 -1
  24. package/schematics/bundles/{migrate_ts_type_references-71b3a951.js → migrate_ts_type_references-5089e4ef.js} +10 -6
  25. package/schematics/bundles/{ng_decorators-e699c081.js → ng_decorators-6878e227.js} +2 -2
  26. package/schematics/bundles/{nodes-a535b2be.js → nodes-ffdce442.js} +1 -1
  27. package/schematics/bundles/output-migration.js +7 -7
  28. package/schematics/bundles/pending-tasks.js +5 -5
  29. package/schematics/bundles/{program-24da9092.js → program-362689f0.js} +148 -148
  30. package/schematics/bundles/{project_paths-b073c4d6.js → project_paths-7d2daa1e.js} +3 -3
  31. package/schematics/bundles/{project_tsconfig_paths-e9ccccbf.js → project_tsconfig_paths-6c9cde78.js} +1 -1
  32. package/schematics/bundles/{property_name-7c8433f5.js → property_name-42030525.js} +1 -1
  33. package/schematics/bundles/provide-initializer.js +5 -5
  34. package/schematics/bundles/route-lazy-loading.js +5 -5
  35. package/schematics/bundles/self-closing-tags-migration.js +8 -8
  36. package/schematics/bundles/signal-input-migration.js +9 -9
  37. package/schematics/bundles/signal-queries-migration.js +9 -9
  38. package/schematics/bundles/signals.js +9 -9
  39. package/schematics/bundles/standalone-migration.js +9 -9
  40. package/testing/index.d.ts +297 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v19.2.0-rc.0
3
+ * @license Angular v20.0.0-next.0
4
4
  * (c) 2010-2024 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
@@ -9,18 +9,18 @@
9
9
  Object.defineProperty(exports, '__esModule', { value: true });
10
10
 
11
11
  var schematics = require('@angular-devkit/schematics');
12
- require('./index-3891dd55.js');
12
+ require('./index-6675d6bc.js');
13
13
  var fs = require('fs');
14
14
  var p = require('path');
15
15
  var ts = require('typescript');
16
- var compiler_host = require('./compiler_host-c280a924.js');
17
- var project_tsconfig_paths = require('./project_tsconfig_paths-e9ccccbf.js');
18
- var ng_decorators = require('./ng_decorators-e699c081.js');
19
- var nodes = require('./nodes-a535b2be.js');
20
- var imports = require('./imports-abe29092.js');
21
- var checker = require('./checker-2eecc677.js');
16
+ var compiler_host = require('./compiler_host-cc1379e9.js');
17
+ var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
18
+ var ng_decorators = require('./ng_decorators-6878e227.js');
19
+ var nodes = require('./nodes-ffdce442.js');
20
+ var imports = require('./imports-31a38653.js');
21
+ var checker = require('./checker-cf6f7980.js');
22
22
  require('os');
23
- var program = require('./program-24da9092.js');
23
+ var program = require('./program-362689f0.js');
24
24
  require('@angular-devkit/core');
25
25
  require('module');
26
26
  require('url');
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v19.2.0-rc.0
2
+ * @license Angular v20.0.0-next.0
3
3
  * (c) 2010-2024 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -191,6 +191,42 @@ export declare function fakeAsync(fn: Function, options?: {
191
191
  flush?: boolean;
192
192
  }): (...args: any[]) => any;
193
193
 
194
+ /**
195
+ * Fake equivalent of `NavigationHistoryEntry`.
196
+ */
197
+ declare class FakeNavigationHistoryEntry implements NavigationHistoryEntry {
198
+ readonly url: string | null;
199
+ readonly sameDocument: boolean;
200
+ readonly id: string;
201
+ readonly key: string;
202
+ readonly index: number;
203
+ private readonly state;
204
+ private readonly historyState;
205
+ ondispose: ((this: NavigationHistoryEntry, ev: Event) => any) | null;
206
+ constructor(url: string | null, { id, key, index, sameDocument, state, historyState, }: {
207
+ id: string;
208
+ key: string;
209
+ index: number;
210
+ sameDocument: boolean;
211
+ historyState: unknown;
212
+ state?: unknown;
213
+ });
214
+ getState(): unknown;
215
+ getHistoryState(): unknown;
216
+ addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: AddEventListenerOptions | boolean): void;
217
+ removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: EventListenerOptions | boolean): void;
218
+ dispatchEvent(event: Event): boolean;
219
+ }
220
+
221
+ /**
222
+ * Fake equivalent of the `NavigationResult` interface with
223
+ * `FakeNavigationHistoryEntry`.
224
+ */
225
+ declare interface FakeNavigationResult extends NavigationResult {
226
+ readonly committed: Promise<FakeNavigationHistoryEntry>;
227
+ readonly finished: Promise<FakeNavigationHistoryEntry>;
228
+ }
229
+
194
230
  /**
195
231
  * Flushes any pending microtasks and simulates the asynchronous passage of time for the timers in
196
232
  * the `fakeAsync` zone by
@@ -275,6 +311,137 @@ export declare interface ModuleTeardownOptions {
275
311
  rethrowErrors?: boolean;
276
312
  }
277
313
 
314
+ declare class NavigateEvent extends Event {
315
+ constructor(type: string, eventInit?: NavigateEventInit);
316
+ readonly navigationType: NavigationTypeString;
317
+ readonly canIntercept: boolean;
318
+ readonly userInitiated: boolean;
319
+ readonly hashChange: boolean;
320
+ readonly destination: NavigationDestination;
321
+ readonly signal: AbortSignal;
322
+ readonly formData: FormData | null;
323
+ readonly downloadRequest: string | null;
324
+ readonly info?: unknown;
325
+ intercept(options?: NavigationInterceptOptions): void;
326
+ scroll(): void;
327
+ }
328
+
329
+ declare interface NavigateEventInit extends EventInit {
330
+ navigationType?: NavigationTypeString;
331
+ canIntercept?: boolean;
332
+ userInitiated?: boolean;
333
+ hashChange?: boolean;
334
+ destination: NavigationDestination;
335
+ signal: AbortSignal;
336
+ formData?: FormData | null;
337
+ downloadRequest?: string | null;
338
+ info?: unknown;
339
+ }
340
+
341
+ declare class Navigation extends EventTarget {
342
+ entries(): NavigationHistoryEntry[];
343
+ readonly currentEntry: NavigationHistoryEntry | null;
344
+ updateCurrentEntry(options: NavigationUpdateCurrentEntryOptions): void;
345
+ readonly transition: NavigationTransition | null;
346
+ readonly canGoBack: boolean;
347
+ readonly canGoForward: boolean;
348
+ navigate(url: string, options?: NavigationNavigateOptions): NavigationResult;
349
+ reload(options?: NavigationReloadOptions): NavigationResult;
350
+ traverseTo(key: string, options?: NavigationOptions): NavigationResult;
351
+ back(options?: NavigationOptions): NavigationResult;
352
+ forward(options?: NavigationOptions): NavigationResult;
353
+ onnavigate: ((this: Navigation, ev: NavigateEvent) => any) | null;
354
+ onnavigatesuccess: ((this: Navigation, ev: Event) => any) | null;
355
+ onnavigateerror: ((this: Navigation, ev: ErrorEvent) => any) | null;
356
+ oncurrententrychange: ((this: Navigation, ev: NavigationCurrentEntryChangeEvent) => any) | null;
357
+ addEventListener<K extends keyof NavigationEventMap>(type: K, listener: (this: Navigation, ev: NavigationEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
358
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
359
+ removeEventListener<K extends keyof NavigationEventMap>(type: K, listener: (this: Navigation, ev: NavigationEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
360
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
361
+ }
362
+
363
+ declare class NavigationCurrentEntryChangeEvent extends Event {
364
+ constructor(type: string, eventInit?: NavigationCurrentEntryChangeEventInit);
365
+ readonly navigationType: NavigationTypeString | null;
366
+ readonly from: NavigationHistoryEntry;
367
+ }
368
+
369
+ declare interface NavigationCurrentEntryChangeEventInit extends EventInit {
370
+ navigationType?: NavigationTypeString | null;
371
+ from: NavigationHistoryEntry;
372
+ }
373
+
374
+ declare class NavigationDestination {
375
+ readonly url: string;
376
+ readonly key: string | null;
377
+ readonly id: string | null;
378
+ readonly index: number;
379
+ readonly sameDocument: boolean;
380
+ getState(): unknown;
381
+ }
382
+
383
+
384
+ declare interface NavigationEventMap {
385
+ navigate: NavigateEvent;
386
+ navigatesuccess: Event;
387
+ navigateerror: ErrorEvent;
388
+ currententrychange: NavigationCurrentEntryChangeEvent;
389
+ }
390
+
391
+ declare class NavigationHistoryEntry extends EventTarget {
392
+ readonly key: string;
393
+ readonly id: string;
394
+ readonly url: string | null;
395
+ readonly index: number;
396
+ readonly sameDocument: boolean;
397
+ getState(): unknown;
398
+ ondispose: ((this: NavigationHistoryEntry, ev: Event) => any) | null;
399
+ addEventListener<K extends keyof NavigationHistoryEntryEventMap>(type: K, listener: (this: NavigationHistoryEntry, ev: NavigationHistoryEntryEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
400
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
401
+ removeEventListener<K extends keyof NavigationHistoryEntryEventMap>(type: K, listener: (this: NavigationHistoryEntry, ev: NavigationHistoryEntryEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
402
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
403
+ }
404
+
405
+ declare interface NavigationHistoryEntryEventMap {
406
+ dispose: Event;
407
+ }
408
+
409
+ declare interface NavigationInterceptOptions {
410
+ handler?: () => Promise<void>;
411
+ focusReset?: 'after-transition' | 'manual';
412
+ scroll?: 'after-transition' | 'manual';
413
+ }
414
+
415
+ declare interface NavigationNavigateOptions extends NavigationOptions {
416
+ state?: unknown;
417
+ history?: 'auto' | 'push' | 'replace';
418
+ }
419
+
420
+ declare interface NavigationOptions {
421
+ info?: unknown;
422
+ }
423
+
424
+ declare interface NavigationReloadOptions extends NavigationOptions {
425
+ state?: unknown;
426
+ }
427
+
428
+ declare interface NavigationResult {
429
+ committed: Promise<NavigationHistoryEntry>;
430
+ finished: Promise<NavigationHistoryEntry>;
431
+ }
432
+
433
+ declare class NavigationTransition {
434
+ readonly navigationType: NavigationTypeString;
435
+ readonly from: NavigationHistoryEntry;
436
+ readonly finished: Promise<void>;
437
+ }
438
+
439
+ declare type NavigationTypeString = 'reload' | 'push' | 'replace' | 'traverse';
440
+
441
+ declare interface NavigationUpdateCurrentEntryOptions {
442
+ state: unknown;
443
+ }
444
+
278
445
  /**
279
446
  * Clears out the shared fake async zone for a test.
280
447
  * To be called in a global `beforeEach`.
@@ -557,6 +724,135 @@ export declare function withModule(moduleDef: TestModuleMetadata): InjectSetupWr
557
724
 
558
725
  export declare function withModule(moduleDef: TestModuleMetadata, fn: Function): () => any;
559
726
 
727
+ /**
728
+ * Fake implementation of user agent history and navigation behavior. This is a
729
+ * high-fidelity implementation of browser behavior that attempts to emulate
730
+ * things like traversal delay.
731
+ */
732
+ export declare class ɵFakeNavigation implements Navigation {
733
+ private readonly window;
734
+ /**
735
+ * The fake implementation of an entries array. Only same-document entries
736
+ * allowed.
737
+ */
738
+ private readonly entriesArr;
739
+ /**
740
+ * The current active entry index into `entriesArr`.
741
+ */
742
+ private currentEntryIndex;
743
+ /**
744
+ * The current navigate event.
745
+ */
746
+ private navigateEvent;
747
+ /**
748
+ * A Map of pending traversals, so that traversals to the same entry can be
749
+ * re-used.
750
+ */
751
+ private readonly traversalQueue;
752
+ /**
753
+ * A Promise that resolves when the previous traversals have finished. Used to
754
+ * simulate the cross-process communication necessary for traversals.
755
+ */
756
+ private nextTraversal;
757
+ /**
758
+ * A prospective current active entry index, which includes unresolved
759
+ * traversals. Used by `go` to determine where navigations are intended to go.
760
+ */
761
+ private prospectiveEntryIndex;
762
+ /**
763
+ * A test-only option to make traversals synchronous, rather than emulate
764
+ * cross-process communication.
765
+ */
766
+ private synchronousTraversals;
767
+ /** Whether to allow a call to setInitialEntryForTesting. */
768
+ private canSetInitialEntry;
769
+ /** `EventTarget` to dispatch events. */
770
+ private eventTarget;
771
+ /** The next unique id for created entries. Replace recreates this id. */
772
+ private nextId;
773
+ /** The next unique key for created entries. Replace inherits this id. */
774
+ private nextKey;
775
+ /** Whether this fake is disposed. */
776
+ private disposed;
777
+ /** Equivalent to `navigation.currentEntry`. */
778
+ get currentEntry(): FakeNavigationHistoryEntry;
779
+ get canGoBack(): boolean;
780
+ get canGoForward(): boolean;
781
+ constructor(window: Window, startURL: `http${string}`);
782
+ /**
783
+ * Sets the initial entry.
784
+ */
785
+ setInitialEntryForTesting(url: `http${string}`, options?: {
786
+ historyState: unknown;
787
+ state?: unknown;
788
+ }): void;
789
+ /** Returns whether the initial entry is still eligible to be set. */
790
+ canSetInitialEntryForTesting(): boolean;
791
+ /**
792
+ * Sets whether to emulate traversals as synchronous rather than
793
+ * asynchronous.
794
+ */
795
+ setSynchronousTraversalsForTesting(synchronousTraversals: boolean): void;
796
+ /** Equivalent to `navigation.entries()`. */
797
+ entries(): FakeNavigationHistoryEntry[];
798
+ /** Equivalent to `navigation.navigate()`. */
799
+ navigate(url: string, options?: NavigationNavigateOptions): FakeNavigationResult;
800
+ /** Equivalent to `history.pushState()`. */
801
+ pushState(data: unknown, title: string, url?: string): void;
802
+ /** Equivalent to `history.replaceState()`. */
803
+ replaceState(data: unknown, title: string, url?: string): void;
804
+ private pushOrReplaceState;
805
+ /** Equivalent to `navigation.traverseTo()`. */
806
+ traverseTo(key: string, options?: NavigationOptions): FakeNavigationResult;
807
+ /** Equivalent to `navigation.back()`. */
808
+ back(options?: NavigationOptions): FakeNavigationResult;
809
+ /** Equivalent to `navigation.forward()`. */
810
+ forward(options?: NavigationOptions): FakeNavigationResult;
811
+ /**
812
+ * Equivalent to `history.go()`.
813
+ * Note that this method does not actually work precisely to how Chrome
814
+ * does, instead choosing a simpler model with less unexpected behavior.
815
+ * Chrome has a few edge case optimizations, for instance with repeated
816
+ * `back(); forward()` chains it collapses certain traversals.
817
+ */
818
+ go(direction: number): void;
819
+ /** Runs a traversal synchronously or asynchronously */
820
+ private runTraversal;
821
+ /** Equivalent to `navigation.addEventListener()`. */
822
+ addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: AddEventListenerOptions | boolean): void;
823
+ /** Equivalent to `navigation.removeEventListener()`. */
824
+ removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: EventListenerOptions | boolean): void;
825
+ /** Equivalent to `navigation.dispatchEvent()` */
826
+ dispatchEvent(event: Event): boolean;
827
+ /** Cleans up resources. */
828
+ dispose(): void;
829
+ /** Returns whether this fake is disposed. */
830
+ isDisposed(): boolean;
831
+ /** Implementation for all navigations and traversals. */
832
+ private userAgentNavigate;
833
+ /** Implementation to commit a navigation. */
834
+ private userAgentCommit;
835
+ /** Implementation for a push or replace navigation. */
836
+ private userAgentPushOrReplace;
837
+ /** Implementation for a traverse navigation. */
838
+ private userAgentTraverse;
839
+ /** Utility method for finding entries with the given `key`. */
840
+ private findEntry;
841
+ set onnavigate(_handler: ((this: Navigation, ev: NavigateEvent) => any) | null);
842
+ get onnavigate(): ((this: Navigation, ev: NavigateEvent) => any) | null;
843
+ set oncurrententrychange(_handler: // tslint:disable-next-line:no-any
844
+ ((this: Navigation, ev: NavigationCurrentEntryChangeEvent) => any) | null);
845
+ get oncurrententrychange(): // tslint:disable-next-line:no-any
846
+ ((this: Navigation, ev: NavigationCurrentEntryChangeEvent) => any) | null;
847
+ set onnavigatesuccess(_handler: ((this: Navigation, ev: Event) => any) | null);
848
+ get onnavigatesuccess(): ((this: Navigation, ev: Event) => any) | null;
849
+ set onnavigateerror(_handler: ((this: Navigation, ev: ErrorEvent) => any) | null);
850
+ get onnavigateerror(): ((this: Navigation, ev: ErrorEvent) => any) | null;
851
+ get transition(): NavigationTransition | null;
852
+ updateCurrentEntry(_options: NavigationUpdateCurrentEntryOptions): void;
853
+ reload(_options?: NavigationReloadOptions): NavigationResult;
854
+ }
855
+
560
856
  export declare class ɵMetadataOverrider {
561
857
  private _references;
562
858
  /**