Paul пре 6 година
родитељ
комит
facaa0f38c
1 измењених фајлова са 4 додато и 4 уклоњено
  1. 4
    4
      src/client.ts

+ 4
- 4
src/client.ts Прегледај датотеку

37
    * @param param 请求参数,比如{"hello":"world"}
37
    * @param param 请求参数,比如{"hello":"world"}
38
    * @param requestCallback 请求状态回调
38
    * @param requestCallback 请求状态回调
39
    */
39
    */
40
-  public ping(param: any, requestCallback: RequestCallback): void {
40
+  public ping(param: object, requestCallback: RequestCallback): void {
41
     if (this.socket.readyState !== this.socket.OPEN) {
41
     if (this.socket.readyState !== this.socket.OPEN) {
42
       throw new Error('asyncSend: connection refuse');
42
       throw new Error('asyncSend: connection refuse');
43
     }
43
     }
73
    */
73
    */
74
   public asyncSend(
74
   public asyncSend(
75
     operator: string,
75
     operator: string,
76
-    param: any,
76
+    param: object,
77
     callback: RequestCallback,
77
     callback: RequestCallback,
78
   ): void {
78
   ): void {
79
     console.info('websocket send data', operator, this.requestHeader, param);
79
     console.info('websocket send data', operator, this.requestHeader, param);
122
    */
122
    */
123
   public async syncSend(
123
   public async syncSend(
124
     operator: string,
124
     operator: string,
125
-    param: any,
125
+    param: object,
126
     callback: RequestCallback,
126
     callback: RequestCallback,
127
   ): Promise<void> {
127
   ): Promise<void> {
128
     await this.asyncSend(operator, param, callback);
128
     await this.asyncSend(operator, param, callback);
145
    * 移除消息监听
145
    * 移除消息监听
146
    * @param operator 消息监听地址
146
    * @param operator 消息监听地址
147
    */
147
    */
148
-  public removeMessageListener(operator: string) {
148
+  public removeMessageListener(operator: string): void {
149
     delete this.listeners[Utils.crc32(operator)];
149
     delete this.listeners[Utils.crc32(operator)];
150
   }
150
   }
151
 
151