Skip to main content Link Search Menu Expand Document (external link)

AST overview

Added in v1.0.0


Table of contents


annotations

Annotated (interface)

Signature

export interface Annotated {
  readonly annotations: Annotations
}

Added in v1.0.0

Annotations (interface)

Signature

export interface Annotations {
  readonly [_: symbol]: unknown
}

Added in v1.0.0

BatchingAnnotation (type alias)

Signature

export type BatchingAnnotation = boolean | "inherit" | undefined

Added in v1.0.0

BatchingAnnotationId

Signature

export declare const BatchingAnnotationId: typeof BatchingAnnotationId

Added in v1.0.0

BrandAnnotation (type alias)

Signature

export type BrandAnnotation = ReadonlyArray.NonEmptyReadonlyArray<string | symbol>

Added in v1.0.0

BrandAnnotationId

Signature

export declare const BrandAnnotationId: typeof BrandAnnotationId

Added in v1.0.0

ConcurrencyAnnotation (type alias)

Signature

export type ConcurrencyAnnotation = Concurrency | undefined

Added in v1.0.0

ConcurrencyAnnotationId

Signature

export declare const ConcurrencyAnnotationId: typeof ConcurrencyAnnotationId

Added in v1.0.0

DefaultAnnotation (type alias)

Signature

export type DefaultAnnotation<A> = A

Added in v1.0.0

DefaultAnnotationId

Signature

export declare const DefaultAnnotationId: typeof DefaultAnnotationId

Added in v1.0.0

DescriptionAnnotation (type alias)

Signature

export type DescriptionAnnotation = string

Added in v1.0.0

DescriptionAnnotationId

Signature

export declare const DescriptionAnnotationId: typeof DescriptionAnnotationId

Added in v1.0.0

DocumentationAnnotation (type alias)

Signature

export type DocumentationAnnotation = string

Added in v1.0.0

DocumentationAnnotationId

Signature

export declare const DocumentationAnnotationId: typeof DocumentationAnnotationId

Added in v1.0.0

ExamplesAnnotation (type alias)

Signature

export type ExamplesAnnotation<A> = ReadonlyArray.NonEmptyReadonlyArray<A>

Added in v1.0.0

ExamplesAnnotationId

Signature

export declare const ExamplesAnnotationId: typeof ExamplesAnnotationId

Added in v1.0.0

IdentifierAnnotation (type alias)

Signature

export type IdentifierAnnotation = string

Added in v1.0.0

IdentifierAnnotationId

Signature

export declare const IdentifierAnnotationId: typeof IdentifierAnnotationId

Added in v1.0.0

JSONSchemaAnnotation (type alias)

Signature

export type JSONSchemaAnnotation = object

Added in v1.0.0

JSONSchemaAnnotationId

Signature

export declare const JSONSchemaAnnotationId: typeof JSONSchemaAnnotationId

Added in v1.0.0

MessageAnnotation (type alias)

Signature

export type MessageAnnotation = (issue: ParseIssue) => string | Effect<string>

Added in v1.0.0

MessageAnnotationId

Signature

export declare const MessageAnnotationId: typeof MessageAnnotationId

Added in v1.0.0

ParseIssueTitleAnnotation (type alias)

Signature

export type ParseIssueTitleAnnotation = (issue: ParseIssue) => string | undefined

Added in v1.0.0

ParseIssueTitleAnnotationId

Signature

export declare const ParseIssueTitleAnnotationId: typeof ParseIssueTitleAnnotationId

Added in v1.0.0

TitleAnnotation (type alias)

Signature

export type TitleAnnotation = string

Added in v1.0.0

TitleAnnotationId

Signature

export declare const TitleAnnotationId: typeof TitleAnnotationId

Added in v1.0.0

TypeAnnotation (type alias)

Signature

export type TypeAnnotation = symbol

Added in v1.0.0

TypeAnnotationId

Signature

export declare const TypeAnnotationId: typeof TypeAnnotationId

Added in v1.0.0

getAnnotation

Signature

export declare const getAnnotation: {
  <A>(key: symbol): (annotated: Annotated) => Option.Option<A>
  <A>(annotated: Annotated, key: symbol): Option.Option<A>
}

Added in v1.0.0

getBatchingAnnotation

Signature

export declare const getBatchingAnnotation: (annotated: Annotated) => Option.Option<A>

Added in v1.0.0

getBrandAnnotation

Signature

export declare const getBrandAnnotation: (annotated: Annotated) => Option.Option<A>

Added in v1.0.0

