SchemaAST
Annotations
Signature
interface Annotated {
readonly annotations: Annotations;
}Annotations interface
Added in v3.10.0
Source
Signature
interface Annotations {
[_: string]: unknown;
[_: symbol]: unknown;
}ArbitraryAnnotationId
Added in v3.10.0
Source
Signature
declare const ArbitraryAnnotationId: unique symbol;BatchingAnnotation type
Added in v3.10.0
Source
Signature
type BatchingAnnotation = boolean | "inherit" | undefined;BatchingAnnotationId
Added in v3.10.0
Source
Signature
declare const BatchingAnnotationId: unique symbol;BrandAnnotation type
Added in v3.10.0
Source
Signature
type BrandAnnotation = Arr.NonEmptyReadonlyArray<string | symbol>;BrandAnnotationId
Added in v3.10.0
Source
Signature
declare const BrandAnnotationId: unique symbol;ConcurrencyAnnotation type
Added in v3.10.0
Source
Signature
type ConcurrencyAnnotation = Concurrency | undefined;ConcurrencyAnnotationId
Added in v3.10.0
Source
Signature
declare const ConcurrencyAnnotationId: unique symbol;DecodingFallbackAnnotation type
Added in v3.10.0
Source
Signature
type DecodingFallbackAnnotation<A> = (issue: ParseIssue) => Effect<A, ParseIssue>;DecodingFallbackAnnotationId
Added in v3.10.0
Source
Signature
declare const DecodingFallbackAnnotationId: unique symbol;DefaultAnnotation type
Added in v3.10.0
Source
Signature
type DefaultAnnotation<A> = A;DefaultAnnotationId
Added in v3.10.0
Source
Signature
declare const DefaultAnnotationId: unique symbol;DescriptionAnnotation type
Added in v3.10.0
Source
Signature
type DescriptionAnnotation = string;DescriptionAnnotationId
Added in v3.10.0
Source
Signature
declare const DescriptionAnnotationId: unique symbol;DocumentationAnnotation type
Added in v3.10.0
Source
Signature
type DocumentationAnnotation = string;DocumentationAnnotationId
Added in v3.10.0
Source
Signature
declare const DocumentationAnnotationId: unique symbol;EquivalenceAnnotation type
Added in v3.10.0
Source
Signature
type EquivalenceAnnotation<A, TypeParameters extends ReadonlyArray<any> = readonly []> = (
...equivalences: { [K in keyof TypeParameters]: Equivalence<TypeParameters[K]> }
) => Equivalence<A>;EquivalenceAnnotationId
Added in v3.10.0
Source
Signature
declare const EquivalenceAnnotationId: unique symbol;ExamplesAnnotation type
Added in v3.10.0
Source
Signature
type ExamplesAnnotation<A> = Arr.NonEmptyReadonlyArray<A>;ExamplesAnnotationId
Added in v3.10.0
Source
Signature
declare const ExamplesAnnotationId: unique symbol;getAnnotation
Added in v3.10.0
Source
Signature
declare const getAnnotation: {
<A>(key: symbol): (annotated: Annotated) => Option<A>;
<A>(annotated: Annotated, key: symbol): Option<A>;
};getBatchingAnnotation
Added in v3.10.0
Source
Signature
declare const getBatchingAnnotation: (annotated: Annotated) => Option<BatchingAnnotation>;getBrandAnnotation
Added in v3.10.0
Source
Signature
declare const getBrandAnnotation: (
annotated: Annotated,
) => Option<readonly [string | symbol, string | symbol]>;getConcurrencyAnnotation
Added in v3.10.0
Source
Signature
declare const getConcurrencyAnnotation: (annotated: Annotated) => Option<ConcurrencyAnnotation>;getDecodingFallbackAnnotation
Added in v3.10.0
Source
Signature
declare const getDecodingFallbackAnnotation: (
annotated: Annotated,
) => Option<DecodingFallbackAnnotation<unknown>>;getDefaultAnnotation
Added in v3.10.0
Source
Signature
declare const getDefaultAnnotation: (annotated: Annotated) => Option<unknown>;getDescriptionAnnotation
Added in v3.10.0
Source
Signature
declare const getDescriptionAnnotation: (annotated: Annotated) => Option<string>;getDocumentationAnnotation
Added in v3.10.0
Source
Signature
declare const getDocumentationAnnotation: (annotated: Annotated) => Option<string>;getExamplesAnnotation
Added in v3.10.0
Source
Signature
declare const getExamplesAnnotation: (annotated: Annotated) => Option<readonly [unknown, unknown]>;getIdentifierAnnotation
Added in v3.10.0
Source
Signature
declare const getIdentifierAnnotation: (annotated: Annotated) => Option<string>;getJSONIdentifier
Added in v3.10.0
Source
Signature
declare function getJSONIdentifier(annotated: Annotated): Option<string>;getJSONIdentifierAnnotation
Added in v3.10.0
Source
Signature
declare const getJSONIdentifierAnnotation: (annotated: Annotated) => Option<string>;getJSONSchemaAnnotation
Added in v3.10.0
Source
Signature
declare const getJSONSchemaAnnotation: (annotated: Annotated) => Option<object>;getMessageAnnotation
Added in v3.10.0
Source
Signature
declare const getMessageAnnotation: (annotated: Annotated) => Option<MessageAnnotation>;getMissingMessageAnnotation
Added in v3.10.0
Source
Signature
declare const getMissingMessageAnnotation: (
annotated: Annotated,
) => Option<MissingMessageAnnotation>;getParseIssueTitleAnnotation
Added in v3.10.0
Source
Signature
declare const getParseIssueTitleAnnotation: (
annotated: Annotated,
) => Option<ParseIssueTitleAnnotation>;getParseOptionsAnnotation
Added in v3.10.0
Source
Signature
declare const getParseOptionsAnnotation: (annotated: Annotated) => Option<ParseOptions>;getSchemaIdAnnotation
Added in v3.14.2
Source
Signature
declare const getSchemaIdAnnotation: (annotated: Annotated) => Option<SchemaIdAnnotation>;getSurrogateAnnotation
Added in v3.10.0
Source
Signature
declare const getSurrogateAnnotation: (annotated: Annotated) => Option<AST>;getTitleAnnotation
Added in v3.10.0
Source
Signature
declare const getTitleAnnotation: (annotated: Annotated) => Option<string>;getTypeConstructorAnnotation
Added in v3.19.0
Source
Signature
declare const getTypeConstructorAnnotation: (
annotated: Annotated,
) => Option<TypeConstructorAnnotation>;IdentifierAnnotation type
Added in v3.10.0
Source
Signature
type IdentifierAnnotation = string;IdentifierAnnotationId
Added in v3.10.0
Source
Signature
declare const IdentifierAnnotationId: unique symbol;JSONIdentifierAnnotationId
Added in v3.10.0
Source
Signature
declare const JSONIdentifierAnnotationId: unique symbol;JSONSchemaAnnotation type
Added in v3.10.0
Source
Signature
type JSONSchemaAnnotation = object;JSONSchemaAnnotationId
Added in v3.10.0
Source
Signature
declare const JSONSchemaAnnotationId: unique symbol;MessageAnnotation type
Added in v3.10.0
Source
Signature
type MessageAnnotation = (issue: ParseIssue) =>
| string
| Effect<string>
| {
readonly message: string | Effect<string>;
readonly override: boolean;
};MessageAnnotationId
Added in v3.10.0
Source
Signature
declare const MessageAnnotationId: unique symbol;MissingMessageAnnotation type
Added in v3.10.0
Source
Signature
type MissingMessageAnnotation = () => string | Effect<string>;MissingMessageAnnotationId
Added in v3.10.0
Source
Signature
declare const MissingMessageAnnotationId: unique symbol;ParseIssueTitleAnnotation type
Added in v3.10.0
Source
Signature
type ParseIssueTitleAnnotation = (issue: ParseIssue) => string | undefined;ParseIssueTitleAnnotationId
Added in v3.10.0
Source
Signature
declare const ParseIssueTitleAnnotationId: unique symbol;ParseOptionsAnnotationId
Added in v3.10.0
Source
Signature
declare const ParseOptionsAnnotationId: unique symbol;PrettyAnnotationId
Added in v3.10.0
Source
Signature
declare const PrettyAnnotationId: unique symbol;SchemaIdAnnotation type
Added in v3.10.0
Source
Signature
type SchemaIdAnnotation = string | symbol;SchemaIdAnnotationId
Added in v3.10.0
Source
Signature
declare const SchemaIdAnnotationId: unique symbol;SurrogateAnnotation type
Added in v3.10.0
Source
Signature
type SurrogateAnnotation = AST;SurrogateAnnotationId
Added in v3.10.0
Source
Signature
declare const SurrogateAnnotationId: unique symbol;TitleAnnotation type
Added in v3.10.0
Source
Signature
type TitleAnnotation = string;TitleAnnotationId
Added in v3.10.0
Source
Signature
declare const TitleAnnotationId: unique symbol;TypeConstructorAnnotation type
Added in v3.19.0
Source
Signature
type TypeConstructorAnnotation = {
[key: string | number | symbol]: unknown;
readonly _tag: string;
};TypeConstructorAnnotationId
Added in v3.19.0
Source
Signature
declare const TypeConstructorAnnotationId: unique symbol;Constructors
anyKeyword
Added in v3.10.0
Source
Signature
declare const anyKeyword: AnyKeyword;bigIntKeyword
Added in v3.10.0
Source
Signature
declare const bigIntKeyword: BigIntKeyword;booleanKeyword
Added in v3.10.0
Source
Signature
declare const booleanKeyword: BooleanKeyword;composeTransformation
Added in v3.10.0
Source
Signature
declare const composeTransformation: ComposeTransformation;neverKeyword
Added in v3.10.0
Source
Signature
declare const neverKeyword: NeverKeyword;numberKeyword
Added in v3.10.0
Source
Signature
declare const numberKeyword: NumberKeyword;objectKeyword
Added in v3.10.0
Source
Signature
declare const objectKeyword: ObjectKeyword;stringKeyword
Added in v3.10.0
Source
Signature
declare const stringKeyword: StringKeyword;symbolKeyword
Added in v3.10.0
Source
Signature
declare const symbolKeyword: SymbolKeyword;undefinedKeyword
Added in v3.10.0
Source
Signature
declare const undefinedKeyword: UndefinedKeyword;unknownKeyword
Added in v3.10.0
Source
Signature
declare const unknownKeyword: UnknownKeyword;voidKeyword
Added in v3.10.0
Source
Signature
declare const voidKeyword: VoidKeyword;Guards
isAnyKeyword
Added in v3.10.0
Source
Signature
declare const isAnyKeyword: (ast: AST) => ast is AnyKeyword;isBigIntKeyword
Added in v3.10.0
Source
Signature
declare const isBigIntKeyword: (ast: AST) => ast is BigIntKeyword;isBooleanKeyword
Added in v3.10.0
Source
Signature
declare const isBooleanKeyword: (ast: AST) => ast is BooleanKeyword;isComposeTransformation
Added in v3.10.0
Source
Signature
declare const isComposeTransformation: (ast: TransformationKind) => ast is ComposeTransformation;isDeclaration
Added in v3.10.0
Source
Signature
declare const isDeclaration: (ast: AST) => ast is Declaration;Signature
declare const isEnums: (ast: AST) => ast is Enums;isFinalTransformation
Added in v3.10.0
Source
Signature
declare const isFinalTransformation: (ast: TransformationKind) => ast is FinalTransformation;Signature
declare const isLiteral: (ast: AST) => ast is Literal;isNeverKeyword
Added in v3.10.0
Source
Signature
declare const isNeverKeyword: (ast: AST) => ast is NeverKeyword;isNumberKeyword
Added in v3.10.0
Source
Signature
declare const isNumberKeyword: (ast: AST) => ast is NumberKeyword;isObjectKeyword
Added in v3.10.0
Source
Signature
declare const isObjectKeyword: (ast: AST) => ast is ObjectKeyword;isRefinement
Added in v3.10.0
Source
Signature
declare const isRefinement: (ast: AST) => ast is Refinement<AST>;isStringKeyword
Added in v3.10.0
Source
Signature
declare const isStringKeyword: (ast: AST) => ast is StringKeyword;Signature
declare const isSuspend: (ast: AST) => ast is Suspend;isSymbolKeyword
Added in v3.10.0
Source
Signature
declare const isSymbolKeyword: (ast: AST) => ast is SymbolKeyword;isTemplateLiteral
Added in v3.10.0
Source
Signature
declare const isTemplateLiteral: (ast: AST) => ast is TemplateLiteral;isTransformation
Added in v3.10.0
Source
Signature
declare const isTransformation: (ast: AST) => ast is Transformation;isTupleType
Added in v3.10.0
Source
Signature
declare const isTupleType: (ast: AST) => ast is TupleType;isTypeLiteral
Added in v3.10.0
Source
Signature
declare const isTypeLiteral: (ast: AST) => ast is TypeLiteral;isTypeLiteralTransformation
Added in v3.10.0
Source
Signature
declare const isTypeLiteralTransformation: (
ast: TransformationKind,
) => ast is TypeLiteralTransformation;isUndefinedKeyword
Added in v3.10.0
Source
Signature
declare const isUndefinedKeyword: (ast: AST) => ast is UndefinedKeyword;Signature
declare const isUnion: (ast: AST) => ast is Union;isUniqueSymbol
Added in v3.10.0
Source
Signature
declare const isUniqueSymbol: (ast: AST) => ast is UniqueSymbol;isUnknownKeyword
Added in v3.10.0
Source
Signature
declare const isUnknownKeyword: (ast: AST) => ast is UnknownKeyword;isVoidKeyword
Added in v3.10.0
Source
Signature
declare const isVoidKeyword: (ast: AST) => ast is VoidKeyword;Model
AnyKeyword
Added in v3.10.0
Source
Signature
declare class AnyKeyword implements Annotated {
constructor(annotations: Annotations);
readonly _tag: "AnyKeyword";
readonly annotations: Annotations;
toJSON(): object;
toString(): string;
}Signature
type AST =
| Declaration
| Literal
| UniqueSymbol
| UndefinedKeyword
| VoidKeyword
| NeverKeyword
| UnknownKeyword
| AnyKeyword
| StringKeyword
| NumberKeyword
| BooleanKeyword
| BigIntKeyword
| SymbolKeyword
| ObjectKeyword
| Enums
| TemplateLiteral
| Refinement
| TupleType
| TypeLiteral
| Union
| Suspend
| Transformation;BigIntKeyword
Added in v3.10.0
Source
Signature
declare class BigIntKeyword implements Annotated {
constructor(annotations: Annotations);
readonly _tag: "BigIntKeyword";
readonly annotations: Annotations;
toJSON(): object;
toString(): string;
}BooleanKeyword
Added in v3.10.0
Source
Signature
declare class BooleanKeyword implements Annotated {
constructor(annotations: Annotations);
readonly _tag: "BooleanKeyword";
readonly annotations: Annotations;
toJSON(): object;
toString(): string;
}ComposeTransformation
Added in v3.10.0
Source
Signature
declare class ComposeTransformation {
constructor();
readonly _tag: "ComposeTransformation";
}Declaration
Added in v3.10.0
Source
Signature
declare class Declaration implements Annotated {
constructor(typeParameters: readonly Array<AST>, decodeUnknown: (...typeParameters: readonly Array<AST>) => (input: unknown, options: ParseOptions, self: Declaration) => Effect<any, ParseIssue, any>, encodeUnknown: (...typeParameters: readonly Array<AST>) => (input: unknown, options: ParseOptions, self: Declaration) => Effect<any, ParseIssue, any>, annotations: Annotations);
readonly _tag: "Declaration";
readonly annotations: Annotations;
readonly decodeUnknown: (...typeParameters: readonly Array<AST>) => (input: unknown, options: ParseOptions, self: Declaration) => Effect<any, ParseIssue, any>;
readonly encodeUnknown: (...typeParameters: readonly Array<AST>) => (input: unknown, options: ParseOptions, self: Declaration) => Effect<any, ParseIssue, any>;
readonly typeParameters: readonly Array<AST>;
toJSON(): object;
toString(): string;
}Signature
declare class Enums implements Annotated {
constructor(enums: readonly Array<readonly [string, string | number]>, annotations: Annotations);
readonly _tag: "Enums";
readonly annotations: Annotations;
readonly enums: readonly Array<readonly [string, string | number]>;
toJSON(): object;
toString(): string;
}FinalTransformation
Added in v3.10.0
Source
Signature
declare class FinalTransformation {
constructor(
decode: (
fromA: any,
options: ParseOptions,
self: Transformation,
fromI: any,
) => Effect<any, ParseIssue, any>,
encode: (
toI: any,
options: ParseOptions,
self: Transformation,
toA: any,
) => Effect<any, ParseIssue, any>,
);
readonly _tag: "FinalTransformation";
readonly decode: (
fromA: any,
options: ParseOptions,
self: Transformation,
fromI: any,
) => Effect<any, ParseIssue, any>;
readonly encode: (
toI: any,
options: ParseOptions,
self: Transformation,
toA: any,
) => Effect<any, ParseIssue, any>;
}IndexSignature
Added in v3.10.0
Source
Signature
declare class IndexSignature {
constructor(parameter: AST, type: AST, isReadonly: boolean);
readonly isReadonly: boolean;
readonly parameter: Parameter;
readonly type: AST;
toJSON(): object;
toString(): string;
}Signature
declare class Literal implements Annotated {
constructor(literal: LiteralValue, annotations: Annotations);
readonly _tag: "Literal";
readonly annotations: Annotations;
readonly literal: LiteralValue;
toJSON(): object;
toString(): string;
}LiteralValue type
Added in v3.10.0
Source
Signature
type LiteralValue = string | number | boolean | null | bigint;NeverKeyword
Added in v3.10.0
Source
Signature
declare class NeverKeyword implements Annotated {
constructor(annotations: Annotations);
readonly _tag: "NeverKeyword";
readonly annotations: Annotations;
toJSON(): object;
toString(): string;
}NumberKeyword
Added in v3.10.0
Source
Signature
declare class NumberKeyword implements Annotated {
constructor(annotations: Annotations);
readonly _tag: "NumberKeyword";
readonly annotations: Annotations;
toJSON(): object;
toString(): string;
}ObjectKeyword
Added in v3.10.0
Source
Signature
declare class ObjectKeyword implements Annotated {
constructor(annotations: Annotations);
readonly _tag: "ObjectKeyword";
readonly annotations: Annotations;
toJSON(): object;
toString(): string;
}OptionalType
Added in v3.10.0
Source
Signature
declare class OptionalType extends Type {
constructor(type: AST, isOptional: boolean, annotations: Annotations);
readonly isOptional: boolean;
toJSON(): object;
toString(): string;
}ParseOptions interface
Added in v3.10.0
Source
Signature
interface ParseOptions {
readonly errors?: "first" | "all";
readonly exact?: boolean;
readonly onExcessProperty?: "error" | "ignore" | "preserve";
readonly propertyOrder?: "none" | "original";
}PropertySignature
Added in v3.10.0
Source
Signature
declare class PropertySignature extends OptionalType {
constructor(
name: PropertyKey,
type: AST,
isOptional: boolean,
isReadonly: boolean,
annotations?: Annotations,
);
readonly isReadonly: boolean;
readonly name: PropertyKey;
toJSON(): object;
toString(): string;
}PropertySignatureTransformation
Added in v3.10.0
Source
Signature
declare class PropertySignatureTransformation {
constructor(
from: PropertyKey,
to: PropertyKey,
decode: (o: Option<any>) => Option<any>,
encode: (o: Option<any>) => Option<any>,
);
readonly decode: (o: Option<any>) => Option<any>;
readonly encode: (o: Option<any>) => Option<any>;
readonly from: PropertyKey;
readonly to: PropertyKey;
}Refinement
Added in v3.10.0
Source
Signature
declare class Refinement<From extends AST = AST> implements Annotated {
constructor<From extends AST = AST>(from: From, filter: (input: any, options: ParseOptions, self: Refinement) => Option<ParseIssue>, annotations: Annotations);
readonly _tag: "Refinement";
readonly annotations: Annotations;
readonly filter: (input: any, options: ParseOptions, self: Refinement) => Option<ParseIssue>;
readonly from: From;
toJSON(): object;
toString(): string;
}StringKeyword
Added in v3.10.0
Source
Signature
declare class StringKeyword implements Annotated {
constructor(annotations: Annotations);
readonly _tag: "StringKeyword";
readonly annotations: Annotations;
toJSON(): object;
toString(): string;
}Signature
declare class Suspend implements Annotated {
constructor(f: () => AST, annotations: Annotations);
readonly _tag: "Suspend";
readonly annotations: Annotations;
readonly f: () => AST;
toJSON(): object;
toString(): string;
}SymbolKeyword
Added in v3.10.0
Source
Signature
declare class SymbolKeyword implements Annotated {
constructor(annotations: Annotations);
readonly _tag: "SymbolKeyword";
readonly annotations: Annotations;
toJSON(): object;
toString(): string;
}TemplateLiteral
Added in v3.10.0
Source
Signature
declare class TemplateLiteral implements Annotated {
constructor(
head: string,
spans: readonly [TemplateLiteralSpan, TemplateLiteralSpan],
annotations: Annotations,
);
readonly _tag: "TemplateLiteral";
readonly annotations: Annotations;
readonly head: string;
readonly spans: readonly [TemplateLiteralSpan, TemplateLiteralSpan];
toJSON(): object;
toString(): string;
}TemplateLiteralSpan
Added in v3.10.0
Source
Signature
declare class TemplateLiteralSpan {
constructor(type: AST, literal: string);
readonly literal: string;
readonly type: TemplateLiteralSpanType;
toJSON(): object;
toString(): string;
}Transformation
Added in v3.10.0
Source
Signature
declare class Transformation implements Annotated {
constructor(from: AST, to: AST, transformation: TransformationKind, annotations: Annotations);
readonly _tag: "Transformation";
readonly annotations: Annotations;
readonly from: AST;
readonly to: AST;
readonly transformation: TransformationKind;
toJSON(): object;
toString(): string;
}TransformationKind type
Added in v3.10.0
Source
Signature
type TransformationKind = FinalTransformation | ComposeTransformation | TypeLiteralTransformation;Signature
declare class TupleType implements Annotated {
constructor(elements: readonly Array<OptionalType>, rest: readonly Array<Type>, isReadonly: boolean, annotations: Annotations);
readonly _tag: "TupleType";
readonly annotations: Annotations;
readonly elements: readonly Array<OptionalType>;
readonly isReadonly: boolean;
readonly rest: readonly Array<Type>;
toJSON(): object;
toString(): string;
}Signature
declare class Type implements Annotated {
constructor(type: AST, annotations: Annotations);
readonly annotations: Annotations;
readonly type: AST;
toJSON(): object;
toString(): string;
}TypeLiteral
Added in v3.10.0
Source
Signature
declare class TypeLiteral implements Annotated {
constructor(propertySignatures: readonly Array<PropertySignature>, indexSignatures: readonly Array<IndexSignature>, annotations: Annotations);
readonly _tag: "TypeLiteral";
readonly annotations: Annotations;
readonly indexSignatures: readonly Array<IndexSignature>;
readonly propertySignatures: readonly Array<PropertySignature>;
toJSON(): object;
toString(): string;
}TypeLiteralTransformation
Added in v3.10.0
Source
Signature
declare class TypeLiteralTransformation {
constructor(propertySignatureTransformations: readonly Array<PropertySignatureTransformation>);
readonly _tag: "TypeLiteralTransformation";
readonly propertySignatureTransformations: readonly Array<PropertySignatureTransformation>;
}UndefinedKeyword
Added in v3.10.0
Source
Signature
declare class UndefinedKeyword implements Annotated {
constructor(annotations: Annotations);
readonly _tag: "UndefinedKeyword";
readonly annotations: Annotations;
toJSON(): object;
toString(): string;
}Signature
declare class Union<M extends AST = AST> implements Annotated {
readonly _tag: "Union";
readonly annotations: Annotations;
readonly types: readonly [M, M, M];
toJSON(): object;
toString(): string;
static make(types: readonly Array<AST>, annotations?: Annotations): AST;
}UniqueSymbol
Added in v3.10.0
Source
Signature
declare class UniqueSymbol implements Annotated {
constructor(symbol: symbol, annotations: Annotations);
readonly _tag: "UniqueSymbol";
readonly annotations: Annotations;
readonly symbol: symbol;
toJSON(): object;
toString(): string;
}UnknownKeyword
Added in v3.10.0
Source
Signature
declare class UnknownKeyword implements Annotated {
constructor(annotations: Annotations);
readonly _tag: "UnknownKeyword";
readonly annotations: Annotations;
toJSON(): object;
toString(): string;
}VoidKeyword
Added in v3.10.0
Source
Signature
declare class VoidKeyword implements Annotated {
constructor(annotations: Annotations);
readonly _tag: "VoidKeyword";
readonly annotations: Annotations;
toJSON(): object;
toString(): string;
}Other
annotations
Added in v3.10.0
Source
Merges a set of new annotations with existing ones, potentially overwriting any duplicates.
Any previously existing identifier annotations are deleted.
Signature
declare function annotations(ast: AST, overrides: Annotations): AST;Signature
type Compiler<A> = (ast: AST, path: ReadonlyArray<PropertyKey>) => A;defaultParseOption
Added in v3.10.0
Source
Signature
declare const defaultParseOption: ParseOptions;encodedAST
Added in v3.10.0
Source
Signature
declare function encodedAST(ast: AST): AST;encodedBoundAST
Added in v3.10.0
Source
Signature
declare function encodedBoundAST(ast: AST): AST;getCompiler
Added in v3.10.0
Source
Signature
declare function getCompiler<A>(match: Match<A>): Compiler<A>;getPropertySignatures
Added in v3.10.0
Source
Signature
declare function getPropertySignatures(ast: AST): Array<PropertySignature>;getTemplateLiteralCapturingRegExp
Added in v3.10.0
Source
Generates a regular expression that captures the pattern defined by the given TemplateLiteral AST.
See
getTemplateLiteralRegExpfor a variant that does not capture the pattern.
Signature
declare function getTemplateLiteralCapturingRegExp(ast: TemplateLiteral): RegExp;getTemplateLiteralRegExp
Added in v3.10.0
Source
Generates a regular expression from a TemplateLiteral AST node.
See
getTemplateLiteralCapturingRegExpfor a variant that captures the pattern.
Signature
declare function getTemplateLiteralRegExp(ast: TemplateLiteral): RegExp;isParameter
Added in v3.10.0
Source
Signature
declare function isParameter(ast: AST): ast is Parameter;Equivalent at runtime to the TypeScript type-level keyof operator.
Signature
declare function keyof(ast: AST): AST;Signature
type Match<A> = {
[K in AST["_tag"]]: (
ast: Extract<
AST,
{
_tag: K;
}
>,
compile: Compiler<A>,
path: ReadonlyArray<PropertyKey>,
) => A;
};Signature
type Members<A> = readonly [A, A, ...Array<A>];Creates a new AST with shallow mutability applied to its properties.
Signature
declare function mutable(ast: AST): AST;Signature
declare const null: LiteralEquivalent at runtime to the built-in TypeScript utility type Omit.
Signature
declare function omit(ast: AST, keys: readonly Array<PropertyKey>): TypeLiteral | TransformationSignature
type Parameter = StringKeyword | SymbolKeyword | TemplateLiteral | Refinement<Parameter>;Equivalent at runtime to the built-in TypeScript utility type Partial.
Signature
declare function partial(
ast: AST,
options?: {
readonly exact: true;
},
): AST;Equivalent at runtime to the built-in TypeScript utility type Pick.
Signature
declare function pick(ast: AST, keys: readonly Array<PropertyKey>): TypeLiteral | TransformationEquivalent at runtime to the built-in TypeScript utility type Required.
Signature
declare function required(ast: AST): AST;Signature
declare function typeAST(ast: AST): AST;Schema Id
ParseJsonSchemaId
Added in v3.10.0
Source
Signature
declare const ParseJsonSchemaId: unique symbol;
Represents a
PropertySignature -> PropertySignaturetransformationThe semantic of
decodeis: -none()represents the absence of the key/value pair -some(value)represents the presence of the key/value pairThe semantic of
encodeis: -none()you don't want to output the key/value pair -some(value)you want to output the key/value pair