import { ActivatedRoute } from '@angular/router'; /** * Injects the deepest (leaf) activated route as a signal. * * This function returns a signal that always contains the current leaf route in the router state tree. * The leaf route is the deepest child route that has no children of its own. This is useful when you * need to access route information from the currently active, deepest route regardless of your * component's position in the route hierarchy. * * The signal updates automatically whenever navigation ends, ensuring it always reflects the current * leaf route even when navigating to the same URL (depending on your router configuration's * `OnSameUrlNavigation` setting). * * @returns A signal containing the current leaf ActivatedRoute * * @example * ```ts * @Component({ * template: ` *
Current route: {{ leafRoute().snapshot.url }}
*
Route params: {{ leafRoute().snapshot.params | json }}
* ` * }) * export class MyComponent { * leafRoute = injectLeafActivatedRoute(); * } * ``` * * @example * Access params from the leaf route * ```ts * @Component({}) * export class MyComponent { * leafRoute = injectLeafActivatedRoute(); * userId = computed(() => this.leafRoute().snapshot.params['id']); * } * ``` */ export declare function injectLeafActivatedRoute(): import("@angular/core").Signal; /** * Recursively walks down the ActivatedRoute tree to find the deepest (leaf) child route. * * The Angular router organizes routes in a tree structure where parent routes can have * child routes. This function traverses the tree by following the `firstChild` references * until it reaches a route with no children, which is considered the "leaf" route. * * @param step - The current ActivatedRoute node to start traversing from * @returns The deepest ActivatedRoute in the tree (the leaf route with no children) * * @example * ```ts * // Given route tree: /parent/child/grandchild * const root = router.routerState.root; * const leaf = walkToDeepest(root); * // leaf will be the ActivatedRoute for 'grandchild' * ``` */ export declare function walkToDeepest(step: ActivatedRoute): ActivatedRoute;