waygraph / defineNavBlock
Function: defineNavBlock()
defineNavBlock<
Out>(options):NavBlock<Out>
Defined in: src/engine/block/kinds/nav.ts:174
Builds a NavBlock. The generated act() is always exactly page.goto(url) or page.locator(click).click() - never anything else, never author-supplied. Callers get a real Page here internally (the one legitimate place navigation belongs); defineBlock's own ActionPage narrowing is what discourages navigation everywhere else, and never applies to this generated function since no author ever writes it by hand.
Type Parameters
Out
Out extends Checkpoint<string>
Parameters
options
NavBlockOptions<Out>
Returns
NavBlock<Out>
Examples
ts
defineNavBlock({ name: "nav-web-login", checkpoint: "LoginForm", url: "/login" })ts
defineNavBlock({ name: "nav-web-request-detail", checkpoint: "RequestDetail", url: (mem) => `/dashboard/requests/${mem.get(RequestId.key)}` })ts
defineNavClickBlock({ name: "nav-web-documents", checkpoint: "DocumentsList", click: "nav >> text=Documents" })
For click-nav in app code prefer {@link defineNavClickBlock} (url stays here).