Writer for TL objects.

Constructors

Properties

dataView: DataView
objectMap: undefined | TlWriterMap

Writers map

pos: number

Current position in the buffer.

uint8View: Uint8Array
platform: ITlPlatform

Methods

  • Parameters

    • val: boolean

    Returns void

  • Parameters

    • val: Uint8Array

    Returns void

  • Parameters

    • val: number

    Returns void

  • Parameters

    • val: number

    Returns void

  • Parameters

    • val: number

    Returns void

  • Parameters

    • val: Uint8Array

    Returns void

  • Parameters

    • val: Uint8Array

    Returns void

  • Parameters

    • val: number

    Returns void

  • Parameters

    • obj: any

    Returns void

  • Write raw bytes to the buffer

    Parameters

    • val: Uint8Array

      Buffer to write

    Returns void

  • Get the resulting buffer

    Returns Uint8Array

  • Parameters

    • val: string

    Returns void

  • Parameters

    • val: number

    Returns void

  • Parameters

    • fn: ((item: unknown, bare?: boolean) => void)
        • (item, bare?): void
        • Parameters

          • item: unknown
          • Optionalbare: boolean

          Returns void

    • val: unknown[]
    • Optionalbare: boolean

    Returns void

  • Create a new writer without objects map for manual usage

    Parameters

    • buffer: number | ArrayBuffer

      Buffer to write to, or its size

    • start: number = 0

      Position to start writing at

    Returns TlBinaryWriter

  • Serialize a single object

    Parameters

    • objectMap: TlWriterMap

      Writers map

    • obj: {
          _: string;
      }

      Object to serialize

      • _: string
    • knownSize: number = -1

      In case the size is known, pass it here

    Returns Uint8Array