@pkhex-everywhere/engine 0.21.0 → 0.22.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.
Files changed (58) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/_framework/{PKHeX.Core.xz85b76xhy.wasm → PKHeX.Core.37d1f5m7pz.wasm} +0 -0
  3. package/_framework/{PKHeX.Core.AutoMod.m0h2ixrhk3.wasm → PKHeX.Core.AutoMod.hzyvs0y2ox.wasm} +0 -0
  4. package/_framework/{PKHeX.Everywhere.Engine.Host.g5jaq4yuy7.wasm → PKHeX.Everywhere.Engine.Host.4nbsbrvno9.wasm} +0 -0
  5. package/_framework/{PKHeX.Everywhere.Engine.PlugIns.pmucjgqnut.wasm → PKHeX.Everywhere.Engine.PlugIns.lycjgzrfas.wasm} +0 -0
  6. package/_framework/PKHeX.Everywhere.Engine.v7owo48kei.wasm +0 -0
  7. package/_framework/{PKHeX.Everywhere.PlugIns.eew0c8iczp.wasm → PKHeX.Everywhere.PlugIns.akj82ozp0c.wasm} +0 -0
  8. package/_framework/{PKHeX.Everywhere.RomHacks.ww5ccma9ih.wasm → PKHeX.Everywhere.RomHacks.l4pef92lj2.wasm} +0 -0
  9. package/_framework/PKHeX.Facade.xa2d7ql88l.wasm +0 -0
  10. package/_framework/{System.Collections.Concurrent.v9ktg7beqz.wasm → System.Collections.Concurrent.w7ionvsf6a.wasm} +0 -0
  11. package/_framework/{System.Collections.Immutable.98cu5knfnu.wasm → System.Collections.Immutable.gncfv428s7.wasm} +0 -0
  12. package/_framework/{System.Collections.9eyardblf5.wasm → System.Collections.j6pd7lu88q.wasm} +0 -0
  13. package/_framework/{System.ComponentModel.Annotations.l2lkirukk7.wasm → System.ComponentModel.Annotations.rhh7nmdlbp.wasm} +0 -0
  14. package/_framework/{System.ComponentModel.Primitives.hq8djy5qsf.wasm → System.ComponentModel.Primitives.ca08tls1fc.wasm} +0 -0
  15. package/_framework/{System.ComponentModel.TypeConverter.9engqsonw8.wasm → System.ComponentModel.TypeConverter.iyk8wj8bw4.wasm} +0 -0
  16. package/_framework/{System.ComponentModel.iv4cyr9ulo.wasm → System.ComponentModel.aonfao9zwt.wasm} +0 -0
  17. package/_framework/{System.Diagnostics.TraceSource.9pll2qpv1b.wasm → System.Diagnostics.TraceSource.0dwt57739n.wasm} +0 -0
  18. package/_framework/{System.IO.Compression.ZipFile.8lq1xxnf5t.wasm → System.IO.Compression.ZipFile.26k5j8tfyy.wasm} +0 -0
  19. package/_framework/{System.IO.Compression.5xkha2tnps.wasm → System.IO.Compression.pogxkev19w.wasm} +0 -0
  20. package/_framework/{System.IO.FileSystem.DriveInfo.f0e4wqpit7.wasm → System.IO.FileSystem.DriveInfo.3br6pv3vtc.wasm} +0 -0
  21. package/_framework/{System.IO.MemoryMappedFiles.9ojxkhkatq.wasm → System.IO.MemoryMappedFiles.zndhyy7skd.wasm} +0 -0
  22. package/_framework/{System.IO.Pipelines.z0womrlbrz.wasm → System.IO.Pipelines.7bhjmkezc5.wasm} +0 -0
  23. package/_framework/{System.Linq.ki1kpszwd6.wasm → System.Linq.0vyhsig4ls.wasm} +0 -0
  24. package/_framework/{System.Memory.ncqfmeoczp.wasm → System.Memory.3ctjlavdlp.wasm} +0 -0
  25. package/_framework/{System.Net.Http.ndno1pctv0.wasm → System.Net.Http.g2xcp18wai.wasm} +0 -0
  26. package/_framework/{System.Net.Primitives.ib2mzkdyxg.wasm → System.Net.Primitives.thlk6osq1r.wasm} +0 -0
  27. package/_framework/{System.Numerics.Vectors.k4xv3aksoq.wasm → System.Numerics.Vectors.ughjugupsx.wasm} +0 -0
  28. package/_framework/{System.ObjectModel.2y96ov9tla.wasm → System.ObjectModel.h75xegp88m.wasm} +0 -0
  29. package/_framework/System.Private.CoreLib.5qtirqqbjy.wasm +0 -0
  30. package/_framework/{System.Private.Uri.wwpt9fk95x.wasm → System.Private.Uri.l2jknlbpv7.wasm} +0 -0
  31. package/_framework/{System.Reflection.Metadata.5du2bbgsv2.wasm → System.Reflection.Metadata.1se4ztut5j.wasm} +0 -0
  32. package/_framework/{System.Runtime.InteropServices.JavaScript.t5vdubah79.wasm → System.Runtime.InteropServices.JavaScript.gm9bhpobfn.wasm} +0 -0
  33. package/_framework/{System.Runtime.InteropServices.zsicxx3i3w.wasm → System.Runtime.InteropServices.b6c1t3l6jq.wasm} +0 -0
  34. package/_framework/{System.Runtime.Numerics.2v8hhbeq9a.wasm → System.Runtime.Numerics.iqapql9em3.wasm} +0 -0
  35. package/_framework/{System.Runtime.vnwhlsf4yw.wasm → System.Runtime.ojhgbv89lz.wasm} +0 -0
  36. package/_framework/System.Security.Cryptography.xpalh523o8.wasm +0 -0
  37. package/_framework/{System.Text.Encodings.Web.hc4v4bocun.wasm → System.Text.Encodings.Web.6ojpym5w5z.wasm} +0 -0
  38. package/_framework/{System.Text.Json.c01v2xkggx.wasm → System.Text.Json.ak49pvk33c.wasm} +0 -0
  39. package/_framework/{System.Text.RegularExpressions.ff2vgl1w9u.wasm → System.Text.RegularExpressions.esf5yf0ukg.wasm} +0 -0
  40. package/_framework/{System.Threading.hlnr40ah8w.wasm → System.Threading.7sl2cuzk31.wasm} +0 -0
  41. package/_framework/{System.Threading.Tasks.Parallel.mwmkdih2pi.wasm → System.Threading.Tasks.Parallel.yhzas143i1.wasm} +0 -0
  42. package/_framework/dotnet.js +95 -95
  43. package/_framework/{dotnet.native.rw4kynp763.wasm → dotnet.native.3zpaws0drs.wasm} +0 -0
  44. package/_framework/{dotnet.native.b6l13xorvf.js → dotnet.native.q38003gvqi.js} +1 -1
  45. package/_framework/{dotnet.runtime.v06hirbjsv.js → dotnet.runtime.azrfhwb804.js} +1 -1
  46. package/dist/generated/client.d.ts +44 -3
  47. package/dist/generated/errors.d.ts +1 -1
  48. package/dist/generated/topics.d.ts +1 -1
  49. package/dist/generated/types.d.ts +74 -0
  50. package/dist/index.js +2 -1
  51. package/dist/internal.js +1 -1
  52. package/dist/{topics-BLLnioZB.js → topics-DWCwlDfO.js} +18 -2
  53. package/notices.json +3 -3
  54. package/package.json +1 -1
  55. package/_framework/PKHeX.Everywhere.Engine.4h4crj39m3.wasm +0 -0
  56. package/_framework/PKHeX.Facade.lpyzkwn670.wasm +0 -0
  57. package/_framework/System.Private.CoreLib.37lagr3mrw.wasm +0 -0
  58. package/_framework/System.Security.Cryptography.lsw01b789b.wasm +0 -0
