websocket-ts
    Preparing search index...

    Class WebsocketBuilder

    Builder for websockets.

    Index

    Constructors

    Accessors

    • get buffer(): | undefined
      | WebsocketBuffer<
          string
          | ArrayBufferLike
          | Blob
          | ArrayBufferView<ArrayBufferLike>,
      >

      Getter for the buffer.

      Returns
          | undefined
          | WebsocketBuffer<
              string
              | ArrayBufferLike
              | Blob
              | ArrayBufferView<ArrayBufferLike>,
          >

      the buffer, undefined if no buffer has been set

    • get instantReconnect(): undefined | boolean

      Getter for whether to reconnect immediately after a connection has been lost, ignoring the backoff strategy for the first retry.

      Returns undefined | boolean

      whether to reconnect immediately after a connection has been lost, undefined if no value has been set

    • get maxRetries(): undefined | number

      Getter for the maximum number of retries before giving up.

      Returns undefined | number

      the maximum number of retries before giving up, undefined if no maximum has been set

    • get protocols(): undefined | string | string[]

      Getter for the protocols.

      Returns undefined | string | string[]

      the protocols, undefined if no protocols have been set

    Methods

    • Adds a buffer to the websocket. Subsequent calls to this method will override the previously set buffer.

      Parameters

      • buffer:
            | undefined
            | WebsocketBuffer<
                string
                | ArrayBufferLike
                | Blob
                | ArrayBufferView<ArrayBufferLike>,
            >

        the buffer to add

      Returns WebsocketBuilder

    • Sets whether to reconnect immediately after a connection has been lost, ignoring the backoff strategy for the first retry.

      Parameters

      • instantReconnect: undefined | boolean

        whether to reconnect immediately after a connection has been lost

      Returns WebsocketBuilder

    • Sets the maximum number of retries before giving up. No limit if undefined.

      Parameters

      • maxRetries: undefined | number

        the maximum number of retries before giving up

      Returns WebsocketBuilder

    • Adds protocols to the websocket. Subsequent calls to this method will override the previously set protocols.

      Parameters

      • protocols: undefined | string | string[]

        the protocols to add

      Returns WebsocketBuilder