//#endregion //#region src/models/common/resource.d.ts /** * Marks what a link points at. * * A type parameter that appears nowhere in an interface is not inferable, and * every instantiation of it stays mutually assignable — so `NamedAPIResource` * needs somewhere to carry `T`. This key exists only in the type system: it is * never present at runtime, and reading it is not the point. * * A `unique symbol` is nominal per declaration, and the package emits one set of * declarations per module format — so a link crossing the ESM/CJS boundary keeps * assigning structurally but stops carrying `T`, and comes back as `unknown`. * Documented in `docs/src/clients/utility-client.md`, alongside the same split * behind `PokenodeError.isPokenodeError`. */ declare const RESOURCE_TYPE: unique symbol; /** * The name and the URL of the referenced resource. * * @template T - What the URL resolves to. Defaults to `unknown`, so a link whose * target has not been declared still type-checks; pass it to * {@link UtilityClient.getResourceByUrl} and the resource comes back typed. */ interface NamedAPIResource { /** The name of the referenced resource. */ name: string; /** The URL of the referenced resource. */ url: string; /** Phantom. Never present at runtime. */ readonly [RESOURCE_TYPE]?: T; } /** * Calling any API endpoint without a resource ID or name will return a paginated list of available resources for that API. * By default, a list "page" will contain up to 20 resources. If you would like to change this just add a 'limit' query parameter * to the GET request, e.g. ?=60. You can use 'offset' to move to the next page, e.g. ?limit=60&offset=60. * * @template T - What the listed links resolve to. */ interface NamedAPIResourceList { /** The total number of resources available from this API. */ count: number; /** The URL for the next page in the list. */ next: string | null; /** The URL for the previous page in the list. */ previous: string | null; /** A list of named API resources. */ results: NamedAPIResource[]; } /** * A URL for another resource in the API. * * @template T - What the URL resolves to. */ interface APIResource { /** The URL of the referenced resource. */ url: string; /** Phantom. Never present at runtime. */ readonly [RESOURCE_TYPE]?: T; } /** * A paginated list whose entries are identified by URL alone. * * The `machine`, `contest-effect`, `super-contest-effect`, `evolution-chain` and * `characteristic` sections have no names to list, so their entries carry a `url` * and nothing else. * * @template T - What the listed links resolve to. */ interface APIResourceList { /** The total number of resources available from this API. */ count: number; /** The URL for the next page in the list. */ next: string | null; /** The URL for the previous page in the list. */ previous: string | null; /** A list of unnamed API resources. */ results: APIResource[]; } //#endregion //#region src/models/common/name.d.ts /** * The localized name for an API resource in a specific language. */ interface Name { /** The localized name for an API resource in a specific language. */ name: string; /** The language this name is in. */ language: NamedAPIResource; } //#endregion //#region src/models/common/language.d.ts /** * Languages for translations of API resource information. */ interface Language { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** Whether or not the games are published in this language. */ official: boolean; /** The two-letter code of the country where this language is spoken. Note that it is not unique. */ iso639: string; /** The two-letter code of the language. Note that it is not unique. */ iso3166: string; /** The name of this resource listed in different languages. */ names: Name[]; } //#endregion //#region src/models/common/description.d.ts /** * The localized description for an API resource in a specific language. */ interface Description { /** The localized description for an API resource in a specific language. */ description: string; /** The language this name is in. */ language: NamedAPIResource; } //#endregion //#region src/models/common/effect.d.ts /** * The localized effect text for an API resource in a specific language. */ interface Effect { /** The localized effect text for an API resource in a specific language. */ effect: string; /** The language this effect is in. */ language: NamedAPIResource; } //#endregion //#region src/models/encounter/encounter.d.ts /** * ## Encounter Method * Methods by which the player can encounter Pokémon in the wild, e.g., walking in tall grass. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Wild_Pok%C3%A9mon) for greater detail. */ interface EncounterMethod { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** A good value for sorting. */ order: number; /** The name of this resource listed in different languages. */ names: Name[]; } /** * ## Encounter Condition * Conditions which affect what Pokémon might appear in the wild, e.g., day or night. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Time). */ interface EncounterCondition { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** The name of this resource listed in different languages. */ names: Name[]; /** A list of possible values for this encounter condition. */ values: NamedAPIResource[]; } /** * ## Encounter Condition Value * Encounter condition values are the various states that an encounter * condition can have, i.e., time of day can be either **day** or **night** * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Time). */ interface EncounterConditionValue { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** The condition this encounter condition value pertains to. */ condition: NamedAPIResource; /** The name of this resource listed in different languages. */ names: Name[]; } //#endregion //#region src/models/common/encounter.d.ts /** * How the encountered Pokémon itself is generated, where a game constrains it. * * Only the games that impose such constraints populate this — guaranteed * perfect IVs, forced or forbidden shininess, and Legends: Arceus alphas. */ interface EncounterPokemonDetail { /** How many IVs are guaranteed to be perfect, if the game guarantees any. */ min_perfect_ivs: number | null; /** Whether the encountered Pokémon is always shiny. */ always_shiny: boolean; /** Whether the encountered Pokémon can never be shiny. */ never_shiny: boolean; /** Whether the encountered Pokémon is an alpha. */ is_alpha: boolean; } /** Information about a Pokémon encounter. */ interface Encounter { /** The lowest level the Pokémon could be encountered at. */ min_level: number; /** The highest level the Pokémon could be encountered at. */ max_level: number; /** A list of condition values that must be in effect for this encounter to occur. */ condition_values: NamedAPIResource[]; /** Percent chance that this encounter will occur. */ chance: number; /** The method by which this encounter happens. */ method: NamedAPIResource; /** How the encountered Pokémon is generated, where the game constrains it. */ pokemon_details: EncounterPokemonDetail | null; } //#endregion //#region src/models/contest/contest.d.ts /** * ## Contest Type * Contest types are categories judges used to weigh a Pokémon's condition in Pokémon contests. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Contest_condition) for greater detail. */ interface ContestType { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: "cool" | "beauty" | "cute" | "smart" | "tough"; /** The berry flavor that correlates with this contest type. */ berry_flavor: NamedAPIResource; /** The name of this contest type listed in different languages. */ names: ContestName[]; } /** * The name of the given contest type. */ interface ContestName { /** The name for this contest. */ name: string; /** The color associated with this contest's name. */ color: string; /** The language that this name is in. */ language: NamedAPIResource; } /** * Flavor text for a contest effect, in a single language. * * Deliberately not the shared `FlavorText`: contest effects are not tied to a * game, so the API omits the `version` that type carries. */ interface ContestFlavorText { /** The localized flavor text. */ flavor_text: string; /** The language this flavor text is in. */ language: NamedAPIResource; } /** * ## Contest Effect * Contest effects refer to the effects of moves when used in contests. */ interface ContestEffect { /** The identifier for this resource. */ id: number; /** The base number of hearts the user of this move gets. */ appeal: number; /** The base number of hearts the user's opponent loses. */ jam: number; /** The result of this contest effect listed in different languages. */ effect_entries: Effect[]; /** The flavor text of this contest effect listed in different languages. */ flavor_text_entries: ContestFlavorText[]; } /** * ## Super Contest Effect * Super contest effects refer to the effects of moves when used in super contests. * A Pokémon Super Contest is an expanded format of the [Pokémon Contests](https://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_Contest) * for the Generation IV games, * specifically in [Diamond, Pearl](https://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_Diamond_and_Pearl_Versions), * and [Platinum](https://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_Platinum_Version). * In it, Pokémon are rated on their appearance and performance, rather than strength. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_Super_Contest). */ interface SuperContestEffect { /** The identifier for this resource. */ id: number; /** The level of appeal this super contest effect has. */ appeal: number; /** The flavor text of this super contest effect listed in different languages. */ flavor_text_entries: ContestFlavorText[]; /** A list of moves that have the effect when used in super contests. */ moves: NamedAPIResource[]; } //#endregion //#region src/models/currency/currency.d.ts /** * ## Currency * Currencies are what items are bought and sold with. Most items are priced in * Pokémon Dollars, but a shop can trade in anything from Battle Points to * Volcanic Ash. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Currency) for greater detail. */ interface Currency { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** The name of this currency listed in different languages. */ names: Name[]; } //#endregion //#region src/models/item/item.d.ts /** * Sprites used to depict the given item in the game. */ interface ItemSprites { /** The default depiction of this item. */ default: string; } /** * Pokémon that might be found in the wild holding the given item. */ interface ItemHolderPokemon { /** The Pokémon that holds this item. */ pokemon: NamedAPIResource; /** The details for the version that this item is held in by the Pokémon. */ version_details: ItemHolderPokemonVersionDetail[]; } /** * The details for the version that the given item is held in by the Pokémon. */ interface ItemHolderPokemonVersionDetail { /** How often this Pokémon holds this item in this version. */ rarity: number; /** The version that this item is held in by the Pokémon. */ version: NamedAPIResource; } /** * ## Item Attribute * Item attributes define particular aspects of items, e.g. "usable in battle" or "consumable". */ interface ItemAttribute { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** A list of items that have this attribute. */ items: NamedAPIResource[]; /** The name of this item attribute listed in different languages. */ names: Name[]; /** The description of this item attribute listed in different languages. */ descriptions: Description[]; } /** * ## Item Category * Item categories determine where items will be placed in the player's bag. */ interface ItemCategory { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** A list of items that are a part of this category. */ items: NamedAPIResource[]; /** The name of this item category listed in different languages. */ names: Name[]; /** The pocket items in this category would be put in. */ pocket: NamedAPIResource; } /** * ## Item Fling Effect * The various effects of the move "Fling" when used with different items. */ interface ItemFlingEffect { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** The result of this fling effect listed in different languages. */ effect_entries: Effect[]; /** A list of items that have this fling effect. */ items: NamedAPIResource[]; } /** * ## Item Pocket * Pockets within the player's bag used for storing items by category. */ interface ItemPocket { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** A list of item categories that are relevant to this item pocket. */ categories: NamedAPIResource[]; /** The name of this resource listed in different languages. */ names: Name[]; } /** The price of an item in a single version group. */ interface ItemPrice { /** The currency used for this price. */ currency: NamedAPIResource; /** The purchase price of this item in this version group. Null if the item cannot be purchased. */ purchase_price: number | null; /** The sell price of this item in this version group. Null if the item cannot be sold. */ sell_price: number | null; /** The version group these prices apply to. */ version_group: NamedAPIResource; } /** * ## Item * An item is an object in the games which the player can pick up, keep in their bag, and use in some manner. * They have various uses, including healing, powering up, helping catch Pokémon, or to access a new area. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Item). */ interface Item { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** The purchase and sell prices of this item for each version group. */ prices: ItemPrice[]; /** The power of the move Fling when used with this item. */ fling_power: number | null; /** The effect of the move Fling when used with this item. */ fling_effect: NamedAPIResource | null; /** A list of attributes this item has. */ attributes: NamedAPIResource[]; /** The category of items this item falls into. */ category: NamedAPIResource; /** The effect of this ability listed in different languages. */ effect_entries: VerboseEffect[]; /** The flavor text of this ability listed in different languages. */ flavor_text_entries: VersionGroupFlavorText[]; /** A list of game indices relevant to this item by generation. */ game_indices: GenerationGameIndex[]; /** The name of this item listed in different languages. */ names: Name[]; /** A set of sprites used to depict this item in the game. */ sprites: ItemSprites; /** A list of Pokémon that might be found in the wild holding this item. */ held_by_pokemon: ItemHolderPokemon[]; /** An evolution chain this item requires to produce a baby during mating. */ baby_trigger_for: APIResource | null; /** A list of the machines related to this item. */ machines: MachineVersionDetail[]; } //#endregion //#region src/models/location/encounter.d.ts /** * Method in which Pokémon may be encountered in the given area * and how likely the method will occur depending on the version of the game. */ interface EncounterMethodRate { /** The method in which Pokémon may be encountered in an area. */ encounter_method: NamedAPIResource; /** The chance of the encounter to occur on a version of the game. */ version_details: EncounterVersionDetails[]; } /** * The chance of the encounter to occur on a version of the game. */ interface EncounterVersionDetails { /** The chance of an encounter to occur. */ rate: number; /** The version of the game in which the encounter can occur with the given chance. */ version: NamedAPIResource; } /** * Describes a pokémon encounter in a given area. */ interface PokemonEncounter { /** The Pokémon being encountered. */ pokemon: NamedAPIResource; /** A list of versions and encounters with Pokémon that might happen in the referenced location area. */ version_details: VersionEncounterDetail[]; } //#endregion //#region src/models/location/location.d.ts /** * ## Location * Locations that can be visited within the games. * Locations make up sizable portions of regions, like cities or routes. * * - See the [List of Locations](https://bulbapedia.bulbagarden.net/wiki/List_of_locations_by_name). */ interface Location { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** The region this location can be found in. */ region: NamedAPIResource | null; /** The name of this resource listed in different languages. */ names: Name[]; /** A list of game indices relevant to this location by generation. */ game_indices: GenerationGameIndex[]; /** Areas that can be found within this location. */ areas: NamedAPIResource[]; } /** * ## Location Area * Location areas are sections of areas, such as floors in a building or cave. * Each area has its own set of possible Pokémon encounters. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Area) for greater detail. */ interface LocationArea { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** The internal id of an API resource within game data. */ game_index: number; /** A list of methods in which Pokémon may be encountered in this area and how likely the method will occur depending on the version of the game. */ encounter_method_rates: EncounterMethodRate[]; /** The region this location area can be found in. */ location: NamedAPIResource; /** The name of this resource listed in different languages. */ names: Name[]; /** A list of Pokémon that can be encountered in this area along with version specific details about the encounter. */ pokemon_encounters: PokemonEncounter[]; } //#endregion //#region src/models/pokemon/type.d.ts /** * Details of Pokémon for a specific type. */ interface TypePokemon { /** The order the Pokémon's types are listed in. */ slot: number; /** The Pokémon that has the referenced type. */ pokemon: NamedAPIResource; } /** * Detail of how effective a type is toward others and vice versa. */ interface TypeRelations { /** A list of types this type has no effect on. */ no_damage_to: NamedAPIResource[]; /** A list of types this type is not very effective against. */ half_damage_to: NamedAPIResource[]; /** A list of types this type is very effective against. */ double_damage_to: NamedAPIResource[]; /** A list of types that have no effect on this type. */ no_damage_from: NamedAPIResource[]; /** A list of types that are not very effective against this type. */ half_damage_from: NamedAPIResource[]; /** A list of types that are very effective against this type. */ double_damage_from: NamedAPIResource[]; } /** * Details of how effective this type was toward others and vice versa in a previous generation. */ interface TypeRelationsPast { /** The last generation in which the referenced type had the listed damage relations. */ generation: NamedAPIResource; /** The damage relations the referenced type had up to and including the listed generation. */ damage_relations: TypeRelations; } /** * The pair of icons a single game uses to depict a type. * * `symbol_icon` is the type's bare glyph and `name_icon` spells the name out; * games that only ever shipped one of the two leave the other `null`. */ interface TypeGameSprites { /** The icon spelling out the type's name. */ name_icon: string | null; /** The icon showing the type's symbol alone. */ symbol_icon: string | null; } /** Generation-III type icons, by game. */ interface GenerationIIITypeSprites { colosseum: TypeGameSprites; emerald: TypeGameSprites; "firered-leafgreen": TypeGameSprites; "ruby-sapphire": TypeGameSprites; xd: TypeGameSprites; } /** Generation-IV type icons, by game. */ interface GenerationIVTypeSprites { "diamond-pearl": TypeGameSprites; "heartgold-soulsilver": TypeGameSprites; platinum: TypeGameSprites; } /** Generation-V type icons, by game. */ interface GenerationVTypeSprites { "black-2-white-2": TypeGameSprites; "black-white": TypeGameSprites; } /** Generation-VI type icons, by game. */ interface GenerationVITypeSprites { "omega-ruby-alpha-sapphire": TypeGameSprites; "x-y": TypeGameSprites; } /** Generation-VII type icons, by game. */ interface GenerationVIITypeSprites { "lets-go-pikachu-lets-go-eevee": TypeGameSprites; "sun-moon": TypeGameSprites; "ultra-sun-ultra-moon": TypeGameSprites; } /** Generation-VIII type icons, by game. */ interface GenerationVIIITypeSprites { "brilliant-diamond-shining-pearl": TypeGameSprites; "legends-arceus": TypeGameSprites; "sword-shield": TypeGameSprites; } /** Generation-IX type icons, by game. */ interface GenerationIXTypeSprites { "scarlet-violet": TypeGameSprites; } /** * The icons used to depict a type, by generation and game. * * Generations I and II are absent: neither displayed type icons in-game. */ interface TypeSprites { /** Generation-III type icons. */ "generation-iii": GenerationIIITypeSprites; /** Generation-IV type icons. */ "generation-iv": GenerationIVTypeSprites; /** Generation-V type icons. */ "generation-v": GenerationVTypeSprites; /** Generation-VI type icons. */ "generation-vi": GenerationVITypeSprites; /** Generation-VII type icons. */ "generation-vii": GenerationVIITypeSprites; /** Generation-VIII type icons. */ "generation-viii": GenerationVIIITypeSprites; /** Generation-IX type icons. */ "generation-ix": GenerationIXTypeSprites; } /** * ## Type * Types are properties for Pokémon and their moves. * Each type has three properties: which types of Pokémon it is super effective against, * which types of Pokémon it is not very effective against, and which types of Pokémon it is completely ineffective against. */ interface Type { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** A detail of how effective this type is toward others and vice versa. */ damage_relations: TypeRelations; /** A list of details of how effective this type was toward others and vice versa in previous generations. */ past_damage_relations: TypeRelationsPast[]; /** A list of game indices relevant to this item by generation. */ game_indices: GenerationGameIndex[]; /** The generation this type was introduced in. */ generation: NamedAPIResource; /** The class of damage inflicted by this type. */ move_damage_class: NamedAPIResource; /** The name of this resource listed in different languages. */ names: Name[]; /** A list of details of Pokémon that have this type. */ pokemon: TypePokemon[]; /** A list of moves that have this type. */ moves: NamedAPIResource[]; /** The icons used to depict this type, by generation and game. */ sprites: TypeSprites; } //#endregion //#region src/models/evolution/evolution.d.ts /** * ## Evolution Time Of Day * The times of day an evolution can be tied to, lower case as the API writes * them. `dusk` is Lycanroc's Dusk Form and `full-moon` is Ursaluna, so this is * wider than the day/night pair the endpoint documentation describes. */ type EvolutionTimeOfDay = "day" | "night" | "dusk" | "full-moon"; /** * ## Evolution Detail * All details regarding the specific details of the referenced Pokémon species evolution. */ interface EvolutionDetail { /** The item required to cause evolution into this Pokémon species. */ item: NamedAPIResource | null; /** The type of event that triggers evolution into this Pokémon species. */ trigger: NamedAPIResource; /** The gender the evolving Pokémon species must be in order to evolve into this Pokémon species. */ gender: number | null; /** The item the evolving Pokémon species must be holding during the evolution trigger event to evolve into this Pokémon species. */ held_item: NamedAPIResource | null; /** The move that must be known by the evolving Pokémon species during the evolution trigger event in order to evolve into this Pokémon species. */ known_move: NamedAPIResource | null; /** The evolving Pokémon species must know a move with this type during the evolution trigger event in order to evolve into this Pokémon species. */ known_move_type: NamedAPIResource | null; /** The location the evolution must be triggered at. */ location: NamedAPIResource | null; /** The minimum required level the evolving Pokémon species must reach to evolve into this Pokémon species. */ min_level: number | null; /** The minimum required level of happiness the evolving Pokémon species must have to evolve into this Pokémon species. */ min_happiness: number | null; /** The minimum required level of beauty the evolving Pokémon species must have to evolve into this Pokémon species. */ min_beauty: number | null; /** The minimum required level of affection the evolving Pokémon species must have to evolve into this Pokémon species. */ min_affection: number | null; /** Whether or not it must be raining in the overworld to cause evolution into this Pokémon species. */ needs_overworld_rain: boolean; /** The Pokémon species that must be in the player's party in order for the evolving Pokémon species to evolve into this Pokémon species. */ party_species: NamedAPIResource | null; /** * The player must have a Pokémon of this type in their party during the evolution trigger event * in order for the evolving Pokémon species to evolve into this Pokémon species. */ party_type: NamedAPIResource | null; /** The required relation between the Pokémon's Attack and Defense stats. 1 means Attack > Defense. 0 means Attack = Defense. -1 means Attack < Defense. */ relative_physical_stats: 1 | 0 | -1 | null; /** The required time of day, or `""` when any time will do. */ time_of_day: EvolutionTimeOfDay | ""; /** Pokémon species for which this one must be traded. */ trade_species: NamedAPIResource | null; /** Whether or not the 3DS needs to be turned upside-down as this Pokémon levels up. */ turn_upside_down: boolean; /** The version group in which the evolution was introduced. */ version_group: NamedAPIResource; /** * Whether the evolution is the expected one in a main series game. Each Pokémon variety of a line * capable of evolution has exactly one default evolution per distinct variety it evolves into. */ is_default: boolean; /** Whether or not the Pokémon must be near a Moss Rock or Icy Rock to evolve into this species. */ near_special_rock: boolean; /** Whether or not multiplayer link play is needed to evolve into this species, e.g. Union Circle. */ needs_multiplayer: boolean; /** The region this evolution must occur in. */ region: NamedAPIResource | null; /** The form the evolving Pokémon must be in for this evolution to occur. */ base_form: NamedAPIResource | null; /** The form this evolution produces. */ evolved_form: NamedAPIResource | null; /** * The move that must be used by the evolving Pokémon species during the evolution trigger event * in order to evolve into this Pokémon species. */ used_move: NamedAPIResource | null; /** The minimum number of times `used_move` must be used to evolve into this species. */ min_move_count: number | null; /** The minimum number of steps that must be taken to evolve into this species. */ min_steps: number | null; /** * The minimum amount of damage taken during the evolution trigger event to evolve into this * species. */ min_damage_taken: number | null; } /** * ## Chain Link * Contains evolution details for a Pokémon in the chain. * Each link references the next Pokémon in the natural evolution order. */ interface ChainLink { /** Whether or not this link is for a baby Pokémon. This would only ever be true on the base link. */ is_baby: boolean; /** The Pokémon species at this point in the evolution chain. */ species: NamedAPIResource; /** All details regarding the specific details of the referenced Pokémon species evolution. */ evolution_details: EvolutionDetail[]; /** A list of chain objects. */ evolves_to: ChainLink[]; } /** * ## Evolution Chain * Evolution chains are essentially family trees. * They start with the lowest stage within a family and detail * evolution conditions for each as well as Pokémon they can evolve * into up through the hierarchy. */ interface EvolutionChain { /** The identifier for this resource. */ id: number; /** * The item that a Pokémon would be holding when mating that would trigger * the egg hatching a baby Pokémon rather than a basic Pokémon. */ baby_trigger_item: NamedAPIResource | null; /** * The base chain link object. Each link contains evolution details for a Pokémon in the chain. * Each link references the next Pokémon in the natural evolution order. */ chain: ChainLink; } /** * ## Evolution Trigger Name * Every trigger the PokéAPI publishes, in the order `/evolution-trigger` lists * them — which is the order their ids run in, and the order * {@link EVOLUTION_TRIGGERS} mirrors. */ type EvolutionTriggerName = "level-up" | "trade" | "use-item" | "shed" | "spin" | "tower-of-darkness" | "tower-of-waters" | "three-critical-hits" | "take-damage" | "other" | "agile-style-move" | "strong-style-move" | "recoil-damage" | "use-move" | "three-defeated-bisharp" | "gimmighoul-coins"; /** * ## Evolution Trigger * Evolution triggers are the events and conditions that cause a Pokémon to evolve. * There are numerous methods of evolution which define how and when Pokémon evolve. * Most Pokémon will evolve by leveling up while others evolve through specific means, * such as being traded, achieving a certain amount of friendship or leveling at certain times, among others. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Methods_of_evolution) for greater detail. */ interface EvolutionTrigger { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: EvolutionTriggerName; /** The name of this resource listed in different languages. */ names: Name[]; /** A list of Pokémon species that result from this evolution trigger. */ pokemon_species: NamedAPIResource[]; } //#endregion //#region src/models/game/pokemon-entry.d.ts /** * A Pokémon catalogued in a Pokédex. */ interface PokemonEntry { /** The index of this Pokémon species entry within the Pokédex. */ entry_number: number; /** The Pokémon species being encountered. */ pokemon_species: NamedAPIResource; } //#endregion //#region src/models/game/pokedex.d.ts /** * ## Pokédex * A Pokédex is a handheld electronic encyclopedia device; * one which is capable of recording and retaining information of the various Pokémon in a given region * with the exception of the national dex and some smaller dexes related to portions of a region. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9dex) for greater detail. */ interface Pokedex { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** Whether or not this Pokédex originated in the main series of the video games. */ is_main_series: boolean; /** The description of this resource listed in different languages. */ descriptions: Description[]; /** The name of this resource listed in different languages. */ names: Name[]; /** A list of Pokémon catalogued in this Pokédex and their indexes. */ pokemon_entries: PokemonEntry[]; /** The region this Pokédex catalogues Pokémon for. */ region: NamedAPIResource | null; /** A list of version groups this Pokédex is relevant to. */ version_groups: NamedAPIResource[]; } //#endregion //#region src/models/location/palpark.d.ts /** * ## Pal Park Area * Areas used for grouping Pokémon encounters in Pal Park. * They're like habitats that are specific to Pal Park. * Pal Park is divided into five separate areas: * * - [Field](https://bulbapedia.bulbagarden.net/wiki/List_of_Pok%C3%A9mon_by_Pal_Park_location#Field) * - [Forest](https://bulbapedia.bulbagarden.net/wiki/List_of_Pok%C3%A9mon_by_Pal_Park_location#Forest) * - [Mountain](https://bulbapedia.bulbagarden.net/wiki/List_of_Pok%C3%A9mon_by_Pal_Park_location#Mountain) * - [Pond](https://bulbapedia.bulbagarden.net/wiki/List_of_Pok%C3%A9mon_by_Pal_Park_location#Pound) * - [Sea](https://bulbapedia.bulbagarden.net/wiki/List_of_Pok%C3%A9mon_by_Pal_Park_location#Sea) * - [Trivia](https://bulbapedia.bulbagarden.net/wiki/List_of_Pok%C3%A9mon_by_Pal_Park_location#Trivia) * * See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Pal_Park) for greater detail. */ interface PalParkArea { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** The name of this resource listed in different languages. */ names: Name[]; /** A list of Pokémon encountered in this pal park area along with details. */ pokemon_encounters: PalParkEncounterSpecies[]; } /** * Details of a Pokémon encountered in this Pal Park area. */ interface PalParkEncounterSpecies { /** The base score given to the player when this Pokémon is caught during a pal park run. */ base_score: number; /** The base rate for encountering this Pokémon in this pal park area. */ rate: number; /** The Pokémon species being encountered. */ pokemon_species: NamedAPIResource; } //#endregion //#region src/models/pokemon/egg-group.d.ts /** * ## Egg Group * Egg Groups are categories which determine which Pokémon are able to interbreed. * Pokémon may belong to either one or two Egg Groups. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Egg_Group) for greater detail. */ interface EggGroup { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: "monster" | "water1" | "water2" | "water3" | "bug" | "flying" | "ground" | "fairy" | "plant" | "humanshape" | "mineral" | "indeterminate" | "ditto" | "dragon" | "no-eggs"; /** The name of this resource listed in different languages. */ names: Name[]; /** A list of all Pokémon species that are members of this egg group. */ pokemon_species: NamedAPIResource[]; } //#endregion //#region src/models/pokemon/growth-rate.d.ts /** * Levels and the amount of experience needed to attain them based on the given growth rate. */ interface GrowthRateExperienceLevel { /** The level gained. */ level: number; /** The amount of experience required to reach the referenced level. */ experience: number; } /** * ## Growth Rate * Growth rates are the speed with which Pokémon gain levels through experience. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Experience) for greater detail. */ interface GrowthRate { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: "slow" | "medium" | "fast" | "medium-slow" | "slow-then-very-fast" | "fast-then-very-slow"; /** The formula used to calculate the rate at which the Pokémon species gains levels. */ formula: string; /** The descriptions of this characteristic listed in different languages. */ descriptions: Description[]; /** A list of levels and the amount of experience needed to attain them based on this growth rate. */ levels: GrowthRateExperienceLevel[]; /** A list of Pokémon species that gain levels at this growth rate. */ pokemon_species: NamedAPIResource[]; } //#endregion //#region src/models/pokemon/characteristic.d.ts /** * ## Characteristic * Characteristics indicate which stat contains a Pokémon's highest IV. * A Pokémon's Characteristic is determined by the remainder of its highest IV divided by 5 (gene_modulo). * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Characteristic) for greater detail. */ interface Characteristic { /** The identifier for this resource. */ id: number; /** The remainder of the highest stat/IV divided by 5. */ gene_modulo: number; /** The possible values of the highest stat that would result in a Pokémon receiving this characteristic when divided by 5. */ possible_values: number[]; /** The highest stat for the referenced characteristic. */ highest_stat: NamedAPIResource; /** Descriptions for the referenced characteristic. */ descriptions: Description[]; } //#endregion //#region src/models/pokemon/pokeathlon-stat.d.ts /** * ## Pokéathlon Stat * Pokéathlon Stats are different attributes of a Pokémon's performance in Pokéathlons. * In Pokéathlons, competitions happen on different courses; one for each of the different Pokéathlon stats. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9athlon) for greater detail. */ interface PokeathlonStat { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: "speed" | "power" | "skill" | "stamina" | "jump"; /** The name of this resource listed in different languages. */ names: Name[]; /** A detail of natures which affect this Pokéathlon stat positively or negatively. */ affecting_natures: NaturePokeathlonStatAffectSets; } /** * A nature and how it changes the referenced Pokéathlon stat. */ interface NaturePokeathlonStatAffect { /** The maximum amount of change to the referenced Pokéathlon stat. */ max_change: -1 | -2 | 1 | 2; /** The nature causing the change. */ nature: NamedAPIResource; } /** * A detail of natures which affect this Pokéathlon stat positively or negatively. */ interface NaturePokeathlonStatAffectSets { /** A list of natures and how they change the referenced Pokéathlon stat. */ increase: NaturePokeathlonStatAffect[]; /** A list of natures and how they change the referenced Pokéathlon stat. */ decrease: NaturePokeathlonStatAffect[]; } //#endregion //#region src/models/pokemon/nature.d.ts /** * ## Nature * Natures influence how a Pokémon's stats grow. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Nature) for greater detail. */ interface Nature { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** The stat decreased by 10% in Pokémon with this nature. */ decreased_stat: NamedAPIResource | null; /** The stat increased by 10% in Pokémon with this nature. */ increased_stat: NamedAPIResource | null; /** The flavor hated by Pokémon with this nature. */ hates_flavor: NamedAPIResource | null; /** The flavor liked by Pokémon with this nature. */ likes_flavor: NamedAPIResource | null; /** A list of Pokéathlon stats this nature affects and by how much. */ pokeathlon_stat_changes: NatureStatChange[]; /** A list of battle styles and how likely a Pokémon with this nature is to use them in the Battle Palace or Battle Tent. */ move_battle_style_preferences: MoveBattleStylePreference[]; /** The name of this resource listed in different languages. */ names: Name[]; } /** * A Pokéathlon stat a nature affects, and by how much. */ interface NatureStatChange { /** The amount of change. */ max_change: -1 | 1 | -2 | 2; /** The stat being affected. */ pokeathlon_stat: NamedAPIResource; } /** * Battle Style and how likely a Pokémon with the given nature is to use them * in the Battle Palace or Battle Tent. */ interface MoveBattleStylePreference { /** Chance of using the move, in percent, if HP is under one half. */ low_hp_preference: number; /** Chance of using the move, in percent, if HP is over one half. */ high_hp_preference: number; /** The move battle style. */ move_battle_style: NamedAPIResource; } //#endregion //#region src/models/pokemon/stat.d.ts /** * ## Stat * Stats determine certain aspects of battles. Each Pokémon has a value for each stat * which grows as they gain levels and can be altered momentarily by effects in battles. */ interface Stat { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: "hp" | "attack" | "defense" | "special-attack" | "special-defense" | "speed" | "accuracy" | "evasion"; /** ID the games use for this stat. */ game_index: number; /** Whether this stat only exists within a battle. */ is_battle_only: boolean; /** A detail of moves which affect this stat positively or negatively. */ affecting_moves: MoveStatAffectSets; /** A detail of natures which affect this stat positively or negatively. */ affecting_natures: NatureStatAffectSets; /** A list of items which affect this stat. */ affecting_items: NamedAPIResource[]; /** A list of characteristics that are set on a Pokémon when its highest base stat is this stat. */ characteristics: APIResource[]; /** The class of damage this stat is directly related to. */ move_damage_class: NamedAPIResource | null; /** The name of this resource listed in different languages. */ names: Name[]; } /** * A detail of natures which affect the given stat positively or negatively. */ interface NatureStatAffectSets { /** A list of natures and how they change the referenced stat. */ increase: NamedAPIResource[]; /** A list of natures and how they change the referenced stat. */ decrease: NamedAPIResource[]; } /** * A move and how it changes the referenced stat. */ interface MoveStatAffect { /** The maximum amount of change to the referenced stat. */ change: -1 | -2 | 1 | 2; /** The move causing the change. */ move: NamedAPIResource; } /** * A detail of moves which affect a stat positively or negatively. */ interface MoveStatAffectSets { /** A list of moves and how they change the referenced stat. */ increase: MoveStatAffect[]; /** A list of moves and how they change the referenced stat. */ decrease: MoveStatAffect[]; } //#endregion //#region src/models/pokemon/pokemon.d.ts /** * ## Pokémon * Pokémon are the creatures that inhabit the world of the Pokémon games. * They can be caught using Pokéballs and trained by battling with other Pokémon. * Each Pokémon belongs to a specific species but may take on a variant * which makes it differ from other Pokémon of the same species, such as base stats, available abilities and typings. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_(species)) for greater detail. */ interface Pokemon { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** The base experience gained for defeating this Pokémon. */ base_experience: number; /** The height of this Pokémon in decimetres. */ height: number; /** Set for exactly one Pokémon used as the default for each species. */ is_default: boolean; /** Order for sorting. Almost national order, except families are grouped together. */ order: number; /** The weight of this Pokémon in hectograms. */ weight: number; /** A list of abilities this Pokémon could potentially have. */ abilities: PokemonAbility[]; /** A list of forms this Pokémon can take on. */ forms: NamedAPIResource[]; /** A list of game indices relevant to this Pokémon by generation. */ game_indices: VersionGameIndex[]; /** A list of items this Pokémon may be holding when encountered. */ held_items: PokemonHeldItem[]; /** A link to a list of location areas, as well as encounter details pertaining to specific versions. */ location_area_encounters: string; /** A list of moves along with learn methods and level details pertaining to specific version groups. */ moves: PokemonMove[]; /** A set of sprites used to depict this Pokémon in the game. */ sprites: PokemonSprites; /** A set of cries used to depict this Pokémon in the game. */ cries: PokemonCries; /** The species this Pokémon belongs to. */ species: NamedAPIResource; /** A list of base stat values for this Pokémon. */ stats: PokemonStat[]; /** A list of details showing types this Pokémon has. */ types: PokemonType[]; /** Data describing a Pokémon's types in a previous generation. */ past_types: PokemonPastType[]; /** Data describing a Pokémon's abilities in a previous generation. */ past_abilities: PokemonPastAbility[]; /** Data describing a Pokémon's stats in a previous generation. */ past_stats: PokemonPastStat[]; } /** The cries used to depict a Pokémon in the games. */ type PokemonCries = { /** The legacy depiction of this Pokémon's cry. */ legacy: string; /** The latest depiction of this Pokémon's cry. */ latest: string; }; /** * Abilities the given Pokémon could potentially have. */ interface PokemonAbility { /** Whether or not this is a hidden ability. */ is_hidden: boolean; /** The slot this ability occupies in this Pokémon species. */ slot: number; /** The ability the Pokémon may have. */ ability: NamedAPIResource; } /** * Details showing types the given Pokémon has. */ interface PokemonType { /** The order the Pokémon's types are listed in. */ slot: number; /** The type the referenced Pokémon has. */ type: NamedAPIResource; } /** * Data describing a Pokémon's types in a previous generation. */ interface PokemonPastType { /** The generation of this Pokémon Type. */ generation: NamedAPIResource; /** The types this Pokémon had in a previous generation. */ types: PokemonType[]; } /** An ability slot as it stood in a previous generation. */ interface PokemonPastAbilitySlot { /** Whether or not this was a hidden ability. */ is_hidden: boolean; /** The slot this ability occupied in this Pokémon species. */ slot: number; /** The ability that occupied the slot, or `null` when the slot was empty. */ ability: NamedAPIResource | null; } /** Data describing a Pokémon's abilities in a previous generation. */ interface PokemonPastAbility { /** The last generation in which the referenced Pokémon had the listed abilities. */ generation: NamedAPIResource; /** The abilities the referenced Pokémon had up to and including the listed generation. */ abilities: PokemonPastAbilitySlot[]; } /** Data describing a Pokémon's stats in a previous generation. */ interface PokemonPastStat { /** The last generation in which the referenced Pokémon had the listed stats. */ generation: NamedAPIResource; /** The stats the Pokémon had up to and including the listed generation. */ stats: PokemonStat[]; } /** * Items the given Pokémon may be holding when encountered. */ interface PokemonHeldItem { /** The item the referenced Pokémon holds. */ item: NamedAPIResource; /** The details of the different versions in which the item is held. */ version_details: PokemonHeldItemVersion[]; } /** * The details of the different versions in which the item is held. */ interface PokemonHeldItemVersion { /** The version in which the item is held. */ version: NamedAPIResource; /** How often the item is held. */ rarity: number; } /** * A Move along with learn methods and level details pertaining to specific version groups. */ interface PokemonMove { /** The move the Pokémon can learn. */ move: NamedAPIResource; /** The details of the version in which the Pokémon can learn the move. */ version_group_details: PokemonMoveVersion[]; } /** * The details of the version in which the Pokémon can learn the move. */ interface PokemonMoveVersion { /** The method by which the move is learned. */ move_learn_method: NamedAPIResource; /** The version group in which the move is learned. */ version_group: NamedAPIResource; /** The minimum level to learn the move. */ level_learned_at: number; /** * Order by which the Pokémon will learn the move. A newly learnt move replaces the move with * the lowest order. */ order: number | null; } /** * Base stat values for the given Pokémon. */ interface PokemonStat { /** The stat the Pokémon has. */ stat: NamedAPIResource; /** The effort points (EV) the Pokémon has in the stat. */ effort: number; /** The base value of the stat. */ base_stat: number; } /** Version Sprites. */ interface VersionSprites { /** Generation-I Sprites of this Pokémon. */ "generation-i": GenerationISprites; /** Generation-II Sprites of this Pokémon. */ "generation-ii": GenerationIISprites; /** Generation-III Sprites of this Pokémon. */ "generation-iii": GenerationIIISprites; /** Generation-IV Sprites of this Pokémon. */ "generation-iv": GenerationIVSprites; /** Generation-V Sprites of this Pokémon. */ "generation-v": GenerationVSprites; /** Generation-VI Sprites of this Pokémon. */ "generation-vi": GenerationVISprites; /** Generation-VII Sprites of this Pokémon. */ "generation-vii": GenerationVIISprites; /** Generation-VIII Sprites of this Pokémon. */ "generation-viii": GenerationVIIISprites; /** Generation-IX Sprites of this Pokémon. */ "generation-ix": GenerationIXSprites; } /** * A set of sprites used to depict this Pokémon in the game. * A visual representation of the various sprites can be found at [PokeAPI/sprites](https://github.com/PokeAPI/sprites#sprites). */ interface PokemonSprites { /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The shiny depiction of this Pokémon from the front in battle. */ front_shiny: string | null; /** The female depiction of this Pokémon from the front in battle. */ front_female: string | null; /** The shiny female depiction of this Pokémon from the front in battle. */ front_shiny_female: string | null; /** The default depiction of this Pokémon from the back in battle. */ back_default: string | null; /** The shiny depiction of this Pokémon from the back in battle. */ back_shiny: string | null; /** The female depiction of this Pokémon from the back in battle. */ back_female: string | null; /** The shiny female depiction of this Pokémon from the back in battle. */ back_shiny_female: string | null; /** Dream World, Official Artwork and Home sprites. */ other?: OtherPokemonSprites; /** Version Sprites of this Pokémon. */ versions: VersionSprites; } /** Other Pokémon Sprites (Dream World and Official Artwork sprites). */ interface OtherPokemonSprites { /** Dream World Sprites of this Pokémon. */ dream_world: DreamWorld; /** Official Artwork Sprites of this Pokémon. */ "official-artwork": OfficialArtwork; /** Home Artwork Sprites of this Pokémon. */ home: Home; /** Pokémon Showdown animated sprites of this Pokémon. */ showdown: Showdown; } /** Dream World sprites. */ interface DreamWorld { /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The female depiction of this Pokémon from the front in battle. */ front_female: string | null; } /** Official Artwork sprites. */ interface OfficialArtwork { /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The shiny depiction of this Pokémon from the front in battle. */ front_shiny: string | null; } /** Home sprites. */ interface Home { /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The female depiction of this Pokémon from the front in battle. */ front_female: string | null; /** The shiny depiction of this Pokémon from the front in battle. */ front_shiny: string | null; /** The shiny female depiction of this Pokémon from the front in battle. */ front_shiny_female: string | null; } /** Showdown Sprites. */ interface Showdown { /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The female depiction of this Pokémon from the front in battle. */ front_female: string | null; /** The shiny depiction of this Pokémon from the front in battle. */ front_shiny: string | null; /** The shiny female depiction of this Pokémon from the front in battle. */ front_shiny_female: string | null; /** The default depiction of this Pokémon from the back in battle. */ back_default: string | null; /** The female depiction of this Pokémon from the back in battle. */ back_female: string | null; /** The shiny depiction of this Pokémon from the back in battle. */ back_shiny: string | null; /** The shiny female depiction of this Pokémon from the back in battle. */ back_shiny_female: string | null; } /** Generation-I Sprites. */ interface GenerationISprites { /** Red-blue sprites of this Pokémon. */ "red-blue": RedBlue; /** Yellow sprites of this Pokémon. */ yellow: Yellow; } /** Red/Blue Sprites. */ interface RedBlue { /** The default depiction of this Pokémon from the back in battle. */ back_default: string | null; /** The gray depiction of this Pokémon from the back in battle. */ back_gray: string | null; /** The transparent depiction of this Pokémon from the back in battle. */ back_transparent: string | null; /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The gray depiction of this Pokémon from the front in battle. */ front_gray: string | null; /** The transparent depiction of this Pokémon from the front in battle. */ front_transparent: string | null; } /** Yellow sprites. */ interface Yellow { /** The default depiction of this Pokémon from the back in battle. */ back_default: string | null; /** The gray depiction of this Pokémon from the back in battle. */ back_gray: string | null; /** The transparent depiction of this Pokémon from the back in battle. */ back_transparent: string | null; /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The gray depiction of this Pokémon from the front in battle. */ front_gray: string | null; /** The transparent depiction of this Pokémon from the front in battle. */ front_transparent: string | null; } /** Generation-II Sprites. */ interface GenerationIISprites { /** Crystal sprites of this Pokémon. */ crystal: Crystal; /** Gold sprites of this Pokémon. */ gold: Gold; /** Silver sprites of this Pokémon. */ silver: Silver; } /** Crystal sprites. */ interface Crystal { /** The animated sprites of this Pokémon. */ animated: CrystalAnimated; /** The default depiction of this Pokémon from the back in battle. */ back_default: string | null; /** The shiny depiction of this Pokémon from the back in battle. */ back_shiny: string | null; /** The back shiny transparent depiction of this Pokémon from the back in battle. */ back_shiny_transparent: string | null; /** The transparent depiction of this Pokémon from the back in battle. */ back_transparent: string | null; /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The shiny depiction of this Pokémon from the front in battle. */ front_shiny: string | null; /** The front shiny transparent depiction of this Pokémon from the front in battle. */ front_shiny_transparent: string | null; /** The transparent depiction of this Pokémon from the front in battle. */ front_transparent: string | null; } /** Animated Crystal sprites. */ interface CrystalAnimated { /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The shiny depiction of this Pokémon from the front in battle. */ front_shiny: string | null; } /** Gold sprites of this Pokémon. */ interface Gold { /** The default depiction of this Pokémon from the back in battle. */ back_default: string | null; /** The shiny depiction of this Pokémon from the back in battle. */ back_shiny: string | null; /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The shiny depiction of this Pokémon from the front in battle. */ front_shiny: string | null; /** The transparent depiction of this Pokémon from the front in battle. */ front_transparent: string | null; } /** Silver sprites. */ interface Silver { /** The default depiction of this Pokémon from the back in battle. */ back_default: string | null; /** The shiny depiction of this Pokémon from the back in battle. */ back_shiny: string | null; /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The shiny depiction of this Pokémon from the front in battle. */ front_shiny: string | null; /** The transparent depiction of this Pokémon from the front in battle. */ front_transparent: string | null; } /** Generation-III Sprites. */ interface GenerationIIISprites { /** Emerald sprites of this Pokémon. */ emerald: Emerald; /** Firered-Leafgreen sprites of this Pokémon. */ "firered-leafgreen": FireredLeafgreen; /** Ruby-Sapphire sprites of this Pokémon. */ "ruby-sapphire": RubySapphire; } /** Emerald sprites. */ interface Emerald { /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The shiny depiction of this Pokémon from the front in battle. */ front_shiny: string | null; } /** FireRed LeafGreen sprites. */ interface FireredLeafgreen { /** The default depiction of this Pokémon from the back in battle. */ back_default: string | null; /** The shiny depiction of this Pokémon from the back in battle. */ back_shiny: string | null; /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The shiny depiction of this Pokémon from the front in battle. */ front_shiny: string | null; } /** Ruby/Sapphire sprites. */ interface RubySapphire { /** The default depiction of this Pokémon from the back in battle. */ back_default: string | null; /** The shiny depiction of this Pokémon from the back in battle. */ back_shiny: string | null; /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The shiny depiction of this Pokémon from the front in battle. */ front_shiny: string | null; } /** Generation-IV Sprites. */ interface GenerationIVSprites { /** Diamond-pearl Generation sprites of this Pokémon. */ "diamond-pearl": DiamondPearl; /** Heartgold-Soulsilver sprites of this Pokémon. */ "heartgold-soulsilver": HeartgoldSoulsilver; /** Platinum sprites of this Pokémon. */ platinum: Platinum; } /** Diamond-Pearl sprites of this Pokémon. */ interface DiamondPearl { /** The default depiction of this Pokémon from the back in battle. */ back_default: string | null; /** The shiny depiction of this Pokémon from the back in battle. */ back_shiny: string | null; /** The female depiction of this Pokémon from the back in battle. */ back_female: string | null; /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The shiny depiction of this Pokémon from the front in battle. */ front_shiny: string | null; /** The shiny female depiction of this Pokémon from the back in battle. */ back_shiny_female: string | null; /** The female depiction of this Pokémon from the front in battle. */ front_female: string | null; /** The shiny female depiction of this Pokémon from the back in battle. */ front_shiny_female: string | null; } /** HeartGold-SoulSilver sprites of this Pokémon. */ interface HeartgoldSoulsilver { /** The default depiction of this Pokémon from the back in battle. */ back_default: string | null; /** The shiny depiction of this Pokémon from the back in battle. */ back_shiny: string | null; /** The female depiction of this Pokémon from the back in battle. */ back_female: string | null; /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The shiny depiction of this Pokémon from the front in battle. */ front_shiny: string | null; /** The shiny female depiction of this Pokémon from the back in battle. */ back_shiny_female: string | null; /** The female depiction of this Pokémon from the front in battle. */ front_female: string | null; /** The shiny female depiction of this Pokémon from the back in battle. */ front_shiny_female: string | null; } /** Platinum sprites of this Pokémon. */ interface Platinum { /** The default depiction of this Pokémon from the back in battle. */ back_default: string | null; /** The shiny depiction of this Pokémon from the back in battle. */ back_shiny: string | null; /** The female depiction of this Pokémon from the back in battle. */ back_female: string | null; /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The shiny depiction of this Pokémon from the front in battle. */ front_shiny: string | null; /** The shiny female depiction of this Pokémon from the back in battle. */ back_shiny_female: string | null; /** The female depiction of this Pokémon from the front in battle. */ front_female: string | null; /** The shiny female depiction of this Pokémon from the back in battle. */ front_shiny_female: string | null; } /** Generation-V Sprites. */ interface GenerationVSprites { /** Black-white sprites of this Pokémon. */ "black-white": BlackWhite; /** Menu icons of this Pokémon. */ icons: GenerationVIcons; } /** Black/White sprites. */ interface BlackWhite { /** The animated sprite of this Pokémon. */ animated: Animated; /** The default depiction of this Pokémon from the back in battle. */ back_default: string | null; /** The shiny depiction of this Pokémon from the back in battle. */ back_shiny: string | null; /** The female depiction of this Pokémon from the back in battle. */ back_female: string | null; /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The shiny depiction of this Pokémon from the front in battle. */ front_shiny: string | null; /** The shiny female depiction of this Pokémon from the back in battle. */ back_shiny_female: string | null; /** The female depiction of this Pokémon from the front in battle. */ front_female: string | null; /** The shiny female depiction of this Pokémon from the back in battle. */ front_shiny_female: string | null; } /** Animated sprites of this Pokémon. */ interface Animated { /** The default depiction of this Pokémon from the back in battle. */ back_default: string | null; /** The shiny depiction of this Pokémon from the back in battle. */ back_shiny: string | null; /** The female depiction of this Pokémon from the back in battle. */ back_female: string | null; /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The shiny depiction of this Pokémon from the front in battle. */ front_shiny: string | null; /** The shiny female depiction of this Pokémon from the back in battle. */ back_shiny_female: string | null; /** The female depiction of this Pokémon from the front in battle. */ front_female: string | null; /** The shiny female depiction of this Pokémon from the back in battle. */ front_shiny_female: string | null; } /** Generation-V menu icons. */ interface GenerationVIcons { /** The animated menu icon of this Pokémon. */ animated: GenerationVAnimatedIcons; /** The menu icon of this Pokémon. */ front_default: string | null; } /** Animated Generation-V menu icons. */ interface GenerationVAnimatedIcons { /** The animated menu icon of this Pokémon. */ front_default: string | null; } /** Generation-VI Sprites. */ interface GenerationVISprites { /** Omegaruby-Alphasapphire sprites of this Pokémon. */ "omegaruby-alphasapphire": OmegarubyAlphasapphire; /** X-Y sprites of this Pokémon. */ "x-y": XY; } /** Omega/Ruby Alpha/Sapphire sprites. */ interface OmegarubyAlphasapphire { /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The female depiction of this Pokémon from the front in battle. */ front_female: string | null; /** The shiny depiction of this Pokémon from the front in battle. */ front_shiny: string | null; /** The shiny female depiction of this Pokémon from the back in battle. */ front_shiny_female: string | null; } /** XY sprites. */ interface XY { /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The female depiction of this Pokémon from the front in battle. */ front_female: string | null; /** The shiny depiction of this Pokémon from the front in battle. */ front_shiny: string | null; /** The shiny female depiction of this Pokémon from the back in battle. */ front_shiny_female: string | null; } /** Generation-VII Sprites. */ interface GenerationVIISprites { /** Icon sprites of this Pokémon. */ icons: GenerationViiIcons; /** Ultra-sun-ultra-moon sprites of this Pokémon. */ "ultra-sun-ultra-moon": UltraSunUltraMoon; } /** Generation VII icons. */ interface GenerationViiIcons { /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The female depiction of this Pokémon from the front in battle. */ front_female: string | null; } /** Ultra Sun Ultra Moon sprites. */ interface UltraSunUltraMoon { /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The female depiction of this Pokémon from the front in battle. */ front_female: string | null; /** The shiny depiction of this Pokémon from the front in battle. */ front_shiny: string | null; /** The shiny female depiction of this Pokémon from the back in battle. */ front_shiny_female: string | null; } /** Generation-VIII Sprites. */ interface GenerationVIIISprites { /** Icon sprites of this Pokémon. */ icons: GenerationViiiIcons; /** Brilliant Diamond and Shining Pearl sprites of this Pokémon. */ "brilliant-diamond-shining-pearl": BrilliantDiamondShiningPearl; } /** Generation VIII icons. */ interface GenerationViiiIcons { /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The female depiction of this Pokémon from the front in battle. */ front_female: string | null; } /** Brilliant Diamond and Shining Pearl sprites. */ interface BrilliantDiamondShiningPearl { /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The female depiction of this Pokémon from the front in battle. */ front_female: string | null; } /** Generation-IX Sprites */ interface GenerationIXSprites { /** Scarlet and Violet sprites of this Pokémon. */ "scarlet-violet": ScarletViolet; } /** Scarlet and Violet sprites. */ interface ScarletViolet { /** The default depiction of this Pokémon from the front in battle. */ front_default: string | null; /** The female depiction of this Pokémon from the front in battle. */ front_female: string | null; } /** * ## Location Area Encounter * Pokémon location areas where Pokémon can be found. */ interface LocationAreaEncounter { /** The location area the referenced Pokémon can be encountered in. */ location_area: NamedAPIResource; /** A list of versions and encounters with the referenced Pokémon that might happen. */ version_details: VersionEncounterDetail[]; } /** * ## Pokémon Colors * Colors used for sorting Pokémon in a Pokédex. * The color listed in the Pokédex is usually the color most apparent or covering each Pokémon's body. * No orange category exists; Pokémon that are primarily orange are listed as red or brown. */ interface PokemonColor { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: "black" | "blue" | "brown" | "gray" | "green" | "pink" | "purple" | "red" | "white" | "yellow"; /** The name of this resource listed in different languages. */ names: Name[]; /** A list of the Pokémon species that have this color. */ pokemon_species: NamedAPIResource[]; } /** * ## Pokémon Form * Some Pokémon may appear in one of multiple, visually different forms. * These differences are purely cosmetic. For variations within a Pokémon species, * which do differ in more than just visuals, the 'Pokémon' entity is used to represent such a variety. */ interface PokemonForm { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** The order in which forms should be sorted within all forms. * Multiple forms may have equal order, in which case they should fall back on sorting by name. */ order: number; /** The order in which forms should be sorted within a species' forms. */ form_order: number; /** True for exactly one form used as the default for each Pokémon. */ is_default: boolean; /** Whether or not this form can only happen during battle. */ is_battle_only: boolean; /** Whether or not this form requires mega evolution. */ is_mega: boolean; /** The name of this form. */ form_name: string; /** The Pokémon that can take on this form. */ pokemon: NamedAPIResource; /** A set of sprites used to depict this Pokémon form in the game. */ sprites: PokemonFormSprites; /** The version group this Pokémon form was introduced in. */ version_group: NamedAPIResource; /** The form specific full name of this Pokémon form, or empty if the form does not have a specific name. */ names: Name[]; /** The form specific form name of this Pokémon form, or empty if the form does not have a specific name. */ form_names: Name[]; /** A list of details showing types this Pokémon has. */ types: PokemonType[]; /** * The conditions that trigger this (usually battle-only) form, such as holding a Mega Stone or * having a specific ability. Empty for forms that are not triggered. */ trigger_conditions: PokemonFormCondition[]; /** The flavor text of this Pokémon form, in every language it is published in. */ flavor_text_entries: FlavorText[]; } /** A condition that causes a Pokémon to take on a particular form. */ interface PokemonFormCondition { /** The name of the resource that triggers the form. */ name: string; /** The URL of the resource that triggers the form. */ url: string; /** What kind of resource triggers the form, e.g. `held-item` or `ability`. */ trigger: string; /** The form the Pokémon changes from, when the condition switches between two forms. */ base_form?: NamedAPIResource; } /** * Sprites used to depict this Pokémon form in the game. */ interface PokemonFormSprites { /** The default depiction of this Pokémon form from the front in battle. */ front_default: string | null; /** The female depiction of this Pokémon form from the front in battle. */ front_female: string | null; /** The shiny depiction of this Pokémon form from the front in battle. */ front_shiny: string | null; /** The shiny female depiction of this Pokémon form from the front in battle. */ front_shiny_female: string | null; /** The default depiction of this Pokémon form from the back in battle. */ back_default: string | null; /** The female depiction of this Pokémon form from the back in battle. */ back_female: string | null; /** The shiny depiction of this Pokémon form from the back in battle. */ back_shiny: string | null; /** The shiny female depiction of this Pokémon form from the back in battle. */ back_shiny_female: string | null; /** Version Sprites of this Pokémon form. */ versions: PokemonFormVersionSprites; } /** * Version sprites of a Pokémon form. * * Only the two generations that ship form-specific sprites appear, which is why * this is not the Pokémon-level {@link VersionSprites}. */ interface PokemonFormVersionSprites { /** Generation-VIII Sprites of this Pokémon form. */ "generation-viii": PokemonFormGenerationVIIISprites; /** Generation-IX Sprites of this Pokémon form. */ "generation-ix": GenerationIXSprites; } /** Generation-VIII sprites of a Pokémon form. */ interface PokemonFormGenerationVIIISprites { /** Brilliant Diamond and Shining Pearl sprites of this Pokémon form. */ "brilliant-diamond-shining-pearl": BrilliantDiamondShiningPearl; } /** * ## Pokémon Habitat * Habitats are generally different terrain Pokémon can be found in * but can also be areas designated for rare or legendary Pokémon. */ interface PokemonHabitat { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: "cave" | "forest" | "grassland" | "mountain" | "rare" | "rough-terrain" | "sea" | "urban" | "waters-edge"; /** The name of this resource listed in different languages. */ names: Name[]; /** A list of the Pokémon species that can be found in this habitat. */ pokemon_species: NamedAPIResource[]; } /** * ## Pokémon Shape * Shapes used for sorting Pokémon in a Pokédex. */ interface PokemonShape { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** The "scientific" name of this Pokémon shape listed in different languages. */ awesome_names: AwesomeName[]; /** The name of this resource listed in different languages. */ names: Name[]; /** A list of the Pokémon species that have this shape. */ pokemon_species: NamedAPIResource[]; } /** * The "scientific" name of the Pokémon shape listed in different languages. */ interface AwesomeName { /** The localized "scientific" name for an API resource in a specific language. */ awesome_name: string; /** The language this "scientific" name is in. */ language: NamedAPIResource; } /** * ## Pokémon Species * A Pokémon Species forms the basis for at least one Pokémon. * Attributes of a Pokémon species are shared across all varieties of Pokémon within the species. * A good example is Wormadam; Wormadam is the species which can be found in three different varieties, * Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant */ interface PokemonSpecies { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** The order in which species should be sorted. Based on National Dex order, except families are grouped together and sorted by stage. */ order: number; /** The chance of this Pokémon being female, in eighths; or -1 for genderless. */ gender_rate: number; /** The base capture rate; up to 255. The higher the number, the easier the catch. */ capture_rate: number; /** The happiness when caught by a normal Pokéball; up to 255. The higher the number, the happier the Pokémon. */ base_happiness: number; /** Whether or not this is a baby Pokémon. */ is_baby: boolean; /** Whether or not this is a legendary Pokémon. */ is_legendary: boolean; /** Whether or not this is a mythical Pokémon. */ is_mythical: boolean; /** Initial hatch counter: one must walk 255 × (hatch_counter + 1) steps before this Pokémon's egg hatches, unless utilizing bonuses like Flame Body's. */ hatch_counter: number; /** Whether or not this Pokémon has visual gender differences. */ has_gender_differences: boolean; /** Whether or not this Pokémon has multiple forms and can switch between them. */ forms_switchable: boolean; /** The rate at which this Pokémon species gains levels. */ growth_rate: NamedAPIResource; /** A list of Pokédexes and the indexes reserved within them for this Pokémon species. */ pokedex_numbers: PokemonSpeciesDexEntry[]; /** A list of egg groups this Pokémon species is a member of. */ egg_groups: NamedAPIResource[]; /** The color of this Pokémon for Pokédex search. */ color: NamedAPIResource; /** The shape of this Pokémon for Pokédex search. */ shape: NamedAPIResource; /** The Pokémon species that evolves into this Pokémon species, if any. */ evolves_from_species: NamedAPIResource | null; /** The evolution chain this Pokémon species is a member of. */ evolution_chain: APIResource; /** The habitat this Pokémon species can be encountered in. */ habitat: NamedAPIResource; /** The generation this Pokémon species was introduced in. */ generation: NamedAPIResource; /** The name of this resource listed in different languages. */ names: Name[]; /** A list of encounters that can be had with this Pokémon species in pal park. */ pal_park_encounters: PalParkEncounterArea[]; /** A list of flavor text entries for this Pokémon species. */ flavor_text_entries: FlavorText[]; /** Descriptions of different forms Pokémon take on within the Pokémon species. */ form_descriptions: Description[]; /** The genus of this Pokémon species listed in multiple languages. */ genera: Genus[]; /** A list of the Pokémon that exist within this Pokémon species. */ varieties: PokemonSpeciesVariety[]; } /** * The genus of the given Pokémon species listed in multiple languages. */ interface Genus { /** The localized genus for the referenced Pokémon species. */ genus: string; /** The language this genus is in. */ language: NamedAPIResource; } /** Pokédexes and the indexes reserved within them for the given Pokémon species. */ interface PokemonSpeciesDexEntry { /** The index number within the Pokédex. */ entry_number: number; /** The Pokédex the referenced Pokémon species can be found in. */ pokedex: NamedAPIResource; } /** * Encounter that can be had with the given Pokémon species in pal park. */ interface PalParkEncounterArea { /** The base score given to the player when the referenced Pokémon is caught during a pal park run. */ base_score: number; /** The base rate for encountering the referenced Pokémon in this pal park area. */ rate: number; /** The pal park area where this encounter happens. */ area: NamedAPIResource; } /** * Pokémon that exist within this Pokémon species. */ interface PokemonSpeciesVariety { /** Whether this variety is the default variety. */ is_default: boolean; /** The Pokémon variety. */ pokemon: NamedAPIResource; } //#endregion //#region src/models/pokemon/ability.d.ts /** * ## Ability * Abilities provide passive effects for Pokémon in battle or in the overworld. * Pokémon have multiple possible abilities but can have only one ability at a time. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Ability) for greater detail. */ interface Ability { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** Whether or not this ability originated in the main series of the video games. */ is_main_series: boolean; /** The generation this ability originated in. */ generation: NamedAPIResource; /** The name of this resource listed in different languages. */ names: Name[]; /** The effect of this ability listed in different languages. */ effect_entries: VerboseEffect[]; /** The list of previous effects this ability has had across version groups. */ effect_changes: AbilityEffectChange[]; /** The flavor text of this ability listed in different languages. */ flavor_text_entries: AbilityFlavorText[]; /** A list of Pokémon that could potentially have this ability. */ pokemon: AbilityPokemon[]; } /** * Previous effects an ability has had across version groups. */ interface AbilityEffectChange { /** The previous effect of this ability listed in different languages. */ effect_entries: Effect[]; /** The version group in which the previous effect of this ability originated. */ version_group: NamedAPIResource; } /** * The flavor text of an ability. */ interface AbilityFlavorText { /** The localized name for an API resource in a specific language. */ flavor_text: string; /** The language this text resource is in. */ language: NamedAPIResource; /** The version group that uses this flavor text. */ version_group: NamedAPIResource; } /** * Pokémon that could potentially have the given ability. */ interface AbilityPokemon { /** Whether or not this is a hidden ability for the referenced Pokémon. */ is_hidden: boolean; /** * Pokémon have 3 ability 'slots' which hold references to possible abilities they could have. * This is the slot of this ability for the referenced pokemon. */ slot: number; /** The Pokémon this ability could belong to. */ pokemon: NamedAPIResource; } //#endregion //#region src/models/pokemon/gender.d.ts /** * ## Gender * Genders were introduced in Generation II for the purposes of breeding Pokémon * but can also result in visual differences or even different evolutionary lines. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Gender) for greater detail. */ interface Gender { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: "male" | "female" | "genderless"; /** A list of Pokémon species that can be this gender and how likely it is that they will be. */ pokemon_species_details: PokemonSpeciesGender[]; /** A list of Pokémon species that required this gender in order for a Pokémon to evolve into them. */ required_for_evolution: NamedAPIResource[]; } /** * Pokémon species that can be this gender and how likely it is that they will be. */ interface PokemonSpeciesGender { /** The chance of this Pokémon being female, in eighths; or -1 for genderless. */ rate: number; /** A Pokémon species that can be the referenced gender. */ pokemon_species: NamedAPIResource; } //#endregion //#region src/models/move/move.d.ts /** * ## Move Target * Targets moves can be directed at during battle. Targets can be Pokémon, environments or even other moves. */ interface MoveTarget { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** The description of this resource listed in different languages. */ descriptions: Description[]; /** A list of moves that are directed at this target. */ moves: NamedAPIResource[]; /** The name of this resource listed in different languages. */ names: Name[]; } /** * ## Move Learn Method * Methods by which Pokémon can learn moves. */ interface MoveLearnMethod { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** The description of this resource listed in different languages. */ descriptions: Description[]; /** The name of this resource listed in different languages. */ names: Name[]; /** A list of version groups where moves can be learned through this method. */ version_groups: NamedAPIResource[]; } /** * ## Move Damage Class * Damage classes moves can have, e.g. physical, special, or non-damaging. */ interface MoveDamageClass { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** The description of this resource listed in different languages. */ descriptions: Description[]; /** A list of moves that fall into this damage class. */ moves: NamedAPIResource[]; /** The name of this resource listed in different languages. */ names: Name[]; } /** * ## Move Category * Very general categories that loosely group move effects. */ interface MoveCategory { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** A list of moves that fall into this category. */ moves: NamedAPIResource[]; /** The description of this resource listed in different languages. */ descriptions: Description[]; } /** * ## Move Battle Style * Styles of moves when used in the Battle Palace. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Battle_Frontier_(Generation_III)) for greater detail. */ interface MoveBattleStyle { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: "attack" | "defense" | "support"; /** The name of this resource listed in different languages. */ names: Name[]; } /** * ## Move Ailment * Move Ailments are status conditions caused by moves used during battle. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Status_condition) for greater detail. */ interface MoveAilment { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** A list of moves that cause this ailment. */ moves: NamedAPIResource[]; /** The name of this resource listed in different languages. */ names: Name[]; } /** The values a move had in a previous version group. */ interface PastMoveStatValues { /** The percent value of how likely this move is to be successful. */ accuracy: number | null; /** The percent value of how likely it is this move's effect will take effect. */ effect_chance: number | null; /** The base power of this move with a value of 0 if it does not have a base power. */ power: number | null; /** Power points. The number of times this move can be used. */ pp: number | null; /** The effect of this move listed in different languages. */ effect_entries: VerboseEffect[]; /** The elemental type of this move. */ type: NamedAPIResource | null; /** The version group in which these move stat values were in effect. */ version_group: NamedAPIResource; } /** A stat this move changes, and by how much. */ interface MoveStatChange { /** The amount of change. */ change: number; /** The stat being affected. */ stat: NamedAPIResource; } /** Metadata about a move. */ interface MoveMetaData { /** The status ailment this move inflicts on its target. */ ailment: NamedAPIResource; /** The category of move this move falls under, e.g. damage or ailment. */ category: NamedAPIResource; /** The minimum number of times this move hits. Null if it always only hits once. */ min_hits: number | null; /** The maximum number of times this move hits. Null if it always only hits once. */ max_hits: number | null; /** The minimum number of turns this move continues to take effect. Null if it always only lasts one turn. */ min_turns: number | null; /** The maximum number of turns this move continues to take effect. Null if it always only lasts one turn. */ max_turns: number | null; /** HP drain (if positive) or Recoil damage (if negative), in percent of damage done. */ drain: number; /** The amount of hp gained by the attacking Pokémon, in percent of its maximum HP. */ healing: number; /** Critical hit rate bonus. */ crit_rate: number; /** The likelihood this attack will cause an ailment. */ ailment_chance: number; /** The likelihood this attack will cause the target Pokémon to flinch. */ flinch_chance: number; /** The likelihood this attack will cause a stat change in the target Pokémon. */ stat_chance: number; } /** * The flavor text of this move. */ interface MoveFlavorText { /** The localized flavor text for an API resource in a specific language. */ flavor_text: string; /** The language this name is in. */ language: NamedAPIResource; /** The version group that uses this flavor text. */ version_group: NamedAPIResource; } /** * A detail of moves this move can be used before or after, granting additional appeal points in super contests. */ interface ContestComboDetail { /** A list of moves to use before this move. */ use_before: NamedAPIResource[] | null; /** A list of moves to use after this move. */ use_after: NamedAPIResource[] | null; } /** * A detail of normal and super contest combos that require this move. */ interface ContestComboSets { /** A detail of moves this move can be used before or after, granting additional appeal points in contests. */ normal: ContestComboDetail; /** A detail of moves this move can be used before or after, granting additional appeal points in super contests. */ super: ContestComboDetail; } /** * ## Move * Moves are the skills of Pokémon in battle. In battle, a Pokémon uses one move each turn. * Some moves (including those learned by Hidden Machine) can be used outside of battle as well, * usually for the purpose of removing obstacles or exploring new areas. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Move) for greater detail. */ interface Move { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** The percent value of how likely this move is to be successful. */ accuracy: number | null; /** The percent value of how likely it is this move's effect will happen. */ effect_chance: number | null; /** Power points. The number of times this move can be used. */ pp: number | null; /** * A value between -8 and 8. Sets the order in which moves are executed during battle. * See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Priority) for greater detail. */ priority: -8 | -7 | -6 | -5 | -4 | -3 | -2 | -1 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; /** The base power of this move with a value of 0 if it does not have a base power. */ power: number | null; /** A detail of normal and super contest combos that require this move. */ contest_combos: ContestComboSets | null; /** The type of appeal this move gives a Pokémon when used in a contest. */ contest_type: NamedAPIResource | null; /** The effect the move has when used in a contest. */ contest_effect: APIResource | null; /** The type of damage the move inflicts on the target, e.g. physical. */ damage_class: NamedAPIResource | null; /** The effect of this move listed in different languages. */ effect_entries: VerboseEffect[]; /** The list of previous effects this move has had across version groups of the games. */ effect_changes: AbilityEffectChange[]; /** The flavor text of this move listed in different languages. */ flavor_text_entries: MoveFlavorText[]; /** The generation in which this move was introduced. */ generation: NamedAPIResource; /** A list of the machines that teach this move. */ machines: MachineVersionDetail[]; /** Metadata about this move. */ meta: MoveMetaData | null; /** The name of this resource listed in different languages. */ names: Name[]; /** A list of move resource value changes across version groups of the game. */ past_values: PastMoveStatValues[]; /** A list of stats this move affects and by how much. */ stat_changes: MoveStatChange[]; /** The effect the move has when used in a super contest. */ super_contest_effect: APIResource | null; /** The type of target that will receive the effects of the attack. */ target: NamedAPIResource; /** The elemental type of this move. */ type: NamedAPIResource; /** A list of Pokémon that learned this move. */ learned_by_pokemon: NamedAPIResource[]; } //#endregion //#region src/models/game/generation.d.ts /** * ## Generation * A generation is a grouping of the Pokémon games that separates them based on the Pokémon they include. * In each generation, a new set of Pokémon, Moves, Abilities and Types that did not exist in the previous generation are released. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Generation) for greater detail. */ interface Generation { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** A list of abilities that were introduced in this generation. */ abilities: NamedAPIResource[]; /** The name of this resource listed in different languages. */ names: Name[]; /** The main region travelled in this generation. */ main_region: NamedAPIResource; /** A list of moves that were introduced in this generation. */ moves: NamedAPIResource[]; /** A list of Pokémon species that were introduced in this generation. */ pokemon_species: NamedAPIResource[]; /** A list of types that were introduced in this generation. */ types: NamedAPIResource[]; /** A list of version groups that were introduced in this generation. */ version_groups: NamedAPIResource[]; } //#endregion //#region src/models/location/region.d.ts /** * ## Region * A region is an organized area of the Pokémon world. * Most often, the main difference between regions is * the species of Pokémon that can be encountered within them. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Region) for greater detail. */ type Region = { /** The identifier for this resource. */ id: number; /** A list of locations that can be found in this region. */ locations: NamedAPIResource[]; /** The name for this resource. */ name: string; /** The name of this resource listed in different languages. */ names: Name[]; /** The generation this region was introduced in. */ main_generation: NamedAPIResource; /** A list of Pokédexes that catalogue Pokémon in this region. */ pokedexes: NamedAPIResource[]; /** A list of version groups where this region can be visited. */ version_groups: NamedAPIResource[]; }; //#endregion //#region src/models/game/version.d.ts /** * ## Version * Versions of the games, e.g. Red, Blue or Yellow. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Core_series) for greater detail. */ interface Version { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** The name of this resource listed in different languages. */ names: Name[]; /** The version group this version belongs to. */ version_group: NamedAPIResource; } /** * ## Version Group * Version groups categorize highly similar versions of the games. */ interface VersionGroup { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** Order for sorting. Almost by date of release, except similar versions are grouped together. */ order: number; /** The generation this version was introduced in. */ generation: NamedAPIResource; /** A list of methods in which Pokémon can learn moves in this version group. */ move_learn_methods: NamedAPIResource[]; /** A list of Pokédexes introduced in this version group. */ pokedexes: NamedAPIResource[]; /** A list of regions that can be visited in this version group. */ regions: NamedAPIResource[]; /** The versions this version group owns. */ versions: NamedAPIResource[]; } //#endregion //#region src/models/common/flavor-text.d.ts /** * The localized flavor text for an API resource in a specific language. */ interface FlavorText { /** The localized flavor text for an API resource in a specific language. */ flavor_text: string; /** The language this name is in. */ language: NamedAPIResource; /** The game version this flavor text appears in. */ version: NamedAPIResource; } //#endregion //#region src/models/common/generation.d.ts /** * The generation relevant to this game index. */ interface GenerationGameIndex { /** The internal id of an API resource within game data. */ game_index: number; /** The generation relevant to this game index. */ generation: NamedAPIResource; } //#endregion //#region src/models/machine/machine.d.ts /** * ## Machine * Machines are the representation of items that teach moves to Pokémon. * They vary from version to version, so it is not certain that one specific * [TM (Technical Machine)](https://bulbapedia.bulbagarden.net/wiki/TM) or * [HM (Hidden Machine)](https://bulbapedia.bulbagarden.net/wiki/HM) corresponds to a single Machine. */ type Machine = { /** The identifier for this resource. */ id: number; /** The TM or HM item that corresponds to this machine. */ item: NamedAPIResource; /** The move that is taught by this machine. */ move: NamedAPIResource; /** The version group that this machine applies to. */ version_group: NamedAPIResource; }; //#endregion //#region src/models/common/machine.d.ts /** * The machine that teaches a move from an item. */ interface MachineVersionDetail { /** The machine that teaches a move from an item. */ machine: APIResource; /** The version group of this specific machine. */ version_group: NamedAPIResource; } //#endregion //#region src/models/common/verbose.d.ts /** * The localized effect for an API resource. */ interface VerboseEffect { /** The localized effect text for an API resource in a specific language. */ effect: string; /** The localized effect text in brief. */ short_effect: string; /** The language this effect is in. */ language: NamedAPIResource; } //#endregion //#region src/models/common/version.d.ts /** * Encounters and their specific details. */ interface VersionEncounterDetail { /** The game version this encounter happens in. */ version: NamedAPIResource; /** The total percentage of all encounter potential. */ max_chance: number; /** A list of encounters and their specifics. */ encounter_details: Encounter[]; } /** * The internal id and version of an API resource. */ interface VersionGameIndex { /** The internal id of an API resource within game data. */ game_index: number; /** The version relevant to this game index. */ version: NamedAPIResource; } /** * The flavor text of an API resource. */ interface VersionGroupFlavorText { /** The localized name for an API resource in a specific language. */ text: string; /** The language this name is in. */ language: NamedAPIResource; /** The version group which uses this flavor text. */ version_group: NamedAPIResource; } //#endregion //#region src/models/berry/berry.d.ts /** * ## Berry * Berries are small fruits that can provide HP and status condition restoration, * stat enhancement, and even damage negation when eaten by Pokémon. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Berry) for greater detail. */ type Berry = { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: string; /** Time it takes the tree to grow one stage, in hours. Berry trees go through four of these growth stages before they can be picked. */ growth_time: number; /** The maximum number of these berries that can grow on one tree in Generation IV. */ max_harvest: number; /** The power of the move "Natural Gift" when used with this Berry. */ natural_gift_power: number; /** The size of this Berry, in millimeters. */ size: number; /** The smoothness of this Berry, used in making Pokéblocks or Poffins. */ smoothness: number; /** The speed at which this Berry dries out the soil as it grows. A higher rate means the soil dries more quickly. */ soil_dryness: number; /** The firmness of this berry, used in making Pokéblocks or Poffins. */ firmness: NamedAPIResource; /** A list of references to each flavor a berry can have and the potency of each of those flavors in regard to this berry. */ flavors: BerryFlavorMap[]; /** Berries are actually items. This is a reference to the item specific data for this berry. */ item: NamedAPIResource; /** The type inherited by "Natural Gift" when used with this Berry. */ natural_gift_type: NamedAPIResource; }; /** * Reference to the flavor a berry can have and the potency of each of those flavors in regard to this berry. */ type BerryFlavorMap = { /** How powerful the referenced flavor is for this berry. */ potency: number; /** The referenced berry flavor. */ flavor: NamedAPIResource; }; /** * ## Berry Flavor * Flavors determine whether a Pokémon will benefit or suffer from eating a berry based on its nature. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Flavor) for greater detail. */ type BerryFlavor = { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: "spicy" | "dry" | "sweet" | "bitter" | "sour"; /** A list of the berries with this flavor. */ berries: FlavorBerryMap[]; /** The contest type that correlates with this berry flavor. */ contest_type: NamedAPIResource; /** The name of this resource listed in different languages. */ names: Name[]; }; /** * Berry with the given flavor. */ type FlavorBerryMap = { /** How powerful the referenced flavor is for this berry. */ potency: number; /** The berry with the referenced flavor. */ berry: NamedAPIResource; }; /** * ## Berry Firmness * Berries can be soft, very soft, hard, super hard or very hard. * * - See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Category:Berries_by_firmness) for greater detail. */ type BerryFirmness = { /** The identifier for this resource. */ id: number; /** The name for this resource. */ name: "very-soft" | "soft" | "hard" | "very-hard" | "super-hard"; /** A list of the berries with this firmness. */ berries: NamedAPIResource[]; /** The name of this resource listed in different languages. */ names: Name[]; }; //#endregion //#region src/config/cache.d.ts /** * ## Cache Store * The contract a client uses to cache responses, keyed by request URL. * * Every method may return a promise, so remote backends (Redis, KV stores) work * as-is. Values cross this boundary as parsed objects; expiry is the store's own * business. */ interface CacheStore { get(key: string): unknown | Promise; set(key: string, value: unknown): void | Promise; delete?(key: string): void | Promise; clear?(): void | Promise; } /** * ## Memory Cache Options * Used to configure the default in-memory store. */ interface MemoryCacheOptions { /** How long a cached response stays fresh, in milliseconds. Defaults to 5 minutes. */ ttl?: number; /** * Maximum number of responses kept. The least recently used entry is evicted. * Defaults to 500; zero keeps none. */ maxEntries?: number; } /** * ## Memory Cache * The default {@link CacheStore}: a bounded, time-to-live cache held in memory. * * Values are stored and returned by reference — mutating a response also mutates * what later cache hits return, so treat responses as read-only. */ declare class MemoryCache implements CacheStore { private readonly entries; private readonly ttl; private readonly maxEntries; constructor(options?: MemoryCacheOptions); get(key: string): unknown; set(key: string, value: unknown): void; delete(key: string): void; clear(): void; } /** * ## Etag Entry * What a URL last answered with, and the validator that says so. */ interface EtagEntry { /** The `ETag` the response carried. */ etag: string; /** The parsed body that `etag` identifies. */ value: unknown; } /** * ## Etag Store Options * Used to configure an {@link EtagStore}. */ interface EtagStoreOptions { /** * How many URLs to remember. The least recently used is evicted. Defaults to * 500; zero remembers none. */ maxEntries?: number; } /** * ## Etag Store * Remembers the `ETag` each URL answered with, and the body it identified, so an * expired cache entry can be revalidated instead of downloaded again. * * Deliberately not a {@link CacheStore}: the two answer different questions. A * `CacheStore` says "this response is still fresh, use it"; this says "here is * what the response was last time, ask the server whether it still holds". They * are kept apart so that a store someone else owns — a shared Redis — is never * given a second key shape, and `cache.get(url)` keeps returning the resource * itself. * * Entries live in memory and are never persisted: an `ETag` is only worth what * the body beside it is, and the body is what would cost memory to keep. */ declare class EtagStore { private readonly entries; private readonly maxEntries; constructor(options?: EtagStoreOptions); get(url: string): EtagEntry | undefined; set(url: string, entry: EtagEntry): void; clear(): void; } /** * ## Web Storage Like * The part of the browser's `Storage` interface a {@link WebStorageCache} uses. * * Declared structurally rather than as the DOM's `Storage`: the package compiles * without `lib.dom`, and stays usable anywhere the same shape exists. * * Every method may return a promise, so a React Native `AsyncStorage` works as-is. * Key enumeration is the one place the two shapes differ: `Storage` exposes * `length` and `key(index)`, `AsyncStorage` exposes `getAllKeys`, and a property * cannot be awaited — so both are accepted, and a storage offering neither still * caches; it just never evicts or clears. */ interface WebStorageLike { getItem(key: string): string | null | Promise; setItem(key: string, value: string): void | Promise; removeItem(key: string): void | Promise; /** Every key held, this store's and the application's alike. */ getAllKeys?(): readonly string[] | Promise; key?(index: number): string | null; readonly length?: number; } /** * ## Web Storage Cache Options * Used to configure a store backed by `localStorage` or `sessionStorage`. */ interface WebStorageCacheOptions { /** * Where entries are kept. Pass `localStorage`, `sessionStorage`, a React Native * `AsyncStorage`, or anything else matching {@link WebStorageLike}. */ storage: WebStorageLike; /** How long a cached response stays fresh, in milliseconds. Defaults to 5 minutes. */ ttl?: number; /** Namespace for the keys this store writes. Defaults to `pokenode:`. */ prefix?: string; } /** * ## Web Storage Cache * A {@link CacheStore} backed by `localStorage` or `sessionStorage`, so a cached * response survives a page reload. * * ```ts * const api = new PokemonClient({ cache: new WebStorageCache({ storage: localStorage }) }); * ``` * * Only keys under {@link WebStorageCacheOptions.prefix} are ever read, evicted or * cleared — the storage is assumed to be shared with the surrounding application. * * Values round-trip through JSON, so unlike {@link MemoryCache} every hit returns a * fresh copy. Anything a `JSON.stringify` cannot represent does not survive, which * covers every PokéAPI response. * * A storage that throws instead of answering is treated as empty: a read is a miss * and a write is dropped, because neither is worth failing the request that * triggered it over. */ declare class WebStorageCache implements CacheStore { private readonly storage; private readonly ttl; private readonly prefix; constructor(options: WebStorageCacheOptions); get(key: string): Promise; set(key: string, value: unknown): Promise; delete(key: string): Promise; clear(): Promise; /** Reads a namespaced key, treating unreadable content as a miss. */ private read; /** * Frees space by dropping expired entries, falling back to the ones closest to * expiring when nothing has expired yet. */ private evict; /** * Collects this store's keys before any removal: `key(index)` walks a list that * shifts underneath a loop that deletes as it goes. */ private ownKeys; /** * Every key the storage holds, however it is willing to list them. A storage * offering no enumeration at all reports none, which leaves eviction and * `clear` as no-ops rather than an error on a path that only tidies up. */ private allKeys; /** Removes a key on a path that is only tidying up, where a refusal is moot. */ private remove; } //#endregion //#region src/config/logger.d.ts /** * Fields shared by every payload. * * The text is carried twice on purpose. pino, bunyan and roarr read `msg`; * winston reads `message`. Sending both is what lets a logger from either family * be passed straight in, with no adapter to write and nothing logged as * `undefined`. */ interface LogFields { /** Which point of the request lifecycle this is, for filtering. */ event: "request" | "response" | "retry" | "cancelled" | "error"; msg: string; message: string; /** The request URL, with any credentials the base URL carried removed. */ url: string; } /** * ## Log Request Payload * A request is about to be resolved, from cache or over the network. */ interface LogRequestPayload extends LogFields { event: "request"; /** The HTTP method, uppercase, as RFC 9110 and OpenTelemetry both expect. */ method: string; } /** * ## Log Response Payload * A response was produced. */ interface LogResponsePayload extends LogFields { event: "response"; status: number; /** * Where the response came from. * * - `network` — a round trip was made. * - `cache` — served by the {@link CacheStore}; nothing left the process. * - `in-flight` — an identical request was already on the wire and this caller * shared it, so it made no round trip of its own. * - `revalidated` — a round trip was made, the API answered 304, and the body * already held for that URL was reused. Cheap, but not free. * * Counting `network` and `revalidated` gives the number of requests the * PokéAPI actually saw. Every caller reports, so counting all four gives the * number of calls the application made. */ source: "network" | "cache" | "in-flight" | "revalidated"; /** How long the client took to resolve the request, in milliseconds. */ durationMs: number; } /** * ## Log Retry Payload * An attempt failed and another one is coming. * * Only emitted when `retry` is configured, and never for the attempt that gives * up — that one is a `response` or an `error` like any other. Counting these * gives the round trips the PokéAPI saw beyond the ones it answered. */ interface LogRetryPayload extends LogFields { event: "retry"; /** Which attempt just failed, counting from one. */ attempt: number; /** How long the client will wait before the next one, in milliseconds. */ delayMs: number; /** The status that failed. Absent when the attempt never got a response. */ status?: number; } /** * ## Log Cancelled Payload * A request was cancelled by the scope it was made through. * * A caller that hangs up asked for this, so it is not a failure and does not * reach `error`: a handler that scopes every request would otherwise report its * own timeouts as its error rate. Counting `response` and `cancelled` together * accounts for every `request` logged. */ interface LogCancelledPayload extends LogFields { event: "cancelled"; /** `signal.reason`, or the `TimeoutError` a scoped timeout raised. */ reason: unknown; /** How long the request had been running when it was cancelled, in milliseconds. */ durationMs: number; } /** * ## Log Error Payload * A request failed. * * The error is carried twice for the same reason the message is: pino runs its * error serializer on `err` and nothing else, so an `Error` under any other key * would reach the log as `{}` — no message, no stack. */ interface LogErrorPayload extends LogFields { event: "error"; /** Whatever `fetch` or the API produced. */ err: unknown; error: unknown; } /** * ## Logger * Where a client reports what it did. * * Deliberately the shape every logging library already has, so one can be passed * without glue: * * ```ts * new PokemonClient({ logger: pino() }); * new PokemonClient({ logger: console }); * new PokemonClient({ logger: winston.createLogger() }); * ``` * * Requests, responses and cancellations go to `debug`; failures go to `error`. * Nothing is logged unless a logger is passed, and a client never picks a level * of its own. */ interface Logger { debug(payload: LogRequestPayload | LogResponsePayload | LogRetryPayload | LogCancelledPayload): void; error(payload: LogErrorPayload): void; } /** * A {@link Logger} that writes the request lifecycle to the console as one * formatted line per event. * * `console` itself is a valid {@link Logger} and logs the payload as an object; * this is for when the terminal should stay readable. */ declare const consoleLogger: Logger; //#endregion //#region src/constants/berries.d.ts /** Enum of Berries (NAME - ID) */ declare const BERRIES: { readonly CHERI: 1; readonly CHESTO: 2; readonly PECHA: 3; readonly RAWST: 4; readonly ASPEAR: 5; readonly LEPPA: 6; readonly ORAN: 7; readonly PERSIM: 8; readonly LUM: 9; readonly SITRUS: 10; readonly FIGY: 11; readonly WIKI: 12; readonly MAGO: 13; readonly AGUAV: 14; readonly IAPAPA: 15; readonly RAZZ: 16; readonly BLUK: 17; readonly NANAB: 18; readonly WEPEAR: 19; readonly PINAP: 20; readonly POMEG: 21; readonly KELPSY: 22; readonly QUALOT: 23; readonly HONDEW: 24; readonly GREPA: 25; readonly TAMATO: 26; readonly CORNN: 27; readonly MAGOST: 28; readonly RABUTA: 29; readonly NOMEL: 30; readonly SPELON: 31; readonly PAMTRE: 32; readonly WATMEL: 33; readonly DURIN: 34; readonly BELUE: 35; readonly OCCA: 36; readonly PASSHO: 37; readonly WACAN: 38; readonly RINDO: 39; readonly YACHE: 40; readonly CHOPLE: 41; readonly KEBIA: 42; readonly SHUCA: 43; readonly COBA: 44; readonly PAYAPA: 45; readonly TANGA: 46; readonly CHARTI: 47; readonly KASIB: 48; readonly HABAN: 49; readonly COLBUR: 50; readonly BABIRI: 51; readonly CHILAN: 52; readonly LIECHI: 53; readonly GANLON: 54; readonly SALAC: 55; readonly PETAYA: 56; readonly APICOT: 57; readonly LANSAT: 58; readonly STARF: 59; readonly ENIGMA: 60; readonly MICLE: 61; readonly CUSTAP: 62; readonly JABOCA: 63; readonly ROWAP: 64; readonly KEE: 65; readonly MARANGA: 66; readonly HOPO: 67; readonly ROSELI: 68; }; /** Enum of Berry Firmnesses (NAME - ID) */ declare const BERRY_FIRMNESSES: { readonly VERY_SOFT: 1; readonly SOFT: 2; readonly HARD: 3; readonly VERY_HARD: 4; readonly SUPER_HARD: 5; }; declare const BERRY_FLAVORS: { readonly SPICY: 1; readonly DRY: 2; readonly SWEET: 3; readonly BITTER: 4; readonly SOUR: 5; }; //#endregion //#region src/constants/contests.d.ts declare const CONTEST_TYPES: { readonly COOL: 1; readonly BEAUTY: 2; readonly CUTE: 3; readonly SMART: 4; readonly TOUGH: 5; }; //#endregion //#region src/constants/currencies.d.ts declare const CURRENCIES: { readonly POKE_DOLLAR: 1; readonly COIN: 2; readonly VOLCANIC_ASH: 3; readonly POKE_COUPON: 4; readonly BERRY_POWDER: 5; readonly BATTLE_POINT: 6; readonly SPHERE: 7; readonly CASTLE_POINT: 8; readonly WATT: 9; readonly ATHLETE_POINT: 10; readonly DREAM_POINT: 11; readonly DREAM_WORLD_BERRY: 12; readonly POKE_MILE: 13; readonly FESTIVAL_COIN: 14; readonly POKE_BEAN: 15; readonly HOME_POINT: 16; readonly MERIT_POINT: 17; readonly LEAGUE_POINT: 18; readonly BLUEBERRY_POINT: 19; }; //#endregion //#region src/constants/encounters.d.ts declare const ENCOUNTER_METHODS: { readonly WALK: 1; readonly OLD_ROD: 2; readonly GOOD_ROD: 3; readonly SUPER_ROD: 4; readonly SURF: 5; readonly ROCK_SMASH: 6; readonly HEADBUTT: 7; readonly DARK_GRASS: 8; readonly GRASS_SPOTS: 9; readonly CAVE_SPOTS: 10; readonly BRIDGE_SPOTS: 11; readonly SUPER_ROD_SPOTS: 12; readonly SURF_SPOTS: 13; readonly YELLOW_FLOWERS: 14; readonly PURPLE_FLOWERS: 15; readonly RED_FLOWERS: 16; readonly ROUGH_TERRAIN: 17; readonly GIFT: 18; readonly GIFT_EGG: 19; readonly STATIC: 20; readonly POKEFLUTE: 21; readonly HEADBUTT_LOW: 22; readonly HEADBUTT_NORMAL: 23; readonly HEADBUTT_HIGH: 24; readonly SQUIRT_BOTTLE: 25; readonly WAILMER_PAIL: 26; readonly SEAWEED: 27; readonly ROAMING_GRASS: 28; readonly ROAMING_WATER: 29; readonly DEVON_SCOPE: 30; readonly FEEBAS_TILE_FISHING: 31; readonly ISLAND_SCAN: 32; readonly SOS: 33; readonly BUBBLING_SPOTS: 34; readonly BERRY_TREES: 35; readonly NPC_TRADE: 36; readonly SOS_FROM_BUBBLING_SPOT: 37; readonly OVERWORLD: 38; readonly OVERWORLD_WATER: 39; readonly OVERWORLD_FLYING: 40; readonly OVERWORLD_SPECIAL: 41; readonly OVERWORLD_FLYING_SPECIAL: 42; readonly OVERWORLD_WATER_SPECIAL: 43; readonly HORDE: 44; readonly COLOSSEUM_BONUS_DISC_US: 45; readonly COLOSSEUM_BONUS_DISC_JPN: 46; readonly POKEMON_CHANNEL_PAL: 47; readonly POKEMON_RANGER: 48; readonly POKEMON_BATTLE_REVOLUTION: 49; readonly NEW_YORK_POKECENTER_WISH_EGGS: 50; readonly SNAG: 51; readonly SNAG_REMATCH: 52; readonly POKESPOT: 53; readonly HIDDEN_GROTTO: 54; readonly HONEY_TREE: 55; readonly OVERWORLD_DIRT: 56; readonly WANDERER: 57; readonly WANDERER_WATER: 58; readonly CHASE_WATER: 59; readonly DYNAMAX_ADVENTURE: 60; readonly MAX_RAID: 61; readonly TRASH_CAN_AMBUSH: 62; readonly RUSTLING_BUSH_AMBUSH: 63; readonly CEILING_AMBUSH: 64; readonly GROUND_AMBUSH: 65; readonly SKY_AMBUSH: 66; /** * @deprecated Misspelled: the endpoint names this `headbutt-high`. * Use {@link ENCOUNTER_METHODS.HEADBUTT_HIGH}. Removed in 3.0. */ readonly HEADBUT_HIGH: 24; /** * @deprecated The endpoint names this `static` now. * Use {@link ENCOUNTER_METHODS.STATIC}. Removed in 3.0. */ readonly ONLY_ONE: 20; }; declare const ENCOUNTER_CONDITIONS: { readonly SWARM: 1; readonly TIME: 2; readonly RADAR: 3; readonly SLOT2: 4; readonly RADIO: 5; readonly SEASON: 6; readonly STARTER: 7; readonly TV_OPTION: 8; readonly STORY_PROGRESS: 9; readonly OTHER: 10; readonly ITEM: 11; readonly WEEKDAY: 12; readonly FIRST_PARTY_POKEMON: 13; readonly SPECIAL_ENCOUNTER: 14; readonly TRADE: 15; readonly COINS: 16; readonly FRIEND_SAFARI_SLOT: 17; readonly GREAT_MARSH_DAILY_SLOT: 18; readonly HONEY_TREE_GROUP: 19; readonly HEADBUTT_TREE: 20; readonly BACKLOT: 21; readonly BUG_CATCHING_CONTEST: 22; readonly SAVE_DATA: 23; readonly ALOLAN_DIGLETT_FOUND: 24; readonly WEATHER: 25; readonly JOHTO_SAFARI_BLOCKS: 26; readonly MAX_DEN_RARITY: 27; readonly MAX_DEN_RATING: 28; readonly BERRY_TREE_TYPE: 29; readonly TRASH_CAN_TYPE: 30; }; declare const ENCOUNTER_CONDITION_VALUES: { readonly SWARM_YES: 1; readonly SWARM_NO: 2; readonly TIME_MORNING: 3; readonly TIME_DAY: 4; readonly TIME_NIGHT: 5; readonly RADAR_ON: 6; readonly RADAR_OFF: 7; readonly SLOT2_NONE: 8; readonly SLOT2_RUBY: 9; readonly SLOT2_SAPPHIRE: 10; readonly SLOT2_EMERALD: 11; readonly SLOT2_FIRERED: 12; readonly SLOT2_LEAFGREEN: 13; readonly RADIO_OFF: 14; readonly RADIO_HOENN: 15; readonly RADIO_SINNOH: 16; readonly SEASON_SPRING: 17; readonly SEASON_SUMMER: 18; readonly SEASON_AUTUMN: 19; readonly SEASON_WINTER: 20; readonly STARTER_BULBASAUR: 21; readonly STARTER_SQUIRTLE: 22; readonly STARTER_CHARMANDER: 23; readonly STARTER_CHESPIN: 24; readonly STARTER_FENNEKIN: 25; readonly STARTER_FROAKIE: 26; readonly TV_OPTION_BLUE: 27; readonly TV_OPTION_RED: 28; readonly STORY_PROGRESS_AWAKENED_BEASTS: 29; readonly STORY_PROGRESS_BEAT_GALACTIC_CORONET: 30; readonly STORY_PROGRESS_OAK_ETERNA_CITY: 31; readonly STORY_PROGRESS_VERMILION_COPYCAT: 32; readonly STORY_PROGRESS_MET_TORNADUS_THUNDURUS: 33; readonly STORY_PROGRESS_BEAT_ELITE_FOUR_ROUND_TWO: 34; readonly STORY_PROGRESS_HALL_OF_FAME: 35; readonly STORY_PROGRESS_NONE: 36; readonly STORY_PROGRESS_NATIONAL_DEX: 37; readonly OTHER_NONE: 38; readonly OTHER_SNORLAX_11_BEAT_LEAGUE: 39; readonly OTHER_VIRTUAL_CONSOLE: 40; readonly STORY_PROGRESS_CURE_ELDRITCH_NIGHTMARES: 41; readonly OTHER_TALK_TO_CYNTHIAS_GRANDMOTHER: 42; readonly ITEM_NONE: 43; readonly ITEM_ADAMANT_ORB: 44; readonly ITEM_LUSTROUS_ORB: 45; readonly ITEM_HELIX_FOSSIL: 46; readonly ITEM_DOME_FOSSIL: 47; readonly ITEM_OLD_AMBER: 48; readonly ITEM_ROOT_FOSSIL: 49; readonly ITEM_CLAW_FOSSIL: 50; readonly STORY_PROGRESS_DEFEAT_JUPITER: 51; readonly STORY_PROGRESS_BEAT_TEAM_GALACTIC_IRON_ISLAND: 52; readonly OTHER_CORRECT_PASSWORD: 53; readonly STORY_PROGRESS_ZEPHYR_BADGE: 54; readonly STORY_PROGRESS_BEAT_RED: 55; readonly OTHER_RECEIVED_KANTO_STARTER: 56; readonly STORY_PROGRESS_RECEIVE_TM_FROM_CLAIRE: 57; readonly OTHER_REGIROCK_REGICE_REGISTEEL_IN_PARTY: 58; readonly WEEKDAY_SUNDAY: 59; readonly WEEKDAY_MONDAY: 60; readonly WEEKDAY_TUESDAY: 61; readonly WEEKDAY_WEDNESDAY: 62; readonly WEEKDAY_THURSDAY: 63; readonly WEEKDAY_FRIDAY: 64; readonly WEEKDAY_SATURDAY: 65; readonly FIRST_PARTY_POKEMON_HIGH_FRIENDSHIP: 66; readonly STORY_PROGRESS_DEFEAT_MARS: 67; readonly ITEM_ODD_KEYSTONE: 68; readonly OTHER_TALKED_TO_32_PEOPLE_UNDERGROUND: 69; readonly STORY_PROGRESS_RETURNED_MACHINE_PART: 70; readonly OTHER_EVENT_ARCEUS_IN_PARTY: 71; readonly SPECIAL_ENCOUNTER_COULDNT_CAPTURE_BEFORE: 72; readonly ITEM_ICE_KEY: 73; readonly ITEM_IRON_KEY: 74; readonly STORY_PROGRESS_JUNIPER_CAVE_OF_BEING: 75; readonly ITEM_LUNAR_WING: 76; readonly STORY_PROGRESS_QUAKE_BADGE: 77; readonly ITEM_LIGHT_STONE: 78; readonly ITEM_DARK_STONE: 79; readonly OTHER_CAPTURED_RESHIRAM_OR_ZEKROM: 80; readonly DEFEATED_GHETSIS: 81; readonly OTHER_FOUND_11_TIMES_ROAMING: 82; readonly TIME_MINUTE_00_TO_19: 83; readonly TIME_MINUTE_20_TO_39: 84; readonly TIME_MINUTE_40_TO_59: 85; readonly TIME_04_00_TO_19_59: 86; readonly TIME_20_00_TO_21_59: 87; readonly TIME_21_00_TO_03_59: 88; readonly ITEM_TIDAL_BELL: 89; readonly ITEM_CLEAR_BELL: 90; readonly STORY_PROGRESS_DEFEATED_GROUDON_OR_KYOGRE: 91; readonly OTHER_UXIE_MESPRIT_AZELF_IN_PARTY: 92; readonly OTHER_NICKNAMED_COLD_ITEM_REGICE_REGIROCK_REGISTEEL3: 93; readonly OTHER_DIALGA_OR_PALKIA_IN_PARTY: 94; readonly OTHER_CASTFORM_IN_PARTY: 95; readonly OTHER_LEVEL_100_POKEMON_IN_PARTY: 96; readonly OTHER_TORNADUS_THUNDURUS_IN_PARTY: 97; readonly OTHER_RESHIRAM_ZEKROM_IN_PARTY: 98; readonly OTHER_CAPTURED_ALL_ULTRA_BEASTS: 99; readonly STORY_PROGRESS_FINISHED_LOOKER_SIDEQUEST: 100; readonly STORY_PROGRESS_BEAT_OLIVIAS_TRIAL: 101; readonly OTHER_RAIKOU_ENTEI_IN_PARTY: 102; readonly OTHER_GROUDON_KYOGRE_IN_PARTY: 103; readonly OTHER_DIALGA_PALKIA_IN_PARTY: 104; readonly OTHER_SCAN_QR_CODE: 105; readonly OTHER_CAUGHT_ARTICUNO: 106; readonly OTHER_CAUGHT_ZAPDOS: 107; readonly OTHER_CAUGHT_MOLTRES: 108; readonly TRADE_TOGEPI_OR_TOGETIC: 109; readonly TRADE_TRAPINCH: 110; readonly TRADE_SURSKIT: 111; readonly TRADE_WOOPER: 112; readonly STORY_PROGRESS_CATCH_ALL_SHADOW_POKEMON: 113; readonly OTHER_COMPLETE_MT_BATTLE: 114; readonly COINS_180: 115; readonly COINS_500: 116; readonly COINS_1200: 117; readonly COINS_2800: 118; readonly COINS_5500: 119; readonly COINS_9999: 120; readonly COINS_120: 121; readonly COINS_750: 122; readonly COINS_2500: 123; readonly COINS_4600: 124; readonly COINS_6500: 125; readonly COINS_230: 126; readonly COINS_1000: 127; readonly COINS_2680: 128; readonly COINS_3333: 129; readonly COINS_6666: 130; readonly COINS_200: 131; readonly COINS_700: 132; readonly COINS_2100: 133; readonly COINS_100: 134; readonly COINS_800: 135; readonly COINS_1500: 136; readonly COINS_2222: 137; readonly COINS_5555: 138; readonly COINS_8888: 139; readonly COINS_150: 140; readonly COINS_620: 141; readonly COINS_2880: 142; readonly COINS_5400: 143; readonly COINS_8300: 144; readonly TRADE_ABRA: 145; readonly TRADE_NIDORAN_M: 146; readonly TRADE_NIDORINO: 147; readonly TRADE_SLOWBRO: 148; readonly TRADE_POLIWHIRL: 149; readonly TRADE_SPEAROW: 150; readonly TRADE_RAICHU: 151; readonly TRADE_VENONAT: 152; readonly TRADE_PONYTA: 153; readonly TRADE_CLEFAIRY: 154; readonly TRADE_CUBONE: 155; readonly TRADE_LICKITUNG: 156; readonly TRADE_TANGELA: 157; readonly TRADE_GOLDUCK: 158; readonly TRADE_GROWLITHE: 159; readonly TRADE_KANGASKHAN: 160; readonly TRADE_BELLSPROUT: 161; readonly TRADE_DROWZEE: 162; readonly TRADE_KRABBY: 163; readonly TRADE_DRAGONAIR: 164; readonly TRADE_CHANSEY: 165; readonly TRADE_GLOOM: 166; readonly TRADE_HAUNTER: 167; readonly TRADE_DUGTRIO: 168; readonly TRADE_SLAKOTH: 169; readonly TRADE_PIKACHU: 170; readonly TRADE_BELLOSSOM: 171; readonly TRADE_RALTS: 172; readonly TRADE_VOLBEAT: 173; readonly TRADE_BAGON: 174; readonly TRADE_SKITTY: 175; readonly FRIEND_SAFARI_SLOT_1: 176; readonly FRIEND_SAFARI_SLOT_2: 177; readonly FRIEND_SAFARI_SLOT_3: 178; readonly ITEM_SKULL_FOSSIL: 179; readonly ITEM_ARMOR_FOSSIL: 180; readonly GREAT_MARSH_DAILY_SLOT_NONE: 181; readonly GREAT_MARSH_DAILY_SLOT_1_OF_32: 182; readonly GREAT_MARSH_DAILY_SLOT_2_OF_32: 183; readonly GREAT_MARSH_DAILY_SLOT_3_OF_32: 184; readonly GREAT_MARSH_DAILY_SLOT_5_OF_32: 185; readonly STORY_PROGRESS_BEFORE_NATIONAL_DEX: 186; readonly GREAT_MARSH_DAILY_SLOT_4_OF_32: 187; readonly GREAT_MARSH_DAILY_SLOT_15_OF_32: 188; readonly HONEY_TREE_GROUP_A: 189; readonly HONEY_TREE_GROUP_B: 190; readonly HONEY_TREE_GROUP_C: 191; readonly HEADBUTT_TREE_COMMON: 192; readonly HEADBUTT_TREE_RARE: 193; readonly HEADBUTT_TREE_SECRET: 194; readonly TRADE_COTTONEE: 195; readonly TRADE_PETILIL: 196; readonly TRADE_EMOLGA: 197; readonly TRADE_MANTINE: 198; readonly TRADE_DITTO: 199; readonly TRADE_EXCADRILL: 200; readonly TRADE_HIPPOWDON: 201; readonly BACKLOT_NOT_MENTIONED: 202; readonly BACKLOT_MENTIONED: 203; readonly BUG_CATCHING_CONTEST_NO: 204; readonly BUG_CATCHING_CONTEST_YES: 205; readonly SAVE_DATA_FROM_LETS_GO_PIKACHU: 206; readonly SAVE_DATA_FROM_LETS_GO_EEVEE: 207; readonly ITEM_FOSSILIZED_BIRD: 208; readonly ITEM_FOSSILIZED_DRAKE: 209; readonly ITEM_FOSSILIZED_DINO: 210; readonly ITEM_FOSSILIZED_FISH: 211; readonly STORY_PROGRESS_MASTER_DOJO_COMPLETE_FIRST_TRIAL: 212; readonly STORY_PROGRESS_MASTER_DOJO_COMPLETE_THIRD_TRIAL: 213; readonly ALOLAN_DIGLETT_FOUND_5: 214; readonly ALOLAN_DIGLETT_FOUND_10: 215; readonly ALOLAN_DIGLETT_FOUND_20: 216; readonly ALOLAN_DIGLETT_FOUND_30: 217; readonly ALOLAN_DIGLETT_FOUND_40: 218; readonly ALOLAN_DIGLETT_FOUND_50: 219; readonly ALOLAN_DIGLETT_FOUND_75: 220; readonly ALOLAN_DIGLETT_FOUND_100: 221; readonly ALOLAN_DIGLETT_FOUND_150: 222; readonly STARTER_GROOKEY: 223; readonly STARTER_SCORBUNNY: 224; readonly STARTER_SOBBLE: 225; readonly STORY_PROGRESS_SAVE_VILLAGE_FROM_GLASTRIER_SPECTRIER: 226; readonly STORY_PROGRESS_CATCH_FIVE_ULTRA_BEASTS: 227; readonly TRADE_BUNNELBY: 228; readonly TRADE_MEOWTH_GALAR: 229; readonly TRADE_MINCCINO: 230; readonly TRADE_TOXEL: 231; readonly TRADE_MARACTUS: 232; readonly TRADE_YAMASK_GALAR: 233; readonly TRADE_VANILLISH: 234; readonly TRADE_OBSTAGOON: 235; readonly TRADE_FROSMOTH: 236; readonly TRADE_FARFETCHD_GALAR: 237; readonly TRADE_CORSOLA_GALAR: 238; readonly TRADE_PONYTA_GALAR: 239; readonly TRADE_MR_MIME_GALAR: 240; readonly TRADE_DARUMAKA_GALAR: 241; readonly TRADE_ZIGZAGOON_GALAR: 242; readonly TRADE_STUNFISK_GALAR: 243; readonly TRADE_WEEZING_GALAR: 244; readonly TRADE_EXEGGUTOR: 245; readonly TRADE_MAROWAK: 246; readonly WEATHER_NORMAL: 247; readonly WEATHER_OVERCAST: 248; readonly WEATHER_RAINING: 249; readonly WEATHER_THUNDERSTORM: 250; readonly WEATHER_SNOWING: 251; readonly WEATHER_SNOWSTORM: 252; readonly WEATHER_SANDSTORM: 253; readonly WEATHER_INTENSE_SUN: 254; readonly WEATHER_FOG: 255; readonly STORY_PROGRESS_BEFORE_HALL_OF_FAME: 256; readonly JOHTO_SAFARI_BLOCKS_INACTIVE: 257; readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_2: 258; readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_3: 259; readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_4: 260; readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_5: 261; readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_6: 262; readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_10: 263; readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_12: 264; readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_14: 265; readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_15: 266; readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_24: 267; readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_28: 268; readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_35: 269; readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_49: 270; readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_3: 271; readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_4: 272; readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_5: 273; readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_8: 274; readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_10: 275; readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_14: 276; readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_15: 277; readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_18: 278; readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_20: 279; readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_28: 280; readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_35: 281; readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_42: 282; readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_49: 283; readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_56: 284; readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_3: 285; readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_4: 286; readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_5: 287; readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_6: 288; readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_8: 289; readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_10: 290; readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_15: 291; readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_21: 292; readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_24: 293; readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_28: 294; readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_35: 295; readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_42: 296; readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_49: 297; readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_56: 298; readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_63: 299; readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_2: 300; readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_3: 301; readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_4: 302; readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_5: 303; readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_6: 304; readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_7: 305; readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_8: 306; readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_9: 307; readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_10: 308; readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_12: 309; readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_13: 310; readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_14: 311; readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_15: 312; readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_16: 313; readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_18: 314; readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_20: 315; readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_24: 316; readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_28: 317; readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_35: 318; readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_42: 319; readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_49: 320; readonly ITEM_COVER_FOSSIL: 321; readonly ITEM_PLUME_FOSSIL: 322; readonly OTHER_GIRATINA_NOT_CAUGHT_IN_DISTORTION_WORLD: 323; readonly OTHER_FIND_50_CAVERN_FOOTPRINTS: 324; readonly OTHER_FIND_50_GRASSLAND_FOOTPRINTS: 325; readonly OTHER_FIND_50_IRON_WILL_FOOTPRINTS: 326; readonly OTHER_REGIROCK_REGICE_REGISTEEL_REGIELEKI_REGIDRAGO_IN_PARTY: 327; readonly OTHER_CHOOSE_REGIELEKI_PATTERN: 328; readonly OTHER_CHOOSE_REGIDRAGO_PATTERN: 329; readonly OTHER_GROW_ICEROOT_CARROT: 330; readonly OTHER_GROW_SHADEROOT_CARROT: 331; readonly OTHER_TALKED_TO_32_PEOPLE: 332; readonly OTHER_EAT_CURRY_WITH_COBALION_TERRAKION_VIRIZION: 333; readonly ITEM_REINS_OF_UNITY: 334; readonly OTHER_WITNESS_GALARIAN_BIRD_FIGHT: 335; readonly MAX_DEN_RARITY_COMMON: 336; readonly MAX_DEN_RARITY_RARE: 337; readonly MAX_DEN_RATING_1_STAR: 338; readonly MAX_DEN_RATING_2_STAR: 339; readonly MAX_DEN_RATING_3_STAR: 340; readonly MAX_DEN_RATING_4_STAR: 341; readonly MAX_DEN_RATING_5_STAR: 342; readonly MAX_DEN_RARITY_SPECIAL: 343; readonly BERRY_TREE_TYPE_RED: 344; readonly BERRY_TREE_TYPE_BLUE: 345; readonly BERRY_TREE_TYPE_PURPLE: 346; readonly BERRY_TREE_TYPE_GREEN: 347; readonly BERRY_TREE_TYPE_YELLOW: 348; readonly BERRY_TREE_TYPE_PINK: 349; readonly TRASH_CAN_TYPE_DAILY: 350; readonly TRASH_CAN_TYPE_TUESDAY: 351; readonly TRASH_CAN_TYPE_THURSDAY: 352; readonly TRADE_NIDORAN_F: 353; readonly TRADE_NIDORINA: 354; readonly TRADE_MACHOP: 355; readonly TRADE_BUIZEL: 356; readonly TRADE_MEDICHAM: 357; readonly TRADE_FINNEON: 358; readonly TRADE_FORRETRESS: 359; readonly TRADE_BONSLY: 360; readonly TRADE_ANY_POKEMON: 361; /** * @deprecated Misspelled: the endpoint names this `other-snorlax-11-beat-league`. * Use {@link ENCOUNTER_CONDITION_VALUES.OTHER_SNORLAX_11_BEAT_LEAGUE}. Removed in 3.0. */ readonly OTHER_SNORLAX_LL_BEAT_LEAGUE: 39; /** * @deprecated Misspelled: the endpoint names this `radio-hoenn`. * Use {@link ENCOUNTER_CONDITION_VALUES.RADIO_HOENN}. Removed in 3.0. */ readonly RADIO_HOEN: 15; /** * @deprecated Misspelled: the endpoint names this `slot2-sapphire`. * Use {@link ENCOUNTER_CONDITION_VALUES.SLOT2_SAPPHIRE}. Removed in 3.0. */ readonly SLOT2_SAPHIRE: 10; /** * @deprecated The endpoint names this `story-progress-vermilion-copycat` now. * Use {@link ENCOUNTER_CONDITION_VALUES.STORY_PROGRESS_VERMILION_COPYCAT}. Removed in 3.0. */ readonly STORY_PROGRESS_OAK_VERMILION_COPYCAT: 32; /** * @deprecated Misspelled: the endpoint names this `season-autumn`. * Use {@link ENCOUNTER_CONDITION_VALUES.SEASON_AUTUMN}. Removed in 3.0. */ readonly SWASON_AUTUMN: 19; }; //#endregion //#region src/constants/endpoints.d.ts /** * Endpoints of the PokéAPI */ declare const ENDPOINTS: { readonly BERRY: "/berry"; readonly BERRY_FIRMNESS: "/berry-firmness"; readonly BERRY_FLAVOR: "/berry-flavor"; readonly CONTEST_TYPE: "/contest-type"; readonly CONTEST_EFFECT: "/contest-effect"; readonly SUPER_CONTEST_EFFECT: "/super-contest-effect"; readonly CURRENCY: "/currency"; readonly ENCOUNTER_METHOD: "/encounter-method"; readonly ENCOUNTER_CONDITION: "/encounter-condition"; readonly ENCOUNTER_CONDITION_VALUE: "/encounter-condition-value"; readonly EVOLUTION_CHAIN: "/evolution-chain"; readonly EVOLUTION_TRIGGER: "/evolution-trigger"; readonly GENERATION: "/generation"; readonly POKEDEX: "/pokedex"; readonly VERSION: "/version"; readonly VERSION_GROUP: "/version-group"; readonly ITEM: "/item"; readonly ITEM_ATTRIBUTE: "/item-attribute"; readonly ITEM_CATEGORY: "/item-category"; readonly ITEM_FLING_EFFECT: "/item-fling-effect"; readonly ITEM_POCKET: "/item-pocket"; readonly LOCATION: "/location"; readonly LOCATION_AREA: "/location-area"; readonly PALPARK_AREA: "/pal-park-area"; readonly REGION: "/region"; readonly MACHINE: "/machine"; readonly MOVE: "/move"; readonly MOVE_AILMENT: "/move-ailment"; readonly MOVE_BATTLE_STYLE: "/move-battle-style"; readonly MOVE_CATEGORY: "/move-category"; readonly MOVE_DAMAGE_CLASS: "/move-damage-class"; readonly MOVE_LEARN_METHOD: "/move-learn-method"; readonly MOVE_TARGET: "/move-target"; readonly ABILITY: "/ability"; readonly CHARACTERISTIC: "/characteristic"; readonly EGG_GROUP: "/egg-group"; readonly GENDER: "/gender"; readonly GROWTH_RATE: "/growth-rate"; readonly NATURE: "/nature"; readonly POKEATHLON_STAT: "/pokeathlon-stat"; readonly POKEMON: "/pokemon"; readonly POKEMON_COLOR: "/pokemon-color"; readonly POKEMON_FORM: "/pokemon-form"; readonly POKEMON_HABITAT: "/pokemon-habitat"; readonly POKEMON_SHAPE: "/pokemon-shape"; readonly POKEMON_SPECIES: "/pokemon-species"; readonly STAT: "/stat"; readonly TYPE: "/type"; readonly LANGUAGE: "/language"; }; type ObjectValue = T[keyof T]; type Endpoint = ObjectValue; //#endregion //#region src/constants/evolutions.d.ts declare const EVOLUTION_TRIGGERS: { readonly LEVEL_UP: 1; readonly TRADE: 2; readonly USE_ITEM: 3; readonly SHED: 4; readonly SPIN: 5; readonly TOWER_OF_DARKNESS: 6; readonly TOWER_OF_WATERS: 7; readonly THREE_CRITICAL_HITS: 8; readonly TAKE_DAMAGE: 9; readonly OTHER: 10; readonly AGILE_STYLE_MOVE: 11; readonly STRONG_STYLE_MOVE: 12; readonly RECOIL_DAMAGE: 13; readonly USE_MOVE: 14; readonly THREE_DEFEATED_BISHARP: 15; readonly GIMMIGHOUL_COINS: 16; /** * @deprecated Misspelled: the endpoint names this trigger `tower-of-waters`. * Use {@link EVOLUTION_TRIGGERS.TOWER_OF_WATERS}. Removed in 3.0. */ readonly TOWER_OF_WATER: 7; }; //#endregion //#region src/constants/games.d.ts declare const GENERATIONS: { readonly GENERATION_I: 1; readonly GENERATION_II: 2; readonly GENERATION_III: 3; readonly GENERATION_IV: 4; readonly GENERATION_V: 5; readonly GENERATION_VI: 6; readonly GENERATION_VII: 7; readonly GENERATION_VIII: 8; readonly GENERATION_IX: 9; }; /** * ## Generation Name * A generation as the PokéAPI names it, which is what a * `NamedAPIResource` carries and what the helpers that resolve a * resource's past state are given. * * Written out rather than derived from {@link GENERATIONS}: turning * `GENERATION_VIII` into `generation-viii` in the type system takes a recursive * template literal, and the set is closed and nine long. */ type GenerationName = "generation-i" | "generation-ii" | "generation-iii" | "generation-iv" | "generation-v" | "generation-vi" | "generation-vii" | "generation-viii" | "generation-ix"; declare const POKEDEXES: { readonly NATIONAL: 1; readonly KANTO: 2; readonly ORIGINAL_JOHTO: 3; readonly HOENN: 4; readonly ORIGINAL_SINNOH: 5; readonly EXTENDED_SINNOH: 6; readonly UPDATED_JOHTO: 7; readonly ORIGINAL_UNOVA: 8; readonly UPDATED_UNOVA: 9; readonly CONQUEST_GALLERY: 11; readonly KALOS_CENTRAL: 12; readonly KALOS_COASTAL: 13; readonly KALOS_MOUNTAIN: 14; readonly UPDATED_HOENN: 15; readonly ORIGINAL_ALOLA: 16; readonly ORIGINAL_MELEMELE: 17; readonly ORIGINAL_AKALA: 18; readonly ORIGINAL_ULAULA: 19; readonly ORIGINAL_PONI: 20; readonly UPDATED_ALOLA: 21; readonly UPDATED_MELEMELE: 22; readonly UPDATED_AKALA: 23; readonly UPDATED_ULAULA: 24; readonly UPDATED_PONI: 25; readonly LETSGO_KANTO: 26; readonly GALAR: 27; readonly ISLE_OF_ARMOR: 28; readonly CROWN_TUNDRA: 29; readonly HISUI: 30; readonly PALDEA: 31; readonly KITAKAMI: 32; readonly BLUEBERRY: 33; readonly LUMIOSE_CITY: 34; readonly HYPERSPACE: 35; readonly CHAMPIONS: 36; /** * @deprecated Misspelled: the endpoint names this `kalos-mountain`. * Use {@link POKEDEXES.KALOS_MOUNTAIN}. Removed in 3.0. */ readonly KALOS_MONTAIN: 14; /** * @deprecated The endpoint names this `letsgo-kanto` now. * Use {@link POKEDEXES.LETSGO_KANTO}. Removed in 3.0. */ readonly UPDATED_KANTO: 26; }; declare const VERSIONS: { readonly RED: 1; readonly BLUE: 2; readonly YELLOW: 3; readonly GOLD: 4; readonly SILVER: 5; readonly CRYSTAL: 6; readonly RUBY: 7; readonly SAPPHIRE: 8; readonly EMERALD: 9; readonly FIRERED: 10; readonly LEAFGREEN: 11; readonly DIAMOND: 12; readonly PEARL: 13; readonly PLATINUM: 14; readonly HEARTGOLD: 15; readonly SOULSILVER: 16; readonly BLACK: 17; readonly WHITE: 18; readonly COLOSSEUM: 19; readonly XD: 20; readonly BLACK_2: 21; readonly WHITE_2: 22; readonly X: 23; readonly Y: 24; readonly OMEGA_RUBY: 25; readonly ALPHA_SAPPHIRE: 26; readonly SUN: 27; readonly MOON: 28; readonly ULTRA_SUN: 29; readonly ULTRA_MOON: 30; readonly LETS_GO_PIKACHU: 31; readonly LETS_GO_EEVEE: 32; readonly SWORD: 33; readonly SHIELD: 34; readonly THE_ISLE_OF_ARMOR_SWORD: 35; readonly THE_CROWN_TUNDRA_SWORD: 36; readonly BRILLIANT_DIAMOND: 37; readonly SHINING_PEARL: 38; readonly LEGENDS_ARCEUS: 39; readonly SCARLET: 40; readonly VIOLET: 41; readonly THE_TEAL_MASK_SCARLET: 42; readonly THE_INDIGO_DISK_SCARLET: 43; readonly RED_JAPAN: 44; readonly GREEN_JAPAN: 45; readonly BLUE_JAPAN: 46; readonly LEGENDS_ZA: 47; readonly MEGA_DIMENSION: 48; readonly CHAMPIONS: 49; readonly THE_ISLE_OF_ARMOR_SHIELD: 50; readonly THE_CROWN_TUNDRA_SHIELD: 51; readonly THE_TEAL_MASK_VIOLET: 52; readonly THE_INDIGO_DISK_VIOLET: 53; /** * @deprecated The endpoint names this `the-crown-tundra-sword` now. * Use {@link VERSIONS.THE_CROWN_TUNDRA_SWORD}. Removed in 3.0. */ readonly THE_CROWN_TUNDRA: 36; /** * @deprecated The endpoint names this `the-isle-of-armor-sword` now. * Use {@link VERSIONS.THE_ISLE_OF_ARMOR_SWORD}. Removed in 3.0. */ readonly THE_ISLE_OF_ARMOR: 35; }; declare const VERSION_GROUPS: { readonly RED_BLUE: 1; readonly YELLOW: 2; readonly GOLD_SILVER: 3; readonly CRYSTAL: 4; readonly RUBY_SAPPHIRE: 5; readonly EMERALD: 6; readonly FIRERED_LEAFGREEN: 7; readonly DIAMOND_PEARL: 8; readonly PLATINUM: 9; readonly HEARTGOLD_SOULSILVER: 10; readonly BLACK_WHITE: 11; readonly COLOSSEUM: 12; readonly XD: 13; readonly BLACK_2_WHITE_2: 14; readonly X_Y: 15; readonly OMEGA_RUBY_ALPHA_SAPPHIRE: 16; readonly SUN_MOON: 17; readonly ULTRA_SUN_ULTRA_MOON: 18; readonly LETS_GO_PIKACHU_LETS_GO_EEVEE: 19; readonly SWORD_SHIELD: 20; readonly THE_ISLE_OF_ARMOR: 21; readonly THE_CROWN_TUNDRA: 22; readonly BRILLIANT_DIAMOND_SHINING_PEARL: 23; readonly LEGENDS_ARCEUS: 24; readonly SCARLET_VIOLET: 25; readonly THE_TEAL_MASK: 26; readonly THE_INDIGO_DISK: 27; readonly RED_GREEN_JAPAN: 28; readonly BLUE_JAPAN: 29; readonly LEGENDS_ZA: 30; readonly MEGA_DIMENSION: 31; readonly CHAMPIONS: 32; /** * @deprecated The endpoint names this `brilliant-diamond-shining-pearl` now. * Use {@link VERSION_GROUPS.BRILLIANT_DIAMOND_SHINING_PEARL}. Removed in 3.0. */ readonly BRILLIANT_DIAMOND_AND_SHINING_PEARL: 23; /** * @deprecated The endpoint names this `lets-go-pikachu-lets-go-eevee` now. * Use {@link VERSION_GROUPS.LETS_GO_PIKACHU_LETS_GO_EEVEE}. Removed in 3.0. */ readonly LETS_GO: 19; }; //#endregion //#region src/constants/items.d.ts declare const ITEM_ATTRIBUTES: { readonly COUNTABLE: 1; readonly CONSUMABLE: 2; readonly USABLE_OVERWORLD: 3; readonly USABLE_IN_BATTLE: 4; readonly HOLDABLE: 5; readonly HOLDABLE_PASSIVE: 6; readonly HOLDABLE_ACTIVE: 7; readonly UNDERGROUND: 8; }; declare const ITEM_CATEGORIES: { readonly STAT_BOOSTS: 1; readonly EFFORT_DROP: 2; readonly MEDICINE: 3; readonly OTHER: 4; readonly IN_A_PINCH: 5; readonly PICKY_HEALING: 6; readonly TYPE_PROTECTION: 7; readonly BAKING_ONLY: 8; readonly COLLECTIBLES: 9; readonly EVOLUTION: 10; readonly SPELUNKING: 11; readonly HELD_ITEMS: 12; readonly CHOICE: 13; readonly EFFORT_TRAINING: 14; readonly BAD_HELD_ITEMS: 15; readonly TRAINING: 16; readonly PLATES: 17; readonly SPECIES_SPECIFIC: 18; readonly TYPE_ENHANCEMENT: 19; readonly EVENT_ITEMS: 20; readonly GAMEPLAY: 21; readonly PLOT_ADVANCEMENT: 22; readonly UNUSED: 23; readonly LOOT: 24; readonly ALL_MAIL: 25; readonly VITAMINS: 26; readonly HEALING: 27; readonly PP_RECOVERY: 28; readonly REVIVAL: 29; readonly STATUS_CURES: 30; readonly MULCH: 32; readonly SPECIAL_BALLS: 33; readonly STANDARD_BALLS: 34; readonly DEX_COMPLETION: 35; readonly SCARVES: 36; readonly ALL_MACHINES: 37; readonly FLUTES: 38; readonly APRICORN_BALLS: 39; readonly APRICORN_BOX: 40; readonly DATA_CARDS: 41; readonly JEWELS: 42; readonly MIRACLE_SHOOTER: 43; readonly MEGA_STONES: 44; readonly MEMORIES: 45; readonly Z_CRYSTALS: 46; readonly SPECIES_CANDIES: 47; readonly CATCHING_BONUS: 48; readonly DYNAMAX_CRYSTALS: 49; readonly NATURE_MINTS: 50; readonly CURRY_INGREDIENTS: 51; readonly TERA_SHARD: 52; readonly SANDWICH_INGREDIENTS: 53; readonly TM_MATERIALS: 54; readonly PICNIC: 55; /** * @deprecated Misspelled: the endpoint names this `dynamax-crystals`. * Use {@link ITEM_CATEGORIES.DYNAMAX_CRYSTALS}. Removed in 3.0. */ readonly DYNAMAX_CRISTALS: 49; }; declare const ITEM_FLING_EFFECTS: { readonly BADLY_POISON: 1; readonly BURN: 2; readonly BERRY_EFFECT: 3; readonly HERB_EFFECT: 4; readonly PARALYZE: 5; readonly POISON: 6; readonly FLINCH: 7; }; declare const ITEM_POCKETS: { readonly MISC: 1; readonly MEDICINE: 2; readonly POKEBALLS: 3; readonly MACHINES: 4; readonly BERRIES: 5; readonly MAIL: 6; readonly BATTLE: 7; readonly KEY: 8; }; //#endregion //#region src/constants/locations.d.ts declare const REGIONS: { readonly KANTO: 1; readonly JOHTO: 2; readonly HOENN: 3; readonly SINNOH: 4; readonly UNOVA: 5; readonly KALOS: 6; readonly ALOLA: 7; readonly GALAR: 8; readonly HISUI: 9; readonly PALDEA: 10; readonly ORRE: 11; }; declare const PAL_PARK_AREAS: { readonly FOREST: 1; readonly FIELD: 2; readonly MOUNTAIN: 3; readonly POND: 4; readonly SEA: 5; }; //#endregion //#region src/constants/moves.d.ts declare const MOVE_AILMENTS: { readonly UNKNOWN: -1; readonly NONE: 0; readonly PARALYSIS: 1; readonly SLEEP: 2; readonly FREEZE: 3; readonly BURN: 4; readonly POISON: 5; readonly CONFUSION: 6; readonly INFATUATION: 7; readonly TRAP: 8; readonly NIGHTMARE: 9; readonly TORMENT: 12; readonly DISABLE: 13; readonly YAWN: 14; readonly HEAL_BLOCK: 15; readonly NO_TYPE_IMMUNITY: 17; readonly LEECH_SEED: 18; readonly EMBARGO: 19; readonly PERISH_SONG: 20; readonly INGRAIN: 21; readonly SILENCE: 24; readonly TAR_SHOT: 42; readonly PROTECT: 43; }; declare const MOVE_BATTLE_STYLES: { readonly ATTACK: 1; readonly DEFENSE: 2; readonly SUPPORT: 3; }; declare const MOVE_CATEGORIES: { readonly DAMAGE: 0; readonly AILMENT: 1; readonly NET_GOOD_STATS: 2; readonly HEAL: 3; readonly DAMAGE_AILMENT: 4; readonly SWAGGER: 5; readonly DAMAGE_LOWER: 6; readonly DAMAGE_RAISE: 7; readonly DAMAGE_HEAL: 8; readonly OHKO: 9; readonly WHOLE_FIELD_EFFECT: 10; readonly FIELD_EFFECT: 11; readonly FORCE_SWITCH: 12; readonly UNIQUE: 13; }; declare const MOVE_DAMAGE_CLASSES: { readonly STATUS: 1; readonly PHYSICAL: 2; readonly SPECIAL: 3; }; declare const MOVE_LEARN_METHODS: { readonly LEVEL_UP: 1; readonly EGG: 2; readonly TUTOR: 3; readonly MACHINE: 4; readonly STADIUM_SURFING_PIKACHU: 5; readonly LIGHT_BALL_EGG: 6; readonly COLOSSEUM_PURIFICATION: 7; readonly XD_SHADOW: 8; readonly XD_PURIFICATION: 9; readonly FORM_CHANGE: 10; readonly ZYGARDE_CUBE: 11; readonly TRAIN: 12; }; declare const MOVE_TARGETS: { readonly SPECIFIC_MOVE: 1; readonly SELECTED_POKEMON_ME_FIRST: 2; readonly ALLY: 3; readonly USERS_FIELD: 4; readonly USER_OR_ALLY: 5; readonly OPPONENTS_FIELD: 6; readonly USER: 7; readonly RANDOM_OPPONENT: 8; readonly ALL_OTHER_POKEMON: 9; readonly SELECTED_POKEMON: 10; readonly ALL_OPPONENTS: 11; readonly ENTIRE_FIELD: 12; readonly USER_AND_ALLIES: 13; readonly ALL_POKEMON: 14; readonly ALL_ALLIES: 15; readonly FAINTING_POKEMON: 16; /** * @deprecated Misspelled: the endpoint names this `user-and-allies`. * Use {@link MOVE_TARGETS.USER_AND_ALLIES}. Removed in 3.0. */ readonly USER_AND_ALIES: 13; }; //#endregion //#region src/constants/pokemon.d.ts declare const EGG_GROUPS: { readonly MONSTER: 1; readonly WATER1: 2; readonly BUG: 3; readonly FLYING: 4; readonly GROUND: 5; readonly FAIRY: 6; readonly PLANT: 7; readonly HUMANSHAPE: 8; readonly WATER3: 9; readonly MINERAL: 10; readonly INDETERMINATE: 11; readonly WATER2: 12; readonly DITTO: 13; readonly DRAGON: 14; readonly NO_EGGS: 15; }; declare const GENDERS: { readonly FEMALE: 1; readonly MALE: 2; readonly GENDERLESS: 3; }; declare const GROWTH_RATES: { readonly SLOW: 1; readonly MEDIUM: 2; readonly FAST: 3; readonly MEDIUM_SLOW: 4; readonly SLOW_THEN_VERY_FAST: 5; readonly FAST_THEN_VERY_SLOW: 6; }; declare const NATURES: { readonly HARDY: 1; readonly BOLD: 2; readonly MODEST: 3; readonly CALM: 4; readonly TIMID: 5; readonly LONELY: 6; readonly DOCILE: 7; readonly MILD: 8; readonly GENTLE: 9; readonly HASTY: 10; readonly ADAMANT: 11; readonly IMPISH: 12; readonly BASHFUL: 13; readonly CAREFUL: 14; readonly RASH: 15; readonly JOLLY: 16; readonly NAUGHTY: 17; readonly LAX: 18; readonly QUIRKY: 19; readonly NAIVE: 20; readonly BRAVE: 21; readonly RELAXED: 22; readonly QUIET: 23; readonly SASSY: 24; readonly SERIOUS: 25; }; declare const POKEATHLON_STATS: { readonly SPEED: 1; readonly POWER: 2; readonly SKILL: 3; readonly STAMINA: 4; readonly JUMP: 5; }; declare const POKEMON_COLORS: { readonly BLACK: 1; readonly BLUE: 2; readonly BROWN: 3; readonly GRAY: 4; readonly GREEN: 5; readonly PINK: 6; readonly PURPLE: 7; readonly RED: 8; readonly WHITE: 9; readonly YELLOW: 10; }; declare const POKEMON_HABITATS: { readonly CAVE: 1; readonly FOREST: 2; readonly GRASSLAND: 3; readonly MOUNTAIN: 4; readonly RARE: 5; readonly ROUGH_TERRAIN: 6; readonly SEA: 7; readonly URBAN: 8; readonly WATERS_EDGE: 9; /** * @deprecated Misspelled: the endpoint names this `mountain`. * Use {@link POKEMON_HABITATS.MOUNTAIN}. Removed in 3.0. */ readonly MONTAIN: 4; }; declare const POKEMON_SHAPES: { readonly BALL: 1; readonly SQUIGGLE: 2; readonly FISH: 3; readonly ARMS: 4; readonly BLOB: 5; readonly UPRIGHT: 6; readonly LEGS: 7; readonly QUADRUPED: 8; readonly WINGS: 9; readonly TENTACLES: 10; readonly HEADS: 11; readonly HUMANOID: 12; readonly BUG_WINGS: 13; readonly ARMOR: 14; }; declare const STATS: { readonly HP: 1; readonly ATTACK: 2; readonly DEFENSE: 3; readonly SPECIAL_ATTACK: 4; readonly SPECIAL_DEFENSE: 5; readonly SPEED: 6; readonly ACCURACY: 7; readonly EVASION: 8; readonly SPECIAL: 9; }; declare const TYPES: { readonly NORMAL: 1; readonly FIGHTING: 2; readonly FLYING: 3; readonly POISON: 4; readonly GROUND: 5; readonly ROCK: 6; readonly BUG: 7; readonly GHOST: 8; readonly STEEL: 9; readonly FIRE: 10; readonly WATER: 11; readonly GRASS: 12; readonly ELECTRIC: 13; readonly PSYCHIC: 14; readonly ICE: 15; readonly DRAGON: 16; readonly DARK: 17; readonly FAIRY: 18; readonly STELLAR: 19; readonly UNKNOWN: 10001; readonly SHADOW: 10002; }; /** * ## Type Name * A battle type as the PokéAPI names it, which is what a * `NamedAPIResource` carries and what the type chart is keyed by. * * The eighteen types a Pokémon can be, and `stellar`, which is a Tera type and * nothing else. `unknown` and `shadow` are in {@link TYPES} but not here: they * are artefacts of Generation II's internals and of Colosseum/XD, they appear in * no damage relation, and a table keyed by them would be a table with two entries * nothing can ever fill. * * Written out rather than derived from {@link TYPES}, for the same reason * `GenerationName` is: the set is closed, and the two exclusions are a decision * rather than a transformation. */ type TypeName = "normal" | "fighting" | "flying" | "poison" | "ground" | "rock" | "bug" | "ghost" | "steel" | "fire" | "water" | "grass" | "electric" | "psychic" | "ice" | "dragon" | "dark" | "fairy" | "stellar"; //#endregion //#region src/constants/urls.d.ts declare const BASE_URL: { readonly REST: "https://pokeapi.co/api/v2"; /** Root of the sprite repository the API's own sprite URLs point at. */ readonly SPRITES: "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites"; }; //#endregion //#region src/constants/utilities.d.ts declare const LANGUAGES: { readonly JA_HRKT: 1; readonly JA_ROMA: 2; readonly KO: 3; readonly ZH_HANT: 4; readonly FR: 5; readonly DE: 6; readonly ES: 7; readonly IT: 8; readonly EN: 9; readonly CS: 10; readonly JA: 11; readonly ZH_HANS: 12; readonly PT_BR: 13; readonly ES_419: 14; }; declare namespace index_d_exports { export { BASE_URL, BERRIES, BERRY_FIRMNESSES, BERRY_FLAVORS, CONTEST_TYPES, CURRENCIES, EGG_GROUPS, ENCOUNTER_CONDITIONS, ENCOUNTER_CONDITION_VALUES, ENCOUNTER_METHODS, ENDPOINTS, EVOLUTION_TRIGGERS, Endpoint, GENDERS, GENERATIONS, GROWTH_RATES, GenerationName, ITEM_ATTRIBUTES, ITEM_CATEGORIES, ITEM_FLING_EFFECTS, ITEM_POCKETS, LANGUAGES, MOVE_AILMENTS, MOVE_BATTLE_STYLES, MOVE_CATEGORIES, MOVE_DAMAGE_CLASSES, MOVE_LEARN_METHODS, MOVE_TARGETS, NATURES, PAL_PARK_AREAS, POKEATHLON_STATS, POKEDEXES, POKEMON_COLORS, POKEMON_HABITATS, POKEMON_SHAPES, REGIONS, STATS, TYPES, TypeName, VERSIONS, VERSION_GROUPS }; } //#endregion //#region src/clients/base.d.ts /** * ## Fetch Like * A `fetch` implementation taking a string URL, as every client call does. */ type FetchLike = (input: string, init?: RequestInit) => Promise; /** * ## Resource Link * Something naming a single resource: a link taken from a response, or its URL * as a bare string. * * A link carries what it points at, so passing one infers `T`; a string does * not, and needs `T` named. */ type ResourceLink = string | NamedAPIResource | APIResource; /** * ## Retry Options * When a failed request is worth attempting again. * * Retrying is off unless this is given — a client that quietly triples its own * traffic is not something to opt out of after the fact. */ interface RetryOptions { /** Attempts in total, the first one included. Defaults to 3. */ attempts?: number; /** Statuses worth another attempt. Defaults to 429, 500, 502, 503 and 504. */ statuses?: number[]; /** The first wait, in milliseconds, doubling from there. Defaults to 300. */ initialDelay?: number; /** The longest this client will ever wait between attempts. Defaults to 5000. */ maxDelay?: number; } /** * ## Request Scope * Cancellation applied to every request a client makes. * * Passed to {@link ClientFacade.with}, not to the constructor: a signal belongs * to one unit of work, while a client outlives many, and a client holding a * signal for its whole life is dead the first time that signal aborts. */ interface RequestScope { /** Aborts the requests made through this scope. */ signal?: AbortSignal; /** How long a request may take, in milliseconds, before it is aborted. */ timeout?: number; } /** * ## Client Options * Optional configuration accepted by every client. */ interface ClientOptions { /** * Where the request lifecycle is reported. Leave empty to log nothing, or pass * {@link consoleLogger} to write it to the console. */ logger?: Logger; /** * Response cache. Leave empty for an in-memory {@link MemoryCache}, pass `false` * to disable caching, or supply your own {@link CacheStore}. */ cache?: CacheStore | false; /** Location of the PokéAPI. Leave empty to use the official PokéAPI instance. */ baseURL?: string; /** * Custom `fetch` implementation, for proxies, retries, cancellation or * instrumentation. Defaults to the global `fetch`. * * Requests carry no timeout of their own: derive a scoped client with * {@link ClientFacade.with} if you want one. */ fetch?: FetchLike; /** * When to attempt a failed request again. Leave empty to attempt each request * exactly once. */ retry?: RetryOptions; /** * Ask the PokéAPI whether a response has changed, rather than downloading it * again, once the {@link CacheStore} entry for it has expired. * * Pass `true` for a default {@link EtagStore}, or one of your own to size it. * Leave empty and every expired entry is refetched in full. */ revalidate?: boolean | EtagStore; } /** * ## Client Stats * How many resolutions came from where, since the client was built. * * One count per `source` a {@link LogResponsePayload} reports, which is the only * thing that tells a cache hit from a revalidation from a real round trip once * the promise has settled. A failed request is counted by neither: it resolved * nothing, and it is the logger's `error` event that has it. */ interface ClientStats { /** Responses downloaded in full. */ network: number; /** Responses answered from the {@link CacheStore}, with no request made. */ cache: number; /** Callers that joined a request already on the wire rather than repeating it. */ inFlight: number; /** Responses the PokéAPI answered `304` for, served from the {@link EtagStore}. */ revalidated: number; /** * Requests that left the process — what the PokéAPI actually saw. * * Not `network + revalidated`. A revalidation is a round trip that saved a * body rather than a request that never happened, so it is in here; and a * resolution the `retry` option attempted three times is one `network` and * three of these. The attempts are the half a caller cannot see, and they are * the half that shows up in someone else's rate limit. */ roundTrips: number; } /** * ## List Page * The part of a resource list a walk needs: how much there is, and this page of * it. Both {@link NamedAPIResourceList} and {@link APIResourceList} qualify. */ interface ListPage { count: number; results: L[]; } /** * ## List Fn * A list method, called with the offset and the limit of the page to fetch. */ type ListFn = (offset: number, limit: number) => Promise>; /** * ## List Method * The shape every `list*` method on a section client has. */ type ListMethod = (offset?: number, limit?: number) => Promise>>; /** * ## List Method Name * The names of `C`'s own list methods, and nothing else — so naming one to * {@link BaseClient.paginate} is checked and completed by the compiler. */ type ListMethodName = { [K in keyof C]: C[K] extends ListMethod ? K : never; }[keyof C]; /** What a list method's page is made of. */ type Listed = F extends ((offset?: number, limit?: number) => Promise>) ? L : never; /** What a listed link resolves to. */ type Resolves = L extends APIResource ? T : never; /** * ## Paginate Options * How {@link BaseClient.paginate} walks a list endpoint. */ interface PaginateOptions { /** Entries fetched per request. Defaults to 20. */ pageSize?: number; /** Fetch each link and yield the resource instead. Defaults to `false`. */ resolve?: boolean; /** Links resolved at a time, when `resolve` is set. Defaults to 4. */ concurrency?: number; } /** * ## Resolve Options * How {@link ClientFacade.resolveAll} fetches the links it was given. */ interface ResolveOptions { /** Links fetched at a time. Defaults to 4. */ concurrency?: number; } /** * ## Client Facade * What every client is, underneath: something that owns a transport and talks * to it. Holds the members {@link BaseClient} and {@link MainClient} would * otherwise each declare — the cache, the scope, and following a link. * * The transport is a `#private` field rather than a `protected` one so that * nothing about it reaches the published types: a `protected` member keeps its * type in the emitted `.d.ts`, which would put the whole internal transport * surface in front of consumers who cannot name it. */ declare abstract class ClientFacade { #private; constructor(options?: ClientOptions); /** The store backing this client, or `undefined` when caching is disabled. */ get cache(): CacheStore | undefined; /** * How many resolutions came from where. * * ```ts * await api.pokemon.getPokemonByName('luxray'); * await api.pokemon.getPokemonByName('luxray'); * * api.stats; // { network: 1, cache: 1, inFlight: 0, revalidated: 0, roundTrips: 1 } * ``` * * The counts are the transport's, so they cover every section of a * {@link MainClient} and every client derived with {@link ClientFacade.with} — * the same sharing that makes one cache serve all of them. * * A snapshot, read at the moment it is asked for. Keeping one to compare * against later means keeping the object, not the client. */ get stats(): ClientStats; /** * What has been counted since `snapshot` was taken. * * ```ts * const before = api.stats; * await renderTeam(); * * api.statsSince(before).roundTrips; // what that render cost * ``` * * There is no way to reset the counts, and this is why: the transport behind * them is shared by every section of a {@link MainClient} and by every client * derived with {@link ClientFacade.with}, so zeroing it for one measurement * zeroes it for whatever else is measuring. Subtraction is the same answer * without the shared mutation. */ statsSince(snapshot: ClientStats): ClientStats; /** * Derives a client whose requests carry a signal, a timeout, or both. * * The clone shares this client's transport — its cache, its validators and the * requests already on the wire — so a scoped call still joins an identical * unscoped one instead of repeating it. Cloning is cheap, but not free: derive * one per unit of work — a request handler, a job — rather than one per call. * * ```ts * const scoped = api.with({ signal: request.signal, timeout: 2_000 }); * ``` */ with(scope: RequestScope): this; /** * Drops every cached response, and any `ETag` learned for one — otherwise the * next request revalidates and is answered with the body just dropped. * * A {@link CacheStore} that does not implement `clear` is left alone. * * The store is the transport's, so a client sharing one with others clears * theirs too. */ clearCache(): Promise; /** * Fetches what a link points at, through this client's cache and scope. * * A link carries what it points at, so the result is typed without saying so: * * ```ts * const pokemon = await api.getPokemonByName('luxray'); * const species = await api.resolve(pokemon.species); * // ^? PokemonSpecies * ``` * * A link names a resource, not a section, so any client resolves any link. * * @throws {TypeError} If the URL is not valid, or names no PokéAPI endpoint. */ resolve(resource: ResourceLink): Promise; /** * Fetches what several links point at, in the order they were given. * * At most `concurrency` requests run at a time — four by default, because the * PokéAPI's fair-use policy asks clients not to flood it. The first failure * rejects, and no further link is fetched. * * ```ts * const types = await api.resolveAll(pokemon.types.map((slot) => slot.type)); * // ^? Type[] * ``` */ resolveAll(resources: readonly ResourceLink[], options?: ResolveOptions): Promise; /** * Retrieves a single resource from the PokéAPI by its endpoint and identifier. * * @param segments - The identifier of the resource, followed by any path below * it. Each is percent-encoded, so pass `id, 'encounters'` rather than * `` `${id}/encounters` ``. Omit them to address the endpoint itself. */ protected getResource(endpoint: Endpoint, ...segments: (string | number)[]): Promise; /** * Retrieves a resource by its URL, or by a link taken from another response. * * A link knows what it points at, so passing one infers `T`; a bare string * does not, and needs `T` named. * * @throws {TypeError} If the URL is not valid, or names no endpoint under `baseURL`. */ protected getResourceByURL(resource: ResourceLink, baseURL?: string): Promise; /** * Retrieves a list of resources from the PokéAPI with pagination support. * * @template T - What the listed links resolve to. */ protected getListResource(endpoint: Endpoint, offset?: number, limit?: number): Promise>; /** * Retrieves a list of resources that have no name to list, with pagination support. * * @template T - What the listed links resolve to. */ protected getUnnamedListResource(endpoint: Endpoint, offset?: number, limit?: number): Promise>; /** * Walks every page of a list, yielding one entry at a time. The bridge * {@link BaseClient.paginate} reaches the transport through, so that no * signature here has to name one. */ protected walk(list: ListFn>, options?: PaginateOptions): AsyncGenerator | T>; } /** * ## Base Client * Base class for every section client. Names endpoints; the transport behind * {@link ClientFacade} does everything else — requests, caching, coalescing, * retries and logs. * * A {@link MainClient} builds one transport and hands it to all twelve of its * section clients, which is what makes them share a cache and a round trip. */ declare class BaseClient extends ClientFacade { /** * Walks every page of a list endpoint, yielding one entry at a time. * * Name the list method to walk; the offset and the limit are this method's to * manage. * * ```ts * for await (const berry of api.berry.paginate('listBerries')) { * console.log(berry.name); * } * ``` * * With `resolve`, each link is fetched and the resource is yielded instead of * the link. Requests are capped at `concurrency` at a time — the default is * deliberately low, because walking a section is exactly the traffic the * PokéAPI's fair-use policy asks clients to keep gentle. * * ```ts * for await (const berry of api.berry.paginate('listBerries', { resolve: true })) { * console.log(berry.growth_time); * } * ``` * * A function is accepted too, for a list this client does not carry — a page * of a foreign endpoint, or one narrowed before the walk sees it. * * ```ts * api.berry.paginate((offset, limit) => api.berry.listBerries(offset, limit)); * ``` */ paginate>(list: K, options?: PaginateOptions & { resolve?: false; }): AsyncGenerator>; paginate>(list: K, options: PaginateOptions & { resolve: true; }): AsyncGenerator>>; paginate>(list: ListFn, options?: PaginateOptions & { resolve?: false; }): AsyncGenerator; paginate(list: ListFn>, options: PaginateOptions & { resolve: true; }): AsyncGenerator; } //#endregion //#region src/clients/berry.client.d.ts /** * ### Berry Client * * Client used to access the Berry Endpoints: * * - [Berries](https://pokeapi.co/docs/v2#berries) * - [Berry Firmnesses](https://pokeapi.co/docs/v2#berry-firmnesses) * - [Berry Flavors](https://pokeapi.co/docs/v2#berry-flavors) * * See [PokéAPI Documentation](https://pokeapi.co/docs/v2#berries-section) */ declare class BerryClient extends BaseClient { /** Get a Berry by its name. */ getBerryByName(name: string): Promise; /** Get a Berry by its ID. */ getBerryById(id: number): Promise; /** Get a Berry Firmness by its ID. */ getBerryFirmnessById(id: number): Promise; /** Get a Berry Firmness by its name. */ getBerryFirmnessByName(name: string): Promise; /** Get a Berry Flavor by its ID. */ getBerryFlavorById(id: number): Promise; /** Get a Berry Flavor by its name. */ getBerryFlavorByName(name: string): Promise; /** List Berries. Page defaults to 20 entries from offset 0. */ listBerries(offset?: number, limit?: number): Promise>; /** List Berry Firmnesses. Page defaults to 20 entries from offset 0. */ listBerryFirmnesses(offset?: number, limit?: number): Promise>; /** List Berry Flavors. Page defaults to 20 entries from offset 0. */ listBerryFlavors(offset?: number, limit?: number): Promise>; } //#endregion //#region src/clients/contest.client.d.ts /** * ### Contest Client * * Client used to access the Contest Endpoints: * * - [Contest Types](https://pokeapi.co/docs/v2#contest-types) * - [Contest Effects](https://pokeapi.co/docs/v2#contest-effects) * - [Super Contest Effects](https://pokeapi.co/docs/v2#super-contest-effects) * * See [PokéAPI Documentation](https://pokeapi.co/docs/v2#contests-section) */ declare class ContestClient extends BaseClient { /** Get a Contest Type by its name. */ getContestTypeByName(name: string): Promise; /** Get a Contest Type by its ID. */ getContestTypeById(id: number): Promise; /** Get a Contest Effect by its ID. */ getContestEffectById(id: number): Promise; /** Get a Super Contest Effect by its ID. */ getSuperContestEffectById(id: number): Promise; /** List Contest Types. Page defaults to 20 entries from offset 0. */ listContestTypes(offset?: number, limit?: number): Promise>; /** List Contest Effects. Page defaults to 20 entries from offset 0. */ listContestEffects(offset?: number, limit?: number): Promise>; /** List Super Contest Effects. Page defaults to 20 entries from offset 0. */ listSuperContestEffects(offset?: number, limit?: number): Promise>; } //#endregion //#region src/clients/currency.client.d.ts /** * ### Currency Client * * Client used to access the Currency Endpoints: * * - [Currencies](https://pokeapi.co/docs/v2#currencies) * * See [PokéAPI Documentation](https://pokeapi.co/docs/v2#currencies-section) */ declare class CurrencyClient extends BaseClient { /** Get a Currency by its name. */ getCurrencyByName(name: string): Promise; /** Get a Currency by its ID. */ getCurrencyById(id: number): Promise; /** List Currencies. Page defaults to 20 entries from offset 0. */ listCurrencies(offset?: number, limit?: number): Promise>; } //#endregion //#region src/clients/encounter.client.d.ts /** * ### Encounter Client * * Client used to access the Encounter Endpoints: * * - [Encounter Methods](https://pokeapi.co/docs/v2#encounter-methods) * - [Encounter Conditions](https://pokeapi.co/docs/v2#encounter-conditions) * - [Encounter Condition Values](https://pokeapi.co/docs/v2#encounter-condition-values) * * See [PokéAPI Documentation](https://pokeapi.co/docs/v2#encounters-section) */ declare class EncounterClient extends BaseClient { /** Get an Encounter Method by its name. */ getEncounterMethodByName(name: string): Promise; /** Get an Encounter Method by its ID. */ getEncounterMethodById(id: number): Promise; /** Get an Encounter Condition by its ID. */ getEncounterConditionById(id: number): Promise; /** Get an Encounter Condition by its name. */ getEncounterConditionByName(name: string): Promise; /** Get an Encounter Condition Value by its name. */ getEncounterConditionValueByName(name: string): Promise; /** Get an Encounter Condition Value by its ID. */ getEncounterConditionValueById(id: number): Promise; /** List Encounter Methods. Page defaults to 20 entries from offset 0. */ listEncounterMethods(offset?: number, limit?: number): Promise>; /** List Encounter Conditions. Page defaults to 20 entries from offset 0. */ listEncounterConditions(offset?: number, limit?: number): Promise>; /** List Encounter Condition Values. Page defaults to 20 entries from offset 0. */ listEncounterConditionValues(offset?: number, limit?: number): Promise>; } //#endregion //#region src/clients/evolution.client.d.ts /** * ### Evolution Client * * Client used to access the Evolution Endpoints: * * - [Evolution Chains](https://pokeapi.co/docs/v2#evolution-chains) * - [Evolution Triggers](https://pokeapi.co/docs/v2#evolution-triggers) * * See [PokéAPI Documentation](https://pokeapi.co/docs/v2#evolution-section) */ declare class EvolutionClient extends BaseClient { /** Get an Evolution Chain by its ID. */ getEvolutionChainById(id: number): Promise; /** Get an Evolution Trigger by its ID. */ getEvolutionTriggerById(id: number): Promise; /** Get an Evolution Trigger by its name. */ getEvolutionTriggerByName(name: string): Promise; /** List Evolution Chains. Page defaults to 20 entries from offset 0. */ listEvolutionChains(offset?: number, limit?: number): Promise>; /** List Evolution Triggers. Page defaults to 20 entries from offset 0. */ listEvolutionTriggers(offset?: number, limit?: number): Promise>; } //#endregion //#region src/clients/game.client.d.ts /** * ### Game Client * * Client used to access the Game Endpoints: * * - [Generations](https://pokeapi.co/docs/v2#generations) * - [Pokédexes](https://pokeapi.co/docs/v2#pokedexes) * - [Versions](https://pokeapi.co/docs/v2#version) * - [Version Groups](https://pokeapi.co/docs/v2#version-groups) * * See [PokéAPI Documentation](https://pokeapi.co/docs/v2#games-section) */ declare class GameClient extends BaseClient { /** Get a Generation by its name. */ getGenerationByName(name: string): Promise; /** Get a Generation by its ID. */ getGenerationById(id: number): Promise; /** Get a Pokédex by its name. */ getPokedexByName(name: string): Promise; /** Get a Pokédex by its ID. */ getPokedexById(id: number): Promise; /** Get a Version by its name. */ getVersionByName(name: string): Promise; /** Get a Version by its ID. */ getVersionById(id: number): Promise; /** Get a Version Group by its name. */ getVersionGroupByName(name: string): Promise; /** Get a Version Group by its ID. */ getVersionGroupById(id: number): Promise; /** List Generations. Page defaults to 20 entries from offset 0. */ listGenerations(offset?: number, limit?: number): Promise>; /** List Pokédexes. Page defaults to 20 entries from offset 0. */ listPokedexes(offset?: number, limit?: number): Promise>; /** List Versions. Page defaults to 20 entries from offset 0. */ listVersions(offset?: number, limit?: number): Promise>; /** List Version Groups. Page defaults to 20 entries from offset 0. */ listVersionGroups(offset?: number, limit?: number): Promise>; } //#endregion //#region src/clients/item.client.d.ts /** * ### Item Client * * Client used to access the Item Endpoints: * * - [Items](https://pokeapi.co/docs/v2#item) * - [Item Attributes](https://pokeapi.co/docs/v2#item-attributes) * - [Item Categories](https://pokeapi.co/docs/v2#item-categories) * - [Item Fling Effects](https://pokeapi.co/docs/v2#item-fling-effects) * - [Item Pockets](https://pokeapi.co/docs/v2#item-pockets) * * See [PokéAPI Documentation](https://pokeapi.co/docs/v2#items-section) */ declare class ItemClient extends BaseClient { /** Get an Item by its name. */ getItemByName(name: string): Promise; /** Get an Item by its ID. */ getItemById(id: number): Promise; /** Get an Item Attribute by its name. */ getItemAttributeByName(name: string): Promise; /** Get an Item Attribute by its ID. */ getItemAttributeById(id: number): Promise; /** Get an Item Category by its name. */ getItemCategoryByName(name: string): Promise; /** Get an Item Category by its ID. */ getItemCategoryById(id: number): Promise; /** Get an Item Fling Effect by its name. */ getItemFlingEffectByName(name: string): Promise; /** Get an Item Fling Effect by its ID. */ getItemFlingEffectById(id: number): Promise; /** Get an Item Pocket by its name. */ getItemPocketByName(name: string): Promise; /** Get an Item Pocket by its ID. */ getItemPocketById(id: number): Promise; /** List Items. Page defaults to 20 entries from offset 0. */ listItems(offset?: number, limit?: number): Promise>; /** List Item Attributes. Page defaults to 20 entries from offset 0. */ listItemAttributes(offset?: number, limit?: number): Promise>; /** List Item Categories. Page defaults to 20 entries from offset 0. */ listItemCategories(offset?: number, limit?: number): Promise>; /** List Item Fling Effects. Page defaults to 20 entries from offset 0. */ listItemFlingEffects(offset?: number, limit?: number): Promise>; /** List Item Pockets. Page defaults to 20 entries from offset 0. */ listItemPockets(offset?: number, limit?: number): Promise>; } //#endregion //#region src/clients/location.client.d.ts /** * ### Location Client * * Client used to access the Location Endpoints: * * - [Locations](https://pokeapi.co/docs/v2#locations) * - [Location Areas](https://pokeapi.co/docs/v2#location-areas) * - [Pal Park Areas](https://pokeapi.co/docs/v2#pal-park-areas) * - [Regions](https://pokeapi.co/docs/v2#regions) * * See [PokéAPI Documentation](https://pokeapi.co/docs/v2#locations-section) */ declare class LocationClient extends BaseClient { /** Get a Location by its name. */ getLocationByName(name: string): Promise; /** Get a Location by its ID. */ getLocationById(id: number): Promise; /** Get a Location Area by its name. */ getLocationAreaByName(name: string): Promise; /** Get a Location Area by its ID. */ getLocationAreaById(id: number): Promise; /** Get a Pal Park Area by its name. */ getPalParkAreaByName(name: string): Promise; /** Get a Pal Park Area by its ID. */ getPalParkAreaById(id: number): Promise; /** Get a Region by its name. */ getRegionByName(name: string): Promise; /** Get a Region by its ID. */ getRegionById(id: number): Promise; /** List Locations. Page defaults to 20 entries from offset 0. */ listLocations(offset?: number, limit?: number): Promise>; /** List Location Areas. Page defaults to 20 entries from offset 0. */ listLocationAreas(offset?: number, limit?: number): Promise>; /** List Pal Park Areas. Page defaults to 20 entries from offset 0. */ listPalParkAreas(offset?: number, limit?: number): Promise>; /** List Regions. Page defaults to 20 entries from offset 0. */ listRegions(offset?: number, limit?: number): Promise>; } //#endregion //#region src/clients/machine.client.d.ts /** * ### Machine Client * * Client used to access the Machine Endpoints: * * - [Machines](https://pokeapi.co/docs/v2#machines) * * See [PokéAPI Documentation](https://pokeapi.co/docs/v2#machines-section) */ declare class MachineClient extends BaseClient { /** Get a Machine by its ID. */ getMachineById(id: number): Promise; /** List Machines. Page defaults to 20 entries from offset 0. */ listMachines(offset?: number, limit?: number): Promise>; } //#endregion //#region src/clients/move.client.d.ts /** * ### Move Client * * Client used to access the Move Endpoints: * * - [Moves](https://pokeapi.co/docs/v2#moves) * - [Move Ailments](https://pokeapi.co/docs/v2#move-ailments) * - [Move Battle Styles](https://pokeapi.co/docs/v2#move-battle-styles) * - [Move Categories](https://pokeapi.co/docs/v2#move-categories) * - [Move Damage Classes](https://pokeapi.co/docs/v2#move-damage-classes) * - [Move Learn Methods](https://pokeapi.co/docs/v2#move-learn-methods) * - [Move Targets](https://pokeapi.co/docs/v2#move-targets) * * See [PokéAPI Documentation](https://pokeapi.co/docs/v2#moves-section) */ declare class MoveClient extends BaseClient { /** Get a Move by its name. */ getMoveByName(name: string): Promise; /** Get a Move by its ID. */ getMoveById(id: number): Promise; /** Get a Move Ailment by its name. */ getMoveAilmentByName(name: string): Promise; /** Get a Move Ailment by its ID. */ getMoveAilmentById(id: number): Promise; /** Get a Move Battle Style by its name. */ getMoveBattleStyleByName(name: string): Promise; /** Get a Move Battle Style by its ID. */ getMoveBattleStyleById(id: number): Promise; /** Get a Move Category by its name. */ getMoveCategoryByName(name: string): Promise; /** Get a Move Category by its ID. */ getMoveCategoryById(id: number): Promise; /** Get a Move Damage Class by its name. */ getMoveDamageClassByName(name: string): Promise; /** Get a Move Damage Class by its ID. */ getMoveDamageClassById(id: number): Promise; /** Get a Move Learn Method by its name. */ getMoveLearnMethodByName(name: string): Promise; /** Get a Move Learn Method by its ID. */ getMoveLearnMethodById(id: number): Promise; /** Get a Move Target by its name. */ getMoveTargetByName(name: string): Promise; /** Get a Move Target by its ID. */ getMoveTargetById(id: number): Promise; /** List Moves. Page defaults to 20 entries from offset 0. */ listMoves(offset?: number, limit?: number): Promise>; /** List Move Ailments. Page defaults to 20 entries from offset 0. */ listMoveAilments(offset?: number, limit?: number): Promise>; /** List Move Battle Styles. Page defaults to 20 entries from offset 0. */ listMoveBattleStyles(offset?: number, limit?: number): Promise>; /** List Move Categories. Page defaults to 20 entries from offset 0. */ listMoveCategories(offset?: number, limit?: number): Promise>; /** List Move Damage Classes. Page defaults to 20 entries from offset 0. */ listMoveDamageClasses(offset?: number, limit?: number): Promise>; /** List Move Learn Methods. Page defaults to 20 entries from offset 0. */ listMoveLearnMethods(offset?: number, limit?: number): Promise>; /** List Move Targets. Page defaults to 20 entries from offset 0. */ listMoveTargets(offset?: number, limit?: number): Promise>; } //#endregion //#region src/clients/pokemon.client.d.ts /** * ### Pokémon Client * * Client used to access the Pokémon Endpoints: * * - [Abilities](https://pokeapi.co/docs/v2#abilities) * - [Characteristics](https://pokeapi.co/docs/v2#characteristics) * - [Egg Groups](https://pokeapi.co/docs/v2#egg-groups) * - [Genders](https://pokeapi.co/docs/v2#genders) * - [Growth Rates](https://pokeapi.co/docs/v2#growth-rates) * - [Natures](https://pokeapi.co/docs/v2#natures) * - [Pokéathlon Stats](https://pokeapi.co/docs/v2#pokeathlon-stats) * - [Pokémon](https://pokeapi.co/docs/v2#pokemon) * - [Pokémon Location Areas](https://pokeapi.co/docs/v2#pokemon-location-areas) * - [Pokémon Colors](https://pokeapi.co/docs/v2#pokemon-colors) * - [Pokémon Forms](https://pokeapi.co/docs/v2#pokemon-forms) * - [Pokémon Habitats](https://pokeapi.co/docs/v2#pokemon-habitats) * - [Pokémon Shapes](https://pokeapi.co/docs/v2#pokemon-shapes) * - [Pokémon Species](https://pokeapi.co/docs/v2#pokemon-species) * - [Stats](https://pokeapi.co/docs/v2#stats) * - [Types](https://pokeapi.co/docs/v2#types) * * See [PokéAPI Documentation](https://pokeapi.co/docs/v2#pokemon-section) */ declare class PokemonClient extends BaseClient { /** Get an Ability by its name. */ getAbilityByName(name: string): Promise; /** Get an Ability by its ID. */ getAbilityById(id: number): Promise; /** Get a Characteristic by its ID. */ getCharacteristicById(id: number): Promise; /** Get an Egg Group by its name. */ getEggGroupByName(name: string): Promise; /** Get an Egg Group by its ID. */ getEggGroupById(id: number): Promise; /** Get a Gender by its name. */ getGenderByName(name: string): Promise; /** Get a Gender by its ID. */ getGenderById(id: number): Promise; /** Get a Growth Rate by its name. */ getGrowthRateByName(name: string): Promise; /** Get a Growth Rate by its ID. */ getGrowthRateById(id: number): Promise; /** Get a Nature by its name. */ getNatureByName(name: string): Promise; /** Get a Nature by its ID. */ getNatureById(id: number): Promise; /** Get a Pokéathlon Stat by its name. */ getPokeathlonStatByName(name: string): Promise; /** Get a Pokéathlon Stat by its ID. */ getPokeathlonStatById(id: number): Promise; /** Get a Pokémon by its name. */ getPokemonByName(name: string): Promise; /** Get a Pokémon by its ID. */ getPokemonById(id: number): Promise; /** * Get the areas a Pokémon can be encountered in, by its ID. * @returns Every location area the Pokémon appears in, with its encounter details. */ getPokemonLocationAreaById(id: number): Promise; /** Get a Pokémon Color by its name. */ getPokemonColorByName(name: string): Promise; /** Get a Pokémon Color by its ID. */ getPokemonColorById(id: number): Promise; /** Get a Pokémon Form by its name. */ getPokemonFormByName(name: string): Promise; /** Get a Pokémon Form by its ID. */ getPokemonFormById(id: number): Promise; /** Get a Pokémon Habitat by its name. */ getPokemonHabitatByName(name: string): Promise; /** Get a Pokémon Habitat by its ID. */ getPokemonHabitatById(id: number): Promise; /** Get a Pokémon Shape by its name. */ getPokemonShapeByName(name: string): Promise; /** Get a Pokémon Shape by its ID. */ getPokemonShapeById(id: number): Promise; /** Get a Pokémon Species by its name. */ getPokemonSpeciesByName(name: string): Promise; /** Get a Pokémon Species by its ID. */ getPokemonSpeciesById(id: number): Promise; /** Get a Stat by its name. */ getStatByName(name: string): Promise; /** Get a Stat by its ID. */ getStatById(id: number): Promise; /** Get a Type by its name. */ getTypeByName(name: string): Promise; /** Get a Type by its ID. */ getTypeById(id: number): Promise; /** List Abilities. Page defaults to 20 entries from offset 0. */ listAbilities(offset?: number, limit?: number): Promise>; /** List Characteristics. Page defaults to 20 entries from offset 0. */ listCharacteristics(offset?: number, limit?: number): Promise>; /** List Egg Groups. Page defaults to 20 entries from offset 0. */ listEggGroups(offset?: number, limit?: number): Promise>; /** List Genders. Page defaults to 20 entries from offset 0. */ listGenders(offset?: number, limit?: number): Promise>; /** List Growth Rates. Page defaults to 20 entries from offset 0. */ listGrowthRates(offset?: number, limit?: number): Promise>; /** List Natures. Page defaults to 20 entries from offset 0. */ listNatures(offset?: number, limit?: number): Promise>; /** List Pokéathlon Stats. Page defaults to 20 entries from offset 0. */ listPokeathlonStats(offset?: number, limit?: number): Promise>; /** List Pokémon. Page defaults to 20 entries from offset 0. */ listPokemons(offset?: number, limit?: number): Promise>; /** List Pokémon Colors. Page defaults to 20 entries from offset 0. */ listPokemonColors(offset?: number, limit?: number): Promise>; /** List Pokémon Forms. Page defaults to 20 entries from offset 0. */ listPokemonForms(offset?: number, limit?: number): Promise>; /** List Pokémon Habitats. Page defaults to 20 entries from offset 0. */ listPokemonHabitats(offset?: number, limit?: number): Promise>; /** List Pokémon Shapes. Page defaults to 20 entries from offset 0. */ listPokemonShapes(offset?: number, limit?: number): Promise>; /** List Pokémon Species. Page defaults to 20 entries from offset 0. */ listPokemonSpecies(offset?: number, limit?: number): Promise>; /** List Stats. Page defaults to 20 entries from offset 0. */ listStats(offset?: number, limit?: number): Promise>; /** List Types. Page defaults to 20 entries from offset 0. */ listTypes(offset?: number, limit?: number): Promise>; } //#endregion //#region src/clients/utility.client.d.ts /** * ### Utility Client * * Client used to access the Utility Endpoints: * * - [Languages](https://pokeapi.co/docs/v2#languages) * - [Resources](https://pokeapi.co/docs/v2#resource-listspagination-section) * * See [PokéAPI Documentation](https://pokeapi.co/docs/v2#utility-section) */ declare class UtilityClient extends BaseClient { /** Get a Language by its ID. */ getLanguageById(id: number): Promise; /** Get a Language by its name. */ getLanguageByName(name: string): Promise; /** * Get any resource by its URL, or by a link taken from another response. * * ```ts * const pokemon = await api.pokemon.getPokemonByName('luxray'); * const species = await api.utility.getResourceByUrl(pokemon.species); * // ^? PokemonSpecies * ``` * * Every client carries {@link BaseClient.resolve}, which does the same thing; * this is the name it went out under, and it stays. * * @param resource The absolute URL of the resource, or a link to it. * @returns The resource the URL points at. * @throws {TypeError} If the URL is not valid, or names no PokéAPI endpoint. */ getResourceByUrl(resource: ResourceLink): Promise; /** List Languages. Page defaults to 20 entries from offset 0. */ listLanguages(offset?: number, limit?: number): Promise>; } //#endregion //#region src/clients/main.client.d.ts /** * ### Main Client * * The main client used to access all the PokéAPI Endpoints: * * - [Berries](https://pokeapi.co/docs/v2#berries-section) * - [Contests](https://pokeapi.co/docs/v2#contests-section) * - [Currencies](https://pokeapi.co/docs/v2#currencies-section) * - [Encounters](https://pokeapi.co/docs/v2#encounters-section) * - [Evolution](https://pokeapi.co/docs/v2#evolution-section) * - [Games](https://pokeapi.co/docs/v2#games-section) * - [Items](https://pokeapi.co/docs/v2#items-section) * - [Locations](https://pokeapi.co/docs/v2#locations-section) * - [Machines](https://pokeapi.co/docs/v2#machines-section) * - [Moves](https://pokeapi.co/docs/v2#moves-section) * - [Pokémon](https://pokeapi.co/docs/v2#pokemon-section) * - [Utility](https://pokeapi.co/docs/v2#utility-section) * * All the clients below share a single transport, so a resource fetched through * one of them is served from cache by the rest — and two of them asking for the * same URL at once make one round trip, not two. * * Composes its sections rather than inheriting from them: it extends * {@link ClientFacade}, not {@link BaseClient}, so it carries no endpoint of its * own. * * See [PokéAPI Documentation](https://pokeapi.co/docs/v2) */ declare class MainClient extends ClientFacade { readonly berry: BerryClient; readonly contest: ContestClient; readonly currency: CurrencyClient; readonly encounter: EncounterClient; readonly evolution: EvolutionClient; readonly game: GameClient; readonly item: ItemClient; readonly location: LocationClient; readonly machine: MachineClient; readonly move: MoveClient; readonly pokemon: PokemonClient; readonly utility: UtilityClient; constructor(options?: ClientOptions); } //#endregion //#region src/config/errors.d.ts /** * ## Pokenode Error * Thrown when the PokéAPI answers with a non-2xx status. Transport failures are * not wrapped — the native error propagates untouched. */ declare class PokenodeError extends Error { readonly name = "PokenodeError"; readonly kind = "pokenode:http"; /** HTTP status code of the response. */ readonly status: number; /** HTTP status text of the response. */ readonly statusText: string; /** URL that produced the error. */ readonly url: string; /** Parsed response body, when the error response carried JSON. */ readonly body: unknown; /** * @param message Overrides the default text, for a status whose failure is not * self-explanatory. */ constructor(response: Response, body: unknown, message?: string); /** Whether the error came from a pokenode-ts client. */ static isPokenodeError(error: unknown): error is PokenodeError; } //#endregion //#region src/utils/evolution.d.ts /** * ## Evolution Step * One edge of an evolution chain: a species, what it evolves into, and every way * that happens. */ interface EvolutionStep { /** The species that evolves. */ from: NamedAPIResource; /** What it evolves into. */ to: NamedAPIResource; /** * The ways this step happens, which are alternatives rather than a sequence — * the API publishes one per version group, so Leafeon carries five mossy-rock * locations and a Leaf Stone. Never empty. */ details: EvolutionDetail[]; /** How deep in the chain this step sits: `1` for a first evolution. */ depth: number; /** Whether {@link EvolutionStep.to} is a baby Pokémon. */ isBaby: boolean; } /** * ## Flatten Options * How {@link flattenChain} narrows the chain it walks. */ interface FlattenOptions { /** * Keep only the details tagged with this version group, by the name the API * gives it — `sword-shield`, not `Sword/Shield` — and drop the steps left with * none. The tag is the game that introduced the method, not every game it * applies in — see {@link flattenChain}. */ versionGroup?: string; } /** * Flattens an evolution chain into one step per evolution, depth-first in the * order the API lists them. * * ```ts * const species = await api.pokemon.getPokemonSpeciesByName('eevee'); * const chain = await api.resolve(species.evolution_chain); * * for (const step of flattenChain(chain)) { * console.log(`${step.from.name} → ${step.to.name}`); * } * ``` * * The root is not a step: it is what the chain starts from, and the API gives it * no `evolution_details` to describe. * * `versionGroup` keeps only the details tagged with that version group, which is * what picks the Leaf Stone out of Leafeon's six alternatives: * * ```ts * flattenChain(chain, { versionGroup: 'sword-shield' }); * ``` * * That tag is the game which *introduced* the method, not every game it applies * in: Eevee's Water Stone is tagged `red-blue` alone, so filtering to * `sword-shield` drops Vaporeon even though Sword/Shield evolves it the same way * it always did. The question this answers is what a game changed. * * A step with nothing left after that is dropped, but the chain below it is * still walked — every edge is filtered on its own terms, and `depth` stays the * position in the chain rather than in the result. */ declare const flattenChain: (chain: EvolutionChain, options?: FlattenOptions) => EvolutionStep[]; /** * The steps leading from the root of a chain to `species`. * * ```ts * pathTo(chain, 'dustox')?.map((step) => step.to.name); // ['cascoon', 'dustox'] * ``` * * Matched against the name the API gives a species, which is not the name a game * displays: `localize(species.names)` is `Papilord` in French and finds nothing * here. Pass the link itself when you have one. * * @returns The steps, `[]` when `species` is the root the chain starts from, and * `undefined` when the chain does not contain it. The two empty answers are * different questions, so they are different values. */ declare const pathTo: (chain: EvolutionChain, species: string | NamedAPIResource) => EvolutionStep[] | undefined; /** * ## Evolution Requirement * One condition an evolution is subject to, as a discriminated union — what an * {@link EvolutionDetail}'s thirty-odd nullable fields say, without the nulls. * * `is_default` and `version_group` are not here: they describe the record, not * what the Pokémon has to do. */ type EvolutionRequirement = { kind: "trigger"; trigger: NamedAPIResource; } | { kind: "item"; item: NamedAPIResource; } | { kind: "held-item"; item: NamedAPIResource; } | { kind: "min-level"; level: number; } | { kind: "min-happiness"; happiness: number; } | { kind: "min-beauty"; beauty: number; } | { kind: "min-affection"; affection: number; } | { kind: "known-move"; move: NamedAPIResource; } | { kind: "known-move-type"; type: NamedAPIResource; } | { kind: "used-move"; move: NamedAPIResource; } | { kind: "min-move-count"; count: number; } | { kind: "min-steps"; steps: number; } | { kind: "min-damage-taken"; damage: number; } | { kind: "location"; location: NamedAPIResource; } | { kind: "region"; region: NamedAPIResource; } | { kind: "time-of-day"; time: EvolutionTimeOfDay; } | { kind: "gender"; gender: number; } | { kind: "relative-physical-stats"; comparison: 1 | 0 | -1; } | { kind: "party-species"; species: NamedAPIResource; } | { kind: "party-type"; type: NamedAPIResource; } | { kind: "trade-species"; species: NamedAPIResource; } | { kind: "base-form"; form: NamedAPIResource; } | { kind: "evolved-form"; form: NamedAPIResource; } | { kind: "needs-overworld-rain"; } | { kind: "turn-upside-down"; } | { kind: "near-special-rock"; } | { kind: "needs-multiplayer"; }; /** * The conditions one {@link EvolutionDetail} sets out, with everything it left * unset dropped. * * ```ts * requirementsOf(step.details[0]); // eevee → umbreon * // [ * // { kind: 'trigger', trigger: { name: 'level-up', … } }, * // { kind: 'min-happiness', happiness: 160 }, * // { kind: 'time-of-day', time: 'night' }, * // { kind: 'base-form', form: { name: 'eevee', … } }, * // ] * ``` * * The trigger leads, so rendering the result is a walk over one array. * * Every field is tested against the value the API uses for "unset" rather than * for truthiness: `relative_physical_stats` is `0` when Attack has to equal * Defense, and `time_of_day` is `''`. */ declare const requirementsOf: (detail: EvolutionDetail) => EvolutionRequirement[]; /** * ## Requirement Phrases * One renderer per {@link EvolutionRequirement} kind. Exhaustive, so a kind added * to that union has to be given words here too. */ type RequirementPhrases = { [K in EvolutionRequirement["kind"]]: (requirement: Extract) => string; }; /** * ## Resource Namer * How a resource a requirement names is written out. * * @param resource The item, move, species, location, region, form or type the * requirement carries. * @returns What to print for it. */ type ResourceNamer = (resource: NamedAPIResource) => string; /** * Builds the English table around a way of naming resources. * * Everything except the name is fixed; `namer` is the one thing a caller who * keeps the English sentence still has to replace, because `spaced` prints what * the API calls a resource and no localized name is derivable from it. * * ```ts * const names = new Map([['water-stone', 'Pedra da Água']]); * * requirementPhrases((resource) => names.get(resource.name) ?? resource.name); * ``` * * @param namer How to write a resource out. Defaults to the API's own name, with * the hyphens turned to spaces. */ declare const requirementPhrases: (namer?: ResourceNamer) => RequirementPhrases; /** * ## Requirement Phrases * The English {@link formatRequirements} renders with, naming resources the way * the API does. Exported so a caller can replace the wording of one kind — or * all of them, in another language — without rebuilding the rest of the renderer * around it, and so an override can fall back to the default for what it does * not handle. * * ```ts * formatRequirements(requirements, { * phrases: { 'min-happiness': ({ happiness }) => `com ${happiness} de felicidade` }, * }); * * formatRequirements(requirements, { * phrases: { * trigger: (requirement) => MINE[requirement.trigger.name] ?? REQUIREMENT_PHRASES.trigger(requirement), * }, * }); * ``` */ declare const REQUIREMENT_PHRASES: RequirementPhrases; /** * ## Format Options * How {@link formatRequirements} words what it renders. */ interface FormatOptions { /** * How to write out the resources the requirements name. Defaults to the API's * own name with the hyphens turned to spaces — `water stone`. * * This is the half of a translation that `phrases` cannot do: a display name * is `localize(item.names)`, which is a request, so it has to come from the * caller. Applied to the default table, and to nothing a `phrases` entry * overrides — that entry is handed the resource and names it however it likes. * * Hold the function rather than writing it inline: the table built around a * namer is kept and reused, and a new closure per call is a new table per call. */ name?: ResourceNamer; /** * Wording for the kinds named, {@link REQUIREMENT_PHRASES} for the rest — * everything around it, including the `use-item` de-duplication, stays. */ phrases?: Partial; } /** * Renders requirements as an English phrase. * * ```ts * formatRequirements(requirementsOf(detail)); // eevee → umbreon * // 'level up, with at least 160 happiness, during the night, in its eevee form' * ``` * * The only English in the library, and a separate export for that reason: an * application rendering its own copy — in its own language, or as anything other * than a sentence — drops this and the phrase table with it. Use * {@link requirementsOf} for that, or `phrases` to keep the sentence and change * the words: * * ```ts * formatRequirements(requirements, { phrases: { trade: () => 'by trade' } }); * ``` * * Resources are named the way the API names them, not the way a game displays * them. `localize(item.names)` is the display name, it costs a request, and * `name` is where it goes: * * ```ts * const items = await api.resolveAll(links); * const display = new Map(items.map((item) => [item.name, localize(item.names)?.name])); * * formatRequirements(requirements, { name: (resource) => display.get(resource.name) ?? resource.name }); * // 'use Water Stone' * ``` * * The two options are the two halves of a translation and are independent: * `phrases` is the words the library supplies, `name` the words the API does. * * A `use-item` trigger and the item it uses are one phrase, since "use an item, * use water stone" says it twice. That holds under `phrases` too: the trigger is * dropped before anything is rendered, so an overridden `item` is still what says * the item is used. */ declare const formatRequirements: (requirements: readonly EvolutionRequirement[], options?: FormatOptions) => string; //#endregion //#region src/utils/localize.d.ts /** * ## Localized * An entry the PokéAPI publishes once per language — a `Name`, `FlavorText`, * `Description`, `Effect`, `VerboseEffect`, and everything shaped like them. */ interface Localized { language: NamedAPIResource; } /** * ## Localize Options * Which language to pick, and which to settle for. */ interface LocalizeOptions { /** The language wanted, by the name the PokéAPI gives it. Defaults to `en`. */ language?: string; /** * The language to try when the first one is absent. Left out, nothing is tried * and the answer is `undefined` — a fallback is a decision about the product, * not a default. */ fallback?: string; } /** * Picks the entry written in `language`, by the name the PokéAPI gives that * language: `en`, `ja`, `ja-hrkt`, `zh-hans`, `es-419`, and so on. * * ```ts * const species = await api.pokemon.getPokemonSpeciesByName('eevee'); * * localize(species.names)?.name; // 'Eevee' * localize(species.names, 'ja')?.name; // 'イーブイ' * localize(species.names, { language: 'gd', fallback: 'en' })?.name; // 'Eevee' * ``` * * Matched without regard to case: the PokéAPI writes these tags in lower case, * while BCP 47 capitalizes the script subtag — `ja-Hrkt` is the form anyone used * to language tags will reach for, and it should not silently match nothing. * * A section may list several entries for one language — flavor text, one per * version — and the first is the one returned. {@link localizeAll} is the way to * see the rest and pick by version. * * @returns The entry, the one in `fallback` when that language is absent, or * `undefined` when neither is there. */ declare const localize: (entries: readonly T[], language?: string | LocalizeOptions) => T | undefined; /** * Every entry written in `language`, in the order the API lists them. * * ```ts * const species = await api.pokemon.getPokemonSpeciesByName('eevee'); * * const entries = localizeAll(species.flavor_text_entries, 'en'); * entries.find((entry) => entry.version.name === 'sword')?.flavor_text; * ``` * * Which is what a section publishing one entry per version needs: `localize` * answers with the first, and the first is an arbitrary game's Pokédex entry * rather than the one asked for. The version is on the entry — `version` on * flavor text, `version_group` on the sections that change per group — so the * filter belongs to the caller, who knows which of the two is there. * * @returns The entries, those in `fallback` when the language is absent, or `[]` * when neither is there. */ declare const localizeAll: (entries: readonly T[], language?: string | LocalizeOptions) => T[]; //#endregion //#region src/utils/resource-id.d.ts /** * The id inside a resource URL, without a request. * * ```ts * const page = await api.pokemon.listPokemons(0, 20); * * page.results.map((link) => getPokemonSpriteUrl(resourceId(link))); * ``` * * A list page gives names and URLs and no ids, while the sprite repository is * keyed by id alone — this is what joins the two, and it is what lets a grid of * every Pokémon render off one list request instead of one request per card. * * The id is read off the URL rather than fetched, so it is only as good as the * link: a URL the API did not write is not promised to end in one. * * @param resource The link, as a URL or as the resource object carrying one. * @returns The id. * @throws {TypeError} If the URL does not end in an id. */ declare const resourceId: (resource: ResourceLink) => number; //#endregion //#region src/utils/sprites.d.ts /** * ## Sprite Variant * The sprite sets the PokéAPI publishes for a Pokémon. */ type SpriteVariant = "default" | "official-artwork" | "home" | "dream-world" | "showdown"; /** * ## Pokemon Sprite Options * Which sprite to build a URL for. * * The sets do not carry the same images, so the options are constrained per * variant: only `default` and `showdown` have back-facing sprites, and only * `official-artwork` has no gendered ones. */ type PokemonSpriteOptions = { variant?: "default"; shiny?: boolean; back?: boolean; female?: boolean; } | { variant: "showdown"; shiny?: boolean; back?: boolean; female?: boolean; } | { variant: "home"; shiny?: boolean; female?: boolean; back?: never; } | { variant: "official-artwork"; shiny?: boolean; back?: never; female?: never; } | { variant: "dream-world"; female?: boolean; shiny?: never; back?: never; }; /** * Builds the URL of a Pokémon sprite, without a request. * * ```ts * getPokemonSpriteUrl(25); // front, default set * getPokemonSpriteUrl(25, { variant: "official-artwork" }); * getPokemonSpriteUrl(25, { variant: "showdown", back: true, shiny: true }); * ``` * * The sprite repository does not hold every combination for every Pokémon — a * back-facing sprite of a recent generation, or a gendered form of a species with * one appearance, simply does not exist. This builds a well-formed URL; it does * not promise the file is there. * * @param id The Pokémon ID. Names are not addressable — the sprites are keyed by ID. * @param options Which sprite set and which facing to build for. * @returns The URL of the sprite. */ declare const getPokemonSpriteUrl: (id: number, options?: PokemonSpriteOptions) => string; //#endregion //#region src/utils/type-chart.d.ts /** * ## Generation Scope * Which generation's type chart to read. Leave it out for the current one. */ interface GenerationScope { generation?: GenerationName; } /** * The damage relations `type` had in `generation`, or the current ones when no * generation is named. * * ```ts * const ghost = await api.pokemon.getTypeByName('ghost'); * * relationsFor(ghost).half_damage_to; // [dark] * relationsFor(ghost, 'generation-iii')?.half_damage_to; // [dark, steel] * ``` * * Each entry in `past_damage_relations` records the *last* generation it applied * to, so the chart in force is the first entry still at or after the generation * asked for — Ghost's `generation-v` entry is what Ghost looked like from II * through V, and the current relations take over at VI. * * @returns The relations, or `undefined` when `type` did not exist yet in * `generation`. Nothing is guessed: Steel in generation I has no chart, and a * neutral one would be a confidently wrong answer rather than a missing one. */ declare const relationsFor: (type: Type, generation?: GenerationName) => TypeRelations | undefined; /** * The damage multiplier `attacking` deals to a defender that has `defending` * types — `0`, `0.25`, `0.5`, `1`, `2` or `4`. * * ```ts * const fire = await api.pokemon.getTypeByName('fire'); * const ferrothorn = await api.pokemon.getPokemonByName('ferrothorn'); * * effectiveness(fire, ferrothorn.types.map((slot) => slot.type)); // 4 * ``` * * Read from the attacking type's own offensive relations, so this needs the one * type fetched rather than one per defending type. * * With a `generation`, the chart of that generation is used and the result is * `undefined` when `attacking` postdates it. Only the attacker is checked that * way: the defenders arrive as links, which carry no generation to check * against. `Pokemon.past_types` is where a historically correct defender comes * from. */ declare function effectiveness(attacking: Type, defending: readonly NamedAPIResource[]): number; declare function effectiveness(attacking: Type, defending: readonly NamedAPIResource[], options: { generation: GenerationName; }): number | undefined; /** * What every one of `types` does to a defender that has `defending` types, keyed * by attacking type name — the "what is this Pokémon weak to" table. * * ```ts * const types: Type[] = []; * for await (const type of api.pokemon.paginate('listTypes', { resolve: true })) { * types.push(type); * } * * const profile = defensiveProfile(types, gengar.types.map((slot) => slot.type)); * profile.psychic; // 2 * profile.normal; // 0 * ``` * * The whole `type` section is one cached walk, and every lookup after that is * local. A type that did not exist in the generation asked for is left out of the * table rather than reported as neutral. * * `Partial` because of that, and because `types` is whatever the caller resolved: * an entry is there when the attacking type is, so every lookup is `number | * undefined`. `unknown` and `shadow` are not {@link TypeName}s and are skipped — * they hold no damage relations, so they have no place in a matchup table. * * Reach for {@link defensiveProfileFrom} unless you are asking about a past * generation: it answers the same question from the defender's own types, which * is one or two resources rather than the whole section. This is the form that * takes a `generation`, because only the attacking type carries the history. * * Keyed by the name the API gives a type, which is not the name a game displays: * `localize(type.names)` is what a table headed in French needs, and it is a * property of the resource rather than of this table. */ declare const defensiveProfile: (types: readonly Type[], defending: readonly NamedAPIResource[], options?: GenerationScope) => Partial>; /** * The same table, read off the defending types themselves — what every type does * to a Pokémon that has `defending` types. * * ```ts * const gengar = await api.pokemon.getPokemonByName('gengar'); * const types = await api.resolveAll(gengar.types.map((slot) => slot.type)); * * const profile = defensiveProfileFrom(types); * profile.psychic; // 2 * profile.normal; // 0 * ``` * * Two requests for a dual-typed Pokémon, against the whole `type` section that * {@link defensiveProfile} needs — the answer is the same because the chart is * symmetric, which `tests/live/relations.live.spec.ts` is what keeps honest. * * Every {@link TypeName} is present: the defending types name every attacker * they interact with, and the rest are neutral rather than unknown. There is no * `generation` option for exactly the reason the entries are total — a defending * type's arrays are the current chart, and they have no way to say that an * attacking type did not exist yet. That question needs {@link defensiveProfile}. * * Keyed by the API's name for a type, as {@link defensiveProfile} is; * `localize(type.names)` is the displayed one. */ declare const defensiveProfileFrom: (defending: readonly Type[]) => Record; //#endregion export { APIResource, APIResourceList, Ability, AbilityEffectChange, AbilityFlavorText, AbilityPokemon, Animated, AwesomeName, BASE_URL, BERRIES, BERRY_FIRMNESSES, BERRY_FLAVORS, Berry, BerryClient, BerryFirmness, BerryFlavor, BerryFlavorMap, BlackWhite, BrilliantDiamondShiningPearl, index_d_exports as CONSTANTS, CONTEST_TYPES, CURRENCIES, type CacheStore, ChainLink, Characteristic, type ClientOptions, type ClientStats, ContestClient, ContestComboDetail, ContestComboSets, ContestEffect, ContestFlavorText, ContestName, ContestType, Crystal, CrystalAnimated, Currency, CurrencyClient, Description, DiamondPearl, DreamWorld, EGG_GROUPS, ENCOUNTER_CONDITIONS, ENCOUNTER_CONDITION_VALUES, ENCOUNTER_METHODS, ENDPOINTS, EVOLUTION_TRIGGERS, Effect, EggGroup, Emerald, Encounter, EncounterClient, EncounterCondition, EncounterConditionValue, EncounterMethod, EncounterMethodRate, EncounterPokemonDetail, EncounterVersionDetails, Endpoint, type EtagEntry, EtagStore, type EtagStoreOptions, EvolutionChain, EvolutionClient, EvolutionDetail, type EvolutionRequirement, type EvolutionStep, EvolutionTimeOfDay, EvolutionTrigger, EvolutionTriggerName, type FetchLike, FireredLeafgreen, type FlattenOptions, FlavorBerryMap, FlavorText, type FormatOptions, GENDERS, GENERATIONS, GROWTH_RATES, GameClient, Gender, Generation, GenerationGameIndex, GenerationIIISprites, GenerationIIITypeSprites, GenerationIISprites, GenerationISprites, GenerationIVSprites, GenerationIVTypeSprites, GenerationIXSprites, GenerationIXTypeSprites, GenerationName, type GenerationScope, GenerationVAnimatedIcons, GenerationVIIISprites, GenerationVIIITypeSprites, GenerationVIISprites, GenerationVIITypeSprites, GenerationVISprites, GenerationVITypeSprites, GenerationVIcons, GenerationVSprites, GenerationVTypeSprites, GenerationViiIcons, GenerationViiiIcons, Genus, Gold, GrowthRate, GrowthRateExperienceLevel, HeartgoldSoulsilver, Home, ITEM_ATTRIBUTES, ITEM_CATEGORIES, ITEM_FLING_EFFECTS, ITEM_POCKETS, Item, ItemAttribute, ItemCategory, ItemClient, ItemFlingEffect, ItemHolderPokemon, ItemHolderPokemonVersionDetail, ItemPocket, ItemPrice, ItemSprites, LANGUAGES, Language, type ListFn, type ListMethodName, type ListPage, type LocalizeOptions, type Localized, Location, LocationArea, LocationAreaEncounter, LocationClient, type LogCancelledPayload, type LogErrorPayload, type LogRequestPayload, type LogResponsePayload, type LogRetryPayload, type Logger, MOVE_AILMENTS, MOVE_BATTLE_STYLES, MOVE_CATEGORIES, MOVE_DAMAGE_CLASSES, MOVE_LEARN_METHODS, MOVE_TARGETS, Machine, MachineClient, MachineVersionDetail, MainClient, MemoryCache, type MemoryCacheOptions, Move, MoveAilment, MoveBattleStyle, MoveBattleStylePreference, MoveCategory, MoveClient, MoveDamageClass, MoveFlavorText, MoveLearnMethod, MoveMetaData, MoveStatAffect, MoveStatAffectSets, MoveStatChange, MoveTarget, NATURES, Name, NamedAPIResource, NamedAPIResourceList, Nature, NaturePokeathlonStatAffect, NaturePokeathlonStatAffectSets, NatureStatAffectSets, NatureStatChange, OfficialArtwork, OmegarubyAlphasapphire, OtherPokemonSprites, PAL_PARK_AREAS, POKEATHLON_STATS, POKEDEXES, POKEMON_COLORS, POKEMON_HABITATS, POKEMON_SHAPES, type PaginateOptions, PalParkArea, PalParkEncounterArea, PalParkEncounterSpecies, PastMoveStatValues, Platinum, PokeathlonStat, Pokedex, Pokemon, PokemonAbility, PokemonClient, PokemonColor, PokemonCries, PokemonEncounter, PokemonEntry, PokemonForm, PokemonFormCondition, PokemonFormGenerationVIIISprites, PokemonFormSprites, PokemonFormVersionSprites, PokemonHabitat, PokemonHeldItem, PokemonHeldItemVersion, PokemonMove, PokemonMoveVersion, PokemonPastAbility, PokemonPastAbilitySlot, PokemonPastStat, PokemonPastType, PokemonShape, PokemonSpecies, PokemonSpeciesDexEntry, PokemonSpeciesGender, PokemonSpeciesVariety, type PokemonSpriteOptions, PokemonSprites, PokemonStat, PokemonType, PokenodeError, REGIONS, REQUIREMENT_PHRASES, RedBlue, Region, type RequestScope, type RequirementPhrases, type ResolveOptions, type ResourceLink, type ResourceNamer, type RetryOptions, RubySapphire, STATS, ScarletViolet, Showdown, Silver, type SpriteVariant, Stat, SuperContestEffect, TYPES, Type, TypeGameSprites, TypeName, TypePokemon, TypeRelations, TypeRelationsPast, TypeSprites, UltraSunUltraMoon, UtilityClient, VERSIONS, VERSION_GROUPS, VerboseEffect, Version, VersionEncounterDetail, VersionGameIndex, VersionGroup, VersionGroupFlavorText, VersionSprites, WebStorageCache, type WebStorageCacheOptions, type WebStorageLike, XY, Yellow, consoleLogger, defensiveProfile, defensiveProfileFrom, effectiveness, flattenChain, formatRequirements, getPokemonSpriteUrl, localize, localizeAll, pathTo, relationsFor, requirementPhrases, requirementsOf, resourceId }; //# sourceMappingURL=index.d.cts.map