deepwoken 0.2.9 → 0.3.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/generated.ts CHANGED
@@ -5,3 +5,20 @@ export type Stat = "Strength" | "Fortitude" | "Agility" | "Intelligence" | "Will
5
5
  export const CORE_STATS: Stat[] = ["Strength", "Fortitude", "Agility", "Intelligence", "Willpower", "Charisma"];
6
6
  export const WEAPON_STATS: Stat[] = ["Heavy", "Medium", "Light"];
7
7
  export const ATTUNEMENT_STATS: Stat[] = ["Flamecharm", "Frostdraw", "Thundercall", "Galebreathe", "Shadowcast", "Ironsing", "Bloodrend"];
8
+
9
+ export type ItemRarity = "Common" | "Uncommon" | "Rare" | "Legendary" | "Mythical" | "Unique" | "Exclusive" | "Relic" | "Unknown" | "Named" | "Hallowtide" | "Spec";
10
+ export const ITEM_RARITIES: ItemRarity[] = ["Common", "Uncommon", "Rare", "Legendary", "Mythical", "Unique", "Exclusive", "Relic", "Unknown", "Named", "Hallowtide", "Spec"];
11
+
12
+ export type TalentRarity = "Common" | "Rare" | "Advanced" | "Faction" | "Innate" | "Memento" | "Murmur" | "Oath" | "Origin" | "Quest" | "Spec" | "Equipment" | "Outfit" | "Weapon";
13
+ export const TALENT_RARITIES: TalentRarity[] = ["Common", "Rare", "Advanced", "Faction", "Innate", "Memento", "Murmur", "Oath", "Origin", "Quest", "Spec", "Equipment", "Outfit", "Weapon"];
14
+
15
+ export type WeaponType = "Bow" | "Club" | "Dagger" | "Fist" | "Greataxe" | "Greatcannon" | "Greathammer" | "Greatsword" | "Parrying Dagger" | "Pistol" | "Rapier" | "Rifle" | "Shield" | "Spear" | "Spear / Rifle" | "Staff" | "Sword" | "Sword / Greatsword" | "Twinblade" | "Exclusive";
16
+ export const WEAPON_TYPES: WeaponType[] = ["Bow", "Club", "Dagger", "Fist", "Greataxe", "Greatcannon", "Greathammer", "Greatsword", "Parrying Dagger", "Pistol", "Rapier", "Rifle", "Shield", "Spear", "Spear / Rifle", "Staff", "Sword", "Sword / Greatsword", "Twinblade", "Exclusive"];
17
+
18
+ export type EquipmentSlot = "Arms" | "Earrings" | "Face" | "Head" | "Legs" | "Rings" | "Torso";
19
+ export const EQUIPMENT_SLOTS: EquipmentSlot[] = ["Arms", "Earrings", "Face", "Head", "Legs", "Rings", "Torso"];
20
+
21
+ export type RangeType = "Sweep" | "Lunge";
22
+
23
+ export type MantraType = "Normal" | "Oath" | "Origin" | "Event" | "Monster";
24
+
package/index.ts CHANGED
@@ -1,16 +1,17 @@
1
- export { ATTUNEMENT_STATS, CORE_STATS, WEAPON_STATS } from './types.js';
2
- export type { Aspect, Mantra, Outfit, Stat, Talent, Weapon } from './types.js';
1
+ export { ATTUNEMENT_STATS, CORE_STATS, WEAPON_STATS, ITEM_RARITIES, TALENT_RARITIES, WEAPON_TYPES, EQUIPMENT_SLOTS } from './types.js';
2
+ export type { Aspect, Equipment, EquipmentSlot, ItemRarity, Mantra, MantraType, Outfit, RangeType, Stat, Talent, TalentRarity, Weapon, WeaponType } from './types.js';
3
3
  export type { Atom, Clause, ClauseType, Reducability } from './requirement.js';
4
4
 
5
- import type { Aspect, Mantra, Outfit, Stat, Talent, Weapon } from './types.js';
5
+ import type { Aspect, Equipment, Mantra, Outfit, Stat, Talent, Weapon } from './types.js';
6
6
  import type { Clause } from './requirement.js';
7
7
 
8
8
  const wasm = await import('./pkg/deepwoken.js');
9
9
 
