moqtail-ts
    Preparing search index...

    Class KeyValuePair

    Represents a key-value pair for MOQT protocol parameters.

    • If typeValue is even, the value is a varint (bigint).
    • If typeValue is odd, the value is a binary blob (Uint8Array) with a maximum length of 65535 bytes.

    Use KeyValuePair.tryNewVarInt for varint pairs and KeyValuePair.tryNewBytes for blob pairs.

    Index

    Properties

    typeValue: bigint

    The key/type identifier for this pair.

    • Even: value is a varint.
    • Odd: value is a blob.
    value: bigint | Uint8Array<ArrayBufferLike>

    The value for this pair.

    • If typeValue is even: a varint (bigint).
    • If typeValue is odd: a binary blob (Uint8Array).

    Methods

    • Creates a new blob KeyValuePair.

      Parameters

      • typeValue: number | bigint

        Must be odd.

      • value: Uint8Array

        The binary blob value.

      Returns KeyValuePair

      A KeyValuePair with blob value.

      KeyValueFormattingError if typeValue is not odd.

      LengthExceedsMaxError if value length exceeds 65535 bytes.

    • Creates a new varint KeyValuePair.

      Parameters

      • typeValue: number | bigint

        Must be even.

      • value: number | bigint

        The varint value.

      Returns KeyValuePair

      A KeyValuePair with varint value.

      KeyValueFormattingError if typeValue is not even.