← Navigation and routes

Navigation.Options

luastra/navigation

Navigation.Options is the checked configuration record accepted by the related SDK operation. Required fields establish the minimum contract, while optional fields preserve documented defaults when omitted.

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.Options when a reusable variable or helper passes configuration to the related SDK operation. The exported type keeps optional and required fields aligned with the checked public contract.

Fields or definition

ParameterType / valuesDescription
routes{ string }Complete set of unique named routes admitted by the stack.
initialstringRoute selected when the stack is first created.
maximumDepthnumber?Optional upper bound preventing unbounded route history growth.

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 Options = { routes: { string }, initial: string, maximumDepth: number? }

Continue learning

Companions

Navigation.Snapshot

Next steps

Navigation.create

Complete inventory

View all pages in Navigation and routes
← Previous: Navigation.RestoreResultNext: Navigation.Stack →