getConcurrencyAnnotation

Signature

export declare const getConcurrencyAnnotation: (annotated: Annotated) => Option.Option<A>

Added in v1.0.0

getDefaultAnnotation

Signature

export declare const getDefaultAnnotation: (annotated: Annotated) => Option.Option<A>

Added in v1.0.0

getDescriptionAnnotation

Signature

export declare const getDescriptionAnnotation: (annotated: Annotated) => Option.Option<A>

Added in v1.0.0

getDocumentationAnnotation

Signature

export declare const getDocumentationAnnotation: (annotated: Annotated) => Option.Option<A>

Added in v1.0.0

getExamplesAnnotation

Signature

export declare const getExamplesAnnotation: (annotated: Annotated) => Option.Option<A>

Added in v1.0.0

getIdentifierAnnotation

Signature

export declare const getIdentifierAnnotation: (annotated: Annotated) => Option.Option<A>

Added in v1.0.0

getJSONSchemaAnnotation

Signature

export declare const getJSONSchemaAnnotation: (annotated: Annotated) => Option.Option<A>

Added in v1.0.0

getMessageAnnotation

Signature

export declare const getMessageAnnotation: (annotated: Annotated) => Option.Option<A>

Added in v1.0.0

getParseIssueTitleAnnotation

Signature

export declare const getParseIssueTitleAnnotation: (annotated: Annotated) => Option.Option<A>

Added in v1.0.0

getTitleAnnotation

Signature

export declare const getTitleAnnotation: (annotated: Annotated) => Option.Option<A>

Added in v1.0.0

constructors

anyKeyword

Signature

export declare const anyKeyword: AnyKeyword

Added in v1.0.0

bigIntKeyword

Signature

export declare const bigIntKeyword: BigIntKeyword

Added in v1.0.0

booleanKeyword

Signature

export declare const booleanKeyword: BooleanKeyword

Added in v1.0.0

composeTransformation

Signature

export declare const composeTransformation: ComposeTransformation

Added in v1.0.0

neverKeyword

Signature

export declare const neverKeyword: NeverKeyword

Added in v1.0.0

null

Signature

export declare const null: Literal

Added in v1.0.0

numberKeyword

Signature

export declare const numberKeyword: NumberKeyword

Added in v1.0.0

objectKeyword

Signature

export declare const objectKeyword: ObjectKeyword

Added in v1.0.0

stringKeyword

Signature

export declare const stringKeyword: StringKeyword

Added in v1.0.0

symbolKeyword

Signature

export declare const symbolKeyword: SymbolKeyword

Added in v1.0.0

undefinedKeyword

Signature

export declare const undefinedKeyword: UndefinedKeyword

Added in v1.0.0

unknownKeyword

Signature

export declare const unknownKeyword: UnknownKeyword

Added in v1.0.0

voidKeyword

Signature

export declare const voidKeyword: VoidKeyword

Added in v1.0.0

guards

isAnyKeyword

Signature

export declare const isAnyKeyword: (ast: AST) => ast is AnyKeyword

Added in v1.0.0

isBigIntKeyword

Signature

export declare const isBigIntKeyword: (ast: AST) => ast is BigIntKeyword

Added in v1.0.0

isBooleanKeyword

Signature

export declare const isBooleanKeyword: (ast: AST) => ast is BooleanKeyword

Added in v1.0.0

isComposeTransformation

Signature

export declare const isComposeTransformation: (ast: TransformationKind) => ast is ComposeTransformation

Added in v1.0.0

isDeclaration

Signature

export declare const isDeclaration: (ast: AST) => ast is Declaration

Added in v1.0.0

isEnums

Signature

export declare const isEnums: (ast: AST) => ast is Enums

Added in v1.0.0

isFinalTransformation

Signature

export declare const isFinalTransformation: (ast: TransformationKind) => ast is FinalTransformation

Added in v1.0.0

isLiteral

Signature

export declare const isLiteral: (ast: AST) => ast is Literal

Added in v1.0.0

isNeverKeyword

Signature

export declare const isNeverKeyword: (ast: AST) => ast is NeverKeyword

Added in v1.0.0

isNumberKeyword

Signature

export declare const isNumberKeyword: (ast: AST) => ast is NumberKeyword

Added in v1.0.0

isObjectKeyword

Signature

export declare const isObjectKeyword: (ast: AST) => ast is ObjectKeyword

Added in v1.0.0

isRefinement

Signature

export declare const isRefinement: (ast: AST) => ast is Refinement<AST>

Added in v1.0.0

