Interface: RouteTree
API / @xmachines/play-router / RouteTree
Defined in: types.ts:122
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 | types.ts:134 |
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 | types.ts:129 |
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"); | types.ts:147 |
root | RouteNode | The root node of the routes | types.ts:124 |