Represents a Header.

Hierarchy

  • Header

Implements

Constructors

Properties

documentMessage?: null | IDocumentMessage

Header documentMessage.

hasMediaAttachment: boolean

Header hasMediaAttachment.

imageMessage?: null | IImageMessage

Header imageMessage.

jpegThumbnail?: null | Uint8Array

Header jpegThumbnail.

locationMessage?: null | ILocationMessage

Header locationMessage.

media?: "imageMessage" | "locationMessage" | "documentMessage" | "videoMessage" | "jpegThumbnail"

Header media.

subtitle: string

Header subtitle.

title: string

Header title.

videoMessage?: null | IVideoMessage

Header videoMessage.

Methods

  • Converts this Header to JSON.

    Returns {
        [k: string]: any;
    }

    JSON object

    • [k: string]: any
  • Decodes a Header message from the specified reader or buffer.

    Parameters

    • reader: Uint8Array | Reader

      Reader or buffer to decode from

    • Optional length: number

      Message length if known beforehand

    Returns Header

    Header

    Throws

    If the payload is not a reader or valid buffer

    Throws

    If required fields are missing

  • Decodes a Header message from the specified reader or buffer, length delimited.

    Parameters

    • reader: Uint8Array | Reader

      Reader or buffer to decode from

    Returns Header

    Header

    Throws

    If the payload is not a reader or valid buffer

    Throws

    If required fields are missing

  • Encodes the specified Header message. Does not implicitly verify messages.

    Parameters

    • message: IHeader

      Header message or plain object to encode

    • Optional writer: Writer

      Writer to encode to

    Returns Writer

    Writer

  • Encodes the specified Header message, length delimited. Does not implicitly verify messages.

    Parameters

    • message: IHeader

      Header message or plain object to encode

    • Optional writer: Writer

      Writer to encode to

    Returns Writer

    Writer

  • Creates a Header message from a plain object. Also converts values to their respective internal types.

    Parameters

    • object: {
          [k: string]: any;
      }

      Plain object

      • [k: string]: any

    Returns Header

    Header

  • Creates a plain object from a Header message. Also converts values to other types if specified.

    Parameters

    • message: Header

      Header

    • Optional options: IConversionOptions

      Conversion options

    Returns {
        [k: string]: any;
    }

    Plain object

    • [k: string]: any
  • Verifies a Header message.

    Parameters

    • message: {
          [k: string]: any;
      }

      Plain object to verify

      • [k: string]: any

    Returns null | string

    null if valid, otherwise the reason why it is not

Generated using TypeDoc