@sandvichxyz/teamtype-wasm 0.9.2-dev → 0.9.2-dev.2
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 +4 -1
- package/teamtype_wasm.d.ts +5 -0
- package/teamtype_wasm.js +16 -7
- package/teamtype_wasm_bg.wasm +0 -0
package/package.json
CHANGED
|
@@ -8,7 +8,10 @@
|
|
|
8
8
|
"HumanoidSandvichDispenser <humanoidsandvichdispenser@gmail.com>"
|
|
9
9
|
],
|
|
10
10
|
"description": "Browser/wasm peer for Teamtype, exposing the sync core over a JavaScript API.",
|
|
11
|
-
"version": "0.9.2-dev",
|
|
11
|
+
"version": "0.9.2-dev.2",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
12
15
|
"license": "AGPL-3.0-or-later",
|
|
13
16
|
"files": [
|
|
14
17
|
"teamtype_wasm_bg.wasm",
|
package/teamtype_wasm.d.ts
CHANGED
|
@@ -83,6 +83,10 @@ export class TeamtypeClient {
|
|
|
83
83
|
* Apply an edit to a file.
|
|
84
84
|
*/
|
|
85
85
|
applyEdit(file_name: string, delta: any): void;
|
|
86
|
+
/**
|
|
87
|
+
* Connect to a peer using a secret address (`<node_id>#<passphrase>`).
|
|
88
|
+
*/
|
|
89
|
+
connectByAddress(address: string): void;
|
|
86
90
|
/**
|
|
87
91
|
* Connect to a peer using a wormhole join code.
|
|
88
92
|
*/
|
|
@@ -148,6 +152,7 @@ export interface InitOutput {
|
|
|
148
152
|
readonly memory: WebAssembly.Memory;
|
|
149
153
|
readonly __wbg_teamtypeclient_free: (a: number, b: number) => void;
|
|
150
154
|
readonly teamtypeclient_applyEdit: (a: number, b: number, c: number, d: any) => void;
|
|
155
|
+
readonly teamtypeclient_connectByAddress: (a: number, b: number, c: number) => void;
|
|
151
156
|
readonly teamtypeclient_connectByJoinCode: (a: number, b: number, c: number) => void;
|
|
152
157
|
readonly teamtypeclient_new: () => number;
|
|
153
158
|
readonly teamtypeclient_nodeInfo: (a: number) => any;
|
package/teamtype_wasm.js
CHANGED
|
@@ -136,6 +136,15 @@ export class TeamtypeClient {
|
|
|
136
136
|
const len0 = WASM_VECTOR_LEN;
|
|
137
137
|
wasm.teamtypeclient_applyEdit(this.__wbg_ptr, ptr0, len0, delta);
|
|
138
138
|
}
|
|
139
|
+
/**
|
|
140
|
+
* Connect to a peer using a secret address (`<node_id>#<passphrase>`).
|
|
141
|
+
* @param {string} address
|
|
142
|
+
*/
|
|
143
|
+
connectByAddress(address) {
|
|
144
|
+
const ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
145
|
+
const len0 = WASM_VECTOR_LEN;
|
|
146
|
+
wasm.teamtypeclient_connectByAddress(this.__wbg_ptr, ptr0, len0);
|
|
147
|
+
}
|
|
139
148
|
/**
|
|
140
149
|
* Connect to a peer using a wormhole join code.
|
|
141
150
|
* @param {string} join_code
|
|
@@ -854,37 +863,37 @@ function __wbg_get_imports() {
|
|
|
854
863
|
return ret;
|
|
855
864
|
},
|
|
856
865
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
857
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
866
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2260, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
858
867
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_a1427d1cfc54b76a___convert__closures_____invoke___wasm_bindgen_a1427d1cfc54b76a___JsValue______true_);
|
|
859
868
|
return ret;
|
|
860
869
|
},
|
|
861
870
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
862
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
871
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 4396, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
863
872
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_a1427d1cfc54b76a___convert__closures_____invoke___wasm_bindgen_a1427d1cfc54b76a___JsValue__core_c09542a5c46f04b6___result__Result_____wasm_bindgen_a1427d1cfc54b76a___JsError___true_);
|
|
864
873
|
return ret;
|
|
865
874
|
},
|
|
866
875
|
__wbindgen_cast_0000000000000003: function(arg0, arg1) {
|
|
867
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx:
|
|
876
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 1891, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
868
877
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_a1427d1cfc54b76a___convert__closures_____invoke___web_sys_9299a82c88baa8d___features__gen_CloseEvent__CloseEvent______true_);
|
|
869
878
|
return ret;
|
|
870
879
|
},
|
|
871
880
|
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
872
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx:
|
|
881
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 3373, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
873
882
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_a1427d1cfc54b76a___convert__closures_____invoke___web_sys_9299a82c88baa8d___features__gen_MessageEvent__MessageEvent______true_);
|
|
874
883
|
return ret;
|
|
875
884
|
},
|
|
876
885
|
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
877
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
886
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 2010, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
|
|
878
887
|
const ret = makeClosure(arg0, arg1, wasm_bindgen_a1427d1cfc54b76a___convert__closures_____invoke_______true_);
|
|
879
888
|
return ret;
|
|
880
889
|
},
|
|
881
890
|
__wbindgen_cast_0000000000000006: function(arg0, arg1) {
|
|
882
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
891
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 2227, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
883
892
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_a1427d1cfc54b76a___convert__closures_____invoke_______true__1_);
|
|
884
893
|
return ret;
|
|
885
894
|
},
|
|
886
895
|
__wbindgen_cast_0000000000000007: function(arg0, arg1) {
|
|
887
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx:
|
|
896
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 3399, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
888
897
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen_a1427d1cfc54b76a___convert__closures_____invoke_______true__2_);
|
|
889
898
|
return ret;
|
|
890
899
|
},
|
package/teamtype_wasm_bg.wasm
CHANGED
|
Binary file
|