This commit is contained in:
CHEVALLIER Abel
2025-11-13 16:23:22 +01:00
parent de9c515a47
commit cb235644dc
34924 changed files with 3811102 additions and 0 deletions

21
node_modules/@angular/router/LICENSE generated vendored Executable file
View File

@@ -0,0 +1,21 @@
The MIT License
Copyright (c) 2010-2025 Google LLC. https://angular.dev/license
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

7
node_modules/@angular/router/README.md generated vendored Executable file
View File

@@ -0,0 +1,7 @@
# Angular
The sources for this package are in the main [Angular](https://github.com/angular/angular) repo. Please file issues and pull requests against that repo.
Usage information and reference details can be found in [Angular documentation](https://angular.dev/overview).
License: MIT

87
node_modules/@angular/router/fesm2022/router.mjs generated vendored Executable file
View File

@@ -0,0 +1,87 @@
/**
* @license Angular v20.3.11
* (c) 2010-2025 Google LLC. https://angular.dev/
* License: MIT
*/
export { ActivatedRoute, ActivatedRouteSnapshot, ActivationEnd, ActivationStart, BaseRouteReuseStrategy, ChildActivationEnd, ChildActivationStart, ChildrenOutletContexts, DefaultTitleStrategy, DefaultUrlSerializer, EventType, GuardsCheckEnd, GuardsCheckStart, NavigationCancel, NavigationCancellationCode, NavigationEnd, NavigationError, NavigationSkipped, NavigationSkippedCode, NavigationStart, OutletContext, PRIMARY_OUTLET, ROUTER_CONFIGURATION, ROUTER_OUTLET_DATA, ROUTES, RedirectCommand, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouteReuseStrategy, Router, RouterEvent, RouterOutlet, RouterState, RouterStateSnapshot, RoutesRecognized, Scroll, TitleStrategy, UrlHandlingStrategy, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree, convertToParamMap, createUrlTreeFromSnapshot, defaultUrlMatcher, ɵEmptyOutletComponent, afterNextNavigation as ɵafterNextNavigation, loadChildren as ɵloadChildren } from './router2.mjs';
export { NoPreloading, PreloadAllModules, PreloadingStrategy, ROUTER_INITIALIZER, RouterLink, RouterLinkActive, RouterLink as RouterLinkWithHref, RouterModule, RouterPreloader, provideRouter, provideRoutes, withComponentInputBinding, withDebugTracing, withDisabledInitialNavigation, withEnabledBlockingInitialNavigation, withHashLocation, withInMemoryScrolling, withNavigationErrorHandler, withPreloading, withRouterConfig, withViewTransitions, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS } from './router_module.mjs';
import { inject, Version } from '@angular/core';
import '@angular/common';
import 'rxjs';
import 'rxjs/operators';
import '@angular/platform-browser';
/**
* Maps an array of injectable classes with canMatch functions to an array of equivalent
* `CanMatchFn` for use in a `Route` definition.
*
* Usage {@example router/utils/functional_guards.ts region='CanActivate'}
*
* @publicApi
* @see {@link Route}
*/
function mapToCanMatch(providers) {
return providers.map((provider) => (...params) => inject(provider).canMatch(...params));
}
/**
* Maps an array of injectable classes with canActivate functions to an array of equivalent
* `CanActivateFn` for use in a `Route` definition.
*
* Usage {@example router/utils/functional_guards.ts region='CanActivate'}
*
* @publicApi
* @see {@link Route}
*/
function mapToCanActivate(providers) {
return providers.map((provider) => (...params) => inject(provider).canActivate(...params));
}
/**
* Maps an array of injectable classes with canActivateChild functions to an array of equivalent
* `CanActivateChildFn` for use in a `Route` definition.
*
* Usage {@example router/utils/functional_guards.ts region='CanActivate'}
*
* @publicApi
* @see {@link Route}
*/
function mapToCanActivateChild(providers) {
return providers.map((provider) => (...params) => inject(provider).canActivateChild(...params));
}
/**
* Maps an array of injectable classes with canDeactivate functions to an array of equivalent
* `CanDeactivateFn` for use in a `Route` definition.
*
* Usage {@example router/utils/functional_guards.ts region='CanActivate'}
*
* @publicApi
* @see {@link Route}
*/
function mapToCanDeactivate(providers) {
return providers.map((provider) => (...params) => inject(provider).canDeactivate(...params));
}
/**
* Maps an injectable class with a resolve function to an equivalent `ResolveFn`
* for use in a `Route` definition.
*
* Usage {@example router/utils/functional_guards.ts region='Resolve'}
*
* @publicApi
* @see {@link Route}
*/
function mapToResolve(provider) {
return (...params) => inject(provider).resolve(...params);
}
/**
* @module
* @description
* Entry point for all public APIs of the router package.
*/
/**
* @publicApi
*/
const VERSION = /* @__PURE__ */ new Version('20.3.11');
export { VERSION, mapToCanActivate, mapToCanActivateChild, mapToCanDeactivate, mapToCanMatch, mapToResolve };
//# sourceMappingURL=router.mjs.map

1
node_modules/@angular/router/fesm2022/router.mjs.map generated vendored Executable file
View File

@@ -0,0 +1 @@
{"version":3,"file":"router.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/router/src/utils/functional_guards.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/packages/router/src/version.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {inject, Type} from '@angular/core';\n\nimport {\n CanActivate,\n CanActivateChild,\n CanActivateChildFn,\n CanActivateFn,\n CanDeactivate,\n CanDeactivateFn,\n CanMatch,\n CanMatchFn,\n Resolve,\n ResolveFn,\n} from '../models';\n\n/**\n * Maps an array of injectable classes with canMatch functions to an array of equivalent\n * `CanMatchFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanMatch(providers: Array<Type<CanMatch>>): CanMatchFn[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canMatch(...params),\n );\n}\n\n/**\n * Maps an array of injectable classes with canActivate functions to an array of equivalent\n * `CanActivateFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanActivate(providers: Array<Type<CanActivate>>): CanActivateFn[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canActivate(...params),\n );\n}\n/**\n * Maps an array of injectable classes with canActivateChild functions to an array of equivalent\n * `CanActivateChildFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanActivateChild(\n providers: Array<Type<CanActivateChild>>,\n): CanActivateChildFn[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canActivateChild(...params),\n );\n}\n/**\n * Maps an array of injectable classes with canDeactivate functions to an array of equivalent\n * `CanDeactivateFn` for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='CanActivate'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToCanDeactivate<T = unknown>(\n providers: Array<Type<CanDeactivate<T>>>,\n): CanDeactivateFn<T>[] {\n return providers.map(\n (provider) =>\n (...params) =>\n inject(provider).canDeactivate(...params),\n );\n}\n/**\n * Maps an injectable class with a resolve function to an equivalent `ResolveFn`\n * for use in a `Route` definition.\n *\n * Usage {@example router/utils/functional_guards.ts region='Resolve'}\n *\n * @publicApi\n * @see {@link Route}\n */\nexport function mapToResolve<T>(provider: Type<Resolve<T>>): ResolveFn<T> {\n return (...params) => inject(provider).resolve(...params);\n}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the router package.\n */\n\nimport {Version} from '@angular/core';\n\n/**\n * @publicApi\n */\nexport const VERSION = /* @__PURE__ */ new Version('20.3.11');\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAuBA;;;;;;;;AAQG;AACG,SAAU,aAAa,CAAC,SAAgC,EAAA;IAC5D,OAAO,SAAS,CAAC,GAAG,CAClB,CAAC,QAAQ,KACP,CAAC,GAAG,MAAM,KACR,MAAM,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,CACzC;AACH;AAEA;;;;;;;;AAQG;AACG,SAAU,gBAAgB,CAAC,SAAmC,EAAA;IAClE,OAAO,SAAS,CAAC,GAAG,CAClB,CAAC,QAAQ,KACP,CAAC,GAAG,MAAM,KACR,MAAM,CAAC,QAAQ,CAAC,CAAC,WAAW,CAAC,GAAG,MAAM,CAAC,CAC5C;AACH;AACA;;;;;;;;AAQG;AACG,SAAU,qBAAqB,CACnC,SAAwC,EAAA;IAExC,OAAO,SAAS,CAAC,GAAG,CAClB,CAAC,QAAQ,KACP,CAAC,GAAG,MAAM,KACR,MAAM,CAAC,QAAQ,CAAC,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAAC,CACjD;AACH;AACA;;;;;;;;AAQG;AACG,SAAU,kBAAkB,CAChC,SAAwC,EAAA;IAExC,OAAO,SAAS,CAAC,GAAG,CAClB,CAAC,QAAQ,KACP,CAAC,GAAG,MAAM,KACR,MAAM,CAAC,QAAQ,CAAC,CAAC,aAAa,CAAC,GAAG,MAAM,CAAC,CAC9C;AACH;AACA;;;;;;;;AAQG;AACG,SAAU,YAAY,CAAI,QAA0B,EAAA;AACxD,IAAA,OAAO,CAAC,GAAG,MAAM,KAAK,MAAM,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,GAAG,MAAM,CAAC;AAC3D;;AC/FA;;;;AAIG;AAIH;;AAEG;AACU,MAAA,OAAO,mBAAmB,IAAI,OAAO,CAAC,mBAAmB;;;;"}

5997
node_modules/@angular/router/fesm2022/router2.mjs generated vendored Executable file

File diff suppressed because it is too large Load Diff

1
node_modules/@angular/router/fesm2022/router2.mjs.map generated vendored Executable file

File diff suppressed because one or more lines are too long

1712
node_modules/@angular/router/fesm2022/router_module.mjs generated vendored Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

203
node_modules/@angular/router/fesm2022/testing.mjs generated vendored Executable file
View File

@@ -0,0 +1,203 @@
/**
* @license Angular v20.3.11
* (c) 2010-2025 Google LLC. https://angular.dev/
* License: MIT
*/
import * as i0 from '@angular/core';
import { NgModule, Injectable, signal, Component, ViewChild } from '@angular/core';
import { TestBed } from '@angular/core/testing';
import { ROUTES, ROUTER_CONFIGURATION, RouterOutlet, Router, afterNextNavigation } from './router2.mjs';
export { ɵEmptyOutletComponent as ɵɵEmptyOutletComponent } from './router2.mjs';
import { RouterModule, ROUTER_PROVIDERS, withPreloading, NoPreloading } from './router_module.mjs';
export { RouterLink as ɵɵRouterLink, RouterLinkActive as ɵɵRouterLinkActive } from './router_module.mjs';
import { provideLocationMocks } from '@angular/common/testing';
import '@angular/common';
import 'rxjs';
import 'rxjs/operators';
import '@angular/platform-browser';
/**
* @description
*
* Sets up the router to be used for testing.
*
* The modules sets up the router to be used for testing.
* It provides spy implementations of `Location` and `LocationStrategy`.
*
* @usageNotes
* ### Example
*
* ```ts
* beforeEach(() => {
* TestBed.configureTestingModule({
* imports: [
* RouterModule.forRoot(
* [{path: '', component: BlankCmp}, {path: 'simple', component: SimpleCmp}]
* )
* ]
* });
* });
* ```
*
* @publicApi
* @deprecated Use `provideRouter` or `RouterModule`/`RouterModule.forRoot` instead.
* This module was previously used to provide a helpful collection of test fakes,
* most notably those for `Location` and `LocationStrategy`. These are generally not
* required anymore, as `MockPlatformLocation` is provided in `TestBed` by default.
* However, you can use them directly with `provideLocationMocks`.
*/
class RouterTestingModule {
static withRoutes(routes, config) {
return {
ngModule: RouterTestingModule,
providers: [
{ provide: ROUTES, multi: true, useValue: routes },
{ provide: ROUTER_CONFIGURATION, useValue: config ? config : {} },
],
};
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: RouterTestingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.11", ngImport: i0, type: RouterTestingModule, exports: [RouterModule] });
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: RouterTestingModule, providers: [
ROUTER_PROVIDERS,
provideLocationMocks(),
withPreloading(NoPreloading).ɵproviders,
{ provide: ROUTES, multi: true, useValue: [] },
], imports: [RouterModule] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: RouterTestingModule, decorators: [{
type: NgModule,
args: [{
exports: [RouterModule],
providers: [
ROUTER_PROVIDERS,
provideLocationMocks(),
withPreloading(NoPreloading).ɵproviders,
{ provide: ROUTES, multi: true, useValue: [] },
],
}]
}] });
class RootFixtureService {
fixture;
harness;
createHarness() {
if (this.harness) {
throw new Error('Only one harness should be created per test.');
}
this.harness = new RouterTestingHarness(this.getRootFixture());
return this.harness;
}
getRootFixture() {
if (this.fixture !== undefined) {
return this.fixture;
}
this.fixture = TestBed.createComponent(RootCmp);
this.fixture.detectChanges();
return this.fixture;
}
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: RootFixtureService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: RootFixtureService, providedIn: 'root' });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: RootFixtureService, decorators: [{
type: Injectable,
args: [{ providedIn: 'root' }]
}] });
class RootCmp {
outlet;
routerOutletData = signal(undefined, ...(ngDevMode ? [{ debugName: "routerOutletData" }] : []));
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: RootCmp, deps: [], target: i0.ɵɵFactoryTarget.Component });
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.11", type: RootCmp, isStandalone: true, selector: "ng-component", viewQueries: [{ propertyName: "outlet", first: true, predicate: RouterOutlet, descendants: true }], ngImport: i0, template: '<router-outlet [routerOutletData]="routerOutletData()"></router-outlet>', isInline: true, dependencies: [{ kind: "directive", type: RouterOutlet, selector: "router-outlet", inputs: ["name", "routerOutletData"], outputs: ["activate", "deactivate", "attach", "detach"], exportAs: ["outlet"] }] });
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.11", ngImport: i0, type: RootCmp, decorators: [{
type: Component,
args: [{
template: '<router-outlet [routerOutletData]="routerOutletData()"></router-outlet>',
imports: [RouterOutlet],
}]
}], propDecorators: { outlet: [{
type: ViewChild,
args: [RouterOutlet]
}] } });
/**
* A testing harness for the `Router` to reduce the boilerplate needed to test routes and routed
* components.
*
* @publicApi
*/
class RouterTestingHarness {
/**
* Creates a `RouterTestingHarness` instance.
*
* The `RouterTestingHarness` also creates its own root component with a `RouterOutlet` for the
* purposes of rendering route components.
*
* Throws an error if an instance has already been created.
* Use of this harness also requires `destroyAfterEach: true` in the `ModuleTeardownOptions`
*
* @param initialUrl The target of navigation to trigger before returning the harness.
*/
static async create(initialUrl) {
const harness = TestBed.inject(RootFixtureService).createHarness();
if (initialUrl !== undefined) {
await harness.navigateByUrl(initialUrl);
}
return harness;
}
/**
* Fixture of the root component of the RouterTestingHarness
*/
fixture;
/** @internal */
constructor(fixture) {
this.fixture = fixture;
}
/** Instructs the root fixture to run change detection. */
detectChanges() {
this.fixture.detectChanges();
}
/** The `DebugElement` of the `RouterOutlet` component. `null` if the outlet is not activated. */
get routeDebugElement() {
const outlet = this.fixture.componentInstance.outlet;
if (!outlet || !outlet.isActivated) {
return null;
}
return this.fixture.debugElement.query((v) => v.componentInstance === outlet.component);
}
/** The native element of the `RouterOutlet` component. `null` if the outlet is not activated. */
get routeNativeElement() {
return this.routeDebugElement?.nativeElement ?? null;
}
async navigateByUrl(url, requiredRoutedComponentType) {
const router = TestBed.inject(Router);
let resolveFn;
const redirectTrackingPromise = new Promise((resolve) => {
resolveFn = resolve;
});
afterNextNavigation(TestBed.inject(Router), resolveFn);
await router.navigateByUrl(url);
await redirectTrackingPromise;
this.fixture.detectChanges();
const outlet = this.fixture.componentInstance.outlet;
// The outlet might not be activated if the user is testing a navigation for a guard that
// rejects
if (outlet && outlet.isActivated && outlet.activatedRoute.component) {
const activatedComponent = outlet.component;
if (requiredRoutedComponentType !== undefined &&
!(activatedComponent instanceof requiredRoutedComponentType)) {
throw new Error(`Unexpected routed component type. Expected ${requiredRoutedComponentType.name} but got ${activatedComponent.constructor.name}`);
}
return activatedComponent;
}
else {
if (requiredRoutedComponentType !== undefined) {
throw new Error(`Unexpected routed component type. Expected ${requiredRoutedComponentType.name} but the navigation did not activate any component.`);
}
return null;
}
}
}
export { RouterTestingHarness, RouterTestingModule, RouterOutlet as ɵɵRouterOutlet };
//# sourceMappingURL=testing.mjs.map

