Function: createInterruptBuilder()
ts
function createInterruptBuilder<TPayload>(id, schema?): InterruptPayloadBuilder<TPayload>;Defined in: builders/create-interrupt-builder.ts:19
Creates a copy-on-write immutable ConfigurableInterruptBuilder for P.interrupt(id).
Defaults the interrupt payload schema to z.unknown() when schema is omitted and returns a frozen builder supporting .payload(nextSchema) and .toAST().
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
TPayload | unknown | Interrupt payload type. |
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Unique interrupt identifier. |
schema? | ZodType<TPayload, unknown, $ZodTypeInternals<TPayload, unknown>> | Optional initial Zod payload schema (defaults to z.unknown()). |
Returns
InterruptPayloadBuilder<TPayload>
Frozen interrupt builder instance.