yao-node-client
Version:
A node client for yao application development
25 lines (24 loc) • 514 B
TypeScript
import WebSocketClient from "ws";
/**
* 模拟ws客户端。
*
* https://github.com/websockets/ws
*/
export declare class WebSocket {
url: string | URL;
protocols: string;
client: WebSocketClient;
ready: boolean;
messages: any[];
/**
*
* @param url ws服务地址
* @param protocols 协议
*/
constructor(url: string | URL, protocols: string);
/**
*发送数据
* @param params 参数
*/
push(params: any): void;
}