@sandvichxyz/teamtype-wasm 0.9.2-dev.1 → 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 CHANGED
@@ -8,7 +8,7 @@
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.1",
11
+ "version": "0.9.2-dev.2",
12
12
  "publishConfig": {
13
13
  "access": "public"
14
14
  },
@@ -7,6 +7,42 @@
7
7
  */
8
8
 
9
9
  export type ReadableStreamType = "bytes";
10
+ /**
11
+ * Info about our own node, surfaced to JS via `nodeInfo()`.
12
+ */
13
+ export interface NodeInfo {
14
+ node_id: string;
15
+ passphrase: string;
16
+ }
17
+
18
+ export interface CursorState {
19
+ name: string | undefined;
20
+ file_path: string;
21
+ ranges: Range[];
22
+ }
23
+
24
+ export interface EphemeralMessage {
25
+ cursor_id: string;
26
+ sequence_number: number;
27
+ cursor_state: CursorState;
28
+ }
29
+
30
+ export interface Position {
31
+ line: number;
32
+ character: number;
33
+ }
34
+
35
+ export interface Range {
36
+ start: Position;
37
+ end: Position;
38
+ }
39
+
40
+ export type DisconnectReason = { kind: "PeerDisconnected" } | { kind: "ReceiveError"; error: string } | { kind: "HandlerError"; error: string };
41
+
42
+ export type WireDelta = WireOp[];
43
+
44
+ export type WireOp = { Retain: number } | { Insert: string } | { Delete: number };
45
+
10
46
 
11
47
  export class IntoUnderlyingByteSource {
12
48
  private constructor();
package/teamtype_wasm.js CHANGED
@@ -863,37 +863,37 @@ function __wbg_get_imports() {
863
863
  return ret;
864
864
  },
865
865
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
866
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2259, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
866
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 2260, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
867
867
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_a1427d1cfc54b76a___convert__closures_____invoke___wasm_bindgen_a1427d1cfc54b76a___JsValue______true_);
868
868
  return ret;
869
869
  },
870
870
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
871
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 4395, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
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`.
872
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_);
873
873
  return ret;
874
874
  },
875
875
  __wbindgen_cast_0000000000000003: function(arg0, arg1) {
876
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("CloseEvent")], shim_idx: 1890, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
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`.
877
877
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_a1427d1cfc54b76a___convert__closures_____invoke___web_sys_9299a82c88baa8d___features__gen_CloseEvent__CloseEvent______true_);
878
878
  return ret;
879
879
  },
880
880
  __wbindgen_cast_0000000000000004: function(arg0, arg1) {
881
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("MessageEvent")], shim_idx: 3372, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
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`.
882
882
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_a1427d1cfc54b76a___convert__closures_____invoke___web_sys_9299a82c88baa8d___features__gen_MessageEvent__MessageEvent______true_);
883
883
  return ret;
884
884
  },
885
885
  __wbindgen_cast_0000000000000005: function(arg0, arg1) {
886
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 2009, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
886
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 2010, ret: Unit, inner_ret: Some(Unit) }, mutable: false }) -> Externref`.
887
887
  const ret = makeClosure(arg0, arg1, wasm_bindgen_a1427d1cfc54b76a___convert__closures_____invoke_______true_);
888
888
  return ret;
889
889
  },
890
890
  __wbindgen_cast_0000000000000006: function(arg0, arg1) {
891
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 2226, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
891
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 2227, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
892
892
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_a1427d1cfc54b76a___convert__closures_____invoke_______true__1_);
893
893
  return ret;
894
894
  },
895
895
  __wbindgen_cast_0000000000000007: function(arg0, arg1) {
896
- // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 3398, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
896
+ // Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 3399, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
897
897
  const ret = makeMutClosure(arg0, arg1, wasm_bindgen_a1427d1cfc54b76a___convert__closures_____invoke_______true__2_);
898
898
  return ret;
899
899
  },
Binary file