Skip to content

Type Alias: RouteStateNode

API / @xmachines/play-xstate / RouteStateNode

type RouteStateNode = object;

Defined in: packages/play-xstate/src/routing/format-play-route-transitions.ts:32

The minimal structural shape of one XState state node, as formatPlayRouteTransitions reads it during its walk over the machine config.

This type holds only the fields that the function reads. Every other field of a state node, such as on, entry, and after, passes through the index signature without a change.

Indexable

[key: string]: unknown

Properties

id?

optional id?: string;

Defined in: packages/play-xstate/src/routing/format-play-route-transitions.ts:36

The optional explicit state ID, for example "home" or "settings". It is the #id target of a play.route event.


meta?

optional meta?: object;

Defined in: packages/play-xstate/src/routing/format-play-route-transitions.ts:38

The state metadata. A meta.route field gives the state a route.

route?

optional route?: RouteMetadata;

The template of the URL path: the string form, for example "/profile/:username", or the object form ({ path, title }). Both match RouteMetadata.


states?

optional states?: Record<string, RouteStateNode>;

Defined in: packages/play-xstate/src/routing/format-play-route-transitions.ts:47

The nested child states. The function walks them for each further route declaration.