waygraph / LayoutOptions
Interface: LayoutOptions<G, D, R>
Defined in: src/engine/block/kinds/layout.ts:35
Type Parameters
G
G extends Record<string, LayoutLink>
D
D extends Record<string, PageMethodEntry>
R
R extends PageRead = PageRead
Properties
description?
optionaldescription?:string
Defined in: src/engine/block/kinds/layout.ts:37
do?
optionaldo?:D
Defined in: src/engine/block/kinds/layout.ts:41
Its actions, by name: Layout.do.<name>, Methods (or () => Method, lazy) valid on every page it covers.
go?
optionalgo?:G
Defined in: src/engine/block/kinds/layout.ts:39
Its links, by name: Layout.go.<name>, Navs valid on every page it covers.
interrupts?
optionalinterrupts?:Record<string, {do: (page) =>Promise<void>;when:string; }>
Defined in: src/engine/block/kinds/layout.ts:52
What can appear on any page it covers and get in the way (a cookie banner, a session warning), each handled where it shows up: when is the selector that shows it, do what to do. Whichever step is running isn't blocked, the run log says it fired, and the demo shows it.
Example
interrupts: { cookies: { when: "#cookie-banner", do: (page) => page.getByRole("button", { name: "Accept" }).click() } }name
name:
string
Defined in: src/engine/block/kinds/layout.ts:36
on?
optionalon?: readonlyCheckpoint<string>[]
Defined in: src/engine/block/kinds/layout.ts:54
The pages it covers, when they aren't the ones under its folder (an app whose layout doesn't follow its addresses).
opens?
optionalopens?:string
Defined in: src/engine/block/kinds/layout.ts:59
The button that opens it, for a layout that hides its links until opened (a burger menu, a user dropdown): a link clicks it first when its own link isn't showing.
read?
optionalread?: (ctx) =>R
Defined in: src/engine/block/kinds/layout.ts:43
What it shows, read on every page it covers: a reader per field, like a page's read. Its keys are Layout.read.<field>.
Parameters
ctx
Returns
R
readAs?
optionalreadAs?:string
Defined in: src/engine/block/kinds/layout.ts:45
The name run logs and waygraph pilot read give what it reads (sidebar.links); the layout's name unless given.