@angular/router 15.0.0-next.3 → 15.0.0-next.5

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.0.0-next.3
2
+ * @license Angular v15.0.0-next.5
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -101,9 +101,9 @@ class RouterTestingModule {
101
101
  };
102
102
  }
103
103
  }
104
- RouterTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.3", ngImport: i0, type: RouterTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
105
- RouterTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-next.3", ngImport: i0, type: RouterTestingModule, exports: [RouterModule] });
106
- RouterTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-next.3", ngImport: i0, type: RouterTestingModule, providers: [
104
+ RouterTestingModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.0-next.5", ngImport: i0, type: RouterTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
105
+ RouterTestingModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.0-next.5", ngImport: i0, type: RouterTestingModule, exports: [RouterModule] });
106
+ RouterTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.0-next.5", ngImport: i0, type: RouterTestingModule, providers: [
107
107
  ɵROUTER_PROVIDERS,
108
108
  EXTRA_ROUTER_TESTING_PROVIDERS,
109
109
  { provide: Location, useClass: SpyLocation },
@@ -127,7 +127,7 @@ RouterTestingModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ver
127
127
  ɵwithPreloading(NoPreloading).ɵproviders,
128
128
  provideRoutes([]),
129
129
  ], imports: [RouterModule] });
130
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.3", ngImport: i0, type: RouterTestingModule, decorators: [{
130
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.0-next.5", ngImport: i0, type: RouterTestingModule, decorators: [{
131
131
  type: NgModule,