1
node_modules/@angular/router/fesm2022/testing.mjs.map generated vendored Executable file

File diff suppressed because one or more lines are too long

141
node_modules/@angular/router/fesm2022/upgrade.mjs generated vendored Executable file
View File

@@ -0,0 +1,141 @@
/**
* @license Angular v20.3.11
* (c) 2010-2025 Google LLC. https://angular.dev/
* License: MIT
*/
import { Location } from '@angular/common';
import { APP_BOOTSTRAP_LISTENER } from '@angular/core';
import { UpgradeModule } from '@angular/upgrade/static';
import { Router } from './router2.mjs';
import 'rxjs';
import 'rxjs/operators';
import '@angular/platform-browser';
/**
* Creates an initializer that sets up `ngRoute` integration
* along with setting up the Angular router.
*
* @usageNotes
*
* For standalone applications:
* ```ts
* export const appConfig: ApplicationConfig = {
* providers: [RouterUpgradeInitializer],
* };
* ```
*
* For NgModule based applications:
* ```ts
* @NgModule({
* imports: [
* RouterModule.forRoot(SOME_ROUTES),
* UpgradeModule
* ],
* providers: [
* RouterUpgradeInitializer
* ]
* })
* export class AppModule {
* ngDoBootstrap() {}
* }
* ```
*
* @publicApi
*/
const RouterUpgradeInitializer = {
provide: APP_BOOTSTRAP_LISTENER,
multi: true,
useFactory: locationSyncBootstrapListener,
deps: [UpgradeModule],
};
/**
* @internal
*/
function locationSyncBootstrapListener(ngUpgrade) {
return () => {
setUpLocationSync(ngUpgrade);
};
}
/**
* Sets up a location change listener to trigger `history.pushState`.
* Works around the problem that `onPopState` does not trigger `history.pushState`.
* Must be called *after* calling `UpgradeModule.bootstrap`.
*
* @param ngUpgrade The upgrade NgModule.
* @param urlType The location strategy.
* @see {@link /api/common/HashLocationStrategy HashLocationStrategy}
* @see {@link /api/common/PathLocationStrategy PathLocationStrategy}
*
* @publicApi
*/
function setUpLocationSync(ngUpgrade, urlType = 'path') {
if (!ngUpgrade.$injector) {
throw new Error(`
RouterUpgradeInitializer can be used only after UpgradeModule.bootstrap has been called.
Remove RouterUpgradeInitializer and call setUpLocationSync after UpgradeModule.bootstrap.
`);
}
const router = ngUpgrade.injector.get(Router);
const location = ngUpgrade.injector.get(Location);
ngUpgrade.$injector
.get('$rootScope')
.$on('$locationChangeStart', (event, newUrl, oldUrl, newState, oldState) => {
// Navigations coming from Angular router have a navigationId state
// property. Don't trigger Angular router navigation again if it is
// caused by a URL change from the current Angular router
// navigation.
const currentNavigationId = router.getCurrentNavigation()?.id;
const newStateNavigationId = newState?.navigationId;
if (newStateNavigationId !== undefined && newStateNavigationId === currentNavigationId) {
return;
}
let url;
if (urlType === 'path') {
url = resolveUrl(newUrl);
}
else if (urlType === 'hash') {
// Remove the first hash from the URL
const hashIdx = newUrl.indexOf('#');
url = resolveUrl(newUrl.substring(0, hashIdx) + newUrl.substring(hashIdx + 1));
}
else {
throw 'Invalid URLType passed to setUpLocationSync: ' + urlType;
}
const path = location.normalize(url.pathname);
router.navigateByUrl(path + url.search + url.hash);
});
}
/**
* Normalizes and parses a URL.
*
* - Normalizing means that a relative URL will be resolved into an absolute URL in the context of
* the application document.
* - Parsing means that the anchor's `protocol`, `hostname`, `port`, `pathname` and related
* properties are all populated to reflect the normalized URL.
*
* While this approach has wide compatibility, it doesn't work as expected on IE. On IE, normalizing
* happens similar to other browsers, but the parsed components will not be set. (E.g. if you assign
* `a.href = 'foo'`, then `a.protocol`, `a.host`, etc. will not be correctly updated.)
* We work around that by performing the parsing in a 2nd step by taking a previously normalized URL
* and assigning it again. This correctly populates all properties.
*
* See
* https://github.com/angular/angular.js/blob/2c7400e7d07b0f6cec1817dab40b9250ce8ebce6/src/ng/urlUtils.js#L26-L33
* for more info.
*/
let anchor;
function resolveUrl(url) {
anchor ??= document.createElement('a');
anchor.setAttribute('href', url);
anchor.setAttribute('href', anchor.href);
return {
// IE does not start `pathname` with `/` like other browsers.
pathname: `/${anchor.pathname.replace(/^\//, '')}`,
search: anchor.search,
hash: anchor.hash,
};
}
export { RouterUpgradeInitializer, locationSyncBootstrapListener, setUpLocationSync };
//# sourceMappingURL=upgrade.mjs.map

