@tangential/core
Version:
Core types and support code for Tangential
22 lines (21 loc) • 1.01 kB
TypeScript
import { ActivatedRoute, Route, Router } from '@angular/router';
export declare class NgRouteUtil {
static fullPath(route: ActivatedRoute): string;
static primaryLeaf(router: Router): ActivatedRoute;
static findDescendantByComponentKey(router: Router, componentTypeKey: string): (ActivatedRoute | null);
/**
* Breadth first search of route to find the descendant where 'parent.children[x].component['Key'] === componentTypeKey'
* This requires that the Component have the static field 'Key' declared and set to a value.
* @param route
* @param componentTypeKey
* @returns {Route | null}
*/
static findDescendantRouteByComponentKey(route: Route, componentTypeKey: string): (Route | null);
/**
* Breadth first search of route to find the descendant where 'parent.children[x].path === path'
* @param route
* @param path
* @returns {Route | null}
*/
static findDescendantRouteByPath(route: Route, path: string): (Route | null);
}