BigIntAST node matching any bigint value.
Details
When serialized to a string-based codec, bigints are converted to/from their decimal string representation.
export class class BigIntclass BigInt {
_tag: 'BigInt';
getParser: () => SchemaParser.Parser;
matchPart: (s: string, options: ParseOptions) => bigint | undefined;
toCodecStringTree: () => AST;
getExpected: () => string;
annotations: Schema.Annotations.Annotations | undefined;
checks: Checks | undefined;
encoding: Encoding | undefined;
context: Context | undefined;
toString: () => string;
}
AST node matching any bigint value.
Details
When serialized to a string-based codec, bigints are converted to/from
their decimal string representation.
BigInt 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 BigInt._tag: "BigInt"_tag = "BigInt"
/** @internal */
BigInt.getParser(): SchemaParser.ParsergetParser() {
return function fromRefinement<T>(
ast: AST,
refinement: (input: unknown) => input is T
): SchemaParser.Parser
fromRefinement(this, import PredicatePredicate.isBigInt)
}
/** @internal */
BigInt.matchPart(s: string, options: ParseOptions): bigint | undefinedmatchPart(s: strings: string, options: ParseOptions(parameter) options: {
errors: "first" | "all" | undefined;
onExcessProperty: "ignore" | "error" | "preserve" | undefined;
propertyOrder: "none" | "original" | undefined;
disableChecks: boolean | undefined;
concurrency: number | "unbounded" | undefined;
}
options: ParseOptions): bigint | undefined {
return const isStringBigIntRegExp: RegExpisStringBigIntRegExp.RegExp.test(string: string): booleanReturns a Boolean value that indicates whether or not a pattern exists in a searched string.
test(s: strings)
? function applyTemplateLiteralPartChecks<
A
>(
ast: AST,
value: A,
options: ParseOptions
): A | undefined
applyTemplateLiteralPartChecks(this, module globalThisglobalThis.var BigInt: BigIntConstructor
;(value: bigint | boolean | number | string) =>
bigint
BigInt(s: strings), options: ParseOptions(parameter) options: {
errors: "first" | "all" | undefined;
onExcessProperty: "ignore" | "error" | "preserve" | undefined;
propertyOrder: "none" | "original" | undefined;
disableChecks: boolean | undefined;
concurrency: number | "unbounded" | undefined;
}
options)
: var undefinedundefined
}
/** @internal */
BigInt.toCodecStringTree(): ASTtoCodecStringTree(): 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 bigIntToString: Linkconst bigIntToString: {
to: AST;
transformation: SchemaTransformation.Transformation<any, any, any, any> | SchemaTransformation.Middleware<any, any, any, any, any, any>;
}
bigIntToString])
}
/** @internal */
BigInt.getExpected(): stringgetExpected(): string {
return "bigint"
}
}