Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • T: 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: 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

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

    Type parameters

    • K: 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: 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