@angular/router 13.0.0-next.0 → 13.0.0-next.12

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 (112) hide show
  1. package/{esm2015/index.js → esm2020/index.mjs} +0 -0
  2. package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
  3. package/esm2020/router.mjs +5 -0
  4. package/{esm2015/src/apply_redirects.js → esm2020/src/apply_redirects.mjs} +0 -0
  5. package/esm2020/src/components/empty_outlet.mjs +29 -0
  6. package/esm2020/src/config.mjs +14 -0
  7. package/{esm2015/src/create_router_state.js → esm2020/src/create_router_state.mjs} +0 -0
  8. package/{esm2015/src/create_url_tree.js → esm2020/src/create_url_tree.mjs} +0 -0
  9. package/esm2020/src/directives/router_link.mjs +353 -0
  10. package/esm2020/src/directives/router_link_active.mjs +215 -0
  11. package/esm2020/src/directives/router_outlet.mjs +219 -0
  12. package/{esm2015/src/events.js → esm2020/src/events.mjs} +1 -1
  13. package/{esm2015/src/index.js → esm2020/src/index.mjs} +1 -1
  14. package/{esm2015/src/interfaces.js → esm2020/src/interfaces.mjs} +1 -1
  15. package/{esm2015/src/operators/activate_routes.js → esm2020/src/operators/activate_routes.mjs} +0 -0
  16. package/esm2020/src/operators/apply_redirects.mjs +14 -0
  17. package/esm2020/src/operators/check_guards.mjs +138 -0
  18. package/{esm2015/src/operators/prioritized_guard_value.js → esm2020/src/operators/prioritized_guard_value.mjs} +0 -0
  19. package/esm2020/src/operators/recognize.mjs +14 -0
  20. package/esm2020/src/operators/resolve_data.mjs +59 -0
  21. package/{esm2015/src/operators/switch_tap.js → esm2020/src/operators/switch_tap.mjs} +0 -0
  22. package/{esm2015/src/private_export.js → esm2020/src/private_export.mjs} +0 -0
  23. package/esm2020/src/recognize.mjs +262 -0
  24. package/{esm2015/src/route_reuse_strategy.js → esm2020/src/route_reuse_strategy.mjs} +0 -0
  25. package/esm2020/src/router.mjs +1009 -0
  26. package/esm2020/src/router_config_loader.mjs +71 -0
  27. package/esm2020/src/router_module.mjs +367 -0
  28. package/esm2020/src/router_outlet_context.mjs +74 -0
  29. package/esm2020/src/router_preloader.mjs +127 -0
  30. package/esm2020/src/router_scroller.mjs +95 -0
  31. package/esm2020/src/router_state.mjs +404 -0
  32. package/{esm2015/src/shared.js → esm2020/src/shared.mjs} +0 -0
  33. package/{esm2015/src/url_handling_strategy.js → esm2020/src/url_handling_strategy.mjs} +0 -0
  34. package/{esm2015/src/url_tree.js → esm2020/src/url_tree.mjs} +2 -2
  35. package/{esm2015/src/utils/collection.js → esm2020/src/utils/collection.mjs} +0 -0
  36. package/{esm2015/src/utils/config.js → esm2020/src/utils/config.mjs} +2 -2
  37. package/esm2020/src/utils/config_matching.mjs +145 -0
  38. package/{esm2015/src/utils/preactivation.js → esm2020/src/utils/preactivation.mjs} +0 -0
  39. package/{esm2015/src/utils/tree.js → esm2020/src/utils/tree.mjs} +0 -0
  40. package/{esm2015/src/utils/type_guards.js → esm2020/src/utils/type_guards.mjs} +0 -0
  41. package/{esm2015/src/version.js → esm2020/src/version.mjs} +1 -1
  42. package/{esm2015/testing/index.js → esm2020/testing/index.mjs} +0 -0
  43. package/{esm2015/testing/public_api.js → esm2020/testing/public_api.mjs} +0 -0
  44. package/esm2020/testing/src/extra_router_testing_providers.mjs +10 -0
  45. package/esm2020/testing/src/router_testing_module.mjs +122 -0
  46. package/esm2020/testing/src/spy_ng_module_factory_loader.mjs +10 -0
  47. package/esm2020/testing/src/testing.mjs +15 -0
  48. package/{esm2015/testing/testing.js → esm2020/testing/testing.mjs} +0 -0
  49. package/{esm2015/upgrade/index.js → esm2020/upgrade/index.mjs} +0 -0
  50. package/{esm2015/upgrade/public_api.js → esm2020/upgrade/public_api.mjs} +0 -0
  51. package/esm2020/upgrade/src/upgrade.mjs +120 -0
  52. package/{esm2015/upgrade/upgrade.js → esm2020/upgrade/upgrade.mjs} +0 -0
  53. package/fesm2015/{router.js → router.mjs} +626 -581
  54. package/fesm2015/router.mjs.map +1 -0
  55. package/fesm2015/testing.mjs +179 -0
  56. package/fesm2015/testing.mjs.map +1 -0
  57. package/fesm2015/{upgrade.js → upgrade.mjs} +4 -5
  58. package/fesm2015/upgrade.mjs.map +1 -0
  59. package/fesm2020/router.mjs +6163 -0
  60. package/fesm2020/router.mjs.map +1 -0
  61. package/fesm2020/testing.mjs +179 -0
  62. package/fesm2020/testing.mjs.map +1 -0
  63. package/fesm2020/upgrade.mjs +150 -0
  64. package/fesm2020/upgrade.mjs.map +1 -0
  65. package/package.json +34 -10
  66. package/router.d.ts +186 -143
  67. package/testing/package.json +5 -5
  68. package/testing/testing.d.ts +9 -66
  69. package/upgrade/package.json +5 -5
  70. package/upgrade/upgrade.d.ts +1 -1
  71. package/bundles/router-testing.umd.js +0 -541
  72. package/bundles/router-testing.umd.js.map +0 -1
  73. package/bundles/router-upgrade.umd.js +0 -157
  74. package/bundles/router-upgrade.umd.js.map +0 -1
  75. package/bundles/router.umd.js +0 -6840
  76. package/bundles/router.umd.js.map +0 -1
  77. package/esm2015/router.externs.js +0 -6
  78. package/esm2015/router.js +0 -9
  79. package/esm2015/src/components/empty_outlet.js +0 -24
  80. package/esm2015/src/config.js +0 -14
  81. package/esm2015/src/directives/router_link.js +0 -293
  82. package/esm2015/src/directives/router_link_active.js +0 -184
  83. package/esm2015/src/directives/router_outlet.js +0 -193
  84. package/esm2015/src/operators/apply_redirects.js +0 -14
  85. package/esm2015/src/operators/check_guards.js +0 -138
  86. package/esm2015/src/operators/recognize.js +0 -14
  87. package/esm2015/src/operators/resolve_data.js +0 -56
  88. package/esm2015/src/recognize.js +0 -262
  89. package/esm2015/src/router.js +0 -1046
  90. package/esm2015/src/router_config_loader.js +0 -76
  91. package/esm2015/src/router_module.js +0 -363
  92. package/esm2015/src/router_outlet_context.js +0 -73
  93. package/esm2015/src/router_preloader.js +0 -130
  94. package/esm2015/src/router_scroller.js +0 -95
  95. package/esm2015/src/router_state.js +0 -404
  96. package/esm2015/src/utils/config_matching.js +0 -145
  97. package/esm2015/testing/src/router_testing_module.js +0 -166
  98. package/esm2015/testing/src/testing.js +0 -14
  99. package/esm2015/testing/testing.externs.js +0 -6
  100. package/esm2015/upgrade/src/upgrade.js +0 -122
  101. package/esm2015/upgrade/upgrade.externs.js +0 -6
  102. package/fesm2015/router.js.map +0 -1
  103. package/fesm2015/testing.js +0 -204
  104. package/fesm2015/testing.js.map +0 -1
  105. package/fesm2015/upgrade.js.map +0 -1
  106. package/router.metadata.json +0 -1
  107. package/testing/testing.metadata.json +0 -1
  108. package/testing.d.ts +0 -7
  109. package/testing.metadata.json +0 -1
  110. package/upgrade/upgrade.metadata.json +0 -1
  111. package/upgrade.d.ts +0 -7
  112. package/upgrade.metadata.json +0 -1
package/router.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v13.0.0-next.0
2
+ * @license Angular v13.0.0-next.12
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -11,21 +11,17 @@ import { ComponentFactoryResolver } from '@angular/core';
11
11
  import { ComponentRef } from '@angular/core';
12
12
  import { ElementRef } from '@angular/core';
13
13
  import { EventEmitter } from '@angular/core';
14
- import { HashLocationStrategy } from '@angular/common';
14
+ import * as i0 from '@angular/core';
15
15
  import { InjectionToken } from '@angular/core';
16
16
  import { Injector } from '@angular/core';
17
17
  import { Location as Location_2 } from '@angular/common';
18
18
  import { LocationStrategy } from '@angular/common';
19
19
  import { ModuleWithProviders } from '@angular/core';
20
20
  import { NgModuleFactory } from '@angular/core';
21
- import { NgModuleFactoryLoader } from '@angular/core';
22
- import { NgProbeToken } from '@angular/core';
23
21
  import { Observable } from 'rxjs';
24
22
  import { OnChanges } from '@angular/core';
25
23
  import { OnDestroy } from '@angular/core';
26
24
  import { OnInit } from '@angular/core';
27
- import { PathLocationStrategy } from '@angular/common';
28
- import { PlatformLocation } from '@angular/common';
29
25
  import { Provider } from '@angular/core';
30
26
  import { QueryList } from '@angular/core';
31
27
  import { Renderer2 } from '@angular/core';
@@ -33,7 +29,6 @@ import { SimpleChanges } from '@angular/core';
33
29
  import { Type } from '@angular/core';
34
30
  import { Version } from '@angular/core';
35
31
  import { ViewContainerRef } from '@angular/core';
36
- import { ViewportScroller } from '@angular/common';
37
32
 
