@wailsio/runtime
    Preparing search index...

    Interface JSONSocket

    The object-shaped view of a stream returned by JSONStream: send takes a value to stringify, and ev.data on a message is the parsed result.

    interface JSONSocket {
        binaryType: "arraybuffer" | "blob";
        bufferedAmount: number;
        CLOSED: 3;
        CLOSING: 2;
        CONNECTING: 0;
        extensions: "";
        name: string;
        onclose: ((ev: CloseEvent) => void) | null;
        onerror: ((ev: Event) => void) | null;
        onmessage: ((ev: MessageEvent<any>) => void) | null;
        onopen: ((ev: Event) => void) | null;
        OPEN: 1;
        protocol: "";
        readyState: number;
        url: string;
        addEventListener(
            type: "message",
            listener:
                | EventListenerObject
                | ((this: JSONSocket, ev: MessageEvent<any>) => any)
                | null,
            options?: boolean | AddEventListenerOptions,
        ): void;
        addEventListener(
            type: string,
            listener: EventListenerOrEventListenerObject | null,
            options?: boolean | AddEventListenerOptions,
        ): void;
        close(code?: number, reason?: string): void;
        dispatchEvent(event: Event): boolean;
        removeEventListener(
            type: "message",
            listener:
                | EventListenerObject
                | ((this: JSONSocket, ev: MessageEvent<any>) => any)
                | null,
            options?: boolean | EventListenerOptions,
        ): void;
        removeEventListener(
            type: string,
            listener: EventListenerOrEventListenerObject | null,
            options?: boolean | EventListenerOptions,
        ): void;
        send(value: unknown): void;
    }

    Hierarchy (View Summary)

    • Omit<
          WailsSocket,
          "send"
          | "onmessage"
          | "addEventListener"
          | "removeEventListener",
      >
      • JSONSocket
    Index

    Properties

    binaryType: "arraybuffer" | "blob" = "arraybuffer"
    bufferedAmount: number
    CLOSED: 3
    CLOSING: 2
    CONNECTING: 0
    extensions: ""
    name: string

    The stream name this connection was opened against.

    onclose: ((ev: CloseEvent) => void) | null = null
    onerror: ((ev: Event) => void) | null = null
    onmessage: ((ev: MessageEvent<any>) => void) | null
    onopen: ((ev: Event) => void) | null = null
    OPEN: 1
    protocol: ""

    Always empty: subprotocols and extensions are not negotiated.

    readyState: number = WailsSocket.CONNECTING
    url: string

    Methods

    • Parameters

      • type: "message"
      • listener: EventListenerObject | ((this: JSONSocket, ev: MessageEvent<any>) => any) | null
      • Optionaloptions: boolean | AddEventListenerOptions

      Returns void

    • Parameters

      Returns void

    • Close the connection. Go's handler sees Receive fail and returns.

      Parameters

      • code: number = 1000
      • reason: string = ""

      Returns void

    • The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.

      MDN Reference

      Parameters

      Returns boolean

    • Parameters

      • type: "message"
      • listener: EventListenerObject | ((this: JSONSocket, ev: MessageEvent<any>) => any) | null
      • Optionaloptions: boolean | EventListenerOptions

      Returns void

    • Parameters

      Returns void

    • Parameters

      • value: unknown

      Returns void