interface / @typed/router/CurrentRoute

CurrentRouteTree

Describes the stable route mount tree visible to a running handler or layout.

Package version
1.0.0-beta.7
Category
Structural mounts
Since
1.0.0

Import

import { CurrentRouteTree } from "@typed/router/CurrentRoute";

Signatures

export interface CurrentRouteTree {
    readonly route: Route<string, any>;
    readonly parent?: CurrentRouteTree | undefined;
}

Why

The mounted tree records structural ownership and parentage. It is deliberately not the live URL; read CurrentPath or Navigation.currentEntry when reacting to location changes.

Ownership and lifetime

Values are immutable and acquire no resources. The selected handler Scope owns the tree supplied through CurrentRoute; nested layout and route layers may extend it.

Property: parent

The enclosing mounted boundary, when the route was nested.

Property: parent: Why

It preserves layout and prefix ancestry without coupling it to browser history.

Property: parent: Ownership and lifetime

The reference is immutable and does not extend the parent’s owning Scope.

Property: route

The route mounted at this boundary.

Property: route: Why

It lets children derive structural prefixes without treating a later URL update as a remount.

Property: route: Ownership and lifetime

The value is immutable and lives with the containing mount tree.

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source