deepwoken 0.1.8 → 0.2.0

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepwoken",
3
- "version": "0.1.8",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
6
  "types": "index.ts",
@@ -38,9 +38,12 @@ export class StatMap {
38
38
  constructor(map: any);
39
39
  remaining(): number;
40
40
  set(stat: string, value: number): void;
41
+ shrineOrder(racial: StatMap): StatMap;
41
42
  toJSON(): any;
42
43
  }
43
44
 
45
+ export function shrineOrderDwb(pre: StatMap, racial: StatMap): StatMap;
46
+
44
47
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
45
48
 
46
49
  export interface InitOutput {
@@ -60,6 +63,7 @@ export interface InitOutput {
60
63
  readonly deepdata_outfits: (a: number) => [number, number, number];
61
64
  readonly deepdata_talents: (a: number) => [number, number, number];
62
65
  readonly deepdata_weapons: (a: number) => [number, number, number];
66
+ readonly shrineOrderDwb: (a: number, b: number) => number;
63
67
  readonly statmap_cost: (a: number) => number;
64
68
  readonly statmap_get: (a: number, b: number, c: number) => [number, number, number];
65
69
  readonly statmap_level: (a: number) => number;
@@ -67,6 +71,7 @@ export interface InitOutput {
67
71
  readonly statmap_remaining: (a: number) => number;
68
72
  readonly statmap_set: (a: number, b: number, c: number, d: number) => [number, number];
69
73
  readonly statmap_toJSON: (a: number) => [number, number, number];
74
+ readonly statmap_shrineOrder: (a: number, b: number) => number;
70
75
  readonly wasm_bindgen__closure__destroy__hf10da1d08ed9fc18: (a: number, b: number) => void;
71
76
  readonly wasm_bindgen__closure__destroy__he46194fcf4899997: (a: number, b: number) => void;
72
77
  readonly wasm_bindgen__convert__closures_____invoke__h71bc5879fd2abe15: (a: number, b: number, c: any) => [number, number];
package/pkg/deepwoken.js CHANGED
@@ -173,6 +173,13 @@ export class DeepData {
173
173
  if (Symbol.dispose) DeepData.prototype[Symbol.dispose] = DeepData.prototype.free;
174
174
 
175
175
  export class StatMap {
176
+ static __wrap(ptr) {
177
+ ptr = ptr >>> 0;
178
+ const obj = Object.create(StatMap.prototype);
179
+ obj.__wbg_ptr = ptr;
180
+ StatMapFinalization.register(obj, obj.__wbg_ptr, obj);
181
+ return obj;
182
+ }
176
183
  __destroy_into_raw() {
177
184
  const ptr = this.__wbg_ptr;
178
185
  this.__wbg_ptr = 0;
@@ -241,6 +248,15 @@ export class StatMap {
241
248
  throw takeFromExternrefTable0(ret[0]);
242
249
  }
243
250
  }
251
+ /**
252
+ * @param {StatMap} racial
253
+ * @returns {StatMap}
254
+ */
255
+ shrineOrder(racial) {
256
+ _assertClass(racial, StatMap);
257
+ const ret = wasm.statmap_shrineOrder(this.__wbg_ptr, racial.__wbg_ptr);
258
+ return StatMap.__wrap(ret);
259
+ }
244
260
  /**
245
261
  * @returns {any}
246
262
  */
@@ -254,6 +270,18 @@ export class StatMap {
254
270
  }
255
271
  if (Symbol.dispose) StatMap.prototype[Symbol.dispose] = StatMap.prototype.free;
256
272
 
273
+ /**
274
+ * @param {StatMap} pre
275
+ * @param {StatMap} racial
276
+ * @returns {StatMap}
277
+ */
278
+ export function shrineOrderDwb(pre, racial) {
279
+ _assertClass(pre, StatMap);
280
+ _assertClass(racial, StatMap);
281
+ const ret = wasm.shrineOrderDwb(pre.__wbg_ptr, racial.__wbg_ptr);
282
+ return StatMap.__wrap(ret);
283
+ }
284
+
257
285
  function __wbg_get_imports() {
258
286
  const import0 = {
259
287
  __proto__: null,
@@ -685,6 +713,12 @@ function addToExternrefTable0(obj) {
685
713
  return idx;
686
714
  }
687
715
 
716
+ function _assertClass(instance, klass) {
717
+ if (!(instance instanceof klass)) {
718
+ throw new Error(`expected instance of ${klass.name}`);
719
+ }
720
+ }
721
+
688
722
  const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
689
723
  ? { register: () => {}, unregister: () => {} }
690
724
  : new FinalizationRegistry(state => state.dtor(state.a, state.b));
Binary file