1
node_modules/@angular/router/fesm2022/upgrade.mjs.map generated vendored Executable file

File diff suppressed because one or more lines are too long

898
node_modules/@angular/router/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,898 @@
/**
* @license Angular v20.3.11
* (c) 2010-2025 Google LLC. https://angular.dev/
* License: MIT
*/
import { ActivatedRouteSnapshot, Params, UrlTree, RouterOutletContract, ActivatedRoute, RouterStateSnapshot, Route, LoadedRouterConfig, Router, Routes, InMemoryScrollingOptions, RouterConfigOptions, NavigationError, RedirectCommand, CanMatch, CanMatchFn, CanActivate, CanActivateFn, CanActivateChild, CanActivateChildFn, CanDeactivate, CanDeactivateFn, Resolve, ResolveFn, Event } from './router_module.d.js';
export { ActivationEnd, ActivationStart, BaseRouteReuseStrategy, CanLoad, CanLoadFn, ChildActivationEnd, ChildActivationStart, Data, DefaultExport, DefaultUrlSerializer, DeprecatedGuard, DeprecatedResolve, DetachedRouteHandle, EventType, ExtraOptions, GuardResult, GuardsCheckEnd, GuardsCheckStart, InitialNavigation, IsActiveMatchOptions, LoadChildren, LoadChildrenCallback, MaybeAsync, Navigation, NavigationBehaviorOptions, NavigationCancel, NavigationCancellationCode, NavigationEnd, NavigationExtras, NavigationSkipped, NavigationSkippedCode, NavigationStart, OnSameUrlNavigation, PRIMARY_OUTLET, ParamMap, QueryParamsHandling, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, ROUTER_OUTLET_DATA, RedirectFunction, ResolveData, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouteReuseStrategy, RouterEvent, RouterLink, RouterLinkActive, RouterLink as RouterLinkWithHref, RouterModule, RouterOutlet, RouterState, RoutesRecognized, RunGuardsAndResolvers, Scroll, UrlCreationOptions, UrlMatchResult, UrlMatcher, UrlSegment, UrlSegmentGroup, UrlSerializer, convertToParamMap, defaultUrlMatcher, ɵEmptyOutletComponent, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS, RestoredState as ɵRestoredState } from './router_module.d.js';
import { Title } from '@angular/platform-browser';
import * as i0 from '@angular/core';
import { ComponentRef, EnvironmentInjector, InjectionToken, Compiler, Injector, Type, OnDestroy, EnvironmentProviders, Provider, Version } from '@angular/core';
import { Observable } from 'rxjs';
import '@angular/common';
/**
* Creates a `UrlTree` relative to an `ActivatedRouteSnapshot`.
*
* @publicApi
*
*
* @param relativeTo The `ActivatedRouteSnapshot` to apply the commands to
* @param commands An array of URL fragments with which to construct the new URL tree.
* If the path is static, can be the literal URL string. For a dynamic path, pass an array of path
* segments, followed by the parameters for each segment.
* The fragments are applied to the one provided in the `relativeTo` parameter.
* @param queryParams The query parameters for the `UrlTree`. `null` if the `UrlTree` does not have
* any query parameters.
* @param fragment The fragment for the `UrlTree`. `null` if the `UrlTree` does not have a fragment.
*
* @usageNotes
*
* ```ts
* // create /team/33/user/11
* createUrlTreeFromSnapshot(snapshot, ['/team', 33, 'user', 11]);
*
* // create /team/33;expand=true/user/11
* createUrlTreeFromSnapshot(snapshot, ['/team', 33, {expand: true}, 'user', 11]);
*
* // you can collapse static segments like this (this works only with the first passed-in value):
* createUrlTreeFromSnapshot(snapshot, ['/team/33/user', userId]);
*
* // If the first segment can contain slashes, and you do not want the router to split it,
* // you can do the following:
* createUrlTreeFromSnapshot(snapshot, [{segmentPath: '/one/two'}]);
*
* // create /team/33/(user/11//right:chat)
* createUrlTreeFromSnapshot(snapshot, ['/team', 33, {outlets: {primary: 'user/11', right:
* 'chat'}}], null, null);
*
* // remove the right secondary node
* createUrlTreeFromSnapshot(snapshot, ['/team', 33, {outlets: {primary: 'user/11', right: null}}]);
*
* // For the examples below, assume the current URL is for the `/team/33/user/11` and the
* `ActivatedRouteSnapshot` points to `user/11`:
*
* // navigate to /team/33/user/11/details
* createUrlTreeFromSnapshot(snapshot, ['details']);
*
* // navigate to /team/33/user/22
* createUrlTreeFromSnapshot(snapshot, ['../22']);
*
* // navigate to /team/44/user/22
* createUrlTreeFromSnapshot(snapshot, ['../../team/44/user/22']);
* ```
*/
declare function createUrlTreeFromSnapshot(relativeTo: ActivatedRouteSnapshot, commands: readonly any[], queryParams?: Params | null, fragment?: string | null): UrlTree;
/**
* Store contextual information about a `RouterOutlet`
*
* @publicApi
*/
declare class OutletContext {
private readonly rootInjector;
outlet: RouterOutletContract | null;
route: ActivatedRoute | null;
children: ChildrenOutletContexts;
attachRef: ComponentRef<any> | null;
get injector(): EnvironmentInjector;
constructor(rootInjector: EnvironmentInjector);
}
/**
* Store contextual information about the children (= nested) `RouterOutlet`
*
* @publicApi
*/
declare class ChildrenOutletContexts {
private rootInjector;
private contexts;
/** @docs-private */
constructor(rootInjector: EnvironmentInjector);
/** Called when a `RouterOutlet` directive is instantiated */
onChildOutletCreated(childName: string, outlet: RouterOutletContract): void;
/**
* Called when a `RouterOutlet` directive is destroyed.
* We need to keep the context as the outlet could be destroyed inside a NgIf and might be
* re-created later.
*/
onChildOutletDestroyed(childName: string): void;
/**
* Called when the corresponding route is deactivated during navigation.
* Because the component get destroyed, all children outlet are destroyed.
*/
onOutletDeactivated(): Map<string, OutletContext>;
onOutletReAttached(contexts: Map<string, OutletContext>): void;
getOrCreateContext(childName: string): OutletContext;
getContext(childName: string): OutletContext | null;
static ɵfac: i0.ɵɵFactoryDeclaration<ChildrenOutletContexts, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<ChildrenOutletContexts>;
}
/**
* Options to configure the View Transitions integration in the Router.
*
* @developerPreview 20.0
* @see withViewTransitions
*/
interface ViewTransitionsFeatureOptions {
/**
* Skips the very first call to `startViewTransition`. This can be useful for disabling the
* animation during the application's initial loading phase.
*/
skipInitialTransition?: boolean;
/**
* A function to run after the `ViewTransition` is created.
*
* This function is run in an injection context and can use `inject`.
*/
onViewTransitionCreated?: (transitionInfo: ViewTransitionInfo) => void;
}
/**
* The information passed to the `onViewTransitionCreated` function provided in the
* `withViewTransitions` feature options.
*
* @developerPreview 20.0
*/
interface ViewTransitionInfo {
/**
* The `ViewTransition` returned by the call to `startViewTransition`.
* @see https://developer.mozilla.org/en-US/docs/Web/API/ViewTransition
*/
transition: ViewTransition;
/**
* The `ActivatedRouteSnapshot` that the navigation is transitioning from.
*/
from: ActivatedRouteSnapshot;
/**
* The `ActivatedRouteSnapshot` that the navigation is transitioning to.
*/
to: ActivatedRouteSnapshot;
}
/**
* Provides a strategy for setting the page title after a router navigation.
*
* The built-in implementation traverses the router state snapshot and finds the deepest primary
* outlet with `title` property. Given the `Routes` below, navigating to
* `/base/child(popup:aux)` would result in the document title being set to "child".
* ```ts
* [
* {path: 'base', title: 'base', children: [
* {path: 'child', title: 'child'},
* ],
* {path: 'aux', outlet: 'popup', title: 'popupTitle'}
* ]
* ```
*
* This class can be used as a base class for custom title strategies. That is, you can create your
* own class that extends the `TitleStrategy`. Note that in the above example, the `title`
* from the named outlet is never used. However, a custom strategy might be implemented to
* incorporate titles in named outlets.
*
* @publicApi
* @see [Page title guide](guide/routing/define-routes#using-titlestrategy-for-page-titles)
*/
declare abstract class TitleStrategy {
/** Performs the application title update. */
abstract updateTitle(snapshot: RouterStateSnapshot): void;
/**
* @returns The `title` of the deepest primary route.
*/
buildTitle(snapshot: RouterStateSnapshot): string | undefined;
/**
* Given an `ActivatedRouteSnapshot`, returns the final value of the
* `Route.title` property, which can either be a static string or a resolved value.
*/
getResolvedTitleForRoute(snapshot: ActivatedRouteSnapshot): any;
static ɵfac: i0.ɵɵFactoryDeclaration<TitleStrategy, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<TitleStrategy>;
}
/**
* The default `TitleStrategy` used by the router that updates the title using the `Title` service.
*/
declare class DefaultTitleStrategy extends TitleStrategy {
readonly title: Title;
constructor(title: Title);
/**
* Sets the title of the browser to the given value.
*
* @param title The `pageTitle` from the deepest primary route.
*/
updateTitle(snapshot: RouterStateSnapshot): void;
static ɵfac: i0.ɵɵFactoryDeclaration<DefaultTitleStrategy, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<DefaultTitleStrategy>;
}
/**
* The DI token for a router configuration.
*
* `ROUTES` is a low level API for router configuration via dependency injection.
*
* We recommend that in almost all cases to use higher level APIs such as `RouterModule.forRoot()`,
* `provideRouter`, or `Router.resetConfig()`.
*
* @publicApi
*/
declare const ROUTES: InjectionToken<Route[][]>;
declare class RouterConfigLoader {
private componentLoaders;
private childrenLoaders;
onLoadStartListener?: (r: Route) => void;
onLoadEndListener?: (r: Route) => void;
private readonly compiler;
loadComponent(injector: EnvironmentInjector, route: Route): Observable<Type<unknown>>;
loadChildren(parentInjector: Injector, route: Route): Observable<LoadedRouterConfig>;
static ɵfac: i0.ɵɵFactoryDeclaration<RouterConfigLoader, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<RouterConfigLoader>;
}
/**
* Executes a `route.loadChildren` callback and converts the result to an array of child routes and
* an injector if that callback returned a module.
*
* This function is used for the route discovery during prerendering
* in @angular-devkit/build-angular. If there are any updates to the contract here, it will require
* an update to the extractor.
*/
declare function loadChildren(route: Route, compiler: Compiler, parentInjector: Injector, onLoadEndListener?: (r: Route) => void): Observable<LoadedRouterConfig>;
/**
* @description
*
* Provides a preloading strategy.
*
* @publicApi
*/
declare abstract class PreloadingStrategy {
abstract preload(route: Route, fn: () => Observable<any>): Observable<any>;
}
/**
* @description
*
* Provides a preloading strategy that preloads all modules as quickly as possible.
*
* ```ts
* RouterModule.forRoot(ROUTES, {preloadingStrategy: PreloadAllModules})
* ```
*
* @publicApi
*/
declare class PreloadAllModules implements PreloadingStrategy {
preload(route: Route, fn: () => Observable<any>): Observable<any>;
static ɵfac: i0.ɵɵFactoryDeclaration<PreloadAllModules, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<PreloadAllModules>;
}
/**
* @description
*
* Provides a preloading strategy that does not preload any modules.
*
* This strategy is enabled by default.
*
* @publicApi
*/
declare class NoPreloading implements PreloadingStrategy {
preload(route: Route, fn: () => Observable<any>): Observable<any>;
static ɵfac: i0.ɵɵFactoryDeclaration<NoPreloading, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<NoPreloading>;
}
/**
* The preloader optimistically loads all router configurations to
* make navigations into lazily-loaded sections of the application faster.
*
* The preloader runs in the background. When the router bootstraps, the preloader
* starts listening to all navigation events. After every such event, the preloader
* will check if any configurations can be loaded lazily.
*
* If a route is protected by `canLoad` guards, the preloaded will not load it.
*
* @publicApi
*/
declare class RouterPreloader implements OnDestroy {
private router;
private injector;
private preloadingStrategy;
private loader;
private subscription?;
constructor(router: Router, injector: EnvironmentInjector, preloadingStrategy: PreloadingStrategy, loader: RouterConfigLoader);
setUpPreloading(): void;
preload(): Observable<any>;
/** @docs-private */
ngOnDestroy(): void;
private processRoutes;
private preloadConfig;
static ɵfac: i0.ɵɵFactoryDeclaration<RouterPreloader, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<RouterPreloader>;
}
/**
* Sets up providers necessary to enable `Router` functionality for the application.
* Allows to configure a set of routes as well as extra features that should be enabled.
*
* @usageNotes
*
* Basic example of how you can add a Router to your application:
* ```ts
* const appRoutes: Routes = [];
* bootstrapApplication(AppComponent, {
* providers: [provideRouter(appRoutes)]
* });
* ```
*
* You can also enable optional features in the Router by adding functions from the `RouterFeatures`
* type:
* ```ts
* const appRoutes: Routes = [];
* bootstrapApplication(AppComponent,
* {
* providers: [
* provideRouter(appRoutes,
* withDebugTracing(),
* withRouterConfig({paramsInheritanceStrategy: 'always'}))
* ]
* }
* );
* ```
* @see [Router](guide/routing)
*
* @see {@link RouterFeatures}
*
* @publicApi
* @param routes A set of `Route`s to use for the application routing table.
* @param features Optional features to configure additional router behaviors.
* @returns A set of providers to setup a Router.
*/
declare function provideRouter(routes: Routes, ...features: RouterFeatures[]): EnvironmentProviders;
/**
* Helper type to represent a Router feature.
*
* @publicApi
*/
interface RouterFeature<FeatureKind extends RouterFeatureKind> {
ɵkind: FeatureKind;
ɵproviders: Array<Provider | EnvironmentProviders>;
}
/**
* Registers a DI provider for a set of routes.
* @param routes The route configuration to provide.
*
* @usageNotes
*
* ```ts
* @NgModule({
* providers: [provideRoutes(ROUTES)]
* })
* class LazyLoadedChildModule {}
* ```
*
* @deprecated If necessary, provide routes using the `ROUTES` `InjectionToken`.
* @see {@link ROUTES}
* @publicApi
*/
declare function provideRoutes(routes: Routes): Provider[];
/**
* A type alias for providers returned by `withInMemoryScrolling` for use with `provideRouter`.
*
* @see {@link withInMemoryScrolling}
* @see {@link provideRouter}
*
* @publicApi
*/
type InMemoryScrollingFeature = RouterFeature<RouterFeatureKind.InMemoryScrollingFeature>;
/**
* Enables customizable scrolling behavior for router navigations.
*
* @usageNotes
*
* Basic example of how you can enable scrolling feature:
* ```ts
* const appRoutes: Routes = [];
* bootstrapApplication(AppComponent,
* {
* providers: [
* provideRouter(appRoutes, withInMemoryScrolling())
* ]
* }
* );
* ```
*
* @see {@link provideRouter}
* @see {@link ViewportScroller}
*
* @publicApi
* @param options Set of configuration parameters to customize scrolling behavior, see
* `InMemoryScrollingOptions` for additional information.
* @returns A set of providers for use with `provideRouter`.
*/
declare function withInMemoryScrolling(options?: InMemoryScrollingOptions): InMemoryScrollingFeature;
/**
* A type alias for providers returned by `withEnabledBlockingInitialNavigation` for use with
* `provideRouter`.
*
* @see {@link withEnabledBlockingInitialNavigation}
* @see {@link provideRouter}
*
* @publicApi
*/
type EnabledBlockingInitialNavigationFeature = RouterFeature<RouterFeatureKind.EnabledBlockingInitialNavigationFeature>;
/**
* A type alias for providers returned by `withEnabledBlockingInitialNavigation` or
* `withDisabledInitialNavigation` functions for use with `provideRouter`.
*
* @see {@link withEnabledBlockingInitialNavigation}
* @see {@link withDisabledInitialNavigation}
* @see {@link provideRouter}
*
* @publicApi
*/
type InitialNavigationFeature = EnabledBlockingInitialNavigationFeature | DisabledInitialNavigationFeature;
/**
* Configures initial navigation to start before the root component is created.
*
* The bootstrap is blocked until the initial navigation is complete. This should be set in case
* you use [server-side rendering](guide/ssr), but do not enable [hydration](guide/hydration) for
* your application.
*
* @usageNotes
*
* Basic example of how you can enable this navigation behavior:
* ```ts
* const appRoutes: Routes = [];
* bootstrapApplication(AppComponent,
* {
* providers: [
* provideRouter(appRoutes, withEnabledBlockingInitialNavigation())
* ]
* }
* );
* ```
*
* @see {@link provideRouter}
*
* @publicApi
* @returns A set of providers for use with `provideRouter`.
*/
declare function withEnabledBlockingInitialNavigation(): EnabledBlockingInitialNavigationFeature;
/**
* A type alias for providers returned by `withDisabledInitialNavigation` for use with
* `provideRouter`.
*
* @see {@link withDisabledInitialNavigation}
* @see {@link provideRouter}
*
* @publicApi
*/
type DisabledInitialNavigationFeature = RouterFeature<RouterFeatureKind.DisabledInitialNavigationFeature>;
/**
* Disables initial navigation.
*
* Use if there is a reason to have more control over when the router starts its initial navigation
* due to some complex initialization logic.
*
* @usageNotes
*
* Basic example of how you can disable initial navigation:
* ```ts
* const appRoutes: Routes = [];
* bootstrapApplication(AppComponent,
* {
* providers: [
* provideRouter(appRoutes, withDisabledInitialNavigation())
* ]
* }
* );
* ```
*
* @see {@link provideRouter}
*
* @returns A set of providers for use with `provideRouter`.
*
* @publicApi
*/
declare function withDisabledInitialNavigation(): DisabledInitialNavigationFeature;
/**
* A type alias for providers returned by `withDebugTracing` for use with `provideRouter`.
*
* @see {@link withDebugTracing}
* @see {@link provideRouter}
*
* @publicApi
*/
type DebugTracingFeature = RouterFeature<RouterFeatureKind.DebugTracingFeature>;
/**
* Enables logging of all internal navigation events to the console.
* Extra logging might be useful for debugging purposes to inspect Router event sequence.
*
* @usageNotes
*
* Basic example of how you can enable debug tracing:
* ```ts
* const appRoutes: Routes = [];
* bootstrapApplication(AppComponent,
* {
* providers: [
* provideRouter(appRoutes, withDebugTracing())
* ]
* }
* );
* ```
*
* @see {@link provideRouter}
*
* @returns A set of providers for use with `provideRouter`.
*
* @publicApi
*/
declare function withDebugTracing(): DebugTracingFeature;
/**
* A type alias that represents a feature which enables preloading in Router.
* The type is used to describe the return value of the `withPreloading` function.
*
* @see {@link withPreloading}
* @see {@link provideRouter}
*
* @publicApi
*/
type PreloadingFeature = RouterFeature<RouterFeatureKind.PreloadingFeature>;
/**
* Allows to configure a preloading strategy to use. The strategy is configured by providing a
* reference to a class that implements a `PreloadingStrategy`.
*
* @usageNotes
*
* Basic example of how you can configure preloading:
* ```ts
* const appRoutes: Routes = [];
* bootstrapApplication(AppComponent,
* {
* providers: [
* provideRouter(appRoutes, withPreloading(PreloadAllModules))
* ]
* }
* );
* ```
*
* @see {@link provideRouter}
*
* @param preloadingStrategy A reference to a class that implements a `PreloadingStrategy` that
* should be used.
* @returns A set of providers for use with `provideRouter`.
*
* @publicApi
*/
declare function withPreloading(preloadingStrategy: Type<PreloadingStrategy>): PreloadingFeature;
/**
* A type alias for providers returned by `withRouterConfig` for use with `provideRouter`.
*
* @see {@link withRouterConfig}
* @see {@link provideRouter}
*
* @publicApi
*/
type RouterConfigurationFeature = RouterFeature<RouterFeatureKind.RouterConfigurationFeature>;
/**
* Allows to provide extra parameters to configure Router.
*
* @usageNotes
*
* Basic example of how you can provide extra configuration options:
* ```ts
* const appRoutes: Routes = [];
* bootstrapApplication(AppComponent,
* {
* providers: [
* provideRouter(appRoutes, withRouterConfig({
* onSameUrlNavigation: 'reload'
* }))
* ]
* }
* );
* ```
*
* @see {@link provideRouter}
*
* @param options A set of parameters to configure Router, see `RouterConfigOptions` for
* additional information.
* @returns A set of providers for use with `provideRouter`.
*
* @publicApi
*/
declare function withRouterConfig(options: RouterConfigOptions): RouterConfigurationFeature;
/**
* A type alias for providers returned by `withHashLocation` for use with `provideRouter`.
*
* @see {@link withHashLocation}
* @see {@link provideRouter}
*
* @publicApi
*/
type RouterHashLocationFeature = RouterFeature<RouterFeatureKind.RouterHashLocationFeature>;
/**
* Provides the location strategy that uses the URL fragment instead of the history API.
*
* @usageNotes
*
* Basic example of how you can use the hash location option:
* ```ts
* const appRoutes: Routes = [];
* bootstrapApplication(AppComponent,
* {
* providers: [
* provideRouter(appRoutes, withHashLocation())
* ]
* }
* );
* ```
*
* @see {@link provideRouter}
* @see {@link /api/common/HashLocationStrategy HashLocationStrategy}
*
* @returns A set of providers for use with `provideRouter`.
*
* @publicApi
*/
declare function withHashLocation(): RouterHashLocationFeature;
/**
* A type alias for providers returned by `withNavigationErrorHandler` for use with `provideRouter`.
*
* @see {@link withNavigationErrorHandler}
* @see {@link provideRouter}
*
* @publicApi
*/
type NavigationErrorHandlerFeature = RouterFeature<RouterFeatureKind.NavigationErrorHandlerFeature>;
/**
* Provides a function which is called when a navigation error occurs.
*
* This function is run inside application's [injection context](guide/di/dependency-injection-context)
* so you can use the [`inject`](api/core/inject) function.
*
* This function can return a `RedirectCommand` to convert the error to a redirect, similar to returning
* a `UrlTree` or `RedirectCommand` from a guard. This will also prevent the `Router` from emitting
* `NavigationError`; it will instead emit `NavigationCancel` with code NavigationCancellationCode.Redirect.
* Return values other than `RedirectCommand` are ignored and do not change any behavior with respect to
* how the `Router` handles the error.
*
* @usageNotes
*
* Basic example of how you can use the error handler option:
* ```ts
* const appRoutes: Routes = [];
* bootstrapApplication(AppComponent,
* {
* providers: [
* provideRouter(appRoutes, withNavigationErrorHandler((e: NavigationError) =>
* inject(MyErrorTracker).trackError(e)))
* ]
* }
* );
* ```
*
* @see {@link NavigationError}
* @see {@link /api/core/inject inject}
* @see {@link runInInjectionContext}
*
* @returns A set of providers for use with `provideRouter`.
*
* @publicApi
*/
declare function withNavigationErrorHandler(handler: (error: NavigationError) => unknown | RedirectCommand): NavigationErrorHandlerFeature;
/**
* A type alias for providers returned by `withComponentInputBinding` for use with `provideRouter`.
*
* @see {@link withComponentInputBinding}
* @see {@link provideRouter}
*
* @publicApi
*/
type ComponentInputBindingFeature = RouterFeature<RouterFeatureKind.ComponentInputBindingFeature>;
/**
* A type alias for providers returned by `withViewTransitions` for use with `provideRouter`.
*
* @see {@link withViewTransitions}
* @see {@link provideRouter}
*
* @publicApi
*/
type ViewTransitionsFeature = RouterFeature<RouterFeatureKind.ViewTransitionsFeature>;
/**
* Enables binding information from the `Router` state directly to the inputs of the component in
* `Route` configurations.
*
* @usageNotes
*
* Basic example of how you can enable the feature:
* ```ts
* const appRoutes: Routes = [];
* bootstrapApplication(AppComponent,
* {
* providers: [
* provideRouter(appRoutes, withComponentInputBinding())
* ]
* }
* );
* ```
*
* The router bindings information from any of the following sources:
*
* - query parameters
* - path and matrix parameters
* - static route data
* - data from resolvers
*
* Duplicate keys are resolved in the same order from above, from least to greatest,
* meaning that resolvers have the highest precedence and override any of the other information
* from the route.
*
* Importantly, when an input does not have an item in the route data with a matching key, this
* input is set to `undefined`. This prevents previous information from being
* retained if the data got removed from the route (i.e. if a query parameter is removed).
* Default values can be provided with a resolver on the route to ensure the value is always present
* or an input and use an input transform in the component.
*
* @see {@link /guide/components/inputs#input-transforms Input Transforms}
* @returns A set of providers for use with `provideRouter`.
*/
declare function withComponentInputBinding(): ComponentInputBindingFeature;
/**
* Enables view transitions in the Router by running the route activation and deactivation inside of
* `document.startViewTransition`.
*
* Note: The View Transitions API is not available in all browsers. If the browser does not support
* view transitions, the Router will not attempt to start a view transition and continue processing
* the navigation as usual.
*
* @usageNotes
*
* Basic example of how you can enable the feature:
* ```ts
* const appRoutes: Routes = [];
* bootstrapApplication(AppComponent,
* {
* providers: [
* provideRouter(appRoutes, withViewTransitions())
* ]
* }
* );
* ```
*
* @returns A set of providers for use with `provideRouter`.
* @see https://developer.chrome.com/docs/web-platform/view-transitions/
* @see https://developer.mozilla.org/en-US/docs/Web/API/View_Transitions_API
* @developerPreview 19.0
*/
declare function withViewTransitions(options?: ViewTransitionsFeatureOptions): ViewTransitionsFeature;
/**
* A type alias that represents all Router features available for use with `provideRouter`.
* Features can be enabled by adding special functions to the `provideRouter` call.
* See documentation for each symbol to find corresponding function name. See also `provideRouter`
* documentation on how to use those functions.
*
* @see {@link provideRouter}
*
* @publicApi
*/
type RouterFeatures = PreloadingFeature | DebugTracingFeature | InitialNavigationFeature | InMemoryScrollingFeature | RouterConfigurationFeature | NavigationErrorHandlerFeature | ComponentInputBindingFeature | ViewTransitionsFeature | RouterHashLocationFeature;
/**
* The list of features as an enum to uniquely type each feature.
*/
declare const enum RouterFeatureKind {
PreloadingFeature = 0,
DebugTracingFeature = 1,
EnabledBlockingInitialNavigationFeature = 2,
DisabledInitialNavigationFeature = 3,
InMemoryScrollingFeature = 4,
RouterConfigurationFeature = 5,
RouterHashLocationFeature = 6,
NavigationErrorHandlerFeature = 7,
ComponentInputBindingFeature = 8,
ViewTransitionsFeature = 9
}
/**
* @description
*
* Provides a way to migrate AngularJS applications to Angular.
*
* @publicApi
*/
declare abstract class UrlHandlingStrategy {
/**
* Tells the router if this URL should be processed.
*
* When it returns true, the router will execute the regular navigation.
* When it returns false, the router will set the router state to an empty state.
* As a result, all the active components will be destroyed.
*
*/
abstract shouldProcessUrl(url: UrlTree): boolean;
/**
* Extracts the part of the URL that should be handled by the router.
* The rest of the URL will remain untouched.
*/
abstract extract(url: UrlTree): UrlTree;
/**
* Merges the URL fragment with the rest of the URL.
*/
abstract merge(newUrlPart: UrlTree, rawUrl: UrlTree): UrlTree;
static ɵfac: i0.ɵɵFactoryDeclaration<UrlHandlingStrategy, never>;
static ɵprov: i0.ɵɵInjectableDeclaration<UrlHandlingStrategy>;
}
/**
* Maps an array of injectable classes with canMatch functions to an array of equivalent
* `CanMatchFn` for use in a `Route` definition.
*
* Usage {@example router/utils/functional_guards.ts region='CanActivate'}
*
* @publicApi
* @see {@link Route}
*/
declare function mapToCanMatch(providers: Array<Type<CanMatch>>): CanMatchFn[];
/**
* Maps an array of injectable classes with canActivate functions to an array of equivalent
* `CanActivateFn` for use in a `Route` definition.
*
* Usage {@example router/utils/functional_guards.ts region='CanActivate'}
*
* @publicApi
* @see {@link Route}
*/
declare function mapToCanActivate(providers: Array<Type<CanActivate>>): CanActivateFn[];
/**
* Maps an array of injectable classes with canActivateChild functions to an array of equivalent
* `CanActivateChildFn` for use in a `Route` definition.
*
* Usage {@example router/utils/functional_guards.ts region='CanActivate'}
*
* @publicApi
* @see {@link Route}
*/
declare function mapToCanActivateChild(providers: Array<Type<CanActivateChild>>): CanActivateChildFn[];
/**
* Maps an array of injectable classes with canDeactivate functions to an array of equivalent
* `CanDeactivateFn` for use in a `Route` definition.
*
* Usage {@example router/utils/functional_guards.ts region='CanActivate'}
*
* @publicApi
* @see {@link Route}
*/
declare function mapToCanDeactivate<T = unknown>(providers: Array<Type<CanDeactivate<T>>>): CanDeactivateFn<T>[];
/**
* Maps an injectable class with a resolve function to an equivalent `ResolveFn`
* for use in a `Route` definition.
*
* Usage {@example router/utils/functional_guards.ts region='Resolve'}
*
* @publicApi
* @see {@link Route}
*/
declare function mapToResolve<T>(provider: Type<Resolve<T>>): ResolveFn<T>;
/**
* @module
* @description
* Entry point for all public APIs of the router package.
*/
/**
* @publicApi
*/
declare const VERSION: Version;
/**
* Performs the given action once the router finishes its next/current navigation.
*
* The navigation is considered complete under the following conditions:
* - `NavigationCancel` event emits and the code is not `NavigationCancellationCode.Redirect` or
* `NavigationCancellationCode.SupersededByNewNavigation`. In these cases, the
* redirecting/superseding navigation must finish.
* - `NavigationError`, `NavigationEnd`, or `NavigationSkipped` event emits
*/
declare function afterNextNavigation(router: {
events: Observable<Event>;
}, action: () => void): void;
export { ActivatedRoute, ActivatedRouteSnapshot, CanActivate, CanActivateChild, CanActivateChildFn, CanActivateFn, CanDeactivate, CanDeactivateFn, CanMatch, CanMatchFn, ChildrenOutletContexts, DefaultTitleStrategy, Event, InMemoryScrollingOptions, NavigationError, NoPreloading, OutletContext, Params, PreloadAllModules, PreloadingStrategy, ROUTES, RedirectCommand, Resolve, ResolveFn, Route, Router, RouterConfigOptions, RouterOutletContract, RouterPreloader, RouterStateSnapshot, Routes, TitleStrategy, UrlHandlingStrategy, UrlTree, VERSION, createUrlTreeFromSnapshot, mapToCanActivate, mapToCanActivateChild, mapToCanDeactivate, mapToCanMatch, mapToResolve, provideRouter, provideRoutes, withComponentInputBinding, withDebugTracing, withDisabledInitialNavigation, withEnabledBlockingInitialNavigation, withHashLocation, withInMemoryScrolling, withNavigationErrorHandler, withPreloading, withRouterConfig, withViewTransitions, afterNextNavigation as ɵafterNextNavigation, loadChildren as ɵloadChildren };
export type { ComponentInputBindingFeature, DebugTracingFeature, DisabledInitialNavigationFeature, EnabledBlockingInitialNavigationFeature, InMemoryScrollingFeature, InitialNavigationFeature, NavigationErrorHandlerFeature, PreloadingFeature, RouterConfigurationFeature, RouterFeature, RouterFeatures, RouterHashLocationFeature, ViewTransitionInfo, ViewTransitionsFeature, ViewTransitionsFeatureOptions };