38
33
  /**
39
34
  * Provides access to information about a route associated with a component
@@ -538,7 +533,7 @@ export declare interface CanDeactivate<T> {
538
533
  * {
539
534
  * path: 'team/:id',
540
535
  * component: TeamComponent,
541
- * loadChildren: 'team.js',
536
+ * loadChildren: () => import('./team').then(mod => mod.TeamModule),
542
537
  * canLoad: [CanLoadTeamSection]
543
538
  * }
544
539
  * ])
@@ -557,7 +552,7 @@ export declare interface CanDeactivate<T> {
557
552
  * {
558
553
  * path: 'team/:id',
559
554
  * component: TeamComponent,
560
- * loadChildren: 'team.js',
555
+ * loadChildren: () => import('./team').then(mod => mod.TeamModule),
561
556
  * canLoad: ['canLoadTeamSection']
562
557
  * }
563
558
  * ])
@@ -682,18 +677,6 @@ export declare class DefaultUrlSerializer implements UrlSerializer {
682
677
  serialize(tree: UrlTree): string;
683
678
  }
684
679
 
685
- /**
686
- * A string of the form `path/to/file#exportName` that acts as a URL for a set of routes to load.
687
- *
688
- * @see `loadChildrenCallback`
689
- * @publicApi
690
- * @deprecated The `string` form of `loadChildren` is deprecated in favor of the
691
- * `LoadChildrenCallback` function which uses the ES dynamic `import()` expression.
692
- * This offers a more natural and standards-based mechanism to dynamically
693
- * load an ES module at runtime.
694
- */
695
- export declare type DeprecatedLoadChildren = string;
696
-
697
680
  /**
698
681
  * @description
699
682
  *
@@ -738,7 +721,7 @@ declare type ErrorHandler = (error: any) => any;
738
721
  * * [ResolveStart](api/router/ResolveStart): When the router begins the *resolve*
739
722
  * phase of routing.
740
723
  * * [ResolveEnd](api/router/ResolveEnd): When the router finishes the *resolve*
741
- * phase of routing successfuly.
724
+ * phase of routing successfully.
742
725
  * * [ChildActivationEnd](api/router/ChildActivationEnd): When the router finishes
743
726
  * activating a route's children.
744
727
  * * [ActivationEnd](api/router/ActivationEnd): When the router finishes activating a route.
@@ -977,6 +960,33 @@ export declare class GuardsCheckStart extends RouterEvent {
977
960
  toString(): string;
978
961
  }
979
962
 
963
+ declare namespace i1 {
964
+ export {
965
+ RouterOutletContract,
966
+ RouterOutlet
967
+ }
968
+ }
969
+
970
+ declare namespace i2 {
971
+ export {
972
+ RouterLink,
973
+ RouterLinkWithHref
974
+ }
975
+ }
976
+
977
+ declare namespace i3 {
978
+ export {
979
+ RouterLinkActive
980
+ }
981
+ }
982
+
983
+ declare namespace i4 {
984
+ export {
985
+ ɵEmptyOutletComponent,
986
+ ɵEmptyOutletComponent as EmptyOutletComponent
987
+ }
988
+ }
989
+
980
990
  /**
981
991
  * Allowed values in an `ExtraOptions` object that configure
982
992
  * when the router performs the initial navigation operation.
@@ -1055,13 +1065,10 @@ export declare interface IsActiveMatchOptions {
1055
1065
  *
1056
1066
  * A function that returns a set of routes to load.
1057
1067
  *
1058
- * The string form of `LoadChildren` is deprecated (see `DeprecatedLoadChildren`). The function
1059
- * form (`LoadChildrenCallback`) should be used instead.
1060
- *
1061
- * @see `loadChildrenCallback`
1068
+ * @see `LoadChildrenCallback`
1062
1069
  * @publicApi
1063
1070
  */
1064
- export declare type LoadChildren = LoadChildrenCallback | DeprecatedLoadChildren;
1071
+ export declare type LoadChildren = LoadChildrenCallback;
1065
1072
 
1066
1073
  /**
1067
1074
  *
@@ -2027,8 +2034,42 @@ export declare class Router {
2027
2034
  private rootContexts;
2028
2035
  private location;
2029
2036
  config: Routes;
2037
+ /**
2038
+ * Represents the activated `UrlTree` that the `Router` is configured to handle (through
2039
+ * `UrlHandlingStrategy`). That is, after we find the route config tree that we're going to
2040
+ * activate, run guards, and are just about to activate the route, we set the currentUrlTree.
2041
+ *
2042
+ * This should match the `browserUrlTree` when a navigation succeeds. If the
2043
+ * `UrlHandlingStrategy.shouldProcessUrl` is `false`, only the `browserUrlTree` is updated.
2044
+ */
2030
2045
  private currentUrlTree;
2046
+ /**
2047
+ * Meant to represent the entire browser url after a successful navigation. In the life of a
2048
+ * navigation transition:
2049
+ * 1. The rawUrl represents the full URL that's being navigated to
2050
+ * 2. We apply redirects, which might only apply to _part_ of the URL (due to
2051
+ * `UrlHandlingStrategy`).
2052
+ * 3. Right before activation (because we assume activation will succeed), we update the
2053
+ * rawUrlTree to be a combination of the urlAfterRedirects (again, this might only apply to part
2054
+ * of the initial url) and the rawUrl of the transition (which was the original navigation url in
2055
+ * its full form).
2056
+ */
2031
2057
  private rawUrlTree;
