diff --git a/packages/router/src/index.ts b/packages/router/src/index.ts index 264929c3fe..6d202fbc3d 100644 --- a/packages/router/src/index.ts +++ b/packages/router/src/index.ts @@ -7,7 +7,7 @@ */ -export {Data, LoadChildren, LoadChildrenCallback, ResolveData, Route, Routes, RunGuardsAndResolvers} from './config'; +export {Data, LoadChildren, LoadChildrenCallback, ResolveData, Route, Routes, RunGuardsAndResolvers, UrlMatchResult, UrlMatcher} from './config'; export {RouterLink, RouterLinkWithHref} from './directives/router_link'; export {RouterLinkActive} from './directives/router_link_active'; export {RouterOutlet} from './directives/router_outlet'; diff --git a/tools/public_api_guard/router/router.d.ts b/tools/public_api_guard/router/router.d.ts index f047c253d0..d234e646c9 100644 --- a/tools/public_api_guard/router/router.d.ts +++ b/tools/public_api_guard/router/router.d.ts @@ -476,6 +476,17 @@ export declare abstract class UrlHandlingStrategy { abstract shouldProcessUrl(url: UrlTree): boolean; } +/** @experimental */ +export declare type UrlMatcher = (segments: UrlSegment[], group: UrlSegmentGroup, route: Route) => UrlMatchResult; + +/** @experimental */ +export declare type UrlMatchResult = { + consumed: UrlSegment[]; + posParams?: { + [name: string]: UrlSegment; + }; +}; + /** @stable */ export declare class UrlSegment { readonly parameterMap: ParamMap;