73
node_modules/@angular/router/package.json generated vendored Executable file
View File

@@ -0,0 +1,73 @@
{
"name": "@angular/router",
"version": "20.3.11",
"description": "Angular - the routing library",
"keywords": [
"angular",
"router"
],
"repository": {
"type": "git",
"url": "git+https://github.com/angular/angular.git",
"directory": "packages/router"
},
"author": "angular",
"license": "MIT",
"engines": {
"node": "^20.19.0 || ^22.12.0 || >=24.0.0"
},
"bugs": {
"url": "https://github.com/angular/angular/issues"
},
"homepage": "https://github.com/angular/angular/tree/main/packages/router",
"dependencies": {
"tslib": "^2.3.0"
},
"peerDependencies": {
"@angular/core": "20.3.11",
"@angular/common": "20.3.11",
"@angular/platform-browser": "20.3.11",
"rxjs": "^6.5.3 || ^7.4.0"
},
"ng-update": {
"packageGroup": [
"@angular/core",
"@angular/bazel",
"@angular/common",
"@angular/compiler",
"@angular/compiler-cli",
"@angular/animations",
"@angular/elements",
"@angular/platform-browser",
"@angular/platform-browser-dynamic",
"@angular/forms",
"@angular/platform-server",
"@angular/upgrade",
"@angular/router",
"@angular/language-service",
"@angular/localize",
"@angular/service-worker"
]
},
"sideEffects": false,
"module": "./fesm2022/router.mjs",
"typings": "./index.d.ts",
"type": "module",
"exports": {
"./package.json": {
"default": "./package.json"
},
".": {
"types": "./index.d.ts",
"default": "./fesm2022/router.mjs"
},
"./testing": {
"types": "./testing/index.d.ts",
"default": "./fesm2022/testing.mjs"
},
"./upgrade": {
"types": "./upgrade/index.d.ts",
"default": "./fesm2022/upgrade.mjs"
}
}
}

