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 +7 -0
- package/package.json +1 -1
- package/pkg/deepwoken.d.ts +12 -5
- package/pkg/deepwoken.js +31 -11
- package/pkg/deepwoken_bg.wasm +0 -0
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
package/pkg/deepwoken.d.ts
CHANGED
|
@@ -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
|
|
76
|
-
readonly
|
|
77
|
-
readonly
|
|
78
|
-
readonly
|
|
79
|
-
readonly
|
|
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
|
|
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:
|
|
641
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
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:
|
|
646
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
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
|
|
681
|
-
wasm.
|
|
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
|
|
685
|
-
const ret = wasm.
|
|
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
|
|
692
|
-
wasm.
|
|
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
|
|
package/pkg/deepwoken_bg.wasm
CHANGED
|
Binary file
|