@es-react/react
Version:
Hippy react framework
26 lines (25 loc) • 874 B
TypeScript
import { HippyTypes } from '../types';
declare class WebSocket implements HippyTypes.WebSocket {
protocol: string;
url: string;
readyState: number;
webSocketCallbackId: number;
webSocketId: number | undefined;
readonly webSocketCallbacks: {
onOpen?: (...args: any[]) => void;
onClose?: (...args: any[]) => void;
onError?: (...args: any[]) => void;
onMessage?: (...args: any[]) => void;
};
constructor(url: any, protocols: string[] | string, extrasHeaders: {
[key: string]: string;
});
close(code: number, reason: string): void;
send(data: string | undefined): void;
set onopen(callback: () => void);
set onclose(callback: () => void);
set onerror(callback: () => void);
set onmessage(callback: (data: any) => void);
private onWebSocketEvent;
}
export default WebSocket;