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

Table of contents


ArrayCombinator (interface)

Signature

export interface ArrayCombinator {
  kind: 'ArrayCombinator'
  type: TypeReference
  name?: string
}

BooleanType (interface)

Signature

export interface BooleanType {
  kind: 'BooleanType'
  name: 'boolean'
}

BrandCombinator (interface)

Signature

export interface BrandCombinator {
  kind: 'BrandCombinator'
  type: TypeReference
  predicate: (variableName: string) => string
  name: string
}

CustomCombinator (interface)

Signature

export interface CustomCombinator {
  kind: 'CustomCombinator'
  static: string
  runtime: string
  dependencies: Array<string>
}

CustomTypeDeclaration (interface)

Signature

export interface CustomTypeDeclaration {
  kind: 'CustomTypeDeclaration'
  name: string
  static: string
  runtime: string
  dependencies: Array<string>
}

DictionaryCombinator (interface)

Signature

export interface DictionaryCombinator {
  kind: 'DictionaryCombinator'
  domain: TypeReference
  codomain: TypeReference
  name?: string
}

ExactCombinator (interface)

Signature

export interface ExactCombinator {
  kind: 'ExactCombinator'
  type: TypeReference
  name?: string
}

FunctionType (interface)

Signature

export interface FunctionType {
  kind: 'FunctionType'
  name: 'Function'
}

Identifier (interface)

Signature

export interface Identifier {
  kind: 'Identifier'
  name: string
}

IntType (interface)

Signature

export interface IntType {
  kind: 'IntType'
  name: 'Int'
}

IntegerType (interface)

Signature

export interface IntegerType {
  kind: 'IntegerType'
  name: 'Integer'
}

InterfaceCombinator (interface)

Signature

export interface InterfaceCombinator {
  kind: 'InterfaceCombinator'
  properties: Array<Property>
  name?: string
  forceType?: boolean
}

IntersectionCombinator (interface)

Signature

export interface IntersectionCombinator {
  kind: 'IntersectionCombinator'
  types: Array<TypeReference>
  name?: string
}

KeyofCombinator (interface)

Signature

export interface KeyofCombinator {
  kind: 'KeyofCombinator'
  values: Array<string>
  name?: string
}

LiteralCombinator (interface)

Signature

export interface LiteralCombinator {
  kind: 'LiteralCombinator'
  value: string | number | boolean
  name?: string
}

NullType (interface)

Signature

export interface NullType {
  kind: 'NullType'
  name: 'null'
}

NumberType (interface)

Signature

export interface NumberType {
  kind: 'NumberType'
  name: 'number'
}

Optional (interface)

Signature

export interface Optional {
  isOptional: boolean
}

PartialCombinator (interface)

Signature

export interface PartialCombinator {
  kind: 'PartialCombinator'
  properties: Array<Property>
  name?: string
  forceType?: boolean
}

Property (interface)

Signature

export interface Property extends Optional {
  kind: 'Property'
  key: string
  type: TypeReference
  description?: string
}

Readonly (interface)

Signature

export interface Readonly {
  isReadonly: boolean
}

ReadonlyArrayCombinator (interface)

Signature

export interface ReadonlyArrayCombinator {
  kind: 'ReadonlyArrayCombinator'
  type: TypeReference
  name?: string
}

ReadonlyCombinator (interface)

Signature

export interface ReadonlyCombinator {
  kind: 'ReadonlyCombinator'
  type: TypeReference
  name?: string
}

Recursion (interface)

Signature

export interface Recursion {
  name: string
  output: boolean
}

RecursiveCombinator (interface)

Signature

export interface RecursiveCombinator {
  kind: 'RecursiveCombinator'
  typeParameter: Identifier
  name: string
  type: TypeReference
}

StrictCombinator (interface)

Signature

export interface StrictCombinator {
  kind: 'StrictCombinator'
  properties: Array<Property>
  name?: string
  forceType?: boolean
}

StringType (interface)

Signature

export interface StringType {
  kind: 'StringType'
  name: 'string'
}

TaggedUnionCombinator (interface)

