Skip to content

Interface: SignalBuilder<TPayload> ​

Defined in: ast/signal-builder.ts:13

Immutable fluent builder and property projection for SignalNode.

Exposes id, type, and schema directly on the builder instance so downstream schemas and builders can reference signal.schema with or without calling .toAST().

Extends ​

Extended by ​

Type Parameters ​

Type ParameterDefault typeDescription
TPayloadunknownValidated output type of the signal payload schema.

Methods ​

payload() ​

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

Defined in: ast/signal-builder.ts:33

Binds a new Zod payload schema to the signal definition, returning a strongly typed builder clone.

Preserves the signal id while replacing schema on a newly frozen copy-on-write SignalBuilder<TNext> instance.

Type Parameters ​

Type ParameterDescription
TNextValidated output type of schema.

Parameters ​

ParameterTypeDescription
schemaZodType<TNext>Zod schema governing emitted signal payloads.

Returns ​

SignalBuilder<TNext>

New immutable SignalBuilder typed to TNext.


toAST() ​

ts
toAST(): SignalNode;

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 ​

SignalNode

Deeply frozen passive AST node.

Inherited from ​

AstBuilder.toAST

Properties ​

PropertyModifierTypeDescriptionDefined in
idreadonlystringUnique logical identifier of the signal.ast/signal-builder.ts:17
schemareadonlyZodType<TPayload>Zod schema used to validate payloads emitted for this signal.ast/signal-builder.ts:19
typereadonly"harness:signal"Discriminant identifying a core signal definition node.ast/signal-builder.ts:15

Released under the MIT License.