waygraph / MethodBlock
Type Alias: MethodBlock<In, Out>
MethodBlock<
In,Out> =Omit<DefinedBlock<In,Out>,"withVerify"|"modVerify"|"modVerifyAll"|"stubBefore"|"stub"|"stubOnError"> &object
Defined in: src/engine/block/kinds/method.ts:25
TypeScript salt over defineBlock for one-shot non-nav app steps (submit, upload, finish, logout) - methods on a page. Same runtime Block; marks __waygraphSalt = "method" so auto/docs can tell Method from bare defineBlock. A Method on one row of many (add this item, remove that one) names the row in mem (requires) and lists the rows on the page (instanceOptions), so waygraph auto offers one menu row each. Prefer hanging methods off a definePageBlock hub.
Type Parameters
In
In extends Checkpoint<string>
Out
Out extends Checkpoint<string>
Type Declaration
__wgFactory?
readonlyoptional__wgFactory?:"method"
modVerify()
modVerify(
nameOrIndex,newCheck):MethodBlock<In,Out>
Parameters
nameOrIndex
string | number
newCheck
Trait | ((page, mem) => Promise<boolean | TraitResult>)
Function
(page, mem) => Promise<boolean | TraitResult>
Returns
MethodBlock<In, Out>
modVerifyAll()
modVerifyAll(
patches):MethodBlock<In,Out>
Parameters
patches
Record<string, Trait["check"] | Trait>
Returns
MethodBlock<In, Out>
stub()
stub(
stub):MethodBlock<In,Out>
Parameters
stub
StubLifecycleFn<Out>
Returns
MethodBlock<In, Out>
stubBefore()
stubBefore(
stub):MethodBlock<In,Out>
Parameters
stub
StubLifecycleFn<Out>
Returns
MethodBlock<In, Out>
stubOnError()
stubOnError(
stub):MethodBlock<In,Out>
Parameters
stub
StubLifecycleFn<Out>
Returns
MethodBlock<In, Out>
withVerify()
withVerify(
verify):MethodBlock<In,Out>
Parameters
verify
Returns
MethodBlock<In, Out>