2058
+ /**
2059
+ * Meant to represent the part of the browser url that the `Router` is set up to handle (via the
2060
+ * `UrlHandlingStrategy`). This value is updated immediately after the browser url is updated (or
2061
+ * the browser url update is skipped via `skipLocationChange`). With that, note that
2062
+ * `browserUrlTree` _may not_ reflect the actual browser URL for two reasons:
2063
+ *
2064
+ * 1. `UrlHandlingStrategy` only handles part of the URL
2065
+ * 2. `skipLocationChange` does not update the browser url.
2066
+ *
2067
+ * So to reiterate, `browserUrlTree` only represents the Router's internal understanding of the
2068
+ * current route, either before guards with `urlUpdateStrategy === 'eager'` or right before
2069
+ * activation with `'deferred'`.
2070
+ *
2071
+ * This should match the `currentUrlTree` when the navigation succeeds.
2072
+ */
2032
2073
  private browserUrlTree;
2033
2074
  private readonly transitions;
2034
2075
  private navigations;
@@ -2036,11 +2077,6 @@ export declare class Router {
2036
2077
  private currentNavigation;
2037
2078
  private disposed;
2038
2079
  private locationSubscription?;
2039
- /**
2040
- * Tracks the previously seen location change from the location subscription so we can compare
2041
- * the two latest to see if they are duplicates. See setUpLocationChangeListener.
2042
- */
2043
- private lastLocationChangeInfo;
2044
2080
  private navigationId;
2045
2081
  /**
2046
2082
  * The id of the currently active page in the router.
@@ -2132,12 +2168,34 @@ export declare class Router {
2132
2168
  * @see `RouterModule`
2133
2169
  */
2134
2170
  relativeLinkResolution: 'legacy' | 'corrected';
2171
+ /**
2172
+ * Configures how the Router attempts to restore state when a navigation is cancelled.
2173
+ *
2174
+ * 'replace' - Always uses `location.replaceState` to set the browser state to the state of the
2175
+ * router before the navigation started. This means that if the URL of the browser is updated
2176
+ * _before_ the navigation is canceled, the Router will simply replace the item in history rather
2177
+ * than trying to restore to the previous location in the session history. This happens most
2178
+ * frequently with `urlUpdateStrategy: 'eager'` and navigations with the browser back/forward
2179
+ * buttons.
2180
+ *
2181
+ * 'computed' - Will attempt to return to the same index in the session history that corresponds
2182
+ * to the Angular route when the navigation gets cancelled. For example, if the browser back
2183
+ * button is clicked and the navigation is cancelled, the Router will trigger a forward navigation
2184
+ * and vice versa.
2185
+ *
2186
+ * Note: the 'computed' option is incompatible with any `UrlHandlingStrategy` which only
2187
+ * handles a portion of the URL because the history restoration navigates to the previous place in
2188
+ * the browser history rather than simply resetting a portion of the URL.
2189
+ *
2190
+ * The default value is `replace`.
2191
+ *
2192
+ */
2193
+ canceledNavigationResolution: 'replace' | 'computed';
2135
2194
  /**
2136
2195
  * Creates the router service.
2137
2196
  */
2138
- constructor(rootComponentType: Type<any> | null, urlSerializer: UrlSerializer, rootContexts: ChildrenOutletContexts, location: Location_2, injector: Injector, loader: NgModuleFactoryLoader, compiler: Compiler, config: Routes);
2197
+ constructor(rootComponentType: Type<any> | null, urlSerializer: UrlSerializer, rootContexts: ChildrenOutletContexts, location: Location_2, injector: Injector, compiler: Compiler, config: Routes);
2139
2198
  private setupNavigations;
2140
- private getTransition;
2141
2199
  private setTransition;
2142
2200
  /**
2143
2201
  * Sets up the location change listener and performs the initial navigation.
@@ -2149,15 +2207,6 @@ export declare class Router {
2149
2207
  * navigation so that the correct events, guards, etc. are triggered.
2150
2208
  */
2151
2209
  setUpLocationChangeListener(): void;
2152
- /** Extracts router-related information from a `PopStateEvent`. */
2153
- private extractLocationChangeInfoFromEvent;
2154
- /**
2155
- * Determines whether two events triggered by the Location subscription are due to the same
2156
- * navigation. The location subscription can fire two events (popstate and hashchange) for a
2157
- * single navigation. The second one should be ignored, that is, we should not schedule another
2158
- * navigation in the Router.
2159
- */
2160
- private shouldScheduleNavigation;
2161
2210
  /** The current URL. */
2162
2211
  get url(): string;
2163
2212
  /**
@@ -2299,9 +2348,9 @@ export declare class Router {
2299
2348
  * Returns whether the url is activated.
2300
2349
  *
2301
2350
  * @deprecated
2302
- * Use `IsActiveUrlTreeOptions` instead.
2351
+ * Use `IsActiveMatchOptions` instead.
2303
2352
  *
2304
- * - The equivalent `IsActiveUrlTreeOptions` for `true` is
2353
+ * - The equivalent `IsActiveMatchOptions` for `true` is
2305
2354
  * `{paths: 'exact', queryParams: 'exact', fragment: 'ignored', matrixParams: 'ignored'}`.
2306
2355
  * - The equivalent for `false` is
2307
2356
  * `{paths: 'subset', queryParams: 'subset', fragment: 'ignored', matrixParams: 'ignored'}`.
@@ -2324,6 +2373,8 @@ export declare class Router {
2324
2373
  private resetUrlToCurrentUrlTree;
2325
2374
  private cancelNavigationTransition;
2326
2375
  private generateNgRouterState;
2376
+ static ɵfac: i0.ɵɵFactoryDeclaration<Router, never>;
2377
+ static ɵprov: i0.ɵɵInjectableDeclaration<Router>;
2327
2378
  }
2328
2379
 
2329
2380
  /**
@@ -2501,6 +2552,9 @@ export declare class RouterEvent {
2501
2552
  export declare class RouterLink implements OnChanges {
2502
2553
  private router;
2503
2554
  private route;
2555
+ private readonly tabIndexAttribute;
2556
+ private readonly renderer;
2557
+ private readonly el;
2504
2558
  /**
2505
2559
  * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the
2506
2560
  * `UrlCreationOptions`.
@@ -2563,21 +2617,27 @@ export declare class RouterLink implements OnChanges {
2563
2617
  */
2564
2618
  relativeTo?: ActivatedRoute | null;
2565
2619
  private commands;
2566
- private preserve;
2567
- constructor(router: Router, route: ActivatedRoute, tabIndex: string, renderer: Renderer2, el: ElementRef);
2620
+ constructor(router: Router, route: ActivatedRoute, tabIndexAttribute: string | null | undefined, renderer: Renderer2, el: ElementRef);
2621
+ /**
2622
+ * Modifies the tab index if there was not a tabindex attribute on the element during
2623
+ * instantiation.
2624
+ */
2625
+ private setTabIndexIfNotOnNativeEl;
2568
2626
  /** @nodoc */
2569
2627
  ngOnChanges(changes: SimpleChanges): void;
2570
2628
  /**
2571
2629
  * Commands to pass to {@link Router#createUrlTree Router#createUrlTree}.
2572
2630
  * - **array**: commands to pass to {@link Router#createUrlTree Router#createUrlTree}.
2573
2631
  * - **string**: shorthand for array of commands with just the string, i.e. `['/route']`
2574
- * - **null|undefined**: shorthand for an empty array of commands, i.e. `[]`
2632
+ * - **null|undefined**: effectively disables the `routerLink`
2575
2633
  * @see {@link Router#createUrlTree Router#createUrlTree}
2576
2634
  */
2577
2635
  set routerLink(commands: any[] | string | null | undefined);
2578
2636
  /** @nodoc */
2579
2637
  onClick(): boolean;
2580
- get urlTree(): UrlTree;
2638
+ get urlTree(): UrlTree | null;
2639
+ static ɵfac: i0.ɵɵFactoryDeclaration<RouterLink, [null, null, { attribute: "tabindex"; }, null, null]>;
2640
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RouterLink, ":not(a):not(area)[routerLink]", never, { "queryParams": "queryParams"; "fragment": "fragment"; "queryParamsHandling": "queryParamsHandling"; "preserveFragment": "preserveFragment"; "skipLocationChange": "skipLocationChange"; "replaceUrl": "replaceUrl"; "state": "state"; "relativeTo": "relativeTo"; "routerLink": "routerLink"; }, {}, never>;
2581
2641
  }
