Skip to content

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 ParameterDefault typeDescription
TPayloadunknownInterrupt payload type.

Parameters ​

ParameterTypeDescription
idstringUnique 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.

Released under the MIT License.