Signature

export interface TaggedUnionCombinator {
  kind: 'TaggedUnionCombinator'
  tag: string
  types: Array<TypeReference>
  name?: string
}

TupleCombinator (interface)

Signature

export interface TupleCombinator {
  kind: 'TupleCombinator'
  types: Array<TypeReference>
  name?: string
}

TypeDeclaration (interface)

Signature

export interface TypeDeclaration extends Readonly {
  kind: 'TypeDeclaration'
  name: string
  type: TypeReference
  isExported: boolean
  description?: string
}

UndefinedType (interface)

Signature

export interface UndefinedType {
  kind: 'UndefinedType'
  name: 'undefined'
}

UnionCombinator (interface)

Signature

export interface UnionCombinator {
  kind: 'UnionCombinator'
  types: Array<TypeReference>
  name?: string
}

UnknownArrayType (interface)

Signature

export interface UnknownArrayType {
  kind: 'AnyArrayType'
  name: 'UnknownArray'
}

UnknownRecordType (interface)

Signature

export interface UnknownRecordType {
  kind: 'AnyDictionaryType'
  name: 'UnknownRecord'
}

UnknownType (interface)

Signature

export interface UnknownType {
  kind: 'UnknownType'
  name: 'unknown'
}

BasicType (type alias)

Signature

export type BasicType =
  | StringType
  | NumberType
  | BooleanType
  | NullType
  | UndefinedType
  // tslint:disable-next-line: deprecation
  | IntegerType
  | IntType
  | UnknownArrayType
  | UnknownRecordType
  | FunctionType
  | UnknownType

Combinator (type alias)

Signature

export type Combinator =
  | InterfaceCombinator
  | UnionCombinator
  | LiteralCombinator
  | IntersectionCombinator
  | KeyofCombinator
  | ArrayCombinator
  | ReadonlyArrayCombinator
  | TupleCombinator
  | RecursiveCombinator
  | DictionaryCombinator
  | PartialCombinator
  | TaggedUnionCombinator
  | CustomCombinator
  | ExactCombinator
  | StrictCombinator
  | ReadonlyCombinator
  | BrandCombinator

Graph (type alias)

Signature

export type Graph = { [key: string]: Vertex }

Node (type alias)

Signature

export type Node = TypeReference | TypeDeclaration | CustomTypeDeclaration

TypeReference (type alias)

Signature

export type TypeReference = BasicType | Combinator | Identifier

Vertex (class)

Signature

export class Vertex {
  constructor(public id: string) { ... }
  ...
}

booleanType (constant)

Signature

export const booleanType: BooleanType = ...

dictionaryCombinator (constant)

Use recordCombinator instead

Signature

export const dictionaryCombinator = ...

functionType (constant)

Signature

export const functionType: FunctionType = ...

intType (constant)

Signature

export const intType: IntType = ...

integerType (constant)

Signature

export const integerType: IntegerType = ...

interfaceCombinator (constant)

Use typeCombinator instead

Signature

export const interfaceCombinator = ...

nullType (constant)

Signature

export const nullType: NullType = ...

numberType (constant)

Signature

export const numberType: NumberType = ...

stringType (constant)

Signature

export const stringType: StringType = ...

undefinedType (constant)

Signature

export const undefinedType: UndefinedType = ...

unknownArrayType (constant)

Signature

export const unknownArrayType: UnknownArrayType = ...

unknownRecordType (constant)

Signature

export const unknownRecordType: UnknownRecordType = ...

unknownType (constant)

Signature

export const unknownType: UnknownType = ...

arrayCombinator (function)

Signature

export function arrayCombinator(type: TypeReference, name?: string): ArrayCombinator { ... }

brandCombinator (function)

Signature

export function brandCombinator(
  type: TypeReference,
  predicate: (variableName: string) => string,
  name: string
): BrandCombinator { ... }

customCombinator (function)

Signature

export function customCombinator(
  staticRepr: string,
  runtimeRepr: string,
  dependencies: Array<string> = []
): CustomCombinator { ... }

customTypeDeclaration (function)

