/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ export const IMPERATIVE_NAVIGATION = 'imperative'; /** * Base for events the router goes through, as opposed to events tied to a specific * route. Fired one time for any given navigation. * * The following code shows how a class subscribes to router events. * * ```ts * import {Event, RouterEvent, Router} from '@angular/router'; * * class MyService { * constructor(public router: Router) { * router.events.pipe( * filter((e: Event | RouterEvent): e is RouterEvent => e instanceof RouterEvent) * ).subscribe((e: RouterEvent) => { * // Do something * }); * } * } * ``` * * @see {@link Event} * @see [Router events summary](guide/router-reference#router-events) * @publicApi */ export class RouterEvent { constructor( /** A unique ID that the router assigns to every router navigation. */ id, /** The URL that is the destination for this navigation. */ url) { this.id = id; this.url = url; } } /** * An event triggered when a navigation starts. * * @publicApi */ export class NavigationStart extends RouterEvent { constructor( /** @docsNotRequired */ id, /** @docsNotRequired */ url, /** @docsNotRequired */ navigationTrigger = 'imperative', /** @docsNotRequired */ restoredState = null) { super(id, url); this.type = 0 /* EventType.NavigationStart */; this.navigationTrigger = navigationTrigger; this.restoredState = restoredState; } /** @docsNotRequired */ toString() { return `NavigationStart(id: ${this.id}, url: '${this.url}')`; } } /** * An event triggered when a navigation ends successfully. * * @see {@link NavigationStart} * @see {@link NavigationCancel} * @see {@link NavigationError} * * @publicApi */ export class NavigationEnd extends RouterEvent { constructor( /** @docsNotRequired */ id, /** @docsNotRequired */ url, /** @docsNotRequired */ urlAfterRedirects) { super(id, url); this.urlAfterRedirects = urlAfterRedirects; this.type = 1 /* EventType.NavigationEnd */; } /** @docsNotRequired */ toString() { return `NavigationEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}')`; } } /** * An event triggered when a navigation is canceled, directly or indirectly. * This can happen for several reasons including when a route guard * returns `false` or initiates a redirect by returning a `UrlTree`. * * @see {@link NavigationStart} * @see {@link NavigationEnd} * @see {@link NavigationError} * * @publicApi */ export class NavigationCancel extends RouterEvent { constructor( /** @docsNotRequired */ id, /** @docsNotRequired */ url, /** * A description of why the navigation was cancelled. For debug purposes only. Use `code` * instead for a stable cancellation reason that can be used in production. */ reason, /** * A code to indicate why the navigation was canceled. This cancellation code is stable for * the reason and can be relied on whereas the `reason` string could change and should not be * used in production. */ code) { super(id, url); this.reason = reason; this.code = code; this.type = 2 /* EventType.NavigationCancel */; } /** @docsNotRequired */ toString() { return `NavigationCancel(id: ${this.id}, url: '${this.url}')`; } } /** * An event triggered when a navigation is skipped. * This can happen for a couple reasons including onSameUrlHandling * is set to `ignore` and the navigation URL is not different than the * current state. * * @publicApi */ export class NavigationSkipped extends RouterEvent { constructor( /** @docsNotRequired */ id, /** @docsNotRequired */ url, /** * A description of why the navigation was skipped. For debug purposes only. Use `code` * instead for a stable skipped reason that can be used in production. */ reason, /** * A code to indicate why the navigation was skipped. This code is stable for * the reason and can be relied on whereas the `reason` string could change and should not be * used in production. */ code) { super(id, url); this.reason = reason; this.code = code; this.type = 16 /* EventType.NavigationSkipped */; } } /** * An event triggered when a navigation fails due to an unexpected error. * * @see {@link NavigationStart} * @see {@link NavigationEnd} * @see {@link NavigationCancel} * * @publicApi */ export class NavigationError extends RouterEvent { constructor( /** @docsNotRequired */ id, /** @docsNotRequired */ url, /** @docsNotRequired */ error, /** * The target of the navigation when the error occurred. * * Note that this can be `undefined` because an error could have occurred before the * `RouterStateSnapshot` was created for the navigation. */ target) { super(id, url); this.error = error; this.target = target; this.type = 3 /* EventType.NavigationError */; } /** @docsNotRequired */ toString() { return `NavigationError(id: ${this.id}, url: '${this.url}', error: ${this.error})`; } } /** * An event triggered when routes are recognized. * * @publicApi */ export class RoutesRecognized extends RouterEvent { constructor( /** @docsNotRequired */ id, /** @docsNotRequired */ url, /** @docsNotRequired */ urlAfterRedirects, /** @docsNotRequired */ state) { super(id, url); this.urlAfterRedirects = urlAfterRedirects; this.state = state; this.type = 4 /* EventType.RoutesRecognized */; } /** @docsNotRequired */ toString() { return `RoutesRecognized(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`; } } /** * An event triggered at the start of the Guard phase of routing. * * @see {@link GuardsCheckEnd} * * @publicApi */ export class GuardsCheckStart extends RouterEvent { constructor( /** @docsNotRequired */ id, /** @docsNotRequired */ url, /** @docsNotRequired */ urlAfterRedirects, /** @docsNotRequired */ state) { super(id, url); this.urlAfterRedirects = urlAfterRedirects; this.state = state; this.type = 7 /* EventType.GuardsCheckStart */; } toString() { return `GuardsCheckStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`; } } /** * An event triggered at the end of the Guard phase of routing. * * @see {@link GuardsCheckStart} * * @publicApi */ export class GuardsCheckEnd extends RouterEvent { constructor( /** @docsNotRequired */ id, /** @docsNotRequired */ url, /** @docsNotRequired */ urlAfterRedirects, /** @docsNotRequired */ state, /** @docsNotRequired */ shouldActivate) { super(id, url); this.urlAfterRedirects = urlAfterRedirects; this.state = state; this.shouldActivate = shouldActivate; this.type = 8 /* EventType.GuardsCheckEnd */; } toString() { return `GuardsCheckEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state}, shouldActivate: ${this.shouldActivate})`; } } /** * An event triggered at the start of the Resolve phase of routing. * * Runs in the "resolve" phase whether or not there is anything to resolve. * In future, may change to only run when there are things to be resolved. * * @see {@link ResolveEnd} * * @publicApi */ export class ResolveStart extends RouterEvent { constructor( /** @docsNotRequired */ id, /** @docsNotRequired */ url, /** @docsNotRequired */ urlAfterRedirects, /** @docsNotRequired */ state) { super(id, url); this.urlAfterRedirects = urlAfterRedirects; this.state = state; this.type = 5 /* EventType.ResolveStart */; } toString() { return `ResolveStart(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`; } } /** * An event triggered at the end of the Resolve phase of routing. * @see {@link ResolveStart} * * @publicApi */ export class ResolveEnd extends RouterEvent { constructor( /** @docsNotRequired */ id, /** @docsNotRequired */ url, /** @docsNotRequired */ urlAfterRedirects, /** @docsNotRequired */ state) { super(id, url); this.urlAfterRedirects = urlAfterRedirects; this.state = state; this.type = 6 /* EventType.ResolveEnd */; } toString() { return `ResolveEnd(id: ${this.id}, url: '${this.url}', urlAfterRedirects: '${this.urlAfterRedirects}', state: ${this.state})`; } } /** * An event triggered before lazy loading a route configuration. * * @see {@link RouteConfigLoadEnd} * * @publicApi */ export class RouteConfigLoadStart { constructor( /** @docsNotRequired */ route) { this.route = route; this.type = 9 /* EventType.RouteConfigLoadStart */; } toString() { return `RouteConfigLoadStart(path: ${this.route.path})`; } } /** * An event triggered when a route has been lazy loaded. * * @see {@link RouteConfigLoadStart} * * @publicApi */ export class RouteConfigLoadEnd { constructor( /** @docsNotRequired */ route) { this.route = route; this.type = 10 /* EventType.RouteConfigLoadEnd */; } toString() { return `RouteConfigLoadEnd(path: ${this.route.path})`; } } /** * An event triggered at the start of the child-activation * part of the Resolve phase of routing. * @see {@link ChildActivationEnd} * @see {@link ResolveStart} * * @publicApi */ export class ChildActivationStart { constructor( /** @docsNotRequired */ snapshot) { this.snapshot = snapshot; this.type = 11 /* EventType.ChildActivationStart */; } toString() { const path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || ''; return `ChildActivationStart(path: '${path}')`; } } /** * An event triggered at the end of the child-activation part * of the Resolve phase of routing. * @see {@link ChildActivationStart} * @see {@link ResolveStart} * @publicApi */ export class ChildActivationEnd { constructor( /** @docsNotRequired */ snapshot) { this.snapshot = snapshot; this.type = 12 /* EventType.ChildActivationEnd */; } toString() { const path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || ''; return `ChildActivationEnd(path: '${path}')`; } } /** * An event triggered at the start of the activation part * of the Resolve phase of routing. * @see {@link ActivationEnd} * @see {@link ResolveStart} * * @publicApi */ export class ActivationStart { constructor( /** @docsNotRequired */ snapshot) { this.snapshot = snapshot; this.type = 13 /* EventType.ActivationStart */; } toString() { const path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || ''; return `ActivationStart(path: '${path}')`; } } /** * An event triggered at the end of the activation part * of the Resolve phase of routing. * @see {@link ActivationStart} * @see {@link ResolveStart} * * @publicApi */ export class ActivationEnd { constructor( /** @docsNotRequired */ snapshot) { this.snapshot = snapshot; this.type = 14 /* EventType.ActivationEnd */; } toString() { const path = this.snapshot.routeConfig && this.snapshot.routeConfig.path || ''; return `ActivationEnd(path: '${path}')`; } } /** * An event triggered by scrolling. * * @publicApi */ export class Scroll { constructor( /** @docsNotRequired */ routerEvent, /** @docsNotRequired */ position, /** @docsNotRequired */ anchor) { this.routerEvent = routerEvent; this.position = position; this.anchor = anchor; this.type = 15 /* EventType.Scroll */; } toString() { const pos = this.position ? `${this.position[0]}, ${this.position[1]}` : null; return `Scroll(anchor: '${this.anchor}', position: '${pos}')`; } } export class BeforeActivateRoutes { } export class RedirectRequest { constructor(url) { this.url = url; } } export function stringifyEvent(routerEvent) { switch (routerEvent.type) { case 14 /* EventType.ActivationEnd */: return `ActivationEnd(path: '${routerEvent.snapshot.routeConfig?.path || ''}')`; case 13 /* EventType.ActivationStart */: return `ActivationStart(path: '${routerEvent.snapshot.routeConfig?.path || ''}')`; case 12 /* EventType.ChildActivationEnd */: return `ChildActivationEnd(path: '${routerEvent.snapshot.routeConfig?.path || ''}')`; case 11 /* EventType.ChildActivationStart */: return `ChildActivationStart(path: '${routerEvent.snapshot.routeConfig?.path || ''}')`; case 8 /* EventType.GuardsCheckEnd */: return `GuardsCheckEnd(id: ${routerEvent.id}, url: '${routerEvent.url}', urlAfterRedirects: '${routerEvent.urlAfterRedirects}', state: ${routerEvent.state}, shouldActivate: ${routerEvent.shouldActivate})`; case 7 /* EventType.GuardsCheckStart */: return `GuardsCheckStart(id: ${routerEvent.id}, url: '${routerEvent.url}', urlAfterRedirects: '${routerEvent.urlAfterRedirects}', state: ${routerEvent.state})`; case 2 /* EventType.NavigationCancel */: return `NavigationCancel(id: ${routerEvent.id}, url: '${routerEvent.url}')`; case 16 /* EventType.NavigationSkipped */: return `NavigationSkipped(id: ${routerEvent.id}, url: '${routerEvent.url}')`; case 1 /* EventType.NavigationEnd */: return `NavigationEnd(id: ${routerEvent.id}, url: '${routerEvent.url}', urlAfterRedirects: '${routerEvent.urlAfterRedirects}')`; case 3 /* EventType.NavigationError */: return `NavigationError(id: ${routerEvent.id}, url: '${routerEvent.url}', error: ${routerEvent.error})`; case 0 /* EventType.NavigationStart */: return `NavigationStart(id: ${routerEvent.id}, url: '${routerEvent.url}')`; case 6 /* EventType.ResolveEnd */: return `ResolveEnd(id: ${routerEvent.id}, url: '${routerEvent.url}', urlAfterRedirects: '${routerEvent.urlAfterRedirects}', state: ${routerEvent.state})`; case 5 /* EventType.ResolveStart */: return `ResolveStart(id: ${routerEvent.id}, url: '${routerEvent.url}', urlAfterRedirects: '${routerEvent.urlAfterRedirects}', state: ${routerEvent.state})`; case 10 /* EventType.RouteConfigLoadEnd */: return `RouteConfigLoadEnd(path: ${routerEvent.route.path})`; case 9 /* EventType.RouteConfigLoadStart */: return `RouteConfigLoadStart(path: ${routerEvent.route.path})`; case 4 /* EventType.RoutesRecognized */: return `RoutesRecognized(id: ${routerEvent.id}, url: '${routerEvent.url}', urlAfterRedirects: '${routerEvent.urlAfterRedirects}', state: ${routerEvent.state})`; case 15 /* EventType.Scroll */: const pos = routerEvent.position ? `${routerEvent.position[0]}, ${routerEvent.position[1]}` : null; return `Scroll(anchor: '${routerEvent.anchor}', position: '${pos}')`; } } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZlbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvcm91dGVyL3NyYy9ldmVudHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBZ0JILE1BQU0sQ0FBQyxNQUFNLHFCQUFxQixHQUFHLFlBQVksQ0FBQztBQT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