xwt
4 小时以前 8a5fc169c691543f60109b2b3a4e000762f247c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
declare namespace UniCloudNamespace {
  interface ConnectWebSocketOptions {
    /**
     * WebSocket云函数/云对象名称
     */
    name: string | string.CloudFunctionString;
    /**
     * 建立连接时需要传递的参数, 仅在 connection 事件中接收到
     */
    query?: Record<string, string>;
  }
 
  interface UniCloud {
    /**
     * 快速连接 WebSocket 服务
     *
     * 文档: [uniCloud.connectWebSocket](https://doc.dcloud.net.cn/uniCloud/websocket.html#unicloud-connectwebsocket)
     */
    connectWebSocket(options: ConnectWebSocketOptions): UniApp.SocketTask;
  }
}