UnknownSource effect/SchemaAST.ts:94611 lines
export class class Unknownclass Unknown {
_tag: 'Unknown';
getParser: () => SchemaParser.Parser;
getExpected: () => string;
annotations: Schema.Annotations.Annotations | undefined;
checks: Checks | undefined;
encoding: Encoding | undefined;
context: Context | undefined;
toString: () => string;
}
AST node representing the unknown type — every value matches.
Details
Unlike
Any
, this is type-safe: the parsed result is typed as
unknown rather than any.
Unknown 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 Unknown._tag: "Unknown"_tag = "Unknown"
/** @internal */
Unknown.getParser(): SchemaParser.ParsergetParser() {
return function fromRefinement<T>(
ast: AST,
refinement: (input: unknown) => input is T
): SchemaParser.Parser
fromRefinement(this, import PredicatePredicate.isUnknown)
}
/** @internal */
Unknown.getExpected(): stringgetExpected(): string {
return "unknown"
}
}Referenced by 3 symbols