Signature

export function customTypeDeclaration(
  name: string,
  staticRepr: string,
  runtimeRepr: string,
  dependencies: Array<string> = []
): CustomTypeDeclaration { ... }

exactCombinator (function)

Signature

export function exactCombinator(type: TypeReference, name?: string): ExactCombinator { ... }

forceTypeCombinator (function)

Signature

export function forceTypeCombinator<T extends InterfaceCombinator | StrictCombinator | PartialCombinator>(
  combinator: T
): T { ... }

getNodeDependencies (function)

Signature

export const getNodeDependencies = (node: Node): Array<string> => ...

getRecursiveTypeDeclaration (function)

Signature

export function getRecursiveTypeDeclaration(declaration: TypeDeclaration): TypeDeclaration { ... }

getTypeDeclarationGraph (function)

Signature

export function getTypeDeclarationGraph(declarations: Array<TypeDeclaration | CustomTypeDeclaration>): Graph { ... }

getTypeDeclarationMap (function)

Signature

export function getTypeDeclarationMap(
  declarations: Array<TypeDeclaration | CustomTypeDeclaration>
): { [key: string]: TypeDeclaration | CustomTypeDeclaration } { ... }

identifier (function)

Signature

export function identifier(name: string): Identifier { ... }

intersectionCombinator (function)

Signature

export function intersectionCombinator(types: Array<TypeReference>, name?: string): IntersectionCombinator { ... }

keyofCombinator (function)

Signature

export function keyofCombinator(values: Array<string>, name?: string): KeyofCombinator { ... }

literalCombinator (function)

Signature

export function literalCombinator(value: string | boolean | number, name?: string): LiteralCombinator { ... }

partialCombinator (function)

Signature

export function partialCombinator(properties: Array<Property>, name?: string): PartialCombinator { ... }

printRuntime (function)

Signature

export function printRuntime(node: Node, i: number = 0): string { ... }

printStatic (function)

Signature

export function printStatic(node: Node, i: number = 0, recursion?: Recursion): string { ... }

property (function)

Signature

export function property(
  key: string,
  type: TypeReference,
  isOptional: boolean = false,
  description?: string
): Property { ... }

readonlyArrayCombinator (function)

Signature

export function readonlyArrayCombinator(type: TypeReference, name?: string): ReadonlyArrayCombinator { ... }

readonlyCombinator (function)

Signature

export function readonlyCombinator(type: TypeReference, name?: string): ReadonlyCombinator { ... }

recordCombinator (function)

Signature

export function recordCombinator(domain: TypeReference, codomain: TypeReference, name?: string): DictionaryCombinator { ... }

recursiveCombinator (function)

Signature

export function recursiveCombinator(typeParameter: Identifier, name: string, type: TypeReference): RecursiveCombinator { ... }

sort (function)

Signature

export function sort(
  declarations: Array<TypeDeclaration | CustomTypeDeclaration>
): Array<TypeDeclaration | CustomTypeDeclaration> { ... }

strictCombinator (function)

Signature

export function strictCombinator(properties: Array<Property>, name?: string): StrictCombinator { ... }

taggedUnionCombinator (function)

Signature

export function taggedUnionCombinator(tag: string, types: Array<TypeReference>, name?: string): TaggedUnionCombinator { ... }

tsort (function)

topological sort

Signature

export function tsort(graph: Graph): { sorted: Array<string>; recursive: { [key: string]: true } } { ... }

tupleCombinator (function)

Signature

export function tupleCombinator(types: Array<TypeReference>, name?: string): TupleCombinator { ... }

typeCombinator (function)

Signature

export function typeCombinator(properties: Array<Property>, name?: string): InterfaceCombinator { ... }

typeDeclaration (function)

Signature

export function typeDeclaration(
  name: string,
  type: TypeReference,
  isExported: boolean = false,
  /** @deprecated */
  isReadonly: boolean = false,
  description?: string
): TypeDeclaration { ... }

unionCombinator (function)

Signature

export function unionCombinator(types: Array<TypeReference>, name?: string): UnionCombinator { ... }