Options
All
  • Public
  • Public/Protected
  • All
Menu

Type Parameters

  • T extends TypeMap = any

Hierarchy

  • Schema

Index

Constructors

  • new Schema<T>(fields?: Field<T[keyof T]>[], metadata?: null | Map<string, string>, dictionaries?: null | Map<number, DataType<Type, any>>): Schema<T>
  • Type Parameters

    • T extends TypeMap = any

    Parameters

    • fields: Field<T[keyof T]>[] = []
    • Optional metadata: null | Map<string, string>
    • Optional dictionaries: null | Map<number, DataType<Type, any>>

    Returns Schema<T>

Properties

dictionaries: Map<number, DataType<Type, any>>
fields: Field<T[keyof T]>[]
metadata: Map<string, string>

Accessors

  • get [toStringTag](): string
  • get names(): (keyof T)[]

Methods

  • Type Parameters

    • R extends TypeMap = any

    Parameters

    Returns Schema<T & R>

  • Type Parameters

    • R extends TypeMap = any

    Parameters

    • Rest ...fields: (Field<R[keyof R]> | Field<R[keyof R]>[])[]

    Returns Schema<T & R>

  • select<K>(fieldNames: K[]): Schema<{ [ P in string | number | symbol]: T[P] }>
  • Construct a new Schema containing only specified fields.

    Type Parameters

    • K extends string | number | symbol = any

    Parameters

    • fieldNames: K[]

      Names of fields to keep.

    Returns Schema<{ [ P in string | number | symbol]: T[P] }>

    A new Schema of fields matching the specified names.

  • selectAt<K>(fieldIndices: number[]): Schema<K>
  • Construct a new Schema containing only fields at the specified indices.

    Type Parameters

    • K extends TypeMap = any

    Parameters

    • fieldIndices: number[]

      Indices of fields to keep.

    Returns Schema<K>

    A new Schema of fields at the specified indices.

  • toString(): string

Generated using TypeDoc