Skip to content

waygraph / PageBlock

Type Alias: PageBlock<Out, M, Nav, E, R, U, Q, F, Lk> ​

PageBlock<Out, M, Nav, E, R, U, Q, F, Lk> = Omit<DefinedBlock<Checkpoint<string>, Out>, "withVerify" | "modVerify" | "modVerifyAll" | "stubBefore" | "stub" | "stubOnError"> & object & PageGo<Out, U, Q> & PageFolderGo<Out, F> & PageLinks<Lk>

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

Page hub Block: one Checkpoint = this screen; methods hang off the hub for readability / auto grouping. Runtime is still a Block (__waygraphKind = "page"). act is goto/click when url/click is set, otherwise a no-op (already here). Child methods stay ordinary Blocks for graph edges - the page only registers them. Branded __wgFactory: "page" (not "nav") - both are accepted by MapBuilder.gotoPage / MapBuilder.gotoExternal.

Type Parameters ​

Out ​

Out extends Checkpoint<string>

M ​

M extends Record<string, PageMethodEntry> = Record<string, PageMethodEntry>

Nav = undefined

E ​

E extends Record<string, PageExpectEntry> = Record<never, never>

R ​

R = Record<never, never>

U ​

U extends string = string

Q ​

Q extends string = never

F ​

F extends "folder" | undefined = undefined

Lk ​

Lk extends Record<string, unknown> = Record<never, never>

Type Declaration ​

__wgFactory? ​

readonly optional __wgFactory?: "page"

checkpoint ​

readonly checkpoint: Out

The page's Checkpoint, as a value: for lands, a Method's from/to, a flow's start.

do ​

readonly do: PageMethods<M>

The page's Methods by name, each its own Block type: what a flow does on this page, from one import.

Example ​

ts
map().gotoPage(Inventory.nav).method(Inventory.do.addItem, { expect: [ExpectBadgeBlock] })

expects ​

readonly expects: PageMethods<E>

The page's expectations by name (Expect Blocks and Traits): what a step here can expect.

methods ​

readonly methods: readonly SomeDefinedBlock[]

Resolved method Blocks registered at define time.

readonly nav: Nav

The Nav Block that opens this page (nav in definePageBlock).

read ​

readonly read: PageReadKeys<R>

What the page shows, as typed keys: Inventory.read.sort.is("az").

check() ​

check(description, test): Trait

A check on what the page shows, for a step's expect: Lines.check("only marked", ({ rows }) => rows.every(...)).

Parameters ​

description ​

string

test ​

(read, mem) => CheckResult

Returns ​

Trait

modVerify() ​

modVerify(nameOrIndex, newCheck): PageBlock<Out, M, Nav, E, R, U, Q, F, Lk>

Parameters ​

nameOrIndex ​

string | number

newCheck ​

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

Trait


Function ​

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

Returns ​

PageBlock<Out, M, Nav, E, R, U, Q, F, Lk>

modVerifyAll() ​

modVerifyAll(patches): PageBlock<Out, M, Nav, E, R, U, Q, F, Lk>

Parameters ​

patches ​

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

Returns ​

PageBlock<Out, M, Nav, E, R, U, Q, F, Lk>

stub() ​

stub(stub): PageBlock<Out, M, Nav, E, R, U, Q, F, Lk>

Parameters ​

stub ​

StubLifecycleFn<Out>

Returns ​

PageBlock<Out, M, Nav, E, R, U, Q, F, Lk>

stubBefore() ​

stubBefore(stub): PageBlock<Out, M, Nav, E, R, U, Q, F, Lk>

Parameters ​

stub ​

StubLifecycleFn<Out>

Returns ​

PageBlock<Out, M, Nav, E, R, U, Q, F, Lk>

stubOnError() ​

stubOnError(stub): PageBlock<Out, M, Nav, E, R, U, Q, F, Lk>

Parameters ​

stub ​

StubLifecycleFn<Out>

Returns ​

PageBlock<Out, M, Nav, E, R, U, Q, F, Lk>

withVerify() ​

withVerify(verify): PageBlock<Out, M, Nav, E, R, U, Q, F, Lk>

Parameters ​

verify ​

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

Returns ​

PageBlock<Out, M, Nav, E, R, U, Q, F, Lk>

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