deepwoken 0.1.0 → 0.1.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 ADDED
@@ -0,0 +1,37 @@
1
+ export { default as init } from './pkg/deepwoken.js';
2
+ export type { Talent, Weapon, Mantra, Outfit, Aspect, Stat } from './types.js';
3
+
4
+ import { DeepData as WasmDeepData } from './pkg/deepwoken.js';
5
+ import type { Talent, Weapon, Mantra, Outfit, Aspect } from './types.js';
6
+
7
+ export class DeepData {
8
+ private _wasm: WasmDeepData;
9
+
10
+ private constructor(wasm: WasmDeepData) {
11
+ this._wasm = wasm;
12
+ }
13
+
14
+ static async fetchLatest(): Promise<DeepData> {
15
+ return new DeepData(await WasmDeepData.fetchLatest());
16
+ }
17
+
18
+ static async fetchLatestFrom(owner: string, repo: string): Promise<DeepData> {
19
+ return new DeepData(await WasmDeepData.fetchLatestFrom(owner, repo));
20
+ }
21
+
22
+ static fromJson(json: string): DeepData {
23
+ return new DeepData(WasmDeepData.fromJson(json));
24
+ }
25
+
26
+ getTalent(name: string): Talent | null { return this._wasm.getTalent(name); }
27
+ getMantra(name: string): Mantra | null { return this._wasm.getMantra(name); }
28
+ getWeapon(name: string): Weapon | null { return this._wasm.getWeapon(name); }
29
+ getOutfit(name: string): Outfit | null { return this._wasm.getOutfit(name); }
30
+ getAspect(name: string): Aspect | null { return this._wasm.getAspect(name); }
31
+
32
+ talents(): Talent[] { return this._wasm.talents(); }
33
+ mantras(): Mantra[] { return this._wasm.mantras(); }
34
+ weapons(): Weapon[] { return this._wasm.weapons(); }
35
+ outfits(): Outfit[] { return this._wasm.outfits(); }
36
+ aspects(): Aspect[] { return this._wasm.aspects(); }
37
+ }
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
- "name": "deepwoken",
3
- "type": "module",
4
- "version": "0.1.0",
5
- "files": [
6
- "deepwoken_bg.wasm",
7
- "deepwoken.js",
8
- "deepwoken_bg.js",
9
- "deepwoken.d.ts"
10
- ],
11
- "main": "deepwoken.js",
12
- "types": "deepwoken.d.ts",
13
- "sideEffects": [
14
- "./deepwoken.js",
15
- "./snippets/*"
16
- ]
17
- }
2
+ "name": "deepwoken",
3
+ "version": "0.1.1",
4
+ "type": "module",
5
+ "main": "index.ts",
6
+ "types": "index.ts",
7
+ "files": [
8
+ "index.ts",
9
+ "types.ts",
10
+ "pkg/deepwoken_bg.wasm",
11
+ "pkg/deepwoken.js",
12
+ "pkg/deepwoken.d.ts"
13
+ ],
14
+ "scripts": {
15
+ "build": "wasm-pack build --target web"
16
+ }
17
+ }
@@ -0,0 +1,84 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+
4
+ export class DeepData {
5
+ private constructor();
6
+ free(): void;
7
+ [Symbol.dispose](): void;
8
+ aspects(): any;
9
+ /**
10
+ * Fetch the latest data bundle from pocamind/data on GitHub
11
+ */
12
+ static fetchLatest(): Promise<DeepData>;
13
+ /**
14
+ * Fetch the latest data bundle from a fork
15
+ */
16
+ static fetchLatestFrom(owner: string, repo: string): Promise<DeepData>;
17
+ /**
18
+ * Parse data from a JSON string
19
+ */
20
+ static fromJson(json: string): DeepData;
21
+ getAspect(name: string): any;
22
+ getMantra(name: string): any;
23
+ getOutfit(name: string): any;
24
+ getTalent(name: string): any;
25
+ getWeapon(name: string): any;
26
+ mantras(): any;
27
+ outfits(): any;
28
+ talents(): any;
29
+ weapons(): any;
30
+ }
31
+
32
+ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
33
+
34
+ export interface InitOutput {
35
+ readonly memory: WebAssembly.Memory;
36
+ readonly __wbg_deepdata_free: (a: number, b: number) => void;
37
+ readonly deepdata_aspects: (a: number) => [number, number, number];
38
+ readonly deepdata_fetchLatest: () => any;
39
+ readonly deepdata_fetchLatestFrom: (a: number, b: number, c: number, d: number) => any;
40
+ readonly deepdata_fromJson: (a: number, b: number) => [number, number, number];
41
+ readonly deepdata_getAspect: (a: number, b: number, c: number) => [number, number, number];
42
+ readonly deepdata_getMantra: (a: number, b: number, c: number) => [number, number, number];
43
+ readonly deepdata_getOutfit: (a: number, b: number, c: number) => [number, number, number];
44
+ readonly deepdata_getTalent: (a: number, b: number, c: number) => [number, number, number];
45
+ readonly deepdata_getWeapon: (a: number, b: number, c: number) => [number, number, number];
46
+ readonly deepdata_mantras: (a: number) => [number, number, number];
47
+ readonly deepdata_outfits: (a: number) => [number, number, number];
48
+ readonly deepdata_talents: (a: number) => [number, number, number];
49
+ readonly deepdata_weapons: (a: number) => [number, number, number];
50
+ readonly wasm_bindgen__closure__destroy__hf10da1d08ed9fc18: (a: number, b: number) => void;
51
+ readonly wasm_bindgen__closure__destroy__he46194fcf4899997: (a: number, b: number) => void;
52
+ readonly wasm_bindgen__convert__closures_____invoke__h71bc5879fd2abe15: (a: number, b: number, c: any) => [number, number];
53
+ readonly wasm_bindgen__convert__closures_____invoke__h2dcdf54066fbc735: (a: number, b: number, c: any, d: any) => void;
54
+ readonly wasm_bindgen__convert__closures_____invoke__h8e5a743d58fae3f8: (a: number, b: number) => void;
55
+ readonly __wbindgen_malloc: (a: number, b: number) => number;
56
+ readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
57
+ readonly __wbindgen_exn_store: (a: number) => void;
58
+ readonly __externref_table_alloc: () => number;
59
+ readonly __wbindgen_externrefs: WebAssembly.Table;
60
+ readonly __externref_table_dealloc: (a: number) => void;
61
+ readonly __wbindgen_start: () => void;
62
+ }
63
+
64
+ export type SyncInitInput = BufferSource | WebAssembly.Module;
65
+
66
+ /**
67
+ * Instantiates the given `module`, which can either be bytes or
68
+ * a precompiled `WebAssembly.Module`.
69
+ *
70
+ * @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
71
+ *
72
+ * @returns {InitOutput}
73
+ */
74
+ export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
75
+
76
+ /**
77
+ * If `module_or_path` is {RequestInfo} or {URL}, makes a request and
78
+ * for everything else, calls `WebAssembly.instantiate` directly.
79
+ *
80
+ * @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
81
+ *
82
+ * @returns {Promise<InitOutput>}
83
+ */
84
+ export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;