2582
2642
 
2583
2643
  /**
@@ -2662,6 +2722,23 @@ export declare class RouterLinkActive implements OnChanges, OnDestroy, AfterCont
2662
2722
  routerLinkActiveOptions: {
2663
2723
  exact: boolean;
2664
2724
  } | IsActiveMatchOptions;
2725
+ /**
2726
+ *
2727
+ * You can use the output `isActiveChange` to get notified each time the link becomes
2728
+ * active or inactive.
2729
+ *
2730
+ * Emits:
2731
+ * true -> Route is active
2732
+ * false -> Route is inactive
2733
+ *
2734
+ * ```
2735
+ * <a
2736
+ * routerLink="/user/bob"
2737
+ * routerLinkActive="active-link"
2738
+ * (isActiveChange)="this.onRouterLinkActive($event)">Bob</a>
2739
+ * ```
2740
+ */
2741
+ readonly isActiveChange: EventEmitter<boolean>;
2665
2742
  constructor(router: Router, element: ElementRef, renderer: Renderer2, cdr: ChangeDetectorRef, link?: RouterLink | undefined, linkWithHref?: RouterLinkWithHref | undefined);
2666
2743
  /** @nodoc */
2667
2744
  ngAfterContentInit(): void;
@@ -2674,6 +2751,8 @@ export declare class RouterLinkActive implements OnChanges, OnDestroy, AfterCont
2674
2751
  private update;
2675
2752
  private isLinkActive;
2676
2753
  private hasActiveLinks;
2754
+ static ɵfac: i0.ɵɵFactoryDeclaration<RouterLinkActive, [null, null, null, null, { optional: true; }, { optional: true; }]>;
2755
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RouterLinkActive, "[routerLinkActive]", ["routerLinkActive"], { "routerLinkActiveOptions": "routerLinkActiveOptions"; "routerLinkActive": "routerLinkActive"; }, { "isActiveChange": "isActiveChange"; }, ["links", "linksWithHrefs"]>;
2677
2756
  }
2678
2757
 