@@ -1,7 +1,7 @@
1
- import type { ActionPlacement, AddFromFileOptions, AddedPokemon, Badge, Binary, BoxEntry, CatalogNames, CatalogNamesRequest, Choice, ConvertedPokemon, DeclaredPage, EditablePokemon, EncounterRow, EncounterVersions, ExportedPokemon, ExportedSave, FilePreview, FormatEntry, GameProgress, InstalledPlugIn, ItemHandle, LoadedSave, PlugInAction, PlugInDetails, PlugInFailure, PlugInOutcome, PlugInSetting, PlugInState, PokemonFile, PokemonHandle, PokemonId, PokemonOptions, PokemonPatch, PokemonSummary, Pouch, PublishedVersion, SaveEvents, SaveSummary, SaveVersion, SpeciesEntry, TeamEntry, TeamSlot, TrainerCard, TrainerGender, TransferOffer, TransferPreview, TransferResult, TransferSave, TransferSummary, VersionEntry } from './types';
1
+ import type { ActionPlacement, AddFromFileOptions, AddedPokemon, Badge, Binary, BoxEntry, CatalogNames, CatalogNamesRequest, Choice, ConvertedPokemon, DeclaredPage, EditablePokemon, EncounterRow, EncounterVersions, ExportedPokemon, ExportedSave, FilePreview, FormatEntry, GameProgress, GiftAlbum, GiftEvent, InstalledPlugIn, ItemHandle, LoadedSave, PlugInAction, PlugInDetails, PlugInFailure, PlugInOutcome, PlugInSetting, PlugInState, PokemonFile, PokemonHandle, PokemonId, PokemonOptions, PokemonPatch, PokemonSummary, Pouch, PublishedVersion, SaveEvents, SaveSummary, SaveVersion, SpeciesEntry, TeamEntry, TeamSlot, TrainerCard, TrainerGender, TransferOffer, TransferPreview, TransferResult, TransferSave, TransferSummary, VersionEntry, WonderCardPreview } from './types';
2
2
  export type Invoke = <T>(call: CallName, args: unknown[]) => Promise<T>;
