deepwoken 0.1.2 → 0.1.4

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
@@ -1,9 +1,17 @@
1
1
  export type { Talent, Weapon, Mantra, Outfit, Aspect, Stat } from './types.js';
2
2
 
3
3
  import wasmInit, { DeepData as WasmDeepData } from './pkg/deepwoken.js';
4
- import type { Talent, Weapon, Mantra, Outfit, Aspect } from './types.js';
4
+ import type { Talent, Weapon, Mantra, Outfit, Aspect, Stat } from './types.js';
5
5
 
6
- await wasmInit();
6
+ if (typeof window !== 'undefined') {
7
+ await wasmInit();
8
+ }
9
+
10
+ import { coreStats, weaponStats, attunementStats } from './pkg/deepwoken.js';
11
+
12
+ export const CORE_STATS: Stat[] = coreStats();
13
+ export const WEAPON_STATS: Stat[] = weaponStats();
14
+ export const ATTUNEMENT_STATS: Stat[] = attunementStats();
7
15
 
8
16
  export class DeepData {
9
17
  private _wasm: WasmDeepData;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepwoken",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
6
  "types": "index.ts",
@@ -29,11 +29,19 @@ export class DeepData {
29
29
  weapons(): any;
30
30
  }
31
31
 
32
+ export function attunementStats(): any;
33
+
34
+ export function coreStats(): any;
35
+
36
+ export function weaponStats(): any;
37
+
32
38
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
33
39
 
34
40
  export interface InitOutput {
35
41
  readonly memory: WebAssembly.Memory;
36
42
  readonly __wbg_deepdata_free: (a: number, b: number) => void;
43
+ readonly attunementStats: () => [number, number, number];
44
+ readonly coreStats: () => [number, number, number];
37
45
  readonly deepdata_aspects: (a: number) => [number, number, number];
38
46
  readonly deepdata_fetchLatest: () => any;
39
47
  readonly deepdata_fetchLatestFrom: (a: number, b: number, c: number, d: number) => any;
@@ -47,6 +55,7 @@ export interface InitOutput {
47
55
  readonly deepdata_outfits: (a: number) => [number, number, number];
48
56
  readonly deepdata_talents: (a: number) => [number, number, number];
49
57
  readonly deepdata_weapons: (a: number) => [number, number, number];
58
+ readonly weaponStats: () => [number, number, number];
50
59
  readonly wasm_bindgen__closure__destroy__hf10da1d08ed9fc18: (a: number, b: number) => void;
51
60
  readonly wasm_bindgen__closure__destroy__he46194fcf4899997: (a: number, b: number) => void;
52
61
  readonly wasm_bindgen__convert__closures_____invoke__h71bc5879fd2abe15: (a: number, b: number, c: any) => [number, number];
package/pkg/deepwoken.js CHANGED
@@ -172,6 +172,39 @@ export class DeepData {
172
172
  }
173
173
  if (Symbol.dispose) DeepData.prototype[Symbol.dispose] = DeepData.prototype.free;
174
174
 
175
+ /**
176
+ * @returns {any}
177
+ */
178
+ export function attunementStats() {
179
+ const ret = wasm.attunementStats();
180
+ if (ret[2]) {
181
+ throw takeFromExternrefTable0(ret[1]);
182
+ }
183
+ return takeFromExternrefTable0(ret[0]);
184
+ }
185
+
186
+ /**
187
+ * @returns {any}
188
+ */
189
+ export function coreStats() {
190
+ const ret = wasm.coreStats();
191
+ if (ret[2]) {
192
+ throw takeFromExternrefTable0(ret[1]);
193
+ }
194
+ return takeFromExternrefTable0(ret[0]);
195
+ }
196
+
197
+ /**
198
+ * @returns {any}
199
+ */
200
+ export function weaponStats() {
201
+ const ret = wasm.weaponStats();
202
+ if (ret[2]) {
203
+ throw takeFromExternrefTable0(ret[1]);
204
+ }
205
+ return takeFromExternrefTable0(ret[0]);
206
+ }
207
+
175
208
  function __wbg_get_imports() {
176
209
  const import0 = {
177
210
  __proto__: null,
Binary file