import { Observable } from "rxjs"; import { Title } from "@angular/platform-browser"; import { NgModuleRef } from "@angular/core"; import { ActivatedRouteSnapshot, Navigation, Router } from "@angular/router"; declare module "@angular/router" { interface ParamMap { /** * Parses Url Parameter to specified Type * * @template T Parameter Type * @param name Parameter Name * @returns Parameter casted to specified Type */ getAs(name: string): T | null; } interface Router { /** * Provides ability to subscribe to Navigation event for activated routes * * @param route Activated Route Navigation occurred to * @param isTarget Indicates whether specified route is target route navigation occurs to * @returns Information about a navigation operation. */ onRouteRetained(route: ActivatedRoute, isTarget?: boolean): Observable; /** * Gets last successful navigation. Behaves similar to {@link Router.getCurrentNavigation}. */ getLastSuccessfulNavigation(): Navigation; } interface LoadedRouterConfig { module: NgModuleRef; } } export declare type RouteTitleProvider = (route: ActivatedRouteSnapshot, navigation?: Navigation) => string; /** * Extends route config with navigation extras. * * @example Route config: { path: "..", data: { extras: { skipLocationChange: true } as NavigationExtras } }, * @param router Angular Router */ export declare function extendRouteConfigWithNavigationExtras(router: Router): void; /** * Binds route config title to website title. * Set "suppressTitleUpdate" to true if you want to avoid title change during navigation. * * @example Route config: * { path: "..", data: { title: string | (route: ActivatedRouteSnapshot, navigation: Navigation) => string } } * @param router Angular Router * @param title Angular Title * @param prefix Application title prefix */ export declare function bindRouteConfigTitle(router: Router, title: Title, prefix: string): void; /** * Extends param map with typed parameters. * Determines value type based on structure and parses it. * * @example (route as ActivatedRoute).snapshot.queryParamMap.getAs("fromDate"); * @param router Angular Router */ export declare function extendParamMapWithTypedParameters(router: Router): void; /** * Adds OnRouteRetained event. When navigation occurs to already activated route, * then OnRouteRetained event will trigger. * * @example (router as Router).onRouteRetained(route, isTarget).subscribe(navigation => {}); * @param router Angular Router */ export declare function addOnRouteRetainedEvent(router: Router): void; export declare function addGetLastSuccessfulNavigation(router: Router): void;