@pkhex-everywhere/react 0.7.0 → 0.7.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @pkhex-everywhere/react
2
2
 
3
+ ## 0.7.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 73a0afe: New `trainer.badges()` lists the gym badges by name with whether each is earned, and `trainer.setBadges(earned)` sets them. Both work on Generation 1, 2 and 3 saves, but not ROM hacks. `useTrainer()` gains `setBadges`.
8
+ - Updated dependencies [f74dcdd]
9
+ - Updated dependencies [40f058d]
10
+ - Updated dependencies [73a0afe]
11
+ - @pkhex-everywhere/engine@0.7.2
12
+
13
+ ## 0.7.1
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [56d8b03]
18
+ - @pkhex-everywhere/engine@0.7.1
19
+
3
20
  ## 0.7.0
4
21
 
5
22
  ### Patch Changes
@@ -67,6 +67,8 @@ export declare function usePokemon(at: PokemonHandle): {
67
67
  };
68
68
  /** Requires a loaded save; throws `no-save` otherwise. Wrap in `<RequireGame>`. */
69
69
  export declare function useTrainer(): {
70
+ /** Sets which gym badges the trainer has, one value per badge in the order `trainer.badges` lists them. Throws `not-supported` when `trainer.badges` returns null, and `out-of-range` when the number of values doesn't match. Requires a loaded save; throws `no-save` otherwise. Wrap in `<RequireGame>`. */
71
+ setBadges: (earned: boolean[]) => Promise<void>;
70
72
  /** Requires a loaded save; throws `no-save` otherwise. Wrap in `<RequireGame>`. */
71
73
  setBattlePoints: (value: number) => Promise<void>;
72
74
  /** Requires a loaded save; throws `no-save` otherwise. Wrap in `<RequireGame>`. */
package/dist/index.js CHANGED
@@ -226,6 +226,8 @@ function useTrainer() {
226
226
  return {
227
227
  trainer: useQuery("trainer.get"),
228
228
  ...useMemo(() => ({
229
+ /** Sets which gym badges the trainer has, one value per badge in the order `trainer.badges` lists them. Throws `not-supported` when `trainer.badges` returns null, and `out-of-range` when the number of values doesn't match. Requires a loaded save; throws `no-save` otherwise. Wrap in `<RequireGame>`. */
230
+ setBadges: (earned) => engine.trainer.setBadges(earned),
229
231
  /** Requires a loaded save; throws `no-save` otherwise. Wrap in `<RequireGame>`. */
230
232
  setBattlePoints: (value) => engine.trainer.setBattlePoints(value),
231
233
  /** Requires a loaded save; throws `no-save` otherwise. Wrap in `<RequireGame>`. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pkhex-everywhere/react",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "React hooks for @pkhex-everywhere/engine.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "homepage": "https://docs.pkhex-everywhere.fyi/docs/",
@@ -30,7 +30,7 @@
30
30
  "test": "vitest run"
31
31
  },
32
32
  "peerDependencies": {
33
- "@pkhex-everywhere/engine": "^0.7.0",
33
+ "@pkhex-everywhere/engine": "^0.7.2",
34
34
  "react": "^19.0.0"
35
35
  },
36
36
  "devDependencies": {