Browse Source

delete types

Paul 5 years ago
parent
commit
4877c3485b
3 changed files with 17 additions and 18 deletions
  1. 3
    2
      package.json
  2. 14
    2
      src/client.ts
  3. 0
    14
      src/types/callback.ts

+ 3
- 2
package.json View File

1
 {
1
 {
2
   "name": "ts-sdk",
2
   "name": "ts-sdk",
3
   "version": "1.0.0",
3
   "version": "1.0.0",
4
-  "description": "",
4
+  "description": "linker's ts sdk",
5
   "main": "index.js",
5
   "main": "index.js",
6
   "scripts": {
6
   "scripts": {
7
     "start": "webpack-dev-server  --mode development",
7
     "start": "webpack-dev-server  --mode development",
8
     "test": "jest",
8
     "test": "jest",
9
     "build": "webpack --config webpack.config.js"
9
     "build": "webpack --config webpack.config.js"
10
   },
10
   },
11
-  "author": "",
11
+  "publid":true,
12
+  "author": "Paul",
12
   "license": "ISC",
13
   "license": "ISC",
13
   "dependencies": {
14
   "dependencies": {
14
     "crypto-js": "^3.1.9-1",
15
     "crypto-js": "^3.1.9-1",

+ 14
- 2
src/client.ts View File

1
-import { ReadyStateCallback, RequestCallback } from './types/callback';
2
 import { Packet } from './packet';
1
 import { Packet } from './packet';
3
 import { Utils } from './utils';
2
 import { Utils } from './utils';
4
 
3
 
4
+interface ReadyStateCallback {
5
+  onOpen(ev: Event): void;
6
+  onError(ev: Event): void;
7
+  onClose(ev: Event): void;
8
+}
9
+
10
+interface RequestCallback {
11
+  onStart(): void;
12
+  onSuccess(data: string): void;
13
+  onError(code: number, message: string): void;
14
+  onEnd(): void;
15
+}
16
+
5
 /**
17
 /**
6
  * 初始化链接以及收发数据
18
  * 初始化链接以及收发数据
7
  */
19
  */
323
   }
335
   }
324
 }
336
 }
325
 
337
 
326
-export { Client };
338
+export { Client, ReadyStateCallback, RequestCallback };

+ 0
- 14
src/types/callback.ts View File

1
-interface ReadyStateCallback {
2
-  onOpen(ev: Event): void;
3
-  onError(ev: Event): void;
4
-  onClose(ev: Event): void;
5
-}
6
-
7
-interface RequestCallback {
8
-  onStart(): void;
9
-  onSuccess(data: string): void;
10
-  onError(code: number, message: string): void;
11
-  onEnd(): void;
12
-}
13
-
14
-export { ReadyStateCallback, RequestCallback };