10
10
  if (typeof process !== 'undefined' && process.versions?.node) {
11
11
  const { readFile } = await import('node:fs/promises');
12
- const { fileURLToPath } = await import('node:url');
13
- const wasmPath = fileURLToPath(new URL('./pkg/deepwoken_bg.wasm', import.meta.url));
12
+ const { createRequire } = await import('node:module');
13
+ const require = createRequire(import.meta.url);
14
+ const wasmPath = require.resolve('deepwoken/pkg/deepwoken_bg.wasm');
14
15
  await wasm.default(await readFile(wasmPath));
15
16
  } else {
16
17
  await wasm.default();
@@ -44,12 +45,14 @@ export class DeepData {
44
45
  getMantra(name: string): Mantra | null { return this._wasm.getMantra(name); }
45
46
  getWeapon(name: string): Weapon | null { return this._wasm.getWeapon(name); }
46
47
  getOutfit(name: string): Outfit | null { return this._wasm.getOutfit(name); }
48
+ getEquipment(name: string): Equipment | null { return this._wasm.getEquipment(name); }
47
49
  getAspect(name: string): Aspect | null { return this._wasm.getAspect(name); }
48
50
 
49
51
  talents(): Talent[] { return this._wasm.talents(); }
50
52
  mantras(): Mantra[] { return this._wasm.mantras(); }
51
53
  weapons(): Weapon[] { return this._wasm.weapons(); }
52
54
  outfits(): Outfit[] { return this._wasm.outfits(); }
55
+ equipment(): Equipment[] { return this._wasm.equipment(); }
53
56
  aspects(): Aspect[] { return this._wasm.aspects(); }
54
57
  }
55
58
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepwoken",
3
- "version": "0.2.9",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "main": "index.ts",
6
6
  "types": "index.ts",
@@ -6,6 +6,7 @@ export class DeepData {
6
6
  free(): void;
7
7
  [Symbol.dispose](): void;
8
8
  aspects(): any;
9
+ equipment(): any;
9
10
  /**
10
11
  * Fetch the latest data bundle from pocamind/data on GitHub
11
12
  */
@@ -19,6 +20,7 @@ export class DeepData {
19
20
  */
20
21
  static fromJson(json: string): DeepData;
21
22
  getAspect(name: string): any;
23
+ getEquipment(name: string): any;
22
24
  getMantra(name: string): any;
23
25
  getOutfit(name: string): any;
24
26
  getTalent(name: string): any;
@@ -70,10 +72,12 @@ export interface InitOutput {
70
72
  readonly __wbg_requirement_free: (a: number, b: number) => void;
71
73
  readonly __wbg_statmap_free: (a: number, b: number) => void;
72
74
  readonly deepdata_aspects: (a: number) => [number, number, number];
75
+ readonly deepdata_equipment: (a: number) => [number, number, number];
73
76
  readonly deepdata_fetchLatest: () => any;
74
77
  readonly deepdata_fetchLatestFrom: (a: number, b: number, c: number, d: number) => any;
75
78
  readonly deepdata_fromJson: (a: number, b: number) => [number, number, number];
76
79
  readonly deepdata_getAspect: (a: number, b: number, c: number) => [number, number, number];
80
+ readonly deepdata_getEquipment: (a: number, b: number, c: number) => [number, number, number];
77
81
  readonly deepdata_getMantra: (a: number, b: number, c: number) => [number, number, number];
78
82
  readonly deepdata_getOutfit: (a: number, b: number, c: number) => [number, number, number];
79
83
  readonly deepdata_getTalent: (a: number, b: number, c: number) => [number, number, number];
package/pkg/deepwoken.js CHANGED
@@ -28,6 +28,16 @@ export class DeepData {
28
28
  }
29
29
  return takeFromExternrefTable0(ret[0]);
30
30
  }
31
+ /**
32
+ * @returns {any}
33
+ */
34
+ equipment() {
35
+ const ret = wasm.deepdata_equipment(this.__wbg_ptr);
36
+ if (ret[2]) {
37
+ throw takeFromExternrefTable0(ret[1]);
38
+ }
39
+ return takeFromExternrefTable0(ret[0]);
40
+ }
31
41
  /**
32
42
  * Fetch the latest data bundle from pocamind/data on GitHub
33
43
  * @returns {Promise<DeepData>}
@@ -77,6 +87,19 @@ export class DeepData {
77
87
  }
78
88
  return takeFromExternrefTable0(ret[0]);
79
89
  }
90
+ /**
91
+ * @param {string} name
92
+ * @returns {any}
93
+ */
94
+ getEquipment(name) {
95
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
96
+ const len0 = WASM_VECTOR_LEN;
97
+ const ret = wasm.deepdata_getEquipment(this.__wbg_ptr, ptr0, len0);
98
+ if (ret[2]) {
99
+ throw takeFromExternrefTable0(ret[1]);
100
+ }
101
+ return takeFromExternrefTable0(ret[0]);
102
+ }
80
103
  /**
81
104
  * @param {string} name
82
105
  * @returns {any}
@@ -758,12 +781,12 @@ function __wbg_get_imports() {
758
781
  return ret;
759
782
  },
760
783
  __wbindgen_cast_0000000000000001: function(arg0, arg1) {
761
- // Cast intrinsic for `Closure(Closure { dtor_idx: 147, function: Function { arguments: [], shim_idx: 148, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
784
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 152, function: Function { arguments: [], shim_idx: 153, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
762
785
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__hfbac65673247baa3, wasm_bindgen__convert__closures_____invoke__hcf18b6c4eb572639);
763
786
  return ret;
764
787
  },
765
788
  __wbindgen_cast_0000000000000002: function(arg0, arg1) {
766
- // Cast intrinsic for `Closure(Closure { dtor_idx: 167, function: Function { arguments: [Externref], shim_idx: 168, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
789
+ // Cast intrinsic for `Closure(Closure { dtor_idx: 172, function: Function { arguments: [Externref], shim_idx: 173, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
767
790
  const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h22f2fd8de233cef9, wasm_bindgen__convert__closures_____invoke__h462ab53fb1f380e1);
768
791
  return ret;
769
792
  },
Binary file
package/types.ts CHANGED
@@ -1,33 +1,64 @@
1
- export type { Stat } from './generated.js';
2
- export { CORE_STATS, WEAPON_STATS, ATTUNEMENT_STATS } from './generated.js';
1
+ export type { Stat, ItemRarity, TalentRarity, WeaponType, EquipmentSlot, RangeType, MantraType } from './generated.js';
2
+ export { CORE_STATS, WEAPON_STATS, ATTUNEMENT_STATS, ITEM_RARITIES, TALENT_RARITIES, WEAPON_TYPES, EQUIPMENT_SLOTS } from './generated.js';
3
3
 
4
- import type { Stat } from './generated.js';
4
+ import type { Stat, ItemRarity, TalentRarity, WeaponType, EquipmentSlot, RangeType, MantraType } from './generated.js';
5
+
6
+ export interface StatValue {
7
+ value: number;
8
+ percentage: boolean;
9
+ }
5
10
 
6
11
  export interface Talent {
7
12
  name: string;
8
13
  desc: string;
9
- rarity: string;
14
+ rarity: TalentRarity;
10
15
  category: string;
11
16
  reqs: string;
12
- exclusive: string[];
13
- innates: Record<string, number>;
14
- not_counted_towards_total: boolean;
17
+ count_towards_talent_total: boolean;
15
18
  vaulted: boolean;
19
+ voi: boolean;
20
+ exclusive?: string[];
21
+ stats?: Record<string, number>;
22
+ additional_info?: string;
23
+ icon?: string;
24
+ roll2able?: boolean;
16
25
  }
17
26
 
18
27
  export interface Weapon {
19
28
  name: string;
20
- type: string;
21
- damage_type: string;
29
+ type: WeaponType;
30
+ rarity: ItemRarity;
31
+ damage: number | null;
32
+ posture_damage: number | null;
33
+ range: number | null;
22
34
  reqs: string;
35
+ enchantable: boolean;
36
+ equip_motifs: boolean;
37
+ voi: boolean;
38
+ desc: string;
39
+ damage_types?: string[];
40
+ range_type?: RangeType;
41
+ attack_duration?: number;
42
+ endlag?: number | null;
43
+ swing_speed?: number;
44
+ scaling?: Record<string, number>;
45
+ bleed_damage?: number;
46
+ chip_damage?: number;
47
+ penetration?: number;
48
+ posture_max?: number;
49
+ posture_restoration?: number;
50
+ talents?: string[];
51
+ }
52
+
53
+ export interface MantraDamageLevel {
54
+ level: string;
23
55
  damage: number;
24
- pen: number;
25
- chip: number;
26
- weight: number;
27
- range: number;
28
- speed: number;
29
- endlag: number;
30
- scaling: Record<string, number>;
56
+ posture_damage: number | null;
57
+ }
58
+
59
+ export interface MantraDamageVariant {
60
+ variant: string | null;
61
+ levels: MantraDamageLevel[];
31
62
  }
32
63
 
33
64
  export interface Mantra {
@@ -35,14 +66,24 @@ export interface Mantra {
35
66
  desc: string;
36
67
  stars: number;
37
68
  category: string;
38
- type: string;
69
+ type: MantraType;
39
70
  attributes: string[];
40
71
  reqs: string;
41
72
  vaulted: boolean;
73
+ voi: boolean;
74
+ damage?: MantraDamageVariant[];
75
+ scaling?: Record<string, number>;
76
+ modifiers?: string[];
77
+ sparks?: string[];
78
+ related_talents?: string[];
79
+ shared_cooldowns?: string[];
80
+ miscellaneous?: string;
42
81
  }
43
82
 
44
83
  export interface Outfit {
45
84
  name: string;
85
+ pants_id: string | null;
86
+ shirt_id: string | null;
46
87
  category: string;
47
88
  durability: number;
48
89
  resistances: Record<string, number>;
@@ -51,6 +92,23 @@ export interface Outfit {
51
92
  reqs: string;
52
93
  mats: Record<string, number>;
53
94
  notes: number;
95
+ voi: boolean;
96
+ desc: string;
97
+ }
98
+
99
+ export interface Equipment {
100
+ name: string;
101
+ equippable: boolean;
102
+ type: EquipmentSlot;
103
+ rarity: ItemRarity;
104
+ set: string | null;
105
+ variants: string[];
106
+ talents: string[];
107
+ innates: Record<string, StatValue>;
108
+ pips: Record<string, number>;
109
+ reqs: string;
110
+ voi: boolean;
111
+ desc: string;
54
112
  }
55
113
 
56
114
  export interface AspectVariantInfo {
@@ -65,4 +123,6 @@ export interface Aspect {
65
123
  innate: Partial<Record<Stat, number>>;
66
124
  is_pathfinder: boolean;
67
125
  variants: Record<string, AspectVariantInfo>;
126
+ talent?: string[];
127
+ exclude_cosmetics?: string[];
68
128
  }