2679
2758
  /**
@@ -2755,14 +2834,13 @@ export declare class RouterLinkWithHref implements OnChanges, OnDestroy {
2755
2834
  relativeTo?: ActivatedRoute | null;
2756
2835
  private commands;
2757
2836
  private subscription;
2758
- private preserve;
2759
- href: string;
2837
+ href: string | null;
2760
2838
  constructor(router: Router, route: ActivatedRoute, locationStrategy: LocationStrategy);
2761
2839
  /**
2762
2840
  * Commands to pass to {@link Router#createUrlTree Router#createUrlTree}.
2763
2841
  * - **array**: commands to pass to {@link Router#createUrlTree Router#createUrlTree}.
2764
2842
  * - **string**: shorthand for array of commands with just the string, i.e. `['/route']`
2765
- * - **null|undefined**: shorthand for an empty array of commands, i.e. `[]`
2843
+ * - **null|undefined**: Disables the link by removing the `href`
2766
2844
  * @see {@link Router#createUrlTree Router#createUrlTree}
2767
2845
  */
2768
2846
  set routerLink(commands: any[] | string | null | undefined);
@@ -2773,7 +2851,9 @@ export declare class RouterLinkWithHref implements OnChanges, OnDestroy {
2773
2851
  /** @nodoc */
2774
2852
  onClick(button: number, ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean): boolean;
2775
2853
  private updateTargetUrlAndHref;
2776
- get urlTree(): UrlTree;
2854
+ get urlTree(): UrlTree | null;
2855
+ static ɵfac: i0.ɵɵFactoryDeclaration<RouterLinkWithHref, never>;
2856
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RouterLinkWithHref, "a[routerLink],area[routerLink]", never, { "target": "target"; "queryParams": "queryParams"; "fragment": "fragment"; "queryParamsHandling": "queryParamsHandling"; "preserveFragment": "preserveFragment"; "skipLocationChange": "skipLocationChange"; "replaceUrl": "replaceUrl"; "state": "state"; "relativeTo": "relativeTo"; "routerLink": "routerLink"; }, {}, never>;
2777
2857
  }
2778
2858
 
2779
2859
  /**
@@ -2835,6 +2915,9 @@ export declare class RouterModule {
2835
2915
  *
2836
2916
  */
2837
2917
  static forChild(routes: Routes): ModuleWithProviders<RouterModule>;
2918
+ static ɵfac: i0.ɵɵFactoryDeclaration<RouterModule, [{ optional: true; }, { optional: true; }]>;
2919
+ static ɵmod: i0.ɵɵNgModuleDeclaration<RouterModule, [typeof i1.RouterOutlet, typeof i2.RouterLink, typeof i2.RouterLinkWithHref, typeof i3.RouterLinkActive, typeof i4.ɵEmptyOutletComponent], never, [typeof i1.RouterOutlet, typeof i2.RouterLink, typeof i2.RouterLinkWithHref, typeof i3.RouterLinkActive, typeof i4.ɵEmptyOutletComponent]>;
2920
+ static ɵinj: i0.ɵɵInjectorDeclaration<RouterModule>;
2838
2921
  }
2839
2922
 
2840
2923
  /**
@@ -2867,12 +2950,17 @@ export declare class RouterModule {
2867
2950
  * `http://base-path/primary-route-path(outlet-name:route-path)`
2868
2951
  *
2869
2952
  * A router outlet emits an activate event when a new component is instantiated,
2870
- * and a deactivate event when a component is destroyed.
2953
+ * deactivate event when a component is destroyed.
2954
+ * An attached event emits when the `RouteReuseStrategy` instructs the outlet to reattach the
2955
+ * subtree, and the detached event emits when the `RouteReuseStrategy` instructs the outlet to
2956
+ * detach the subtree.
2871
2957
  *
2872
2958
  * ```
2873
2959
  * <router-outlet
2874
2960
  * (activate)='onActivate($event)'
2875
- * (deactivate)='onDeactivate($event)'></router-outlet>
2961
+ * (deactivate)='onDeactivate($event)'
2962
+ * (attach)='onAttach($event)'
2963
+ * (detach)='onDetach($event)'></router-outlet>
2876
2964
  * ```
2877
2965
  *
2878
2966
  * @see [Routing tutorial](guide/router-tutorial-toh#named-outlets "Example of a named
@@ -2893,6 +2981,16 @@ export declare class RouterOutlet implements OnDestroy, OnInit, RouterOutletCont
2893
2981
  private name;
2894
2982
  activateEvents: EventEmitter<any>;
2895
2983
  deactivateEvents: EventEmitter<any>;
2984
+ /**
2985
+ * Emits an attached component instance when the `RouteReuseStrategy` instructs to re-attach a
2986
+ * previously detached subtree.
2987
+ **/
2988
+ attachEvents: EventEmitter<unknown>;
2989
+ /**
2990
+ * Emits a detached component instance when the `RouteReuseStrategy` instructs to detach the
2991
+ * subtree.
2992
+ */
2993
+ detachEvents: EventEmitter<unknown>;
2896
2994
  constructor(parentContexts: ChildrenOutletContexts, location: ViewContainerRef, resolver: ComponentFactoryResolver, name: string, changeDetector: ChangeDetectorRef);
2897
2995
  /** @nodoc */
2898
2996
  ngOnDestroy(): void;
