Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Union<Schema>

Type parameters

  • Schema

Hierarchy

  • Union<Schema>
    • Union

Index

Constructors

  • new Union<Schema>(): Union<Schema>
  • new Union<Schema>(discr: Layout<any, any>, defaultLayout: Layout<any, any>, property?: string): Union<Schema>
  • Type parameters

    • Schema

    Returns Union<Schema>

  • Type parameters

    • Schema

    Parameters

    • discr: Layout<any, any>
    • defaultLayout: Layout<any, any>
    • Optional property: string

    Returns Union<Schema>

Properties

property?: ""
registry: object
span: number

Methods

  • addVariant(variant: number, layout: Structure<any, any, Partial<Schema>> | Layout<any, keyof Schema>, property?: string): any
  • Parameters

    • variant: number
    • layout: Structure<any, any, Partial<Schema>> | Layout<any, keyof Schema>
    • Optional property: string

    Returns any

  • decode(b: Buffer, offset?: number): Partial<Schema>
  • Parameters

    • b: Buffer
    • Optional offset: number

    Returns Partial<Schema>

  • decodeInstruction(instruction: any): Partial<Schema>
  • Parameters

    • instruction: any

    Returns Partial<Schema>

  • encode(src: any, b: Buffer, offset?: number): number
  • Parameters

    • src: any
    • b: Buffer
    • Optional offset: number

    Returns number

  • encodeInstruction(instruction: any): Buffer
  • Parameters

    • instruction: any

    Returns Buffer

  • getSpan(b: Buffer, offset?: number): number
  • Parameters

    • b: Buffer
    • Optional offset: number

    Returns number

  • replicate<AP>(name: AP): Layout<any, AP>
  • Type parameters

    • AP: string

    Parameters

    • name: AP

    Returns Layout<any, AP>