phirepass-channel 0.1.93 → 0.1.95
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/package.json +1 -1
- package/phirepass-channel.d.ts +7 -5
- package/phirepass-channel.js +23 -16
- package/phirepass-channel_bg.wasm +0 -0
package/package.json
CHANGED
package/phirepass-channel.d.ts
CHANGED
|
@@ -6,7 +6,8 @@ export class Channel {
|
|
|
6
6
|
[Symbol.dispose](): void;
|
|
7
7
|
connect(): void;
|
|
8
8
|
disconnect(): void;
|
|
9
|
-
|
|
9
|
+
is_connected(): boolean;
|
|
10
|
+
is_disconnected(): boolean;
|
|
10
11
|
constructor(endpoint: string);
|
|
11
12
|
on_connection_close(cb?: Function | null): void;
|
|
12
13
|
on_connection_error(cb?: Function | null): void;
|
|
@@ -29,7 +30,7 @@ export class Channel {
|
|
|
29
30
|
|
|
30
31
|
export enum ErrorType {
|
|
31
32
|
Generic = 0,
|
|
32
|
-
|
|
33
|
+
RequiresUsername = 100,
|
|
33
34
|
RequiresPassword = 110,
|
|
34
35
|
}
|
|
35
36
|
|
|
@@ -47,7 +48,8 @@ export interface InitOutput {
|
|
|
47
48
|
readonly __wbg_channel_free: (a: number, b: number) => void;
|
|
48
49
|
readonly channel_connect: (a: number) => void;
|
|
49
50
|
readonly channel_disconnect: (a: number) => void;
|
|
50
|
-
readonly
|
|
51
|
+
readonly channel_is_connected: (a: number) => number;
|
|
52
|
+
readonly channel_is_disconnected: (a: number) => number;
|
|
51
53
|
readonly channel_new: (a: number, b: number) => number;
|
|
52
54
|
readonly channel_on_connection_close: (a: number, b: number) => void;
|
|
53
55
|
readonly channel_on_connection_error: (a: number, b: number) => void;
|
|
@@ -68,8 +70,8 @@ export interface InitOutput {
|
|
|
68
70
|
readonly channel_stop_heartbeat: (a: number) => void;
|
|
69
71
|
readonly version: (a: number) => void;
|
|
70
72
|
readonly __wasm_bindgen_func_elem_37: (a: number, b: number) => void;
|
|
71
|
-
readonly
|
|
72
|
-
readonly
|
|
73
|
+
readonly __wasm_bindgen_func_elem_40: (a: number, b: number, c: number) => void;
|
|
74
|
+
readonly __wasm_bindgen_func_elem_38: (a: number, b: number) => void;
|
|
73
75
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
74
76
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
75
77
|
readonly __wbindgen_export3: (a: number) => void;
|
package/phirepass-channel.js
CHANGED
|
@@ -20,8 +20,15 @@ export class Channel {
|
|
|
20
20
|
/**
|
|
21
21
|
* @returns {boolean}
|
|
22
22
|
*/
|
|
23
|
-
|
|
24
|
-
const ret = wasm.
|
|
23
|
+
is_connected() {
|
|
24
|
+
const ret = wasm.channel_is_connected(this.__wbg_ptr);
|
|
25
|
+
return ret !== 0;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* @returns {boolean}
|
|
29
|
+
*/
|
|
30
|
+
is_disconnected() {
|
|
31
|
+
const ret = wasm.channel_is_disconnected(this.__wbg_ptr);
|
|
25
32
|
return ret !== 0;
|
|
26
33
|
}
|
|
27
34
|
/**
|
|
@@ -226,7 +233,7 @@ if (Symbol.dispose) Channel.prototype[Symbol.dispose] = Channel.prototype.free;
|
|
|
226
233
|
*/
|
|
227
234
|
export const ErrorType = Object.freeze({
|
|
228
235
|
Generic: 0, "0": "Generic",
|
|
229
|
-
|
|
236
|
+
RequiresUsername: 100, "100": "RequiresUsername",
|
|
230
237
|
RequiresPassword: 110, "110": "RequiresPassword",
|
|
231
238
|
});
|
|
232
239
|
|
|
@@ -381,27 +388,27 @@ function __wbg_get_imports() {
|
|
|
381
388
|
__wbg_set_onopen_b7b52d519d6c0f11: function(arg0, arg1) {
|
|
382
389
|
getObject(arg0).onopen = getObject(arg1);
|
|
383
390
|
},
|
|
384
|
-
|
|
391
|
+
__wbg_warn_2e032b1fe8828f36: function(arg0, arg1) {
|
|
385
392
|
console.warn(getStringFromWasm0(arg0, arg1));
|
|
386
393
|
},
|
|
387
394
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
388
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 1, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx:
|
|
389
|
-
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_37,
|
|
395
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 4, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
396
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_37, __wasm_bindgen_func_elem_40);
|
|
390
397
|
return addHeapObject(ret);
|
|
391
398
|
},
|
|
392
399
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
393
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 1, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx:
|
|
394
|
-
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_37,
|
|
400
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1, function: Function { arguments: [NamedExternref("ErrorEvent")], shim_idx: 4, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
401
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_37, __wasm_bindgen_func_elem_40);
|
|
395
402
|
return addHeapObject(ret);
|
|
396
403
|
},
|
|
397
404
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
398
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 1, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx:
|
|
399
|
-
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_37,
|
|
405
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 4, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
406
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_37, __wasm_bindgen_func_elem_40);
|
|
400
407
|
return addHeapObject(ret);
|
|
401
408
|
},
|
|
402
409
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
403
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 1, function: Function { arguments: [], shim_idx:
|
|
404
|
-
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_37,
|
|
410
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 1, function: Function { arguments: [], shim_idx: 2, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
411
|
+
const ret = makeMutClosure(arg0, arg1, wasm.__wasm_bindgen_func_elem_37, __wasm_bindgen_func_elem_38);
|
|
405
412
|
return addHeapObject(ret);
|
|
406
413
|
},
|
|
407
414
|
__wbindgen_cast_0000000000000005: function(arg0) {
|
|
@@ -438,12 +445,12 @@ function __wbg_get_imports() {
|
|
|
438
445
|
};
|
|
439
446
|
}
|
|
440
447
|
|
|
441
|
-
function
|
|
442
|
-
wasm.
|
|
448
|
+
function __wasm_bindgen_func_elem_38(arg0, arg1) {
|
|
449
|
+
wasm.__wasm_bindgen_func_elem_38(arg0, arg1);
|
|
443
450
|
}
|
|
444
451
|
|
|
445
|
-
function
|
|
446
|
-
wasm.
|
|
452
|
+
function __wasm_bindgen_func_elem_40(arg0, arg1, arg2) {
|
|
453
|
+
wasm.__wasm_bindgen_func_elem_40(arg0, arg1, addHeapObject(arg2));
|
|
447
454
|
}
|
|
448
455
|
|
|
449
456
|
|
|
Binary file
|