isStringKeyword

Signature

export declare const isStringKeyword: (ast: AST) => ast is StringKeyword

Added in v1.0.0

isSuspend

Signature

export declare const isSuspend: (ast: AST) => ast is Suspend

Added in v1.0.0

isSymbolKeyword

Signature

export declare const isSymbolKeyword: (ast: AST) => ast is SymbolKeyword

Added in v1.0.0

isTemplateLiteral

Signature

export declare const isTemplateLiteral: (ast: AST) => ast is TemplateLiteral

Added in v1.0.0

isTransformation

Signature

export declare const isTransformation: (ast: AST) => ast is Transformation

Added in v1.0.0

isTupleType

Signature

export declare const isTupleType: (ast: AST) => ast is TupleType

Added in v1.0.0

isTypeLiteral

Signature

export declare const isTypeLiteral: (ast: AST) => ast is TypeLiteral

Added in v1.0.0

isTypeLiteralTransformation

Signature

export declare const isTypeLiteralTransformation: (ast: TransformationKind) => ast is TypeLiteralTransformation

Added in v1.0.0

isUndefinedKeyword

Signature

export declare const isUndefinedKeyword: (ast: AST) => ast is UndefinedKeyword

Added in v1.0.0

isUnion

Signature

export declare const isUnion: (ast: AST) => ast is Union

Added in v1.0.0

isUniqueSymbol

Signature

export declare const isUniqueSymbol: (ast: AST) => ast is UniqueSymbol

Added in v1.0.0

isUnknownKeyword

Signature

export declare const isUnknownKeyword: (ast: AST) => ast is UnknownKeyword

Added in v1.0.0

isVoidKeyword

Signature

export declare const isVoidKeyword: (ast: AST) => ast is VoidKeyword

Added in v1.0.0

model

AST (type alias)

Signature

export type AST =
  | Declaration
  | Literal
  | UniqueSymbol
  | UndefinedKeyword
  | VoidKeyword
  | NeverKeyword
  | UnknownKeyword
  | AnyKeyword
  | StringKeyword
  | NumberKeyword
  | BooleanKeyword
  | BigIntKeyword
  | SymbolKeyword
  | ObjectKeyword
  | Enums
  | TemplateLiteral
  // possible transformations
  | Refinement
  | TupleType
  | TypeLiteral
  | Union
  | Suspend
  // transformations
  | Transformation

Added in v1.0.0

AnyKeyword (class)

Signature

export declare class AnyKeyword { constructor(readonly annotations: Annotations = {}) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "AnyKeyword"

Added in v1.0.0

BigIntKeyword (class)

Signature

export declare class BigIntKeyword { constructor(readonly annotations: Annotations = {}) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "BigIntKeyword"

Added in v1.0.0

BooleanKeyword (class)

Signature

export declare class BooleanKeyword { constructor(readonly annotations: Annotations = {}) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "BooleanKeyword"

Added in v1.0.0

ComposeTransformation (class)

Signature

export declare class ComposeTransformation

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "ComposeTransformation"

Added in v1.0.0

Declaration (class)

Signature

export declare class Declaration { constructor(
    readonly typeParameters: ReadonlyArray<AST>,
    readonly decodeUnknown: (
      ...typeParameters: ReadonlyArray<AST>
    ) => (input: unknown, options: ParseOptions, self: Declaration) => Effect<any, ParseIssue, any>,
    readonly encodeUnknown: (
      ...typeParameters: ReadonlyArray<AST>
    ) => (input: unknown, options: ParseOptions, self: Declaration) => Effect<any, ParseIssue, any>,
    readonly annotations: Annotations = {}
  ) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "Declaration"

Added in v1.0.0

Element (class)

Signature

export declare class Element { constructor(readonly type: AST, readonly isOptional: boolean) }

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

toString (method)

Signature

toString()

Added in v1.0.0

Enums (class)

Signature

export declare class Enums { constructor(
    readonly enums: ReadonlyArray<readonly [string, string | number]>,
    readonly annotations: Annotations = {}
  ) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "Enums"

Added in v1.0.0

FinalTransformation (class)

Signature

export declare class FinalTransformation { constructor(
    readonly decode: (input: any, options: ParseOptions, self: Transformation) => Effect<any, ParseIssue, any>,
    readonly encode: (input: any, options: ParseOptions, self: Transformation) => Effect<any, ParseIssue, any>
  ) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "FinalTransformation"

Added in v1.0.0

IndexSignature (class)

Signature

export declare class IndexSignature { constructor(
    parameter: AST,
    readonly type: AST,
    readonly isReadonly: boolean
  ) }

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

parameter (property)

Signature

readonly parameter: Parameter

Added in v1.0.0

Literal (class)

Signature

export declare class Literal { constructor(readonly literal: LiteralValue, readonly annotations: Annotations = {}) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "Literal"

Added in v1.0.0

LiteralValue (type alias)

Signature

export type LiteralValue = string | number | boolean | null | bigint

Added in v1.0.0

NeverKeyword (class)

Signature

export declare class NeverKeyword { constructor(readonly annotations: Annotations = {}) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "NeverKeyword"

Added in v1.0.0

NumberKeyword (class)

Signature

export declare class NumberKeyword { constructor(readonly annotations: Annotations = {}) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "NumberKeyword"

Added in v1.0.0

ObjectKeyword (class)

Signature

export declare class ObjectKeyword { constructor(readonly annotations: Annotations = {}) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "ObjectKeyword"

Added in v1.0.0

ParseOptions (interface)

Signature

export interface ParseOptions {
  /** default "first" */
  readonly errors?: "first" | "all" | undefined
  /** default "ignore" */
  readonly onExcessProperty?: "ignore" | "error" | "preserve" | undefined
}

Added in v1.0.0

PropertySignature (class)

Signature

export declare class PropertySignature { constructor(
    readonly name: PropertyKey,
    readonly type: AST,
    readonly isOptional: boolean,
    readonly isReadonly: boolean,
    readonly annotations: Annotations = {}
  ) }

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

PropertySignatureTransformation (class)

Represents a PropertySignature -> PropertySignature transformation

The semantic of decode is:

