fishpi 0.0.60 → 0.0.62
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/lib/chatroom.d.ts +4 -1
- package/lib/chatroom.js +4 -2
- package/package.json +1 -1
package/lib/chatroom.d.ts
CHANGED
|
@@ -99,6 +99,7 @@ declare class ChatRoom {
|
|
|
99
99
|
getNode(): Promise<IChatRoomNodeInfo>;
|
|
100
100
|
/**
|
|
101
101
|
* 重连聊天室
|
|
102
|
+
* @param url 节点地址
|
|
102
103
|
* @param timeout 超时时间
|
|
103
104
|
* @param error 错误回调
|
|
104
105
|
* @param close 关闭回调
|
|
@@ -124,13 +125,15 @@ declare class ChatRoom {
|
|
|
124
125
|
/**
|
|
125
126
|
* 添加聊天室消息监听函数
|
|
126
127
|
* @param wsCallback 消息监听函数
|
|
128
|
+
* @param url 节点地址
|
|
127
129
|
* @param timeout 超时时间
|
|
128
130
|
* @param error 错误回调
|
|
129
131
|
* @param close 关闭回调
|
|
130
132
|
*/
|
|
131
133
|
addListener(wsCallback: (event: {
|
|
132
134
|
msg: Message;
|
|
133
|
-
}) => void, { timeout, error, close }?: {
|
|
135
|
+
}) => void, { url, timeout, error, close }?: {
|
|
136
|
+
url?: string;
|
|
134
137
|
timeout?: number;
|
|
135
138
|
error?: (ev: any) => void;
|
|
136
139
|
close?: (ev: any) => void;
|
package/lib/chatroom.js
CHANGED
|
@@ -490,6 +490,7 @@ var ChatRoom = /** @class */ (function () {
|
|
|
490
490
|
};
|
|
491
491
|
/**
|
|
492
492
|
* 重连聊天室
|
|
493
|
+
* @param url 节点地址
|
|
493
494
|
* @param timeout 超时时间
|
|
494
495
|
* @param error 错误回调
|
|
495
496
|
* @param close 关闭回调
|
|
@@ -629,12 +630,13 @@ var ChatRoom = /** @class */ (function () {
|
|
|
629
630
|
/**
|
|
630
631
|
* 添加聊天室消息监听函数
|
|
631
632
|
* @param wsCallback 消息监听函数
|
|
633
|
+
* @param url 节点地址
|
|
632
634
|
* @param timeout 超时时间
|
|
633
635
|
* @param error 错误回调
|
|
634
636
|
* @param close 关闭回调
|
|
635
637
|
*/
|
|
636
638
|
ChatRoom.prototype.addListener = function (wsCallback, _a) {
|
|
637
|
-
var _b = _a === void 0 ? {} : _a, _c = _b.timeout, timeout = _c === void 0 ? 10 : _c, _d = _b.error, error = _d === void 0 ? function (ev) { } : _d, _e = _b.close, close = _e === void 0 ? function (ev) { } : _e;
|
|
639
|
+
var _b = _a === void 0 ? {} : _a, url = _b.url, _c = _b.timeout, timeout = _c === void 0 ? 10 : _c, _d = _b.error, error = _d === void 0 ? function (ev) { } : _d, _e = _b.close, close = _e === void 0 ? function (ev) { } : _e;
|
|
638
640
|
return __awaiter(this, void 0, void 0, function () {
|
|
639
641
|
return __generator(this, function (_f) {
|
|
640
642
|
switch (_f.label) {
|
|
@@ -645,7 +647,7 @@ var ChatRoom = /** @class */ (function () {
|
|
|
645
647
|
return [2 /*return*/];
|
|
646
648
|
}
|
|
647
649
|
this._wsCallbacks.push(wsCallback);
|
|
648
|
-
return [4 /*yield*/, this.reconnect({ timeout: timeout, error: error, close: close })];
|
|
650
|
+
return [4 /*yield*/, this.reconnect({ url: url, timeout: timeout, error: error, close: close })];
|
|
649
651
|
case 1:
|
|
650
652
|
_f.sent();
|
|
651
653
|
return [2 /*return*/];
|