3
- export declare const queries: readonly ['box.get', 'box.list', 'box.previewFile', 'box.showdown', 'catalog.names', 'encounters.search', 'encounters.versions', 'events.flag', 'events.get', 'game.balls', 'game.blankVersions', 'game.formats', 'game.get', 'game.heldItems', 'game.languages', 'game.moves', 'game.natures', 'game.originGames', 'game.progress', 'game.types', 'game.version', 'inventory.get', 'party.get', 'party.showdown', 'plugins.actions', 'plugins.details', 'plugins.failures', 'plugins.installed', 'plugins.isSupported', 'plugins.pageModule', 'plugins.pages', 'plugins.setting', 'plugins.state', 'pokemon.details', 'pokemon.export', 'pokemon.get', 'pokemon.options', 'pokemon.read', 'pokemon.showdown', 'species.list', 'team.get', 'team.list', 'trainer.badges', 'trainer.get', 'transfer.convert', 'transfer.details', 'transfer.export', 'transfer.get', 'transfer.partnerBoxes', 'transfer.preview'];
4
- export declare const commands: readonly ['box.addEncounter', 'box.addFromFile', 'events.giveTickets', 'events.setFlag', 'events.setWork', 'game.close', 'game.enableFormat', 'game.export', 'game.file', 'game.load', 'game.loadBlank', 'inventory.setItem', 'plugins.dismissFailure', 'plugins.newestCompatible', 'plugins.register', 'plugins.run', 'plugins.setEnabled', 'plugins.setHookEnabled', 'plugins.unregister', 'plugins.updateSetting', 'pokemon.addToBox', 'pokemon.clone', 'pokemon.commit', 'pokemon.edit', 'pokemon.setLevel', 'pokemon.update', 'team.clear', 'team.place', 'trainer.setBadges', 'trainer.setBattlePoints', 'trainer.setGender', 'trainer.setMoney', 'trainer.setName', 'transfer.close', 'transfer.commit', 'transfer.open'];
3
+ export declare const queries: readonly ['box.get', 'box.list', 'box.previewFile', 'box.showdown', 'catalog.names', 'encounters.search', 'encounters.versions', 'events.flag', 'events.get', 'game.balls', 'game.blankVersions', 'game.formats', 'game.get', 'game.heldItems', 'game.languages', 'game.moves', 'game.natures', 'game.originGames', 'game.progress', 'game.types', 'game.version', 'inventory.get', 'mysteryGift.events', 'mysteryGift.previewEvent', 'mysteryGift.previewFile', 'mysteryGift.status', 'party.get', 'party.showdown', 'plugins.actions', 'plugins.details', 'plugins.failures', 'plugins.installed', 'plugins.isSupported', 'plugins.pageModule', 'plugins.pages', 'plugins.setting', 'plugins.state', 'pokemon.details', 'pokemon.export', 'pokemon.get', 'pokemon.options', 'pokemon.read', 'pokemon.showdown', 'species.list', 'team.get', 'team.list', 'trainer.badges', 'trainer.get', 'transfer.convert', 'transfer.details', 'transfer.export', 'transfer.get', 'transfer.partnerBoxes', 'transfer.preview'];
4
+ export declare const commands: readonly ['box.addEncounter', 'box.addFromFile', 'events.giveTickets', 'events.setFlag', 'events.setWork', 'game.close', 'game.enableFormat', 'game.export', 'game.file', 'game.load', 'game.loadBlank', 'inventory.setItem', 'mysteryGift.insertEvent', 'mysteryGift.insertFile', 'mysteryGift.remove', 'mysteryGift.setReceived', 'mysteryGift.setUnlocked', 'plugins.dismissFailure', 'plugins.newestCompatible', 'plugins.register', 'plugins.run', 'plugins.setEnabled', 'plugins.setHookEnabled', 'plugins.unregister', 'plugins.updateSetting', 'pokemon.addToBox', 'pokemon.clone', 'pokemon.commit', 'pokemon.edit', 'pokemon.setLevel', 'pokemon.update', 'team.clear', 'team.place', 'trainer.setBadges', 'trainer.setBattlePoints', 'trainer.setGender', 'trainer.setMoney', 'trainer.setName', 'transfer.close', 'transfer.commit', 'transfer.open'];
5
5
  export type QueryName = (typeof queries)[number];
