Skip to content

waygraph / NavBlock

Type Alias: NavBlock<Out> ​

NavBlock<Out> = Omit<DefinedBlock<Checkpoint<string>, Out>, "withVerify" | "modVerify" | "modVerifyAll" | "stubBefore" | "stub" | "stubOnError"> & object

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

A Block whose only possible action is navigating to a URL - built via defineNavBlock, never with a hand-authored act(). Extends Block (same shape DefinedBlock/ComposedBlock already use), so it drops into map(), connect(), composeBlock() exactly like any other Block - no special-casing needed anywhere that only expects a Block. See openspec/specs/nav-block-and-check/spec.md for why this exists.

__wgFactory is a TypeScript-only brand so MapBuilder.gotoPage / MapBuilder.gotoExternal can reject Assert/Method Blocks at compile time (runtime still checks __waygraphKind). Decorate methods are re-stated (via Omit) so .stubBefore() / .withVerify() keep the brand.

Type Parameters ​

Out ​

Out extends Checkpoint<string>

Type Declaration ​

__wgFactory? ​

readonly optional __wgFactory?: "nav"

modVerify() ​

modVerify(nameOrIndex, newCheck): NavBlock<Out>

Parameters ​

nameOrIndex ​

string | number

newCheck ​

Trait | ((page, mem) => Promise<boolean | TraitResult>)

Trait


Function ​

(page, mem) => Promise<boolean | TraitResult>

Returns ​

NavBlock<Out>

modVerifyAll() ​

modVerifyAll(patches): NavBlock<Out>

Parameters ​

patches ​

Record<string, Trait["check"] | Trait>

Returns ​

NavBlock<Out>

stub() ​

stub(stub): NavBlock<Out>

Parameters ​

stub ​

StubLifecycleFn<Out>

Returns ​

NavBlock<Out>

stubBefore() ​

stubBefore(stub): NavBlock<Out>

Parameters ​

stub ​

StubLifecycleFn<Out>

Returns ​

NavBlock<Out>

stubOnError() ​

stubOnError(stub): NavBlock<Out>

Parameters ​

stub ​

StubLifecycleFn<Out>

Returns ​

NavBlock<Out>

withVerify() ​

withVerify(verify): NavBlock<Out>

Parameters ​

verify ​

Trait[] | ((out) => Trait[])

Returns ​

NavBlock<Out>

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