Static utilities related to presence messages.

Hierarchy

  • PresenceMessageStatic

Properties

fromEncoded: ((JsonObject: any, channelOptions?: ChannelOptions) => PresenceMessage)

Type declaration

    • (JsonObject: any, channelOptions?: ChannelOptions): PresenceMessage
    • Decodes and decrypts a deserialized PresenceMessage-like object using the cipher in ChannelOptions. Any residual transforms that cannot be decoded or decrypted will be in the encoding property. Intended for users receiving messages from a source other than a REST or Realtime channel (for example a queue) to avoid having to parse the encoding string.

      Parameters

      • JsonObject: any

        The deserialized PresenceMessage-like object to decode and decrypt.

      • Optional channelOptions: ChannelOptions

        A ChannelOptions object containing the cipher.

      Returns PresenceMessage

fromEncodedArray: ((JsonArray: any[], channelOptions?: ChannelOptions) => PresenceMessage[])

Type declaration

    • (JsonArray: any[], channelOptions?: ChannelOptions): PresenceMessage[]
    • Decodes and decrypts an array of deserialized PresenceMessage-like object using the cipher in ChannelOptions. Any residual transforms that cannot be decoded or decrypted will be in the encoding property. Intended for users receiving messages from a source other than a REST or Realtime channel (for example a queue) to avoid having to parse the encoding string.

      Parameters

      • JsonArray: any[]

        An array of deserialized PresenceMessage-like objects to decode and decrypt.

      • Optional channelOptions: ChannelOptions

        A ChannelOptions object containing the cipher.

      Returns PresenceMessage[]

Methods

  • Initialises a PresenceMessage from a PresenceMessage-like object.

    Parameters

    • values: PresenceMessage | Record<string, unknown>

      The values to intialise the PresenceMessage from.

    • Optional stringifyAction: boolean

      Whether to convert the action field from a number to a string.

    Returns PresenceMessage

Generated using TypeDoc