xshell 1.0.73 → 1.0.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/net.browser.d.ts CHANGED
@@ -98,7 +98,7 @@ export declare function connect_websocket(url: string | URL, { protocols, on_mes
98
98
  - 数组: 会自动被封装为 { id: 相同, data: 返回值, done: true } 这样的消息并调用 websocket.send 将其发送
99
99
  - void: 什么都不做
100
100
  - 以上的 promise */
101
- export type MessageHandler = (message: Message, websocket?: WebSocket) => void | any[] | Promise<void | any[]>;
101
+ export type MessageHandler<TData extends any[] = any[]> = (message: Message<TData>, websocket?: WebSocket) => void | any[] | Promise<void | any[]>;
102
102
  /** 二进制消息格式
103
103
  - json.length (小端序): 4 字节
104
104
  - json 数据
@@ -162,7 +162,7 @@ export declare class Remote {
162
162
  funcs: Record<string, MessageHandler>;
163
163
  /** map<id, message handler>: 通过 (rpc message).id 找到对应的 handler
164
164
  一元 rpc 接收方不需要设置 handlers, 发送方需要 */
165
- handlers: Map<number, MessageHandler>;
165
+ handlers: Map<number, MessageHandler<any[]>>;
166
166
  /** `false` 打印所有交互的 rpc messages */
167
167
  print: boolean;
168
168
  reconnecting: boolean;
package/net.d.ts CHANGED
@@ -150,7 +150,7 @@ on_message, on_error, on_close }: {
150
150
  - 数组: 会自动被封装为 { id: 相同, data: 返回值, done: true } 这样的消息并调用 websocket.send 将其发送
151
151
  - void: 什么都不做
152
152
  - 以上的 promise */
153
- export type MessageHandler = (message: Message, websocket?: WebSocket) => void | any[] | Promise<void | any[]>;
153
+ export type MessageHandler<TData extends any[] = any[]> = (message: Message<TData>, websocket?: WebSocket) => void | any[] | Promise<void | any[]>;
154
154
  /** 二进制消息格式
155
155
  - json.length (小端序): 4 字节
156
156
  - json 数据
@@ -214,7 +214,7 @@ export declare class Remote {
214
214
  funcs: Record<string, MessageHandler>;
215
215
  /** map<id, message handler>: 通过 (rpc message).id 找到对应的 handler
216
216
  一元 rpc 接收方不需要设置 handlers, 发送方需要 */
217
- handlers: Map<number, MessageHandler>;
217
+ handlers: Map<number, MessageHandler<any[]>>;
218
218
  /** `false` 打印所有交互的 rpc messages */
219
219
  print: boolean;
220
220
  reconnecting: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xshell",
3
- "version": "1.0.73",
3
+ "version": "1.0.75",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -58,7 +58,7 @@
58
58
  "@babel/traverse": "^7.23.6",
59
59
  "@koa/cors": "^5.0.0",
60
60
  "@types/ws": "^8.5.10",
61
- "ali-oss": "^6.18.1",
61
+ "ali-oss": "^6.19.0",
62
62
  "archiver": "^6.0.1",
63
63
  "byte-size": "^8.1.1",
64
64
  "chalk": "^5.3.0",
@@ -71,7 +71,7 @@
71
71
  "fetch-cookie": "^2.1.0",
72
72
  "gulp-sort": "^2.0.0",
73
73
  "hash-string": "^1.0.0",
74
- "i18next": "^23.7.9",
74
+ "i18next": "^23.7.11",
75
75
  "i18next-scanner": "^4.4.0",
76
76
  "js-cookie": "^3.0.5",
77
77
  "koa": "^2.14.2",
@@ -112,7 +112,7 @@
112
112
  "@types/koa-compress": "^4.0.6",
113
113
  "@types/lodash": "^4.14.202",
114
114
  "@types/mime-types": "^2.1.4",
115
- "@types/node": "^20.10.4",
115
+ "@types/node": "^20.10.5",
116
116
  "@types/react": "^18.2.45",
117
117
  "@types/through2": "^2.0.41",
118
118
  "@types/tough-cookie": "^4.0.5",
@@ -121,7 +121,7 @@
121
121
  "@types/vscode": "^1.85.0",
122
122
  "@typescript-eslint/eslint-plugin": "^6.14.0",
123
123
  "@typescript-eslint/parser": "^6.14.0",
124
- "eslint": "^8.55.0",
124
+ "eslint": "^8.56.0",
125
125
  "eslint-plugin-react": "^7.33.2",
126
126
  "eslint-plugin-xlint": "^1.0.11"
127
127
  },