Interface: RouteMapping
API / @xmachines/play-dom-router / RouteMapping
Defined in: play-router/src/base-route-map.ts:54
One entry of the map between a state ID and a path.
Both fields are readonly, because a mapping is immutable after the caller gives
it to RouteMap. An adapter package re-exports a structurally compatible
RouteMapping type under its own name. @xmachines/play-router publishes this
type as RouteMapping, and its name therefore does not collide with such a local
type of an adapter.
Example
const mapping: RouteMapping = { stateId: "home", path: "/" };const paramMapping: RouteMapping = { stateId: "profile", path: "/profile/:userId" };const optionalMapping: RouteMapping = { stateId: "settings", path: "/settings/:section?" };Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
path | readonly | string | The pattern of the URL path, for example "/", "/profile/:userId", or "/settings/:section?" | play-router/src/base-route-map.ts:58 |
stateId | readonly | string | The state ID of the state machine, for example "home" or "#profile" | play-router/src/base-route-map.ts:56 |