Options
All
  • Public
  • Public/Protected
  • All
Menu

The class for creating generic records. This class should not be instantiated directly. Its compact method creates new compact generic records.

This API is currently in Beta and can change at any time.

Hierarchy

  • GenericRecords

Index

Constructors

Methods

Constructors

Methods

  • compact<F>(typeName: string, fields: F, values: { [ property in string | number | symbol]: F[property] extends Field<T> ? T : any }): GenericRecord
  • Static constructor method for compact generic records.

    throws

    TypeError if a value is of wrong type according to {@link fields}

    throws

    RangeError if a value is out of range of its type

    Type parameters

    • F: {}

    Parameters

    • typeName: string

      Represents the type of the compact object, included in serialized form

    • fields: F

      Represents the field schema of the compact

    • values: { [ property in string | number | symbol]: F[property] extends Field<T> ? T : any }

      Values to use in the generic record. This should be in sync with {@link fields}

    Returns GenericRecord

    A compact generic record

Generated using TypeDoc