deepwoken 0.2.0 → 0.2.1

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/index.ts CHANGED
@@ -6,12 +6,14 @@ import type { Aspect, Mantra, Outfit, Stat, Talent, Weapon } from './types.js';
6
6
  // dynamically import wasm bc the server will try to load wasm regardless man
7
7
  let WasmDeepData: any;
8
8
  let WasmStatMap: any;
9
+ let wasmNameToIdentifier: (name: string) => string;
9
10
 
10
11
  if (typeof window !== 'undefined') {
11
12
  const wasm = await import('./pkg/deepwoken.js');
12
13
  await wasm.default();
13
14
  WasmDeepData = wasm.DeepData;
14
15
  WasmStatMap = wasm.StatMap;
16
+ wasmNameToIdentifier = wasm.nameToIdentifier;
15
17
  }
16
18
 
17
19
  export class DeepData {
@@ -46,6 +48,11 @@ export class DeepData {
46
48
  aspects(): Aspect[] { return this._wasm.aspects(); }
47
49
  }
48
50
 
51
+ /** Transforms the name of things ingame into a parsable identifier/key used in the database */
52
+ export function nameToIdentifier(name: string): string {
53
+ return wasmNameToIdentifier(name);
54
+ }
55
+
49
56
  export class StatMap {
50
57
  private _wasm: any;
51
58
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepwoken",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
6
  "types": "index.ts",
@@ -42,6 +42,11 @@ export class StatMap {
42
42
  toJSON(): any;
43
43
  }
44
44
 
45
+ /**
46
+ * Transforms the name of things ingame into an identifier/key used in the database
47
+ */
48
+ export function nameToIdentifier(name: string): string;
49
+
45
50
  export function shrineOrderDwb(pre: StatMap, racial: StatMap): StatMap;
46
51
 
47
52
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
@@ -63,6 +68,7 @@ export interface InitOutput {
63
68
  readonly deepdata_outfits: (a: number) => [number, number, number];
64
69
  readonly deepdata_talents: (a: number) => [number, number, number];
65
70
  readonly deepdata_weapons: (a: number) => [number, number, number];
71
+ readonly nameToIdentifier: (a: number, b: number) => [number, number];
66
72
  readonly shrineOrderDwb: (a: number, b: number) => number;
67
73
  readonly statmap_cost: (a: number) => number;
68
74
  readonly statmap_get: (a: number, b: number, c: number) => [number, number, number];
@@ -72,17 +78,18 @@ export interface InitOutput {
72
78
  readonly statmap_set: (a: number, b: number, c: number, d: number) => [number, number];
73
79
  readonly statmap_toJSON: (a: number) => [number, number, number];
74
80
  readonly statmap_shrineOrder: (a: number, b: number) => number;
75
- readonly wasm_bindgen__closure__destroy__hf10da1d08ed9fc18: (a: number, b: number) => void;
76
- readonly wasm_bindgen__closure__destroy__he46194fcf4899997: (a: number, b: number) => void;
77
- readonly wasm_bindgen__convert__closures_____invoke__h71bc5879fd2abe15: (a: number, b: number, c: any) => [number, number];
78
- readonly wasm_bindgen__convert__closures_____invoke__h2dcdf54066fbc735: (a: number, b: number, c: any, d: any) => void;
79
- readonly wasm_bindgen__convert__closures_____invoke__h8e5a743d58fae3f8: (a: number, b: number) => void;
81
+ readonly wasm_bindgen__closure__destroy__hfbac65673247baa3: (a: number, b: number) => void;
82
+ readonly wasm_bindgen__closure__destroy__h22f2fd8de233cef9: (a: number, b: number) => void;
83
+ readonly wasm_bindgen__convert__closures_____invoke__h462ab53fb1f380e1: (a: number, b: number, c: any) => [number, number];
84
+ readonly wasm_bindgen__convert__closures_____invoke__h3f8186ac2655158b: (a: number, b: number, c: any, d: any) => void;
85
+ readonly wasm_bindgen__convert__closures_____invoke__hcf18b6c4eb572639: (a: number, b: number) => void;
80
86
  readonly __wbindgen_malloc: (a: number, b: number) => number;
81
87
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
82
88
  readonly __wbindgen_exn_store: (a: number) => void;
83
89
  readonly __externref_table_alloc: () => number;
84
90
  readonly __wbindgen_externrefs: WebAssembly.Table;
85
91
  readonly __externref_table_dealloc: (a: number) => void;
92
+ readonly __wbindgen_free: (a: number, b: number, c: number) => void;
86
93
  readonly __wbindgen_start: () => void;
87
94
  }
88
95
 
package/pkg/deepwoken.js CHANGED
@@ -270,6 +270,26 @@ export class StatMap {
270
270
  }
271
271
  if (Symbol.dispose) StatMap.prototype[Symbol.dispose] = StatMap.prototype.free;
272
272
 
273
+ /**
274
+ * Transforms the name of things ingame into an identifier/key used in the database
275
+ * @param {string} name
276
+ * @returns {string}
277
+ */
278
+ export function nameToIdentifier(name) {
279
+ let deferred2_0;
280
+ let deferred2_1;
281
+ try {
282
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
283
+ const len0 = WASM_VECTOR_LEN;
284
+ const ret = wasm.nameToIdentifier(ptr0, len0);
285
+ deferred2_0 = ret[0];
286
+ deferred2_1 = ret[1];
287
+ return getStringFromWasm0(ret[0], ret[1]);
288
+ } finally {
289
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
290
+ }
291
+ }
292
+
273
293
  /**
274
294
  * @param {StatMap} pre
275
295
  * @param {StatMap} racial
@@ -513,7 +533,7 @@ function __wbg_get_imports() {
513
533
  const a = state0.a;
514
534
  state0.a = 0;
515
535
  try {
516
- return wasm_bindgen__convert__closures_____invoke__h2dcdf54066fbc735(a, state0.b, arg0, arg1);
536
+ return wasm_bindgen__convert__closures_____invoke__h3f8186ac2655158b(a, state0.b, arg0, arg1);
517
537
  } finally {
518
538
  state0.a = a;
519
539
  }
@@ -637,13 +657,13 @@ function __wbg_get_imports() {
637
657
  return ret;
638
658
  },
639
659
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
640
- // Cast intrinsic for `Closure(Closure { dtor_idx: 145, function: Function { arguments: [], shim_idx: 146, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
641
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hf10da1d08ed9fc18, wasm_bindgen__convert__closures_____invoke__h8e5a743d58fae3f8);
660
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 151, function: Function { arguments: [], shim_idx: 152, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
661
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hfbac65673247baa3, wasm_bindgen__convert__closures_____invoke__hcf18b6c4eb572639);
642
662
  return ret;
643
663
  },
644
664
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
645
- // Cast intrinsic for `Closure(Closure { dtor_idx: 169, function: Function { arguments: [Externref], shim_idx: 170, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
646
- const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__he46194fcf4899997, wasm_bindgen__convert__closures_____invoke__h71bc5879fd2abe15);
665
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 171, function: Function { arguments: [Externref], shim_idx: 172, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
666
+ const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h22f2fd8de233cef9, wasm_bindgen__convert__closures_____invoke__h462ab53fb1f380e1);
647
667
  return ret;
648
668
  },
649
669
  __wbindgen_cast_0000000000000003: function(arg0) {
@@ -677,19 +697,19 @@ function __wbg_get_imports() {
677
697
  };
678
698
  }
679
699
 
680
- function wasm_bindgen__convert__closures_____invoke__h8e5a743d58fae3f8(arg0, arg1) {
681
- wasm.wasm_bindgen__convert__closures_____invoke__h8e5a743d58fae3f8(arg0, arg1);
700
+ function wasm_bindgen__convert__closures_____invoke__hcf18b6c4eb572639(arg0, arg1) {
701
+ wasm.wasm_bindgen__convert__closures_____invoke__hcf18b6c4eb572639(arg0, arg1);
682
702
  }
683
703
 
684
- function wasm_bindgen__convert__closures_____invoke__h71bc5879fd2abe15(arg0, arg1, arg2) {
685
- const ret = wasm.wasm_bindgen__convert__closures_____invoke__h71bc5879fd2abe15(arg0, arg1, arg2);
704
+ function wasm_bindgen__convert__closures_____invoke__h462ab53fb1f380e1(arg0, arg1, arg2) {
705
+ const ret = wasm.wasm_bindgen__convert__closures_____invoke__h462ab53fb1f380e1(arg0, arg1, arg2);
686
706
  if (ret[1]) {
687
707
  throw takeFromExternrefTable0(ret[0]);
688
708
  }
689
709
  }
690
710
 
691
- function wasm_bindgen__convert__closures_____invoke__h2dcdf54066fbc735(arg0, arg1, arg2, arg3) {
692
- wasm.wasm_bindgen__convert__closures_____invoke__h2dcdf54066fbc735(arg0, arg1, arg2, arg3);
711
+ function wasm_bindgen__convert__closures_____invoke__h3f8186ac2655158b(arg0, arg1, arg2, arg3) {
712
+ wasm.wasm_bindgen__convert__closures_____invoke__h3f8186ac2655158b(arg0, arg1, arg2, arg3);
693
713
  }
694
714
 
695
715
 
Binary file