@@ -2916,6 +3014,8 @@ export declare class RouterOutlet implements OnDestroy, OnInit, RouterOutletCont
2916
3014
  attach(ref: ComponentRef<any>, activatedRoute: ActivatedRoute): void;
2917
3015
  deactivate(): void;
2918
3016
  activateWith(activatedRoute: ActivatedRoute, resolver: ComponentFactoryResolver | null): void;
3017
+ static ɵfac: i0.ɵɵFactoryDeclaration<RouterOutlet, [null, null, null, { attribute: "name"; }, null]>;
3018
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RouterOutlet, "router-outlet", ["outlet"], {}, { "activateEvents": "activate"; "deactivateEvents": "deactivate"; "attachEvents": "attach"; "detachEvents": "detach"; }, never>;
2919
3019
  }
2920
3020
 
2921
3021
  /**
@@ -2978,6 +3078,16 @@ export declare interface RouterOutletContract {
2978
3078
  * Emits a deactivate event when a component is destroyed.
2979
3079
  */
2980
3080
  deactivateEvents?: EventEmitter<unknown>;
3081
+ /**
3082
+ * Emits an attached component instance when the `RouteReuseStrategy` instructs to re-attach a
3083
+ * previously detached subtree.
3084
+ **/
3085
+ attachEvents?: EventEmitter<unknown>;
3086
+ /**
3087
+ * Emits a detached component instance when the `RouteReuseStrategy` instructs to detach the
3088
+ * subtree.
3089
+ */
3090
+ detachEvents?: EventEmitter<unknown>;
2981
3091
  }
2982
3092
 
2983
3093
  /**
@@ -2998,13 +3108,15 @@ export declare class RouterPreloader implements OnDestroy {
2998
3108
  private preloadingStrategy;
2999
3109
  private loader;
3000
3110
  private subscription?;
3001
- constructor(router: Router, moduleLoader: NgModuleFactoryLoader, compiler: Compiler, injector: Injector, preloadingStrategy: PreloadingStrategy);
3111
+ constructor(router: Router, compiler: Compiler, injector: Injector, preloadingStrategy: PreloadingStrategy);
3002
3112
  setUpPreloading(): void;
3003
3113
  preload(): Observable<any>;
3004
3114
  /** @nodoc */
3005
3115
  ngOnDestroy(): void;
3006
3116
  private processRoutes;
3007
3117
  private preloadConfig;
3118
+ static ɵfac: i0.ɵɵFactoryDeclaration<RouterPreloader, never>;
3119
+ static ɵprov: i0.ɵɵInjectableDeclaration<RouterPreloader>;
3008
3120
  }
3009
3121
 
3010
3122
  /**
@@ -3038,7 +3150,7 @@ export declare class RouterPreloader implements OnDestroy {
3038
3150
  *
3039
3151
  * @publicApi
3040
3152
  */
