@dra2020/baseclient 1.0.20 → 1.0.23
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/dist/all/all.d.ts +2 -0
- package/dist/baseclient.js +85 -3
- package/dist/baseclient.js.map +1 -1
- package/dist/emit/all.d.ts +1 -0
- package/dist/emit/emit.d.ts +7 -0
- package/dist/ot-js/otsession.d.ts +2 -0
- package/dist/util/bintrie.d.ts +2 -0
- package/lib/all/all.ts +2 -0
- package/lib/emit/all.ts +1 -0
- package/lib/emit/emit.ts +40 -0
- package/lib/ot-js/otsession.ts +2 -0
- package/lib/util/bintrie.ts +23 -2
- package/package.json +1 -1
package/dist/all/all.d.ts
CHANGED
package/dist/baseclient.js
CHANGED
|
@@ -39,7 +39,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
39
39
|
return result;
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
42
|
-
exports.G = exports.FilterExpr = exports.OTE = exports.OT = exports.LogClient = exports.LogAbstract = exports.Poly = exports.FSM = exports.Context = exports.Util = void 0;
|
|
42
|
+
exports.Emit = exports.G = exports.FilterExpr = exports.OTE = exports.OT = exports.LogClient = exports.LogAbstract = exports.Poly = exports.FSM = exports.Context = exports.Util = void 0;
|
|
43
43
|
// Client and Server
|
|
44
44
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
45
45
|
exports.Util = Util;
|
|
@@ -61,6 +61,8 @@ const all_1 = __webpack_require__(/*! ../filterexpr/all */ "./lib/filterexpr/all
|
|
|
61
61
|
Object.defineProperty(exports, "FilterExpr", ({ enumerable: true, get: function () { return all_1.FilterExpr; } }));
|
|
62
62
|
const G = __importStar(__webpack_require__(/*! ../geo/all */ "./lib/geo/all.ts"));
|
|
63
63
|
exports.G = G;
|
|
64
|
+
const Emit = __importStar(__webpack_require__(/*! ../emit/all */ "./lib/emit/all.ts"));
|
|
65
|
+
exports.Emit = Emit;
|
|
64
66
|
|
|
65
67
|
|
|
66
68
|
/***/ }),
|
|
@@ -167,6 +169,71 @@ function create() {
|
|
|
167
169
|
exports.create = create;
|
|
168
170
|
|
|
169
171
|
|
|
172
|
+
/***/ }),
|
|
173
|
+
|
|
174
|
+
/***/ "./lib/emit/all.ts":
|
|
175
|
+
/*!*************************!*\
|
|
176
|
+
!*** ./lib/emit/all.ts ***!
|
|
177
|
+
\*************************/
|
|
178
|
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
182
|
+
if (k2 === undefined) k2 = k;
|
|
183
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
184
|
+
}) : (function(o, m, k, k2) {
|
|
185
|
+
if (k2 === undefined) k2 = k;
|
|
186
|
+
o[k2] = m[k];
|
|
187
|
+
}));
|
|
188
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
189
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
190
|
+
};
|
|
191
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
192
|
+
__exportStar(__webpack_require__(/*! ./emit */ "./lib/emit/emit.ts"), exports);
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
/***/ }),
|
|
196
|
+
|
|
197
|
+
/***/ "./lib/emit/emit.ts":
|
|
198
|
+
/*!**************************!*\
|
|
199
|
+
!*** ./lib/emit/emit.ts ***!
|
|
200
|
+
\**************************/
|
|
201
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
205
|
+
exports.Emit = void 0;
|
|
206
|
+
class Emit {
|
|
207
|
+
constructor() {
|
|
208
|
+
this.onList = {};
|
|
209
|
+
}
|
|
210
|
+
on(eventName, cb) {
|
|
211
|
+
let aCB = this.onList[eventName];
|
|
212
|
+
if (aCB === undefined) {
|
|
213
|
+
aCB = [];
|
|
214
|
+
this.onList[eventName] = aCB;
|
|
215
|
+
}
|
|
216
|
+
aCB.push(cb);
|
|
217
|
+
}
|
|
218
|
+
emit(eventName, arg1, arg2, arg3) {
|
|
219
|
+
let aCB = this.onList[eventName];
|
|
220
|
+
if (aCB !== undefined)
|
|
221
|
+
for (let i = 0; i < aCB.length; i++)
|
|
222
|
+
(aCB[i])(arg1, arg2, arg3);
|
|
223
|
+
}
|
|
224
|
+
off(eventName, cb) {
|
|
225
|
+
let aCB = this.onList[eventName];
|
|
226
|
+
if (aCB !== undefined)
|
|
227
|
+
for (let i = 0; i < aCB.length; i++)
|
|
228
|
+
if (aCB[i] === cb) {
|
|
229
|
+
aCB.splice(i, 1);
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
exports.Emit = Emit;
|
|
235
|
+
|
|
236
|
+
|
|
170
237
|
/***/ }),
|
|
171
238
|
|
|
172
239
|
/***/ "./lib/filterexpr/all.ts":
|
|
@@ -8859,6 +8926,7 @@ Util.setCoder({ encoder: new u.TextEncoder(), decoder: new u.TextDecoder('utf-8'
|
|
|
8859
8926
|
-- For Browser
|
|
8860
8927
|
Util.setCoder({ encoder: new TextEncoder(), decoder: new TextDecoder('utf-8') });
|
|
8861
8928
|
*/
|
|
8929
|
+
const MaxKeyLength = 128;
|
|
8862
8930
|
function s2u8(coder, s) {
|
|
8863
8931
|
return coder.encoder.encode(s);
|
|
8864
8932
|
}
|
|
@@ -9060,9 +9128,22 @@ class BinTrie {
|
|
|
9060
9128
|
}
|
|
9061
9129
|
return undefined;
|
|
9062
9130
|
}
|
|
9131
|
+
forEach(cb) {
|
|
9132
|
+
let keybuf = new Uint8Array(MaxKeyLength);
|
|
9133
|
+
let keylen = 0;
|
|
9134
|
+
let processNode = (len, byteOffset) => {
|
|
9135
|
+
let iOffset = byteOffset >> 2;
|
|
9136
|
+
let n = this.i32[iOffset];
|
|
9137
|
+
byteOffset += 4;
|
|
9138
|
+
for (let j = 0; j < n; j++) {
|
|
9139
|
+
keybuf[keylen++] = this.u8[byteOffset + j];
|
|
9140
|
+
}
|
|
9141
|
+
};
|
|
9142
|
+
processNode(0, 4);
|
|
9143
|
+
}
|
|
9063
9144
|
}
|
|
9064
9145
|
exports.BinTrie = BinTrie;
|
|
9065
|
-
let DefaultOptions = { dedup: true };
|
|
9146
|
+
let DefaultOptions = { dedup: true, verbose: false };
|
|
9066
9147
|
class BinTrieBuilder {
|
|
9067
9148
|
constructor(coder, options) {
|
|
9068
9149
|
this.coder = coder;
|
|
@@ -9257,7 +9338,8 @@ class BinTrieBuilder {
|
|
|
9257
9338
|
good = false;
|
|
9258
9339
|
}
|
|
9259
9340
|
});
|
|
9260
|
-
|
|
9341
|
+
if (btb.options.verbose)
|
|
9342
|
+
console.log(`bintrie: total size: ${btb.u8.length}, value table size: ${btb.vtb.u8.length}`);
|
|
9261
9343
|
return bt;
|
|
9262
9344
|
}
|
|
9263
9345
|
}
|