6
6
  export type CommandName = (typeof commands)[number];
7
7
  export type CallName = QueryName | CommandName;
@@ -89,6 +89,47 @@ export interface EngineClient {
89
89
  /** Requires a loaded save; throws `no-save` otherwise. */
90
90
  setItem(at: ItemHandle, count: number): Promise<void>;
91
91
  };
92
+ mysteryGift: {
93
+ /** Lists the events from PKHeX's event database that the save's game can receive, in every language. Requires a loaded save; throws `no-save` otherwise. */
94
+ events(): Promise<GiftEvent[]>;
95
+ /**
96
+ * Puts an event's card in the album as the game does when it receives one, and marks its card number received. The player collects the gift from the delivery person in the game: in Generation 4 it waits in the delivery queue, and in Generation 5 the card isn't collected yet. A filled slot is replaced. A slot past the filled ones puts the card in the first empty slot, so the album never has a gap. Mystery Gift stays as locked or unlocked as it was; call `setUnlocked` to show it. Fails with `not-found` for an id `mysteryGift.events` doesn't list, `out-of-range` for a slot outside the album, and `no-slot` when eight Generation 4 gifts already wait for the delivery person. Requires a loaded save; throws `no-save` otherwise.
97
+ *
98
+ * @param id The event's id, from `mysteryGift.events`.
99
+ * @param slot Zero-based album slot.
100
+ */
101
+ insertEvent(id: string, slot: number): Promise<number>;
102
+ /**
103
+ * Puts a Wonder Card file in the album, as `insertEvent` does. A card PKHeX doesn't know still goes in. Fails with `unparseable` and `wrong-generation` as `previewFile` does, `not-supported` for the Lock Capsule card, which doesn't go in the album, and `out-of-range` and `no-slot` as `insertEvent` does. Requires a loaded save; throws `no-save` otherwise.
104
+ *
105
+ * @param slot Zero-based album slot.
106
+ */
107
+ insertFile(bytes: Binary, slot: number): Promise<number>;
108
+ /**
109
+ * Shows an event's card as the save would receive it. Nothing is written. Fails with `not-found` for an id `mysteryGift.events` doesn't list. Requires a loaded save; throws `no-save` otherwise.
110
+ *
111
+ * @param id The event's id, from `mysteryGift.events`.
112
+ */
113
+ previewEvent(id: string): Promise<WonderCardPreview>;
114
+ /** Shows a Wonder Card file as the save would receive it. Nothing is written. Takes `.pgt`, `.pcd` and `.wc4` files for Generation 4 saves and `.pgf` files for Generation 5 saves. Fails with `unparseable` when the bytes aren't a card, and `wrong-generation` for a card of another generation. Requires a loaded save; throws `no-save` otherwise. */
115
+ previewFile(bytes: Binary): Promise<WonderCardPreview>;
116
+ /**
117
+ * Empties an album slot. The cards after it move up, so the album never has a gap. In Generation 4, a gift still waiting for the delivery person goes with its card. Removing from an empty slot does nothing. Fails with `out-of-range` for a slot outside the album. Requires a loaded save; throws `no-save` otherwise.
118
+ *
119
+ * @param slot Zero-based album slot.
120
+ */
121
+ remove(slot: number): Promise<void>;
122
+ /**
123
+ * Sets or clears the save's mark that it received a card number. Fails with `out-of-range` for a number the save has no mark for. Requires a loaded save; throws `no-save` otherwise.
124
+ *
125
+ * @param cardId The card's number, as `cardId` reports it.
126
+ */
127
+ setReceived(cardId: number, value: boolean): Promise<void>;
128
+ /** Shows or hides Mystery Gift in a Generation 4 game's menu. Fails with `not-supported` in Generation 5, which has no unlock of its own. Requires a loaded save; throws `no-save` otherwise. */
129
+ setUnlocked(value: boolean): Promise<void>;
130
+ /** The save's Wonder Card album and whether Mystery Gift is unlocked. Only Generation 4 and 5 saves have an album, which `game.get` reports as `hasMysteryGift`. The `mysteryGift` calls fail with `not-supported` on any other save. Requires a loaded save; throws `no-save` otherwise. */
131
+ status(): Promise<GiftAlbum>;
132
+ };
92
133
  party: {
93
134
  /** Requires a loaded save; throws `no-save` otherwise. */
94
135
  get(): Promise<PokemonSummary[]>;
@@ -1,2 +1,2 @@
1
- export declare const errorCodes: readonly ['no-save', 'invalid-save', 'format-choice-required', 'not-found', 'out-of-range', 'pouch-full', 'box-full', 'unparseable', 'conversion-failed', 'not-in-game', 'unknown-species', 'invalid-patch', 'draft-not-allowed', 'no-slot', 'no-draft', 'unknown-call', 'bad-arguments', 'plugin-failed', 'not-supported', 'no-transfer', 'transfer-refused', 'bad-checksum', 'unexpected'];
1
+ export declare const errorCodes: readonly ['no-save', 'invalid-save', 'format-choice-required', 'not-found', 'out-of-range', 'pouch-full', 'box-full', 'unparseable', 'conversion-failed', 'not-in-game', 'unknown-species', 'invalid-patch', 'draft-not-allowed', 'no-slot', 'no-draft', 'unknown-call', 'bad-arguments', 'plugin-failed', 'not-supported', 'no-transfer', 'transfer-refused', 'bad-checksum', 'wrong-generation', 'unexpected'];
2
2
  export type ErrorCode = (typeof errorCodes)[number];
@@ -1,4 +1,4 @@
1
1
  import type { QueryName } from './client';
2
- export declare const topics: readonly ['*', 'game', 'party', 'box', 'inventory', 'events', 'trainer', 'draft', 'plugins', 'transfer', 'team'];
2
+ export declare const topics: readonly ['*', 'game', 'party', 'box', 'inventory', 'events', 'trainer', 'draft', 'plugins', 'transfer', 'team', 'mysteryGift'];
3
3
  export type Topic = (typeof topics)[number] | `${(typeof topics)[number]}/${string}`;
4
4
  export declare const queryTopics: Record<QueryName, readonly Topic[]>;
@@ -21,6 +21,13 @@ export interface AddedPokemon {
21
21
  /** The empty box slot it was placed in. */
22
22
  at: PokemonHandle;
23
23
  }
24
+ /** A slot in the save's Wonder Card album. */
25
+ export interface AlbumSlot {
26
+ /** Zero-based slot, as `mysteryGift.insertEvent` and `mysteryGift.remove` take it. */
27
+ index: number;
28
+ /** The card in the slot, or null when it's empty. */
29
+ card: WonderCardEntry | null;
30
+ }
24
31
  /** A gym badge, as `trainer.badges` lists it. */
25
32
  export interface Badge {
26
33
  /** The badge's English name without "Badge", such as `Boulder`. */
@@ -309,6 +316,39 @@ export interface GameProgress {
309
316
  /** The Pokédex counts, or null when the save has no Pokédex or the engine can't read it. */
310
317
  pokedex: PokedexCount | null;
311
318
  }
319
+ /** The save's Wonder Card album, returned by `mysteryGift.status`. */
320
+ export interface GiftAlbum {
321
+ /** Whether the game shows Mystery Gift in its menu. Null in Generation 5, where the menu shows it once the player has the Pokédex. */
322
+ unlocked: boolean | null;
323
+ /** Every slot in order, empty ones included: 3 in Generation 4, 12 in Generation 5. The filled slots come first. */
324
+ slots: AlbumSlot[];
325
+ }
326
+ /** An event from PKHeX's event database that the save's game can receive, as `mysteryGift.events` lists it. */
327
+ export interface GiftEvent {
328
+ /** The event's id, to pass to `mysteryGift.previewEvent` and `mysteryGift.insertEvent`. Made from the card's bytes, so it stays the same across releases. */
329
+ id: string;
330
+ /** The title the card shows in the game. */
331
+ title: string;
332
+ kind: GiftKind;
333
+ /** The species of the Pokémon the card gives, or null when it gives none. */
334
+ species: SpeciesEntry | null;
335
+ /** The item the card gives, or null when it gives none. */
336
+ item: GiftItem | null;
337
+ /** The language code the card is for, such as `ENG`. Null when the card doesn't say, as Generation 4 item cards don't. */
338
+ language: string | null;
339
+ /** The card's number. Distributions in several languages often share it. */
340
+ cardId: number;
341
+ /** The save is marked as having received a card with this number. */
342
+ received: boolean;
343
+ }
344
+ /** An item a Wonder Card gives. */
345
+ export interface GiftItem {
346
+ /** PKHeX item id. */
347
+ id: number;
348
+ name: string;
349
+ }
350
+ /** What a Wonder Card gives. */
351
+ export type GiftKind = 'pokemon' | 'item' | 'other';
312
352
  /** The type and power of a Pokémon's Hidden Power. */
313
353
  export interface HiddenPower {
314
354
  /** Type name. */
@@ -826,6 +866,8 @@ export interface SaveSummary {
826
866
  generation: number;
827
867
  /** Whether the save has event flags and work to edit. When false, `events.get` returns null, or fails with `not-supported` when the save doesn't support `events`. */
828
868
  hasEvents: boolean;
869
+ /** Whether the save has a Wonder Card album: Generation 4 and 5 saves do. When false, the `mysteryGift` calls fail with `not-supported`. */
870
+ hasMysteryGift: boolean;
829
871
  /** The save format the save loaded through, or null for a save PKHeX reads on its own. */
830
872
  format: SaveFormat | null;
831
873
  /** What the save supports. A save from PKHeX supports all of them. Calls behind a capability that's missing fail with `not-supported`. */
@@ -1021,6 +1063,38 @@ export interface VersionEntry {
1021
1063
  id: number;
1022
1064
  name: string;
1023
1065
  }
1066
+ /** A Wonder Card in the save's album. */
1067
+ export interface WonderCardEntry {
1068
+ /** The title the card shows in the game. */
1069
+ title: string;
1070
+ kind: GiftKind;
1071
+ /** The species of the Pokémon the card gives, or null when it gives none. */
1072
+ species: SpeciesEntry | null;
1073
+ /** The item the card gives, or null when it gives none. */
1074
+ item: GiftItem | null;
1075
+ /** The language code the card is for, such as `ENG`, `JPN` or `FRE`. Null when the card doesn't say, as Generation 4 item cards don't. */
1076
+ language: string | null;
1077
+ /** The card's number, which the save's received marks go by. */
1078
+ cardId: number;
1079
+ /** The card matches an event in PKHeX's event database. */
1080
+ known: boolean;
1081
+ }
1082
+ /** A Wonder Card as the save would receive it, returned by `mysteryGift.previewEvent` and `mysteryGift.previewFile`. */
1083
+ export interface WonderCardPreview {
1084
+ /** The title the card shows in the game. */
1085
+ title: string;
1086
+ kind: GiftKind;
1087
+ /** The Pokémon as the delivery person would hand it to the save's trainer, or null when the card gives none. A random PID or IVs differ from what the game rolls. */
1088
+ pokemon: PokemonPreview | null;
1089
+ /** The item the card gives, or null when it gives none. */
1090
+ item: GiftItem | null;
1091
+ /** The language code the card is for, such as `ENG`. Null when the card doesn't say. */
1092
+ language: string | null;
1093
+ /** The card's number. A `.pgt` file has no card, so it reads 0. */
1094
+ cardId: number;
1095
+ /** The card matches an event in PKHeX's event database. Unknown cards still insert. */
1096
+ known: boolean;
1097
+ }
1024
1098
  /** A known value for an event work entry, with its label. */
1025
1099
  export interface WorkOption {
1026
1100
  name: string;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as createEngine, n as topics, o as wasmHost, r as EngineError } from "./topics-BLLnioZB.js";
1
+ import { a as createEngine, n as topics, o as wasmHost, r as EngineError } from "./topics-DWCwlDfO.js";
2
2
  //#region src/generated/errors.ts
3
3
  var errorCodes = [
4
4
  "no-save",
@@ -23,6 +23,7 @@ var errorCodes = [
23
23
  "no-transfer",
24
24
  "transfer-refused",
25
25
  "bad-checksum",
26
+ "wrong-generation",
26
27
  "unexpected"
27
28
  ];
28
29
  //#endregion
package/dist/internal.js CHANGED
@@ -1,2 +1,2 @@
1
- import { i as call, s as affects, t as queryTopics } from "./topics-BLLnioZB.js";
1
+ import { i as call, s as affects, t as queryTopics } from "./topics-DWCwlDfO.js";
2
2
  export { affects, call, queryTopics };
@@ -87,6 +87,17 @@ function createClient(invoke) {
87
87
  get: () => invoke("inventory.get", []),
88
88
  setItem: (at, count) => invoke("inventory.setItem", [at, count])
89
89
  },
90
+ mysteryGift: {
91
+ events: () => invoke("mysteryGift.events", []),
92
+ insertEvent: (id, slot) => invoke("mysteryGift.insertEvent", [id, slot]),
93
+ insertFile: async (bytes, slot) => invoke("mysteryGift.insertFile", [await toBase64(bytes), slot]),
94
+ previewEvent: (id) => invoke("mysteryGift.previewEvent", [id]),
95
+ previewFile: async (bytes) => invoke("mysteryGift.previewFile", [await toBase64(bytes)]),
96
+ remove: (slot) => invoke("mysteryGift.remove", [slot]),
97
+ setReceived: (cardId, value) => invoke("mysteryGift.setReceived", [cardId, value]),
98
+ setUnlocked: (value) => invoke("mysteryGift.setUnlocked", [value]),
99
+ status: () => invoke("mysteryGift.status", [])
100
+ },
90
101
  party: {
91
102
  get: () => invoke("party.get", []),
92
103
  showdown: () => invoke("party.showdown", [])
@@ -172,7 +183,7 @@ var overlaps = (a, b) => covers(a, b) || covers(b, a);
172
183
  var affects = (changed, read) => changed.some((c) => read.some((r) => overlaps(c, r)));
173
184
  //#endregion
174
185
  //#region package.json
175
- var version = "0.21.0";
186
+ var version = "0.22.0";
176
187
  //#endregion
177
188
  //#region src/crypto.ts
178
189
  var modes = {
@@ -417,7 +428,8 @@ var topics = [
417
428
  "draft",
418
429
  "plugins",
419
430
  "transfer",
420
- "team"
431
+ "team",
432
+ "mysteryGift"
421
433
  ];
422
434
  var queryTopics = {
423
435
  "box.get": ["box"],
@@ -447,6 +459,10 @@ var queryTopics = {
447
459
  "game.types": ["game"],
448
460
  "game.version": ["game"],
449
461
  "inventory.get": ["inventory"],
462
+ "mysteryGift.events": ["mysteryGift"],
463
+ "mysteryGift.previewEvent": ["trainer"],
464
+ "mysteryGift.previewFile": ["trainer"],
465
+ "mysteryGift.status": ["mysteryGift"],
450
466
  "party.get": ["party"],
451
467
  "party.showdown": ["party"],
452
468
  "plugins.actions": ["*"],
package/notices.json CHANGED
@@ -2,7 +2,7 @@
2
2
  {
3
3
  "name": "ICU",
4
4
  "license": "Unicode-3.0",
5
- "source": "https://github.com/dotnet/dotnet/blob/95017c711e6afc1085133d440e42b4bd78155701/src/runtime/eng/Version.Details.xml"
5
+ "source": "https://github.com/dotnet/dotnet/blob/4099f83977f4d29604a9aeb971fb0a7bc1d5f699/src/runtime/eng/Version.Details.xml"
6
6
  },
7
7
  {
8
8
  "name": "Microsoft.Extensions.DependencyInjection",
@@ -18,9 +18,9 @@
18
18
  },
19
19
  {
20
20
  "name": "Microsoft.NETCore.App.Runtime.Mono.browser-wasm",
21
- "version": "10.0.12",
21
+ "version": "10.0.13",
22
22
  "license": "MIT",
23
- "source": "https://github.com/dotnet/dotnet/tree/95017c711e6afc1085133d440e42b4bd78155701"
23
+ "source": "https://github.com/dotnet/dotnet/tree/4099f83977f4d29604a9aeb971fb0a7bc1d5f699"
24
24
  },
25
25
  {
26
26
  "name": "PKHeX",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pkhex-everywhere/engine",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "description": "PKHeX in the browser: load, read and edit Pokémon save files.",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "homepage": "https://docs.pkhex-everywhere.fyi/docs/",