3041
- export declare class RouterState extends ɵangular_packages_router_router_m<ActivatedRoute> {
3153
+ export declare class RouterState extends Tree<ActivatedRoute> {
3042
3154
  /** The current snapshot of the router state */
3043
3155
  snapshot: RouterStateSnapshot;
3044
3156
  toString(): string;
@@ -3071,7 +3183,7 @@ export declare class RouterState extends ɵangular_packages_router_router_m<Acti
3071
3183
  *
3072
3184
  * @publicApi
3073
3185
  */
3074
- export declare class RouterStateSnapshot extends ɵangular_packages_router_router_m<ActivatedRouteSnapshot> {
3186
+ export declare class RouterStateSnapshot extends Tree<ActivatedRouteSnapshot> {
3075
3187
  /** The url from which this snapshot was created */
3076
3188
  url: string;
3077
3189
  toString(): string;
@@ -3155,6 +3267,19 @@ export declare class Scroll {
3155
3267
  toString(): string;
3156
3268
  }
3157
3269
 
3270
+
3271
+ declare class Tree<T> {
3272
+ constructor(root: TreeNode<T>);
3273
+ get root(): T;
3274
+ }
3275
+
3276
+ declare class TreeNode<T> {
3277
+ value: T;
3278
+ children: TreeNode<T>[];
3279
+ constructor(value: T, children: TreeNode<T>[]);
3280
+ toString(): string;
3281
+ }
3282
+
3158
3283
  /**
3159
3284
  * @description
3160
3285
  *
@@ -3471,90 +3596,8 @@ export declare class UrlTree {
3471
3596
  */
3472
3597
  export declare const VERSION: Version;
3473
3598
 
3474
- /**
3475
- * @docsNotRequired
3476
- */
3477
- export declare const ɵangular_packages_router_router_a: InjectionToken<void>;
3478
-
3479
- export declare function ɵangular_packages_router_router_b(): NgProbeToken;
3480
-
3481
- export declare function ɵangular_packages_router_router_c(router: Router, viewportScroller: ViewportScroller, config: ExtraOptions): ɵangular_packages_router_router_o;
3482
-
3483
- export declare function ɵangular_packages_router_router_d(platformLocationStrategy: PlatformLocation, baseHref: string, options?: ExtraOptions): HashLocationStrategy | PathLocationStrategy;
3484
-
3485
- export declare function ɵangular_packages_router_router_e(router: Router): any;
3486
-
3487
- export declare function ɵangular_packages_router_router_f(urlSerializer: UrlSerializer, contexts: ChildrenOutletContexts, location: Location_2, injector: Injector, loader: NgModuleFactoryLoader, compiler: Compiler, config: Route[][], opts?: ExtraOptions, urlHandlingStrategy?: UrlHandlingStrategy, routeReuseStrategy?: RouteReuseStrategy): Router;
3488
-
3489
- export declare function ɵangular_packages_router_router_g(router: Router): ActivatedRoute;
3490
-
3491
- /**
3492
- * Router initialization requires two steps:
3493
- *
3494
- * First, we start the navigation in a `APP_INITIALIZER` to block the bootstrap if
3495
- * a resolver or a guard executes asynchronously.
3496
- *
3497
- * Next, we actually run activation in a `BOOTSTRAP_LISTENER`, using the
3498
- * `afterPreactivation` hook provided by the router.
3499
- * The router navigation starts, reaches the point when preactivation is done, and then
3500
- * pauses. It waits for the hook to be resolved. We then resolve it only in a bootstrap listener.
3501
- */
3502
- export declare class ɵangular_packages_router_router_h implements OnDestroy {
3503
- private injector;
3504
- private initNavigation;
3505
- private destroyed;
3506
- private resultOfPreactivationDone;
3507
- constructor(injector: Injector);
3508
- appInitializer(): Promise<any>;
3509
- bootstrapListener(bootstrappedComponentRef: ComponentRef<any>): void;
3510
- ngOnDestroy(): void;
3511
- }
3512
-
3513
- export declare function ɵangular_packages_router_router_i(r: ɵangular_packages_router_router_h): () => Promise<any>;
3514
-
3515
- export declare function ɵangular_packages_router_router_j(r: ɵangular_packages_router_router_h): (bootstrappedComponentRef: ComponentRef<any>) => void;
3516
-
3517
- export declare function ɵangular_packages_router_router_k(): ReadonlyArray<Provider>;
3518
-
3519
-
3520
- export declare class ɵangular_packages_router_router_m<T> {
3521
- constructor(root: ɵangular_packages_router_router_n<T>);
3522
- get root(): T;
3523
- }
3524
-
3525
- export declare class ɵangular_packages_router_router_n<T> {
3526
- value: T;
3527
- children: ɵangular_packages_router_router_n<T>[];
3528
- constructor(value: T, children: ɵangular_packages_router_router_n<T>[]);
3529
- toString(): string;
3530
- }
3531
-
3532
- export declare class ɵangular_packages_router_router_o implements OnDestroy {
3533
- private router;
3534
- /** @docsNotRequired */ readonly viewportScroller: ViewportScroller;
3535
- private options;
3536
- private routerEventsSubscription;
3537
- private scrollEventsSubscription;
3538
- private lastId;
3539
- private lastSource;
3540
- private restoredId;
3541
- private store;
3542
- constructor(router: Router,
3543
- /** @docsNotRequired */ viewportScroller: ViewportScroller, options?: {
3544
- scrollPositionRestoration?: 'disabled' | 'enabled' | 'top';
3545
- anchorScrolling?: 'disabled' | 'enabled';
3546
- });
3547
- init(): void;
3548
- private createScrollEvents;
3549
- private consumeScrollEvents;
3550
- private scheduleScrollEvent;
3551
- /** @nodoc */
3552
- ngOnDestroy(): void;
3553
- }
3554
-
3555
3599
  export declare function ɵassignExtraOptionsToRouter(opts: ExtraOptions, router: Router): void;
3556
3600
 
3557
-
3558
3601
  /**
3559
3602
  * This component is used internally within the router to be a placeholder when an empty
3560
3603
  * router-outlet is needed. For example, with a config such as:
@@ -3564,10 +3607,10 @@ export declare function ɵassignExtraOptionsToRouter(opts: ExtraOptions, router:
3564
3607
  * In order to render, there needs to be a component on this config, which will default
3565
3608
  * to this `EmptyOutletComponent`.
3566
3609
  */
3567
- declare class ɵEmptyOutletComponent {
3610
+ export declare class ɵEmptyOutletComponent {
3611
+ static ɵfac: i0.ɵɵFactoryDeclaration<ɵEmptyOutletComponent, never>;
3612
+ static ɵcmp: i0.ɵɵComponentDeclaration<ɵEmptyOutletComponent, "ng-component", never, {}, {}, never, never>;
3568
3613
  }
3569
- export { ɵEmptyOutletComponent }
3570
- export { ɵEmptyOutletComponent as ɵangular_packages_router_router_l }
3571
3614
 
3572
3615
  /**
3573
3616
  * Flattens single-level nested arrays.
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@angular/router/testing",
3
- "main": "../bundles/router-testing.umd.js",
4
- "fesm2015": "../fesm2015/testing.js",
5
- "esm2015": "../esm2015/testing/testing.js",
3
+ "fesm2020": "../fesm2020/testing.mjs",
4
+ "fesm2015": "../fesm2015/testing.mjs",
5
+ "esm2020": "../esm2020/testing/testing.mjs",
6
6
  "typings": "./testing.d.ts",
7
- "module": "../fesm2015/testing.js",
8
- "es2015": "../fesm2015/testing.js"
7
+ "module": "../fesm2015/testing.mjs",
8
+ "es2020": "../fesm2020/testing.mjs"
9
9
  }