Skip to content

waygraph / InlineMethod

Interface: InlineMethod<Out, L> ​

Defined in: src/engine/block/kinds/page.ts:44

A Method written inside its page's do: the page is its from and, unless to says otherwise, its to.

Type Parameters ​

Out ​

Out extends Checkpoint<string>

L ​

L extends Checkpoint<string>

Properties ​

description? ​

optional description?: string

Defined in: src/engine/block/kinds/page.ts:46


expect? ​

optional expect?: ExpectList<Out>

Defined in: src/engine/block/kinds/page.ts:58


for? ​

optional for?: readonly Account[]

Defined in: src/engine/block/kinds/page.ts:53

Who has it (its button shows for them).


instanceOptions? ​

optional instanceOptions?: (page) => Promise<readonly WaygraphInstanceOption<unknown>[]>

Defined in: src/engine/block/kinds/page.ts:59

Optional. When this Block's real choices depend on the live page (which of several items to add to cart, which of several rows to open) rather than being knowable ahead of time, this returns one option per live choice - waygraph auto lists one menu row per option (via label) instead of a single generic edge, and seeds mem.set(option.key, option.value) before this Block's own act() runs when a row is picked. Purely additive tooling data - runGraph/ connect/anything that decides behavior never consults it; a Block without it behaves exactly as before.

Parameters ​

page ​

Page

Returns ​

Promise<readonly WaygraphInstanceOption<unknown>[]>

Example ​

ts
instanceOptions: (page) => collectInventoryItems(page).then((items) => items.map((it) => ({ id: it.id, label: `Add "${it.name}" to cart`, key: SelectedItem.key, value: it })))

name? ​

optional name?: string

Defined in: src/engine/block/kinds/page.ts:45


precondition? ​

optional precondition?: Trait[] | ((input) => Trait[])

Defined in: src/engine/block/kinds/page.ts:54


requires? ​

optional requires?: readonly MemKey<unknown>[]

Defined in: src/engine/block/kinds/page.ts:51

Mem keys it needs set before it runs.


sets? ​

optional sets?: StateSets

Defined in: src/engine/block/kinds/page.ts:47


to? ​

optional to?: LandsOn | readonly LandsOn[]

Defined in: src/engine/block/kinds/page.ts:49

Where it lands, when it isn't the page it's on: a page's name, so no import of it is needed. Several: lands says which.


verify? ​

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

Defined in: src/engine/block/kinds/page.ts:56

Methods ​

act() ​

act(page, input, mem): Promise<void>

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

Parameters ​

page ​

Page

input ​

Out

mem ​

MemPage

Returns ​

Promise<void>


lands()? ​

optional lands(page, mem): L | Promise<L>

Defined in: src/engine/block/kinds/page.ts:57

Parameters ​

page ​

Page

mem ​

MemPage

Returns ​

L | Promise<L>

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