Skip to content

waygraph / NavBlockOptions

Type Alias: NavBlockOptions<Out> ​

NavBlockOptions<Out> = object & ({ click?: never; url: string | ((mem) => string); } | { click: string | ((mem) => string); url?: never; })

Defined in: src/engine/block/kinds/nav.ts:55

defineNavBlock's own options - exactly one of url/click required, enforced at compile time (giving both, or neither, is a type error - see typecheck/nav-block.types.ts). checkpoint is the tag this NavBlock resolves to once navigation completes - a NavBlock never branches on observed evidence the way a regular Block can, so there's no resolve logic to author; it always just declares "arrived."

Type Parameters ​

Out ​

Out extends Checkpoint<string>

Type Declaration ​

checkpoint ​

checkpoint: Out

The Checkpoint this Nav lands on: its value (Home).

description? ​

optional description?: string

expect? ​

optional expect?: ExpectList<Out>

What this Block promises wherever it's used, checked after its verify: Expect Blocks, Traits, Key.is(...). A Block that can land in several places lists them per outcome. Read-only and run together; a step can drop them ({ expect: false }) or add its own.

Example ​

ts
expect: [ExpectArchivedToastBlock] · expect: { EquipmentDetail: [ExpectSavedBlock], EquipmentAdd: [ExpectNameRequiredBlock] }

from? ​

optional from?: readonly Checkpoint<string>[]

Checkpoint tags this Nav can run from. Omit (the default) = reachable from anywhere. Set it for a page that only exists after something else - e.g. every in-app page after sign-in - so route finding (auto --blocks, pilot reach, traverse) goes through the sign-in steps instead of jumping straight there from the login page.

Example ​

ts
const SIGNED_IN = [Dashboard, CommandCenter] as const; // src/states/
defineNavBlock({ ..., from: SIGNED_IN })

instanceOptions? ​

optional instanceOptions?: Block<Checkpoint<string>, Out>["instanceOptions"]

Live per-instance menu rows for waygraph auto (see Block.instanceOptions). When set, the explore menu lists one row per option instead of a single generic nav edge - used by defineMemNavBlock.

name ​

name: string

requires? ​

optional requires?: readonly MemKey<unknown>[]

screenshot? ​

optional screenshot?: StepScreenshot

A screenshot of the page once the step is done (true, or { fullPage: true }): Waygraph Studio shows it on the map.

verify? ​

optional verify?: Trait[] | ((out) => Trait[])

waygraph 0.18.3 (alpha) · Node 24+ · peer @playwright/test ^1.40.0 · syntax may change before 1.0: see what was removed