浏览代码

delete types

Paul 5 年前
父节点
当前提交
4877c3485b
共有 3 个文件被更改,包括 17 次插入18 次删除
  1. 3
    2
      package.json
  2. 14
    2
      src/client.ts
  3. 0
    14
      src/types/callback.ts

+ 3
- 2
package.json 查看文件

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

+ 14
- 2
src/client.ts 查看文件

@@ -1,7 +1,19 @@
1
-import { ReadyStateCallback, RequestCallback } from './types/callback';
2 1
 import { Packet } from './packet';
3 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,4 +335,4 @@ class Client {
323 335
   }
324 336
 }
325 337
 
326
-export { Client };
338
+export { Client, ReadyStateCallback, RequestCallback };

+ 0
- 14
src/types/callback.ts 查看文件

@@ -1,14 +0,0 @@
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 };