Interface: RouteTree
API / @xmachines/play-router / RouteTree
Defined in: play-router/src/types.ts:123
The complete route tree, with its lookup maps
It gives you the map between a state ID and a URL path, in both directions:
- byStateId: it maps each state ID to its route node, for the target of a play.route event
- byPath: it maps each URL path to its route node, for the browser navigation
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
byPath | Map<string, RouteNode> | The map from a complete path to its route node. It gives you the state ID of a URL path, for the target of a play.route event | play-router/src/types.ts:135 |
byStateId | Map<string, RouteNode> | The map from a state ID to its route node. It gives you the URL path of a state ID, for the update of the browser URL | play-router/src/types.ts:130 |
graph? | Graph<MachineNodeData, MachineEdgeData, any, any> | The graph of the state machine, for an advanced query. extractMachineRoutes() fills it. Use it for a query of the hierarchy, for a test of the reachability, and for a navigation that knows the transitions, through the algorithms of @statelyai/graph. Example import { getSuccessors, hasPath } from "@statelyai/graph"; const successors = getSuccessors(tree.graph!, "myMachine.home"); | play-router/src/types.ts:148 |
root | RouteNode | The root node of the routes | play-router/src/types.ts:125 |