VoidAST node matching TypeScript void return-value semantics.
When to use
Use when you need an AST node for a value whose result is intentionally ignored.
Details
Parsers built from this node accept any present runtime input and map it to
undefined. Public schemas built from it may still expose void as their
typed decoded and encoded representation.
export class class Voidclass Void {
_tag: 'Void';
getParser: () => SchemaParser.Parser;
toCodecJson: () => AST;
getExpected: () => string;
annotations: Schema.Annotations.Annotations | undefined;
checks: Checks | undefined;
encoding: Encoding | undefined;
context: Context | undefined;
toString: () => string;
}
AST node matching TypeScript void return-value semantics.
When to use
Use when you need an AST node for a value whose result is intentionally
ignored.
Details
Parsers built from this node accept any present runtime input and map it to
undefined. Public schemas built from it may still expose void as their
typed decoded and encoded representation.
Void extends class BaseRepresents the abstract base class for all
AST
node variants.
Details
Every AST node extends Base and inherits these fields:
annotations — user-supplied metadata (identifier, title, description,
arbitrary keys).
checks — optional
Checks
for post-type-match validation.
encoding — optional
Encoding
chain for type ↔ wire
transformations.
context — optional
Context
for per-property metadata.
Subclasses add a _tag discriminant and variant-specific data.
Base {
readonly Void._tag: "Void"_tag = "Void"
/** @internal */
Void.getParser(): SchemaParser.ParsergetParser() {
return function fromAnyToConst<undefined>(
value: undefined
): SchemaParser.Parser
fromAnyToConst(var undefinedundefined)
}
/** @internal */
Void.toCodecJson(): ASTtoCodecJson(): type AST =
| Declaration
| Null
| Undefined
| Void
| Never
| Unknown
| Any
| String
| Number
| Boolean
| BigInt
| Symbol
| Literal
| UniqueSymbol
| ObjectKeyword
| Enum
| TemplateLiteral
| Arrays
| Objects
| Union<AST>
| Suspend
Discriminated union of all AST node types.
Details
Every Schema has an .ast property of this type. Use the guard functions
(
isString
,
isObjects
, etc.) to narrow to a specific variant,
then access variant-specific fields.
- All variants share the
Base
fields:
annotations, checks,
encoding, context.
- Discriminate on the
_tag field (e.g. "String", "Objects", "Union").
AST {
return function replaceEncoding<A extends AST>(
ast: A,
encoding: Encoding | undefined
): A
replaceEncoding(this, [const undefinedToNull: Linkconst undefinedToNull: {
to: AST;
transformation: SchemaTransformation.Transformation<any, any, any, any> | SchemaTransformation.Middleware<any, any, any, any, any, any>;
}
undefinedToNull])
}
/** @internal */
Void.getExpected(): stringgetExpected(): string {
return "void"
}
}