  • none() represents the absence of the key/value pair
  • some(value) represents the presence of the key/value pair

The semantic of encode is:

  • none() you don’t want to output the key/value pair
  • some(value) you want to output the key/value pair

Signature

export declare class PropertySignatureTransformation { constructor(
    readonly from: PropertyKey,
    readonly to: PropertyKey,
    readonly decode: (o: Option.Option<any>) => Option.Option<any>,
    readonly encode: (o: Option.Option<any>) => Option.Option<any>
  ) }

Added in v1.0.0

Refinement (class)

Signature

export declare class Refinement<From> { constructor(
    readonly from: From,
    readonly filter: (
      input: any,
      options: ParseOptions,
      self: Refinement
    ) => Option.Option<ParseIssue>,
    readonly annotations: Annotations = {}
  ) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "Refinement"

Added in v1.0.0

StringKeyword (class)

Signature

export declare class StringKeyword { constructor(readonly annotations: Annotations = {}) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "StringKeyword"

Added in v1.0.0

Suspend (class)

Signature

export declare class Suspend { constructor(readonly f: () => AST, readonly annotations: Annotations = {}) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "Suspend"

Added in v1.0.0

SymbolKeyword (class)

Signature

export declare class SymbolKeyword { constructor(readonly annotations: Annotations = {}) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "SymbolKeyword"

Added in v1.0.0

TemplateLiteral (class)

Signature

export declare class TemplateLiteral { private constructor(
    readonly head: string,
    readonly spans: ReadonlyArray.NonEmptyReadonlyArray<TemplateLiteralSpan>,
    readonly annotations: Annotations = {}
  ) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "TemplateLiteral"

Added in v1.0.0

TemplateLiteralSpan (class)

Signature

export declare class TemplateLiteralSpan { constructor(readonly type: StringKeyword | NumberKeyword, readonly literal: string) }

Added in v1.0.0

toString (method)

Signature

toString()

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

Transformation (class)

Signature

export declare class Transformation { constructor(
    readonly from: AST,
    readonly to: AST,
    readonly transformation: TransformationKind,
    readonly annotations: Annotations = {}
  ) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "Transformation"

Added in v1.0.0

TransformationKind (type alias)

Signature

export type TransformationKind = FinalTransformation | ComposeTransformation | TypeLiteralTransformation

Added in v1.0.0

TupleType (class)

Signature

export declare class TupleType { constructor(
    readonly elements: ReadonlyArray<Element>,
    readonly rest: ReadonlyArray<AST>,
    readonly isReadonly: boolean,
    readonly annotations: Annotations = {}
  ) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "TupleType"

Added in v1.0.0

TypeLiteral (class)

Signature

export declare class TypeLiteral { constructor(
    propertySignatures: ReadonlyArray<PropertySignature>,
    indexSignatures: ReadonlyArray<IndexSignature>,
    readonly annotations: Annotations = {}
  ) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "TypeLiteral"

Added in v1.0.0

propertySignatures (property)

Signature

readonly propertySignatures: ReadonlyArray<PropertySignature>

Added in v1.0.0

indexSignatures (property)

Signature

readonly indexSignatures: ReadonlyArray<IndexSignature>

Added in v1.0.0

TypeLiteralTransformation (class)

Signature

export declare class TypeLiteralTransformation { constructor(
    readonly propertySignatureTransformations: ReadonlyArray<
      PropertySignatureTransformation
    >
  ) }

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "TypeLiteralTransformation"

Added in v1.0.0

UndefinedKeyword (class)

Signature

export declare class UndefinedKeyword { constructor(readonly annotations: Annotations = {}) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "UndefinedKeyword"

Added in v1.0.0

Union (class)

Signature

export declare class Union { private constructor(readonly types: Members<AST>, readonly annotations: Annotations = {}) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "Union"

Added in v1.0.0

UniqueSymbol (class)

Signature

export declare class UniqueSymbol { constructor(readonly symbol: symbol, readonly annotations: Annotations = {}) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "UniqueSymbol"

Added in v1.0.0

UnknownKeyword (class)

Signature

export declare class UnknownKeyword { constructor(readonly annotations: Annotations = {}) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "UnknownKeyword"

Added in v1.0.0

VoidKeyword (class)

Signature

export declare class VoidKeyword { constructor(readonly annotations: Annotations = {}) }

Added in v1.0.0

toString (method)

Signature

toString(verbose: boolean = false)

Added in v1.0.0

toJSON (method)

Signature

toJSON(): object

Added in v1.0.0

_tag (property)

Signature

readonly _tag: "VoidKeyword"

Added in v1.0.0

utils

Compiler (type alias)

Signature

export type Compiler<A> = (ast: AST) => A

Added in v1.0.0

Match (type alias)

Signature

export type Match<A> = {
  [K in AST["_tag"]]: (ast: Extract<AST, { _tag: K }>, compile: Compiler<A>) => A
}

Added in v1.0.0

Members (type alias)

Signature

export type Members<A> = readonly [A, A, ...Array<A>]

Added in v1.0.0

Parameter (type alias)

Signature

export type Parameter = StringKeyword | SymbolKeyword | TemplateLiteral | Refinement<Parameter>

Added in v1.0.0

annotations

Adds a group of annotations, potentially overwriting existing annotations.

Signature

export declare const annotations: (ast: AST, annotations: Annotations) => AST

Added in v1.0.0

defaultParseOption

Signature

export declare const defaultParseOption: ParseOptions

Added in v1.0.0

encodedAST

Signature

export declare const encodedAST: (ast: AST) => AST

Added in v1.0.0

getCompiler

Signature

export declare const getCompiler: <A>(match: Match<A>) => Compiler<A>

Added in v1.0.0

getPropertySignatures

Signature

export declare const getPropertySignatures: (ast: AST) => Array<PropertySignature>

Added in v1.0.0

getTemplateLiteralRegExp

Signature

export declare const getTemplateLiteralRegExp: (ast: TemplateLiteral) => RegExp

Added in v1.0.0

hash

Signature

export declare const hash: (ast: AST) => number

Added in v1.0.0

isParameter

Signature

export declare const isParameter: (ast: AST) => ast is Parameter

Added in v1.0.0

keyof

Equivalent at runtime to the TypeScript type-level keyof operator.

Signature

export declare const keyof: (ast: AST) => AST

Added in v1.0.0

mutable

Creates a new AST with shallow mutability applied to its properties.

Signature

export declare const mutable: (ast: AST) => AST

Added in v1.0.0

omit

Equivalent at runtime to the built-in TypeScript utility type Omit.

Signature

export declare const omit: (ast: AST, keys: ReadonlyArray<PropertyKey>) => TypeLiteral | Transformation

Added in v1.0.0

partial

Equivalent at runtime to the built-in TypeScript utility type Partial.

Signature

export declare const partial: (ast: AST, options?: { readonly exact: true }) => AST

Added in v1.0.0

pick

Equivalent at runtime to the built-in TypeScript utility type Pick.

Signature

export declare const pick: (ast: AST, keys: ReadonlyArray<PropertyKey>) => TypeLiteral | Transformation

Added in v1.0.0

required

Equivalent at runtime to the built-in TypeScript utility type Required.

Signature

export declare const required: (ast: AST) => AST

Added in v1.0.0

typeAST

Signature

export declare const typeAST: (ast: AST) => AST

Added in v1.0.0