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
AstBuilder<SignalNode<TPayload>>
Extended by
Type Parameters
| Type Parameter | Default type | Description |
|---|---|---|
TPayload | unknown | Validated output type of the signal payload schema. |
Methods
payload()
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 Parameter | Description |
|---|---|
TNext | Validated output type of schema. |
Parameters
| Parameter | Type | Description |
|---|---|---|
schema | ZodType<TNext> | Zod schema governing emitted signal payloads. |
Returns
SignalBuilder<TNext>
New immutable SignalBuilder typed to TNext.
toAST()
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
Deeply frozen passive AST node.
Inherited from
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
id | readonly | string | Unique logical identifier of the signal. | ast/signal-builder.ts:17 |
schema | readonly | ZodType<TPayload> | Zod schema used to validate payloads emitted for this signal. | ast/signal-builder.ts:19 |
type | readonly | "harness:signal" | Discriminant identifying a core signal definition node. | ast/signal-builder.ts:15 |