@coze/uniapp-api
Version:
Official Coze UniApp SDK for seamless AI integration into your applications | 扣子官方 UniApp SDK,助您轻松集成 AI 能力到应用中
30 lines (29 loc) • 1.05 kB
TypeScript
export declare class UniAppWebSocket implements WebSocket {
private ws;
private eventListeners;
static CONNECTING: 0;
static OPEN: 1;
static CLOSING: 2;
static CLOSED: 3;
readonly CONNECTING = 0;
readonly OPEN = 1;
readonly CLOSING = 2;
readonly CLOSED = 3;
url: string;
protocol: string;
readyState: number;
bufferedAmount: number;
extensions: string;
binaryType: BinaryType;
constructor(url: string | URL, protocols?: string | string[], options?: any);
send(data: string | ArrayBufferLike | Blob | ArrayBufferView): void;
close(code?: number, reason?: string): void;
addEventListener(type: string, listener: EventListener): void;
removeEventListener(type: string, listener: EventListener): void;
dispatchEvent(event: any): boolean;
onopen: ((event: Event) => void) | null;
onmessage: ((event: MessageEvent) => void) | null;
onclose: ((event: CloseEvent) => void) | null;
onerror: ((event: Event) => void) | null;
}
export default UniAppWebSocket;