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
InterruptBuilder<TPayload>
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
TPayload | unknown | Interrupt payload type validated by schema. |
Methods
payload()
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 Parameter | Description |
|---|---|
TNext | New interrupt payload output type inferred from schema. |
Parameters
| Parameter | Type | Description |
|---|---|---|
schema | ZodType<TNext> | Zod schema validating interrupt payloads. |
Returns
InterruptPayloadBuilder<TNext>
New immutable interrupt builder instance.
Overrides
toAST()
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
Deeply frozen passive AST node.
Inherited from
Properties
| Property | Modifier | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|---|
id | readonly | string | Unique logical identifier of the interrupt. | - | InterruptBuilder.id | ast/interrupt-builder.ts:17 |
schema | readonly | ZodType<TPayload> | Zod schema used to validate payloads raised with this interrupt. | - | InterruptBuilder.schema | ast/interrupt-builder.ts:19 |
type | readonly | "harness:interrupt" | Discriminant identifying an interrupt AST node. | InterruptBuilder.type | - | builders/interrupt-payload-builder.ts:15 |