132
132
  args: [{
133
133
  exports: [RouterModule],
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.0.0-next.3
2
+ * @license Angular v15.0.0-next.5
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.0.0-next.3
2
+ * @license Angular v15.0.0-next.5
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -32,7 +32,6 @@ import { SimpleChanges } from '@angular/core';
32
32
  import { Title } from '@angular/platform-browser';
33
33
  import { Type } from '@angular/core';
34
34
  import { Version } from '@angular/core';
35
- import { ViewContainerRef } from '@angular/core';
36
35
 
37
36
  /**
38
37
  * Provides access to information about a route associated with a component
@@ -157,7 +156,7 @@ export declare class ActivatedRouteSnapshot {
157
156
  /** The configuration used to match this route **/
158
157
  readonly routeConfig: Route | null;
159
158
  /** The resolved route title */
160
- readonly title?: string;
159
+ get title(): string | undefined;
161
160
  /** The root of the router state */
162
161
  get root(): ActivatedRouteSnapshot;
163
162
  /** The parent of this route in the router state tree */
@@ -838,6 +837,22 @@ export declare type Data = {
838
837
  */
839
838
  export declare type DebugTracingFeature = RouterFeature<RouterFeatureKind.DebugTracingFeature>;
840
839
 
840
+ /**
841
+ * An ES Module object with a default export of the given type.
842
+ *
843
+ * @see `Route#loadComponent`
844
+ * @see `LoadChildrenCallback`
845
+ *
846
+ * @publicApi
847
+ */
848
+ export declare interface DefaultExport<T> {
849
+ /**
850
+ * Default exports are bound under the name `"default"`, per the ES Module spec:
851
+ * https://tc39.es/ecma262/#table-export-forms-mapping-to-exportentry-records
852
+ */
853
+ default: T;
854
+ }
855
+
841
856
  /**
842
857
  * The default `TitleStrategy` used by the router that updates the title using the `Title` service.
843
858
  */
@@ -1338,7 +1353,7 @@ export declare interface IsActiveMatchOptions {
1338
1353
  * @see `LoadChildrenCallback`
1339
1354
  * @publicApi
1340
1355
  */
1341
- export declare type LoadChildren = LoadChildrenCallback;
1356
+ export declare type LoadChildren = LoadChildrenCallback | ɵDeprecatedLoadChildren;
1342
1357
 
1343
1358
  /**
1344
1359
  *
@@ -1364,10 +1379,17 @@ export declare type LoadChildren = LoadChildrenCallback;
1364
1379
  * }];
1365
1380
  * ```
1366
1381
  *
1382
+ * If the lazy-loaded routes are exported via a `default` export, the `.then` can be omitted:
1383
+ * ```
1384
+ * [{
1385
+ * path: 'lazy',
1386
+ * loadChildren: () => import('./lazy-route/lazy.routes'),
1387
+ * }];
1388
+ *
1367
1389
  * @see [Route.loadChildren](api/router/Route#loadChildren)
1368
1390
  * @publicApi
1369
1391
  */
1370
- export declare type LoadChildrenCallback = () => Type<any> | NgModuleFactory<any> | Routes | Observable<Type<any> | Routes> | Promise<NgModuleFactory<any> | Type<any> | Routes>;
1392
+ export declare type LoadChildrenCallback = () => Type<any> | NgModuleFactory<any> | Routes | Observable<Type<any> | Routes | DefaultExport<Type<any>> | DefaultExport<Routes>> | Promise<NgModuleFactory<any> | Type<any> | Routes | DefaultExport<Type<any>> | DefaultExport<Routes>>;
1371
1393
 
1372
1394
  declare interface LoadedRouterConfig {
1373
1395
  routes: Route[];
@@ -2367,7 +2389,7 @@ export declare interface Route {
2367
2389
  /**
2368
2390
  * An object specifying a lazy-loaded component.
2369
2391
  */
2370
- loadComponent?: () => Type<unknown> | Observable<Type<unknown>> | Promise<Type<unknown>>;
2392
+ loadComponent?: () => Type<unknown> | Observable<Type<unknown> | DefaultExport<Type<unknown>>> | Promise<Type<unknown> | DefaultExport<Type<unknown>>>;
2371
2393
  /**
2372
2394
  * A URL to redirect to when the path matches.
2373
2395
  *
@@ -3163,15 +3185,26 @@ export declare type RouterFeatures = PreloadingFeature | DebugTracingFeature | I
3163
3185
  *
3164
3186
  * @publicApi
3165
3187
  */
3166
- export declare class RouterLink implements OnChanges {
3188
+ export declare class RouterLink implements OnChanges, OnDestroy {
3167
3189
  private router;
3168
3190
  private route;
3169
3191
  private readonly tabIndexAttribute;
3170
3192
  private readonly renderer;
3171
3193
  private readonly el;
3194
+ private locationStrategy?;
3172
3195
  private _preserveFragment;
3173
3196
  private _skipLocationChange;
3174
3197
  private _replaceUrl;
3198
+ /**
3199
+ * Represents an `href` attribute value applied to a host element,
3200
+ * when a host element is `<a>`. For other tags, the value is `null`.
3201
+ */
3202
+ href: string | null;
3203
+ /**
3204
+ * Represents the `target` attribute on a host element.
3205
+ * This is only used when the host element is an `<a>` tag.
3206
+ */
3207
+ target?: string;
3175
3208
  /**
3176
3209
  * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the
3177
3210
  * `UrlCreationOptions`.
@@ -3213,7 +3246,10 @@ export declare class RouterLink implements OnChanges {
3213
3246
  */
3214
3247
  relativeTo?: ActivatedRoute | null;
3215
3248
  private commands;
3216
- constructor(router: Router, route: ActivatedRoute, tabIndexAttribute: string | null | undefined, renderer: Renderer2, el: ElementRef);
3249
+ /** Whether a host element is an `<a>` tag. */
3250
+ private isAnchorElement;
3251
+ private subscription?;
3252
+ constructor(router: Router, route: ActivatedRoute, tabIndexAttribute: string | null | undefined, renderer: Renderer2, el: ElementRef, locationStrategy?: LocationStrategy | undefined);
3217
3253
  /**
3218
3254
  * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the
3219
3255
  * `UrlCreationOptions`.
@@ -3254,10 +3290,14 @@ export declare class RouterLink implements OnChanges {
3254
3290
  */
3255
3291
  set routerLink(commands: any[] | string | null | undefined);
3256
3292
  /** @nodoc */
3257
- onClick(): boolean;
3293
+ onClick(button: number, ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean): boolean;
3294
+ /** @nodoc */
3295
+ ngOnDestroy(): any;
3296
+ private updateHref;
3297
+ private applyAttributeValue;
3258
3298
  get urlTree(): UrlTree | null;
3259
- static ɵfac: i0.ɵɵFactoryDeclaration<RouterLink, [null, null, { attribute: "tabindex"; }, null, null]>;
3260
- static ɵdir: i0.ɵɵDirectiveDeclaration<RouterLink, ":not(a):not(area)[routerLink]", never, { "queryParams": "queryParams"; "fragment": "fragment"; "queryParamsHandling": "queryParamsHandling"; "state": "state"; "relativeTo": "relativeTo"; "preserveFragment": "preserveFragment"; "skipLocationChange": "skipLocationChange"; "replaceUrl": "replaceUrl"; "routerLink": "routerLink"; }, {}, never, never, true, never>;
3299
+ static ɵfac: i0.ɵɵFactoryDeclaration<RouterLink, [null, null, { attribute: "tabindex"; }, null, null, null]>;
3300
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RouterLink, ":not(a):not(area)[routerLink]", never, { "target": "target"; "queryParams": "queryParams"; "fragment": "fragment"; "queryParamsHandling": "queryParamsHandling"; "state": "state"; "relativeTo": "relativeTo"; "preserveFragment": "preserveFragment"; "skipLocationChange": "skipLocationChange"; "replaceUrl": "replaceUrl"; "routerLink": "routerLink"; }, {}, never, never, true, never>;
3261
3301
  }
3262
3302
 
3263
3303
  /**
@@ -3404,100 +3444,9 @@ export declare class RouterLinkActive implements OnChanges, OnDestroy, AfterCont
3404
3444
  *
3405
3445
  * @publicApi
3406
3446
  */
3407
- export declare class RouterLinkWithHref implements OnChanges, OnDestroy {
3408
- private router;
3409
- private route;
3410
- private locationStrategy;
3411
- private _preserveFragment;
3412
- private _skipLocationChange;
3413
- private _replaceUrl;
3414
- target: string;
3415
- /**
3416
- * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the
3417
- * `UrlCreationOptions`.
3418
- * @see {@link UrlCreationOptions#queryParams UrlCreationOptions#queryParams}
3419
- * @see {@link Router#createUrlTree Router#createUrlTree}
3420
- */
3421
- queryParams?: Params | null;
3422
- /**
3423
- * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the
3424
- * `UrlCreationOptions`.
3425
- * @see {@link UrlCreationOptions#fragment UrlCreationOptions#fragment}
3426
- * @see {@link Router#createUrlTree Router#createUrlTree}
3427
- */
3428
- fragment?: string;
3429
- /**
3430
- * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the
3431
- * `UrlCreationOptions`.
3432
- * @see {@link UrlCreationOptions#queryParamsHandling UrlCreationOptions#queryParamsHandling}
3433
- * @see {@link Router#createUrlTree Router#createUrlTree}
3434
- */
3435
- queryParamsHandling?: QueryParamsHandling | null;
3436
- /**
3437
- * Passed to {@link Router#navigateByUrl Router#navigateByUrl} as part of the
3438
- * `NavigationBehaviorOptions`.
3439
- * @see {@link NavigationBehaviorOptions#state NavigationBehaviorOptions#state}
3440
- * @see {@link Router#navigateByUrl Router#navigateByUrl}
3441
- */
3442
- state?: {
3443
- [k: string]: any;
3444
- };
3445
- /**
3446
- * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the
3447
- * `UrlCreationOptions`.
3448
- * Specify a value here when you do not want to use the default value
3449
- * for `routerLink`, which is the current activated route.
3450
- * Note that a value of `undefined` here will use the `routerLink` default.
3451
- * @see {@link UrlCreationOptions#relativeTo UrlCreationOptions#relativeTo}
3452
- * @see {@link Router#createUrlTree Router#createUrlTree}
3453
- */
3454
- relativeTo?: ActivatedRoute | null;
3455
- private commands;
3456
- private subscription;
3457
- href: string | null;
3458
- constructor(router: Router, route: ActivatedRoute, locationStrategy: LocationStrategy);
3459
- /**
3460
- * Passed to {@link Router#createUrlTree Router#createUrlTree} as part of the
3461
- * `UrlCreationOptions`.
3462
- * @see {@link UrlCreationOptions#preserveFragment UrlCreationOptions#preserveFragment}
3463
- * @see {@link Router#createUrlTree Router#createUrlTree}
3464
- */
3465
- set preserveFragment(preserveFragment: boolean | string | null | undefined);
3466
- get preserveFragment(): boolean;
3467
- /**
3468
- * Passed to {@link Router#navigateByUrl Router#navigateByUrl} as part of the
3469
- * `NavigationBehaviorOptions`.
3470
- * @see {@link NavigationBehaviorOptions#skipLocationChange NavigationBehaviorOptions#skipLocationChange}
3471
- * @see {@link Router#navigateByUrl Router#navigateByUrl}
3472
- */
3473
- set skipLocationChange(skipLocationChange: boolean | string | null | undefined);
3474
- get skipLocationChange(): boolean;
3475
- /**
3476
- * Passed to {@link Router#navigateByUrl Router#navigateByUrl} as part of the
3477
- * `NavigationBehaviorOptions`.
3478
- * @see {@link NavigationBehaviorOptions#replaceUrl NavigationBehaviorOptions#replaceUrl}
3479
- * @see {@link Router#navigateByUrl Router#navigateByUrl}
3480
- */
3481
- set replaceUrl(replaceUrl: boolean | string | null | undefined);
3482
- get replaceUrl(): boolean;
3483
- /**
3484
- * Commands to pass to {@link Router#createUrlTree Router#createUrlTree}.
3485
- * - **array**: commands to pass to {@link Router#createUrlTree Router#createUrlTree}.
3486
- * - **string**: shorthand for array of commands with just the string, i.e. `['/route']`
3487
- * - **null|undefined**: Disables the link by removing the `href`
3488
- * @see {@link Router#createUrlTree Router#createUrlTree}
3489
- */
3490
- set routerLink(commands: any[] | string | null | undefined);
3491
- /** @nodoc */
3492
- ngOnChanges(changes: SimpleChanges): any;
3493
- /** @nodoc */
3494
- ngOnDestroy(): any;
3495
- /** @nodoc */
3496
- onClick(button: number, ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean): boolean;
3497
- private updateTargetUrlAndHref;
3498
- get urlTree(): UrlTree | null;
3447
+ export declare class RouterLinkWithHref extends RouterLink {
3499
3448
  static ɵfac: i0.ɵɵFactoryDeclaration<RouterLinkWithHref, never>;
3500
- static ɵdir: i0.ɵɵDirectiveDeclaration<RouterLinkWithHref, "a[routerLink],area[routerLink]", never, { "target": "target"; "queryParams": "queryParams"; "fragment": "fragment"; "queryParamsHandling": "queryParamsHandling"; "state": "state"; "relativeTo": "relativeTo"; "preserveFragment": "preserveFragment"; "skipLocationChange": "skipLocationChange"; "replaceUrl": "replaceUrl"; "routerLink": "routerLink"; }, {}, never, never, true, never>;
3449
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RouterLinkWithHref, "a[routerLink],area[routerLink]", never, {}, {}, never, never, true, never>;
3501
3450
  }
3502
3451
 
3503
3452
  /**
@@ -3616,13 +3565,14 @@ export declare class RouterModule {
3616
3565
  * @publicApi
3617
3566
  */
3618
3567
  export declare class RouterOutlet implements OnDestroy, OnInit, RouterOutletContract {
3619
- private parentContexts;
3620
- private location;
3621
- private changeDetector;
3622
- private environmentInjector;
3623
3568
  private activated;
3624
3569
  private _activatedRoute;
3625
- private name;
3570
+ /**
3571
+ * The name of the outlet
3572
+ *
3573
+ * @see [named outlets](guide/router-tutorial-toh#displaying-multiple-routes-in-named-outlets)
3574
+ */
3575
+ name: string;
3626
3576
  activateEvents: EventEmitter<any>;
3627
3577
  deactivateEvents: EventEmitter<any>;
3628
3578
  /**
@@ -3635,11 +3585,18 @@ export declare class RouterOutlet implements OnDestroy, OnInit, RouterOutletCont
3635
3585
  * subtree.
3636
3586
  */
3637
3587
  detachEvents: EventEmitter<unknown>;
3638
- constructor(parentContexts: ChildrenOutletContexts, location: ViewContainerRef, name: string, changeDetector: ChangeDetectorRef, environmentInjector: EnvironmentInjector);
3588
+ private parentContexts;
3589
+ private location;
3590
+ private changeDetector;
3591
+ private environmentInjector;
3592
+ /** @nodoc */
3593
+ ngOnChanges(changes: SimpleChanges): void;
3639
3594
  /** @nodoc */
3640
3595
  ngOnDestroy(): void;
3596
+ private isTrackedInParentContexts;
3641
3597
  /** @nodoc */
3642
3598
  ngOnInit(): void;
3599
+ private initializeOutletWithName;
3643
3600
  get isActivated(): boolean;
3644
3601
  /**
3645
3602
  * @returns The currently activated component instance.
@@ -3658,8 +3615,8 @@ export declare class RouterOutlet implements OnDestroy, OnInit, RouterOutletCont
3658
3615
  attach(ref: ComponentRef<any>, activatedRoute: ActivatedRoute): void;
3659
3616
  deactivate(): void;
3660
3617
  activateWith(activatedRoute: ActivatedRoute, resolverOrInjector?: ComponentFactoryResolver | EnvironmentInjector | null): void;
3661
- static ɵfac: i0.ɵɵFactoryDeclaration<RouterOutlet, [null, null, { attribute: "name"; }, null, null]>;
3662
- static ɵdir: i0.ɵɵDirectiveDeclaration<RouterOutlet, "router-outlet", ["outlet"], {}, { "activateEvents": "activate"; "deactivateEvents": "deactivate"; "attachEvents": "attach"; "detachEvents": "detach"; }, never, never, true, never>;
3618
+ static ɵfac: i0.ɵɵFactoryDeclaration<RouterOutlet, never>;
3619
+ static ɵdir: i0.ɵɵDirectiveDeclaration<RouterOutlet, "router-outlet", ["outlet"], { "name": "name"; }, { "activateEvents": "activate"; "deactivateEvents": "deactivate"; "attachEvents": "attach"; "detachEvents": "detach"; }, never, never, true, never>;
3663
3620
  }
3664
3621
 
3665
3622
  /**
@@ -4483,6 +4440,14 @@ export declare function withRouterConfig(options: RouterConfigOptions): RouterCo
4483
4440
 
4484
4441
  export declare function ɵassignExtraOptionsToRouter(opts: ExtraOptions, router: Router): void;
4485
4442
 
4443
+ /**
4444
+ * Deprecated `loadChildren` value types.
4445
+ *
4446
+ * @publicApi
4447
+ * @deprecated represents the deprecated type side of `LoadChildren`.
4448
+ */
4449
+ export declare type ɵDeprecatedLoadChildren = never;
4450
+
4486
4451
  /**
4487
4452
  * This component is used internally within the router to be a placeholder when an empty
4488
4453
  * router-outlet is needed. For example, with a config such as:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/router",
3
- "version": "15.0.0-next.3",
3
+ "version": "15.0.0-next.5",
4
4
  "description": "Angular - the routing library",
5
5
  "keywords": [
6
6
  "angular",
@@ -24,9 +24,9 @@
24
24
  "tslib": "^2.3.0"
25
25
  },
26
26
  "peerDependencies": {
27
- "@angular/core": "15.0.0-next.3",
28
- "@angular/common": "15.0.0-next.3",
29
- "@angular/platform-browser": "15.0.0-next.3",
27
+ "@angular/core": "15.0.0-next.5",
28
+ "@angular/common": "15.0.0-next.5",
29
+ "@angular/platform-browser": "15.0.0-next.5",
30
30
  "rxjs": "^6.5.3 || ^7.4.0"
31
31
  },
32
32
  "ng-update": {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.0.0-next.3
2
+ * @license Angular v15.0.0-next.5
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v15.0.0-next.3
2
+ * @license Angular v15.0.0-next.5
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */