Paul преди 5 години
родител
ревизия
facaa0f38c
променени са 1 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. 4
    4
      src/client.ts

+ 4
- 4
src/client.ts Целия файл

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