3973
node_modules/@angular/router/router_module.d.d.ts generated vendored Executable file

File diff suppressed because it is too large Load Diff

123
node_modules/@angular/router/testing/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,123 @@
/**
* @license Angular v20.3.11
* (c) 2010-2025 Google LLC. https://angular.dev/
* License: MIT
*/
import * as i0 from '@angular/core';
import { ModuleWithProviders, WritableSignal, DebugElement, Type } from '@angular/core';
import { Routes, ExtraOptions, RouterModule } from '../router_module.d.js';
export { ɵEmptyOutletComponent as ɵɵEmptyOutletComponent, RouterLink as ɵɵRouterLink, RouterLinkActive as ɵɵRouterLinkActive, RouterOutlet as ɵɵRouterOutlet } from '../router_module.d.js';
import { ComponentFixture } from '@angular/core/testing';
import 'rxjs';
import '@angular/common';
/**
* @description
*
* Sets up the router to be used for testing.
*
* The modules sets up the router to be used for testing.
* It provides spy implementations of `Location` and `LocationStrategy`.
*
* @usageNotes
* ### Example
*
* ```ts
* beforeEach(() => {
* TestBed.configureTestingModule({
* imports: [
* RouterModule.forRoot(
* [{path: '', component: BlankCmp}, {path: 'simple', component: SimpleCmp}]
* )
* ]
* });
* });
* ```
*
* @publicApi
* @deprecated Use `provideRouter` or `RouterModule`/`RouterModule.forRoot` instead.
* This module was previously used to provide a helpful collection of test fakes,
* most notably those for `Location` and `LocationStrategy`. These are generally not
* required anymore, as `MockPlatformLocation` is provided in `TestBed` by default.
* However, you can use them directly with `provideLocationMocks`.
*/
declare class RouterTestingModule {
static withRoutes(routes: Routes, config?: ExtraOptions): ModuleWithProviders<RouterTestingModule>;
static ɵfac: i0.ɵɵFactoryDeclaration<RouterTestingModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<RouterTestingModule, never, never, [typeof RouterModule]>;
static ɵinj: i0.ɵɵInjectorDeclaration<RouterTestingModule>;
}
/**
* A testing harness for the `Router` to reduce the boilerplate needed to test routes and routed
* components.
*
* @publicApi
*/
declare class RouterTestingHarness {
/**
* Creates a `RouterTestingHarness` instance.
*
* The `RouterTestingHarness` also creates its own root component with a `RouterOutlet` for the
* purposes of rendering route components.
*
* Throws an error if an instance has already been created.
* Use of this harness also requires `destroyAfterEach: true` in the `ModuleTeardownOptions`
*
* @param initialUrl The target of navigation to trigger before returning the harness.
*/
static create(initialUrl?: string): Promise<RouterTestingHarness>;
/**
* Fixture of the root component of the RouterTestingHarness
*/
readonly fixture: ComponentFixture<{
routerOutletData: WritableSignal<unknown>;
}>;
/** Instructs the root fixture to run change detection. */
detectChanges(): void;
/** The `DebugElement` of the `RouterOutlet` component. `null` if the outlet is not activated. */
get routeDebugElement(): DebugElement | null;
/** The native element of the `RouterOutlet` component. `null` if the outlet is not activated. */
get routeNativeElement(): HTMLElement | null;
/**
* Triggers a `Router` navigation and waits for it to complete.
*
* The root component with a `RouterOutlet` created for the harness is used to render `Route`
* components. The root component is reused within the same test in subsequent calls to
* `navigateForTest`.
*
* When testing `Routes` with a guards that reject the navigation, the `RouterOutlet` might not be
* activated and the `activatedComponent` may be `null`.
*
* {@example router/testing/test/router_testing_harness_examples.spec.ts region='Guard'}
*
* @param url The target of the navigation. Passed to `Router.navigateByUrl`.
* @returns The activated component instance of the `RouterOutlet` after navigation completes
* (`null` if the outlet does not get activated).
*/
navigateByUrl(url: string): Promise<null | {}>;
/**
* Triggers a router navigation and waits for it to complete.
*
* The root component with a `RouterOutlet` created for the harness is used to render `Route`
* components.
*
* {@example router/testing/test/router_testing_harness_examples.spec.ts region='RoutedComponent'}
*
* The root component is reused within the same test in subsequent calls to `navigateByUrl`.
*
* This function also makes it easier to test components that depend on `ActivatedRoute` data.
*
* {@example router/testing/test/router_testing_harness_examples.spec.ts region='ActivatedRoute'}
*
* @param url The target of the navigation. Passed to `Router.navigateByUrl`.
* @param requiredRoutedComponentType After navigation completes, the required type for the
* activated component of the `RouterOutlet`. If the outlet is not activated or a different
* component is activated, this function will throw an error.
* @returns The activated component instance of the `RouterOutlet` after navigation completes.
*/
navigateByUrl<T>(url: string, requiredRoutedComponentType: Type<T>): Promise<T>;
}
export { RouterTestingHarness, RouterTestingModule };

