Interface ISocketReturn<T>

interface ISocketReturn<T> {
    close: ((code?: number, reason?: string) => void);
    data?: Ref<null | T, null | T>;
    send: ((data: string | ArrayBuffer | Blob, useBuffer?: boolean) => boolean);
    websocketOpen: (() => void);
    ws: Ref<undefined | WebSocket, undefined | WebSocket>;
}

Type Parameters

  • T

Properties

close: ((code?: number, reason?: string) => void)

Type declaration

    • (code?, reason?): void
    • Closes the WebSocket connection, optionally using code as the the WebSocket connection close code and reason as the the WebSocket connection close reason.

      MDN Reference

      Parameters

      • Optionalcode: number
      • Optionalreason: string

      Returns void

data?: Ref<null | T, null | T>
send: ((data: string | ArrayBuffer | Blob, useBuffer?: boolean) => boolean)
websocketOpen: (() => void)
ws: Ref<undefined | WebSocket, undefined | WebSocket>