Skip to content

Interface: InterruptPayloadBuilder<TPayload> ​

Defined in: builders/interrupt-payload-builder.ts:12

Fluent builder returned by P.interrupt(id) with .payload(schema) configuration and direct AST property access.

Extends InterruptBuilder<TPayload> so the builder can be passed directly wherever an InterruptNode<TPayload> or AstBuilder<InterruptNode<TPayload>> is expected.

Extends ​

Type Parameters ​

Type ParameterDefault typeDescription
TPayloadunknownInterrupt payload type validated by schema.

Methods ​

payload() ​

ts
payload<TNext>(schema): InterruptPayloadBuilder<TNext>;

Defined in: builders/interrupt-payload-builder.ts:28

Binds a Zod payload schema to the interrupt and returns a new immutable InterruptPayloadBuilder<TNext>.

Replaces the default z.unknown() payload schema while preserving the interrupt's id.

Type Parameters ​

Type ParameterDescription
TNextNew interrupt payload output type inferred from schema.

Parameters ​

ParameterTypeDescription
schemaZodType<TNext>Zod schema validating interrupt payloads.

Returns ​

InterruptPayloadBuilder<TNext>

New immutable interrupt builder instance.

Overrides ​

InterruptBuilder.payload


toAST() ​

ts
toAST(): InterruptNode;

Defined in: ast/ast-builder.ts:20

Compiles the current builder configuration into a deeply frozen passive AST node.

Validates required builder invariants at compilation time and returns an immutable plain-object AST representation containing zero execution methods.

Returns ​

InterruptNode

Deeply frozen passive AST node.

Inherited from ​

InterruptBuilder.toAST

Properties ​

PropertyModifierTypeDescriptionOverridesInherited fromDefined in
idreadonlystringUnique logical identifier of the interrupt.-InterruptBuilder.idast/interrupt-builder.ts:17
schemareadonlyZodType<TPayload>Zod schema used to validate payloads raised with this interrupt.-InterruptBuilder.schemaast/interrupt-builder.ts:19
typereadonly"harness:interrupt"Discriminant identifying an interrupt AST node.InterruptBuilder.type-builders/interrupt-payload-builder.ts:15

Released under the MIT License.