61
node_modules/@angular/router/upgrade/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,61 @@
/**
* @license Angular v20.3.11
* (c) 2010-2025 Google LLC. https://angular.dev/
* License: MIT
*/
import { InjectionToken, ComponentRef } from '@angular/core';
import { UpgradeModule } from '@angular/upgrade/static';
/**
* Creates an initializer that sets up `ngRoute` integration
* along with setting up the Angular router.
*
* @usageNotes
*
* For standalone applications:
* ```ts
* export const appConfig: ApplicationConfig = {
* providers: [RouterUpgradeInitializer],
* };
* ```
*
* For NgModule based applications:
* ```ts
* @NgModule({
* imports: [
* RouterModule.forRoot(SOME_ROUTES),
* UpgradeModule
* ],
* providers: [
* RouterUpgradeInitializer
* ]
* })
* export class AppModule {
* ngDoBootstrap() {}
* }
* ```
*
* @publicApi
*/
declare const RouterUpgradeInitializer: {
provide: InjectionToken<readonly ((compRef: ComponentRef<any>) => void)[]>;
multi: boolean;
useFactory: (ngUpgrade: UpgradeModule) => () => void;
deps: (typeof UpgradeModule)[];
};
/**
* Sets up a location change listener to trigger `history.pushState`.
* Works around the problem that `onPopState` does not trigger `history.pushState`.
* Must be called *after* calling `UpgradeModule.bootstrap`.
*
* @param ngUpgrade The upgrade NgModule.
* @param urlType The location strategy.
* @see {@link /api/common/HashLocationStrategy HashLocationStrategy}
* @see {@link /api/common/PathLocationStrategy PathLocationStrategy}
*
* @publicApi
*/
declare function setUpLocationSync(ngUpgrade: UpgradeModule, urlType?: 'path' | 'hash'): void;
export { RouterUpgradeInitializer, setUpLocationSync };