import { Observable } from 'rxjs'; import { MetaDefinition } from '@angular/platform-browser'; import { ActivatedRouteSnapshot, UrlTree, RouterStateSnapshot, Route as Route$1 } from '@angular/router'; import { ClaimLike } from '@bootkit/ng1/common'; import * as i0 from '@angular/core'; /** * A function that resolves a title from the route and router state */ type RouteTitleResolver = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => string; /** * A router link value. */ type RouterLinkValue = any[] | string | UrlTree | null | undefined; /** * A function that resolves a router link. * @param route The activated route snapshot * @param state The router state snapshot * @returns The resolved link (RouteDataLink) */ type RouterLinkValueResolver = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => RouterLinkValue; /** * A function that resolves meta tags from the route and router state */ type MetaDefinitionResolver = (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => MetaDefinition[]; /** * Route data */ interface RouteData { /** * The title of the route, or a function that resolves the title. */ title?: string | RouteTitleResolver; /** * The description of the route. */ description?: string; /** * A Router link defined for the route. */ link?: RouterLinkValue | RouterLinkValueResolver; /** * linkTarget */ linkTarget?: '_self' | '_blank' | '_parent' | '_top'; /** * meta */ metaTags?: MetaDefinition[] | MetaDefinitionResolver; /** * Route security claim. */ claim?: ClaimLike; /** * Route childreen. */ children?: RouteData[]; [key: string]: any; } /** * Router Activated Route Snapshot. * Represents the state of an activated route in the router. */ interface RouterActivatedRouteSnapshot { /** * The original ActivatedRouteSnapshot */ activatedRoute: ActivatedRouteSnapshot; /** * Resolved title, if any */ title?: string; /** * Resolved description, if any */ description?: string; /** * Resolved meta tags, if any */ metaTags?: MetaDefinition[]; /** * Resolved link, if any */ link: RouterLinkValue; /** * Children routes */ children: RouterActivatedRouteSnapshot[]; } /** * Extended Angular Route interface with additional data property. */ interface Route extends Route$1 { children?: Routes; data?: RouteData; } type Routes = Route[]; /** * Service to interact with Angular Router. */ declare class RouterService { private readonly _router; /** * Listen to activated route tree changes for specified outlets. * This will emit the activated route tree whenever a navigation ends and the activated routes change. * The emitted value is a tree structure representing the activated routes for the specified outlets. * @param outlets List of outlets to include, default is ['primary'] * @returns Observable of the activated route tree */ listenToActivatedRouteTree(outlets?: string[]): Observable; /** * Listen to activated routes changes for a specific outlet. * This will emit an array of activated routes from root to the last one for the specified outlet whenever a navigation ends and the activated routes change. * @param outlet The outlet to listen for, default is 'primary' * @returns Observable of the activated routes array from root to the last one for the specified outlet */ listenToActivatedRoutes(outlet?: string): Observable; /** * Get the current activated routes for a specific outlet. * This will return an array of activated routes from root to the last one for the specified outlet based on the current router state snapshot. * @param outlet The outlet to get activated routes for, default is 'primary' * @returns Array of activated routes from root to the last one for the specified outlet */ getActivatedRoutes(outlet?: string): RouterActivatedRouteSnapshot[]; /** * Map a route to RouterRouteSnapshot * @param route The route to map * @param outlets The outlets to include * @returns The mapped RouterRouteSnapshot */ private _mapRoute; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export { RouterService }; export type { MetaDefinitionResolver, Route, RouteData, RouteTitleResolver, RouterActivatedRouteSnapshot, RouterLinkValue, RouterLinkValueResolver, Routes };