Skip to content

Interface: RouteTree

API / @xmachines/play-router / RouteTree

Defined in: types.ts:117

Complete route tree with lookup maps

Provides bidirectional mapping between state IDs and URL paths:

  • byStateId: Maps state IDs to route nodes (for play.route event targeting)
  • byPath: Maps URL paths to route nodes (for browser navigation)

Properties

PropertyTypeDescriptionDefined in
byPathMap<string, RouteNode>Map full path -> route node Used to look up state ID from URL path for play.route event targetingtypes.ts:129
byStateIdMap<string, RouteNode>Map state ID -> route node Used to look up URL path from state ID for browser URL synctypes.ts:124
graph?Graph<MachineNodeData, MachineEdgeData, any, any>Graph representation of the state machine for advanced queries. Populated by extractMachineRoutes() — use for hierarchy queries, reachability checks, and transition-aware navigation via @statelyai/graph algorithms. Example import { getSuccessors, hasPath } from "@statelyai/graph"; const successors = getSuccessors(tree.graph!, "myMachine.home");types.ts:141
rootRouteNodeRoot route nodetypes.ts:119