angular-cn/goldens/public-api/router/router.md

795 lines
22 KiB
Markdown
Raw Normal View History

## API Report File for "@angular/router"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { AfterContentInit } from '@angular/core';
import { ChangeDetectorRef } from '@angular/core';
import { Compiler } from '@angular/core';
import { ComponentFactoryResolver } from '@angular/core';
import { ComponentRef } from '@angular/core';
import { ElementRef } from '@angular/core';
import { EventEmitter } from '@angular/core';
import { InjectionToken } from '@angular/core';
import { Injector } from '@angular/core';
import { Location as Location_2 } from '@angular/common';
import { LocationStrategy } from '@angular/common';
import { ModuleWithProviders } from '@angular/core';
import { NgModuleFactory } from '@angular/core';
import { NgModuleFactoryLoader } from '@angular/core';
import { Observable } from 'rxjs';
import { OnChanges } from '@angular/core';
import { OnDestroy } from '@angular/core';
import { OnInit } from '@angular/core';
import { QueryList } from '@angular/core';
import { Renderer2 } from '@angular/core';
import { SimpleChanges } from '@angular/core';
import { Type } from '@angular/core';
import { Version } from '@angular/core';
import { ViewContainerRef } from '@angular/core';
// @public
export class ActivatedRoute {
get children(): ActivatedRoute[];
component: Type<any> | string | null;
data: Observable<Data>;
get firstChild(): ActivatedRoute | null;
fragment: Observable<string | null>;
outlet: string;
get paramMap(): Observable<ParamMap>;
params: Observable<Params>;
get parent(): ActivatedRoute | null;
get pathFromRoot(): ActivatedRoute[];
get queryParamMap(): Observable<ParamMap>;
queryParams: Observable<Params>;
get root(): ActivatedRoute;
get routeConfig(): Route | null;
snapshot: ActivatedRouteSnapshot;
// (undocumented)
toString(): string;
url: Observable<UrlSegment[]>;
}
// @public
export class ActivatedRouteSnapshot {
get children(): ActivatedRouteSnapshot[];
component: Type<any> | string | null;
data: Data;
get firstChild(): ActivatedRouteSnapshot | null;
fragment: string | null;
outlet: string;
// (undocumented)
get paramMap(): ParamMap;
params: Params;
get parent(): ActivatedRouteSnapshot | null;
get pathFromRoot(): ActivatedRouteSnapshot[];
// (undocumented)
get queryParamMap(): ParamMap;
queryParams: Params;
get root(): ActivatedRouteSnapshot;
readonly routeConfig: Route | null;
// (undocumented)
toString(): string;
url: UrlSegment[];
}
// @public
export class ActivationEnd {
constructor(
snapshot: ActivatedRouteSnapshot);
// (undocumented)
snapshot: ActivatedRouteSnapshot;
// (undocumented)
toString(): string;
}
// @public
export class ActivationStart {
constructor(
snapshot: ActivatedRouteSnapshot);
// (undocumented)
snapshot: ActivatedRouteSnapshot;
// (undocumented)
toString(): string;
}
// @public
export abstract class BaseRouteReuseStrategy implements RouteReuseStrategy {
retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle | null;
shouldAttach(route: ActivatedRouteSnapshot): boolean;
shouldDetach(route: ActivatedRouteSnapshot): boolean;
shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean;
store(route: ActivatedRouteSnapshot, detachedTree: DetachedRouteHandle): void;
}
// @public
export interface CanActivate {
// (undocumented)
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
}
// @public
export interface CanActivateChild {
// (undocumented)
canActivateChild(childRoute: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
}
// @public
export interface CanDeactivate<T> {
// (undocumented)
canDeactivate(component: T, currentRoute: ActivatedRouteSnapshot, currentState: RouterStateSnapshot, nextState?: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
}
// @public
export interface CanLoad {
// (undocumented)
canLoad(route: Route, segments: UrlSegment[]): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree;
2016-07-26 17:39:02 -04:00
}
// @public
export class ChildActivationEnd {
constructor(
snapshot: ActivatedRouteSnapshot);
// (undocumented)
snapshot: ActivatedRouteSnapshot;
// (undocumented)
toString(): string;
}
// @public
export class ChildActivationStart {
constructor(
snapshot: ActivatedRouteSnapshot);
// (undocumented)
snapshot: ActivatedRouteSnapshot;
// (undocumented)
toString(): string;
}
// @public
export class ChildrenOutletContexts {
// (undocumented)
getContext(childName: string): OutletContext | null;
// (undocumented)
getOrCreateContext(childName: string): OutletContext;
onChildOutletCreated(childName: string, outlet: RouterOutletContract): void;
onChildOutletDestroyed(childName: string): void;
onOutletDeactivated(): Map<string, OutletContext>;
// (undocumented)
onOutletReAttached(contexts: Map<string, OutletContext>): void;
}
// @public
export function convertToParamMap(params: Params): ParamMap;
// @public
export type Data = {
[name: string]: any;
};
// @public
export class DefaultUrlSerializer implements UrlSerializer {
parse(url: string): UrlTree;
serialize(tree: UrlTree): string;
}
// @public @deprecated
export type DeprecatedLoadChildren = string;
feat(router): deprecate loadChildren:string (#30073) The proposed ES dynamic import() is now supported by the Angular CLI and the larger toolchain. This renders the `loadChildren: string` API largely redundant, as import() is far more natural, is less error-prone, and is standards compliant. This commit deprecates the `string` form of `loadChildren` in favor of dynamic import(). DEPRECATION: When defining lazy-loaded route, Angular previously offered two options for configuring the module to be loaded, both via the `loadChildren` parameter of the route. Most Angular developers are familiar withthe `string` form of this API. For example, the following route definition configures Angular to load a `LazyModule` NgModule from `lazy-route/lazy.module.ts`: ``` [{ path: 'lazy', loadChildren: 'lazy-route/lazy.module#LazyModule', }] ``` This "magic string" configuration was previously necessary as there was no dynamic module loading standard on the web. This has changed with the pending standardization of dynamic `import()` expressions, which are now supported in the Angular CLI and in web tooling in general. `import()` offers a more natural and robust solution to dynamic module loading. The above example can be rewritten to use dynamic `import()`: ``` [{ path: 'lazy', loadChildren: () => import('./lazy-route/lazy.module').then(mod => mod.LazyModule), }] ``` This form of lazy loading offers significant advantages in terms of: * type checking via TypeScript * simplicity of generated code * future potential to run natively in supporting browsers (see: [caniuse: dynamic import()](https://caniuse.com/#feat=es6-module-dynamic-import)) As a result, Angular is deprecating the `loadChildren: string` syntax in favor of ES dynamic `import()`. An automatic migration will run during `ng upgrade` to convert your existing Angular code to the new syntax. PR Close #30073
2019-04-23 17:30:09 -04:00
// @public
export type DetachedRouteHandle = {};
// @public
type Event_2 = RouterEvent | RouteConfigLoadStart | RouteConfigLoadEnd | ChildActivationStart | ChildActivationEnd | ActivationStart | ActivationEnd | Scroll;
export { Event_2 as Event }
// @public
export interface ExtraOptions {
anchorScrolling?: 'disabled' | 'enabled';
enableTracing?: boolean;
errorHandler?: ErrorHandler;
initialNavigation?: InitialNavigation;
malformedUriErrorHandler?: (error: URIError, urlSerializer: UrlSerializer, url: string) => UrlTree;
onSameUrlNavigation?: 'reload' | 'ignore';
paramsInheritanceStrategy?: 'emptyOnly' | 'always';
2016-09-16 20:31:24 -04:00
preloadingStrategy?: any;
relativeLinkResolution?: 'legacy' | 'corrected';
scrollOffset?: [number, number] | (() => [number, number]);
scrollPositionRestoration?: 'disabled' | 'enabled' | 'top';
urlUpdateStrategy?: 'deferred' | 'eager';
useHash?: boolean;
}
// @public
export class GuardsCheckEnd extends RouterEvent {
constructor(
id: number,
url: string,
urlAfterRedirects: string,
state: RouterStateSnapshot,
shouldActivate: boolean);
// (undocumented)
shouldActivate: boolean;
// (undocumented)
state: RouterStateSnapshot;
// (undocumented)
toString(): string;
// (undocumented)
urlAfterRedirects: string;
}
// @public
export class GuardsCheckStart extends RouterEvent {
constructor(
id: number,
url: string,
urlAfterRedirects: string,
state: RouterStateSnapshot);
// (undocumented)
state: RouterStateSnapshot;
// (undocumented)
toString(): string;
// (undocumented)
urlAfterRedirects: string;
}
// @public
export type InitialNavigation = 'disabled' | 'enabled' | 'enabledBlocking' | 'enabledNonBlocking';
// @public
export interface IsActiveMatchOptions {
fragment: 'exact' | 'ignored';
matrixParams: 'exact' | 'subset' | 'ignored';
paths: 'exact' | 'subset';
queryParams: 'exact' | 'subset' | 'ignored';
}
// @public
export type LoadChildren = LoadChildrenCallback | DeprecatedLoadChildren;
// @public
export type LoadChildrenCallback = () => Type<any> | NgModuleFactory<any> | Observable<Type<any>> | Promise<NgModuleFactory<any> | Type<any> | any>;
// @public
export interface Navigation {
extractedUrl: UrlTree;
extras: NavigationExtras;
finalUrl?: UrlTree;
id: number;
initialUrl: string | UrlTree;
previousNavigation: Navigation | null;
trigger: 'imperative' | 'popstate' | 'hashchange';
}
// @public
export interface NavigationBehaviorOptions {
replaceUrl?: boolean;
skipLocationChange?: boolean;
state?: {
[k: string]: any;
};
}
// @public
export class NavigationCancel extends RouterEvent {
2016-09-12 13:02:48 -04:00
constructor(
id: number,
url: string,
reason: string);
// (undocumented)
reason: string;
// (undocumented)
toString(): string;
}
// @public
export class NavigationEnd extends RouterEvent {
2016-09-12 13:02:48 -04:00
constructor(
id: number,
url: string,
urlAfterRedirects: string);
// (undocumented)
toString(): string;
// (undocumented)
urlAfterRedirects: string;
}
// @public
export class NavigationError extends RouterEvent {
2016-09-12 13:02:48 -04:00
constructor(
id: number,
url: string,
error: any);
// (undocumented)
error: any;
// (undocumented)
toString(): string;
}
// @public
export interface NavigationExtras extends UrlCreationOptions, NavigationBehaviorOptions {
2016-07-18 19:42:33 -04:00
}
// @public
export class NavigationStart extends RouterEvent {
constructor(
id: number,
url: string,
navigationTrigger?: 'imperative' | 'popstate' | 'hashchange',
restoredState?: {
[k: string]: any;
navigationId: number;
} | null);
navigationTrigger?: 'imperative' | 'popstate' | 'hashchange';
restoredState?: {
[k: string]: any;
navigationId: number;
} | null;
// (undocumented)
toString(): string;
}
// @public
export class NoPreloading implements PreloadingStrategy {
// (undocumented)
2016-09-16 20:31:24 -04:00
preload(route: Route, fn: () => Observable<any>): Observable<any>;
}
// @public
export class OutletContext {
// (undocumented)
attachRef: ComponentRef<any> | null;
// (undocumented)
children: ChildrenOutletContexts;
// (undocumented)
outlet: RouterOutletContract | null;
// (undocumented)
resolver: ComponentFactoryResolver | null;
// (undocumented)
route: ActivatedRoute | null;
}
// @public
export interface ParamMap {
feat(router): introduce `ParamMap` to access parameters The Router use the type `Params` for all of: - position parameters, - matrix parameters, - query parameters. `Params` is defined as follow `type Params = {[key: string]: any}` Because parameters can either have single or multiple values, the type should actually be `type Params = {[key: string]: string | string[]}`. The client code often assumes that parameters have single values, as in the following exemple: ``` class MyComponent { sessionId: Observable<string>; constructor(private route: ActivatedRoute) {} ngOnInit() { this.sessionId = this.route .queryParams .map(params => params['session_id'] || 'None'); } } ``` The problem here is that `params['session_id']` could be `string` or `string[]` but the error is not caught at build time because of the `any` type. Fixing the type as describe above would break the build because `sessionId` would becomes an `Observable<string | string[]>`. However the client code knows if it expects a single or multiple values. By using the new `ParamMap` interface the user code can decide when it needs a single value (calling `ParamMap.get(): string`) or multiple values (calling `ParamMap.getAll(): string[]`). The above exemple should be rewritten as: ``` class MyComponent { sessionId: Observable<string>; constructor(private route: ActivatedRoute) {} ngOnInit() { this.sessionId = this.route .queryParamMap .map(paramMap => paramMap.get('session_id') || 'None'); } } ``` Added APIs: - `interface ParamMap`, - `ActivatedRoute.paramMap: ParamMap`, - `ActivatedRoute.queryParamMap: ParamMap`, - `ActivatedRouteSnapshot.paramMap: ParamMap`, - `ActivatedRouteSnapshot.queryParamMap: ParamMap`, - `UrlSegment.parameterMap: ParamMap`
2017-03-17 13:09:42 -04:00
get(name: string): string | null;
getAll(name: string): string[];
has(name: string): boolean;
readonly keys: string[];
feat(router): introduce `ParamMap` to access parameters The Router use the type `Params` for all of: - position parameters, - matrix parameters, - query parameters. `Params` is defined as follow `type Params = {[key: string]: any}` Because parameters can either have single or multiple values, the type should actually be `type Params = {[key: string]: string | string[]}`. The client code often assumes that parameters have single values, as in the following exemple: ``` class MyComponent { sessionId: Observable<string>; constructor(private route: ActivatedRoute) {} ngOnInit() { this.sessionId = this.route .queryParams .map(params => params['session_id'] || 'None'); } } ``` The problem here is that `params['session_id']` could be `string` or `string[]` but the error is not caught at build time because of the `any` type. Fixing the type as describe above would break the build because `sessionId` would becomes an `Observable<string | string[]>`. However the client code knows if it expects a single or multiple values. By using the new `ParamMap` interface the user code can decide when it needs a single value (calling `ParamMap.get(): string`) or multiple values (calling `ParamMap.getAll(): string[]`). The above exemple should be rewritten as: ``` class MyComponent { sessionId: Observable<string>; constructor(private route: ActivatedRoute) {} ngOnInit() { this.sessionId = this.route .queryParamMap .map(paramMap => paramMap.get('session_id') || 'None'); } } ``` Added APIs: - `interface ParamMap`, - `ActivatedRoute.paramMap: ParamMap`, - `ActivatedRoute.queryParamMap: ParamMap`, - `ActivatedRouteSnapshot.paramMap: ParamMap`, - `ActivatedRouteSnapshot.queryParamMap: ParamMap`, - `UrlSegment.parameterMap: ParamMap`
2017-03-17 13:09:42 -04:00
}
// @public
export type Params = {
[key: string]: any;
};
// @public
export class PreloadAllModules implements PreloadingStrategy {
// (undocumented)
2016-09-16 20:31:24 -04:00
preload(route: Route, fn: () => Observable<any>): Observable<any>;
}
// @public
export abstract class PreloadingStrategy {
// (undocumented)
2016-09-16 20:31:24 -04:00
abstract preload(route: Route, fn: () => Observable<any>): Observable<any>;
}
// @public
export const PRIMARY_OUTLET = "primary";
// @public
export function provideRoutes(routes: Routes): any;
2016-07-06 14:02:52 -04:00
// @public
export type QueryParamsHandling = 'merge' | 'preserve' | '';
// @public
export interface Resolve<T> {
// (undocumented)
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<T> | Promise<T> | T;
}
// @public
export type ResolveData = {
[name: string]: any;
};
// @public
export class ResolveEnd extends RouterEvent {
constructor(
id: number,
url: string,
urlAfterRedirects: string,
state: RouterStateSnapshot);
// (undocumented)
state: RouterStateSnapshot;
// (undocumented)
toString(): string;
// (undocumented)
urlAfterRedirects: string;
}
// @public
export class ResolveStart extends RouterEvent {
constructor(
id: number,
url: string,
urlAfterRedirects: string,
state: RouterStateSnapshot);
// (undocumented)
state: RouterStateSnapshot;
// (undocumented)
toString(): string;
// (undocumented)
urlAfterRedirects: string;
}
// @public
export interface Route {
2016-07-28 17:36:05 -04:00
canActivate?: any[];
canActivateChild?: any[];
canDeactivate?: any[];
canLoad?: any[];
children?: Routes;
component?: Type<any>;
2016-07-28 17:36:05 -04:00
data?: Data;
loadChildren?: LoadChildren;
matcher?: UrlMatcher;
2016-07-28 17:36:05 -04:00
outlet?: string;
path?: string;
2016-07-28 17:36:05 -04:00
pathMatch?: string;
redirectTo?: string;
resolve?: ResolveData;
runGuardsAndResolvers?: RunGuardsAndResolvers;
2016-07-28 17:36:05 -04:00
}
// @public
export class RouteConfigLoadEnd {
constructor(
route: Route);
// (undocumented)
route: Route;
// (undocumented)
toString(): string;
}
// @public
export class RouteConfigLoadStart {
constructor(
route: Route);
// (undocumented)
route: Route;
// (undocumented)
toString(): string;
}
// @public
export class Router {
constructor(rootComponentType: Type<any> | null, urlSerializer: UrlSerializer, rootContexts: ChildrenOutletContexts, location: Location_2, injector: Injector, loader: NgModuleFactoryLoader, compiler: Compiler, config: Routes);
// (undocumented)
config: Routes;
createUrlTree(commands: any[], navigationExtras?: UrlCreationOptions): UrlTree;
dispose(): void;
errorHandler: ErrorHandler;
readonly events: Observable<Event_2>;
getCurrentNavigation(): Navigation | null;
initialNavigation(): void;
// @deprecated
isActive(url: string | UrlTree, exact: boolean): boolean;
isActive(url: string | UrlTree, matchOptions: IsActiveMatchOptions): boolean;
malformedUriErrorHandler: (error: URIError, urlSerializer: UrlSerializer, url: string) => UrlTree;
navigate(commands: any[], extras?: NavigationExtras): Promise<boolean>;
navigateByUrl(url: string | UrlTree, extras?: NavigationBehaviorOptions): Promise<boolean>;
navigated: boolean;
// (undocumented)
ngOnDestroy(): void;
onSameUrlNavigation: 'reload' | 'ignore';
paramsInheritanceStrategy: 'emptyOnly' | 'always';
parseUrl(url: string): UrlTree;
relativeLinkResolution: 'legacy' | 'corrected';
2016-07-06 19:19:52 -04:00
resetConfig(config: Routes): void;
routeReuseStrategy: RouteReuseStrategy;
readonly routerState: RouterState;
serializeUrl(url: UrlTree): string;
setUpLocationChangeListener(): void;
get url(): string;
urlHandlingStrategy: UrlHandlingStrategy;
urlUpdateStrategy: 'deferred' | 'eager';
}
// @public
export const ROUTER_CONFIGURATION: InjectionToken<ExtraOptions>;
// @public
export const ROUTER_INITIALIZER: InjectionToken<(compRef: ComponentRef<any>) => void>;
// @public
export abstract class RouteReuseStrategy {
abstract retrieve(route: ActivatedRouteSnapshot): DetachedRouteHandle | null;
abstract shouldAttach(route: ActivatedRouteSnapshot): boolean;
abstract shouldDetach(route: ActivatedRouteSnapshot): boolean;
abstract shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean;
abstract store(route: ActivatedRouteSnapshot, handle: DetachedRouteHandle | null): void;
}
// @public
export class RouterEvent {
constructor(
id: number,
url: string);
id: number;
url: string;
}
// @public
export class RouterLink implements OnChanges {
constructor(router: Router, route: ActivatedRoute, tabIndex: string, renderer: Renderer2, el: ElementRef);
fragment?: string;
// (undocumented)
ngOnChanges(changes: SimpleChanges): void;
// (undocumented)
onClick(): boolean;
preserveFragment: boolean;
queryParams?: Params | null;
queryParamsHandling?: QueryParamsHandling | null;
relativeTo?: ActivatedRoute | null;
replaceUrl: boolean;
set routerLink(commands: any[] | string | null | undefined);
skipLocationChange: boolean;
state?: {
[k: string]: any;
};
// (undocumented)
get urlTree(): UrlTree;
}
// @public
export class RouterLinkActive implements OnChanges, OnDestroy, AfterContentInit {
constructor(router: Router, element: ElementRef, renderer: Renderer2, cdr: ChangeDetectorRef, link?: RouterLink | undefined, linkWithHref?: RouterLinkWithHref | undefined);
// (undocumented)
readonly isActive: boolean;
// (undocumented)
links: QueryList<RouterLink>;
// (undocumented)
linksWithHrefs: QueryList<RouterLinkWithHref>;
// (undocumented)
ngAfterContentInit(): void;
// (undocumented)
ngOnChanges(changes: SimpleChanges): void;
// (undocumented)
ngOnDestroy(): void;
// (undocumented)
set routerLinkActive(data: string[] | string);
routerLinkActiveOptions: {
exact: boolean;
} | IsActiveMatchOptions;
}
// @public
export class RouterLinkWithHref implements OnChanges, OnDestroy {
constructor(router: Router, route: ActivatedRoute, locationStrategy: LocationStrategy);
fragment?: string;
// (undocumented)
href: string;
// (undocumented)
ngOnChanges(changes: SimpleChanges): any;
// (undocumented)
ngOnDestroy(): any;
// (undocumented)
onClick(button: number, ctrlKey: boolean, shiftKey: boolean, altKey: boolean, metaKey: boolean): boolean;
preserveFragment: boolean;
queryParams?: Params | null;
queryParamsHandling?: QueryParamsHandling | null;
relativeTo?: ActivatedRoute | null;
replaceUrl: boolean;
set routerLink(commands: any[] | string | null | undefined);
skipLocationChange: boolean;
state?: {
[k: string]: any;
};
// (undocumented)
target: string;
// (undocumented)
get urlTree(): UrlTree;
}
// @public
export class RouterModule {
constructor(guard: any, router: Router);
static forChild(routes: Routes): ModuleWithProviders<RouterModule>;
static forRoot(routes: Routes, config?: ExtraOptions): ModuleWithProviders<RouterModule>;
}
// @public
export class RouterOutlet implements OnDestroy, OnInit, RouterOutletContract {
constructor(parentContexts: ChildrenOutletContexts, location: ViewContainerRef, resolver: ComponentFactoryResolver, name: string, changeDetector: ChangeDetectorRef);
// (undocumented)
get activatedRoute(): ActivatedRoute;
// (undocumented)
get activatedRouteData(): Data;
// (undocumented)
activateEvents: EventEmitter<any>;
// (undocumented)
activateWith(activatedRoute: ActivatedRoute, resolver: ComponentFactoryResolver | null): void;
attach(ref: ComponentRef<any>, activatedRoute: ActivatedRoute): void;
// (undocumented)
get component(): Object;
// (undocumented)
deactivate(): void;
// (undocumented)
deactivateEvents: EventEmitter<any>;
detach(): ComponentRef<any>;
// (undocumented)
get isActivated(): boolean;
// (undocumented)
ngOnDestroy(): void;
// (undocumented)
ngOnInit(): void;
}
// @public
export interface RouterOutletContract {
activatedRoute: ActivatedRoute | null;
activatedRouteData: Data;
activateWith(activatedRoute: ActivatedRoute, resolver: ComponentFactoryResolver | null): void;
attach(ref: ComponentRef<unknown>, activatedRoute: ActivatedRoute): void;
component: Object | null;
deactivate(): void;
detach(): ComponentRef<unknown>;
isActivated: boolean;
}
// @public
export class RouterPreloader implements OnDestroy {
constructor(router: Router, moduleLoader: NgModuleFactoryLoader, compiler: Compiler, injector: Injector, preloadingStrategy: PreloadingStrategy);
// (undocumented)
ngOnDestroy(): void;
// (undocumented)
preload(): Observable<any>;
// (undocumented)
setUpPreloading(): void;
}
// @public
export class RouterState extends ɵangular_packages_router_router_m<ActivatedRoute> {
snapshot: RouterStateSnapshot;
// (undocumented)
toString(): string;
}
// @public
export class RouterStateSnapshot extends ɵangular_packages_router_router_m<ActivatedRouteSnapshot> {
// (undocumented)
toString(): string;
url: string;
}
// @public
export const ROUTES: InjectionToken<Route[][]>;
2016-07-06 19:19:52 -04:00
// @public
export type Routes = Route[];
// @public
export class RoutesRecognized extends RouterEvent {
2016-09-12 13:02:48 -04:00
constructor(
id: number,
url: string,
urlAfterRedirects: string,
state: RouterStateSnapshot);
// (undocumented)
state: RouterStateSnapshot;
// (undocumented)
toString(): string;
// (undocumented)
urlAfterRedirects: string;
}
// @public
export type RunGuardsAndResolvers = 'pathParamsChange' | 'pathParamsOrQueryParamsChange' | 'paramsChange' | 'paramsOrQueryParamsChange' | 'always' | ((from: ActivatedRouteSnapshot, to: ActivatedRouteSnapshot) => boolean);
// @public
export class Scroll {
constructor(
routerEvent: NavigationEnd,
position: [number, number] | null,
anchor: string | null);
// (undocumented)
readonly anchor: string | null;
// (undocumented)
readonly position: [number, number] | null;
// (undocumented)
readonly routerEvent: NavigationEnd;
// (undocumented)
toString(): string;
}
// @public
export interface UrlCreationOptions {
fragment?: string;
preserveFragment?: boolean;
queryParams?: Params | null;
queryParamsHandling?: QueryParamsHandling | null;
relativeTo?: ActivatedRoute | null;
}
// @public
export abstract class UrlHandlingStrategy {
abstract extract(url: UrlTree): UrlTree;
abstract merge(newUrlPart: UrlTree, rawUrl: UrlTree): UrlTree;
abstract shouldProcessUrl(url: UrlTree): boolean;
}
// @public
export type UrlMatcher = (segments: UrlSegment[], group: UrlSegmentGroup, route: Route) => UrlMatchResult | null;
// @public
export type UrlMatchResult = {
consumed: UrlSegment[];
posParams?: {
[name: string]: UrlSegment;
};
};
// @public
export class UrlSegment {
2016-09-12 13:02:48 -04:00
constructor(
path: string,
parameters: {
[name: string]: string;
});
// (undocumented)
get parameterMap(): ParamMap;
parameters: {
[name: string]: string;
};
path: string;
// (undocumented)
toString(): string;
}
// @public
export class UrlSegmentGroup {
constructor(
segments: UrlSegment[],
children: {
[key: string]: UrlSegmentGroup;
});
children: {
[key: string]: UrlSegmentGroup;
};
hasChildren(): boolean;
get numberOfChildren(): number;
parent: UrlSegmentGroup | null;
segments: UrlSegment[];
// (undocumented)
toString(): string;
}
// @public
export abstract class UrlSerializer {
abstract parse(url: string): UrlTree;
abstract serialize(tree: UrlTree): string;
}
// @public
export class UrlTree {
fragment: string | null;
// (undocumented)
get queryParamMap(): ParamMap;
queryParams: Params;
root: UrlSegmentGroup;
// (undocumented)
toString(): string;
}
// @public (undocumented)
export const VERSION: Version;
// (No @packageDocumentation comment for this package)
```