Navigation.Snapshot
luastra/navigationNavigation.Snapshot is an exported, statically checked data contract of luastra/navigation. Its exact declaration documents the fields or alternatives accepted at the module boundary and is erased after Luau analysis.
Before you use it
Add luastra/navigation to this module's dependencies in luastra.json, then import it with require("luastra/navigation"). No host capability is required for in-memory navigation. Browser URL/history synchronization additionally needs luastra/host and navigation.history.
How it fits
The type describes a route, stack, compiler, or checked result used by navigation operations.
When to use it
Use Navigation.Snapshot when annotating values that cross the public luastra/navigation boundary or when exporting helpers built on that module. The type documents the exact checked shape and prevents unrelated tables from being substituted accidentally.
Fields or definition
| Parameter | Type / values | Description |
|---|---|---|
| version | number | Explicit contract version used to validate or migrate the serialized value. |
| routes | { string } | Ordered named-route history represented by this snapshot. |
What happens next
A checked route/navigation annotation.
Failures and fixes
Invalid definitions, unknown routes, malformed parameters, excessive history depth, or incompatible snapshots return bounded errors or fail construction. Navigation result records use success:boolean with optional fields, so verify the field you need after checking success.
Availability
Public-source alpha API in 0.5.0-alpha; URL integration is a separate host capability.
Exact declaration
export type Snapshot = { version: number, routes: { string } }