pokenode-ts 2.2.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -663,6 +663,13 @@ interface Type {
663
663
  }
664
664
  //#endregion
665
665
  //#region src/models/evolution/evolution.d.ts
666
+ /**
667
+ * ## Evolution Time Of Day
668
+ * The times of day an evolution can be tied to, lower case as the API writes
669
+ * them. `dusk` is Lycanroc's Dusk Form and `full-moon` is Ursaluna, so this is
670
+ * wider than the day/night pair the endpoint documentation describes.
671
+ */
672
+ type EvolutionTimeOfDay = "day" | "night" | "dusk" | "full-moon";
666
673
  /**
667
674
  * ## Evolution Detail
668
675
  * All details regarding the specific details of the referenced Pokémon species evolution.
@@ -701,8 +708,8 @@ interface EvolutionDetail {
701
708
  party_type: NamedAPIResource<Type> | null;
702
709
  /** The required relation between the Pokémon's Attack and Defense stats. 1 means Attack > Defense. 0 means Attack = Defense. -1 means Attack < Defense. */
703
710
  relative_physical_stats: 1 | 0 | -1 | null;
704
- /** The required time of day. Day or night. */
705
- time_of_day: "Day" | "Night" | "";
711
+ /** The required time of day, or `""` when any time will do. */
712
+ time_of_day: EvolutionTimeOfDay | "";
706
713
  /** Pokémon species for which this one must be traded. */
707
714
  trade_species: NamedAPIResource<PokemonSpecies> | null;
708
715
  /** Whether or not the 3DS needs to be turned upside-down as this Pokémon levels up. */
@@ -775,6 +782,13 @@ interface EvolutionChain {
775
782
  */
776
783
  chain: ChainLink;
777
784
  }
785
+ /**
786
+ * ## Evolution Trigger Name
787
+ * Every trigger the PokéAPI publishes, in the order `/evolution-trigger` lists
788
+ * them — which is the order their ids run in, and the order
789
+ * {@link EVOLUTION_TRIGGERS} mirrors.
790
+ */
791
+ 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";
778
792
  /**
779
793
  * ## Evolution Trigger
780
794
  * Evolution triggers are the events and conditions that cause a Pokémon to evolve.
@@ -788,7 +802,7 @@ interface EvolutionTrigger {
788
802
  /** The identifier for this resource. */
789
803
  id: number;
790
804
  /** The name for this resource. */
791
- name: "level-up" | "trade" | "use-item" | "shed" | "other";
805
+ name: EvolutionTriggerName;
792
806
  /** The name of this resource listed in different languages. */
793
807
  names: Name[];
794
808
  /** A list of Pokémon species that result from this evolution trigger. */
@@ -2920,6 +2934,10 @@ declare const BERRIES: {
2920
2934
  readonly CUSTAP: 62;
2921
2935
  readonly JABOCA: 63;
2922
2936
  readonly ROWAP: 64;
2937
+ readonly KEE: 65;
2938
+ readonly MARANGA: 66;
2939
+ readonly HOPO: 67;
2940
+ readonly ROSELI: 68;
2923
2941
  };
2924
2942
  /** Enum of Berry Firmnesses (NAME - ID) */
2925
2943
  declare const BERRY_FIRMNESSES: {
@@ -2990,14 +3008,63 @@ declare const ENCOUNTER_METHODS: {
2990
3008
  readonly ROUGH_TERRAIN: 17;
2991
3009
  readonly GIFT: 18;
2992
3010
  readonly GIFT_EGG: 19;
2993
- readonly ONLY_ONE: 20;
3011
+ readonly STATIC: 20;
2994
3012
  readonly POKEFLUTE: 21;
2995
3013
  readonly HEADBUTT_LOW: 22;
2996
3014
  readonly HEADBUTT_NORMAL: 23;
2997
- readonly HEADBUT_HIGH: 24;
3015
+ readonly HEADBUTT_HIGH: 24;
2998
3016
  readonly SQUIRT_BOTTLE: 25;
2999
3017
  readonly WAILMER_PAIL: 26;
3000
3018
  readonly SEAWEED: 27;
3019
+ readonly ROAMING_GRASS: 28;
3020
+ readonly ROAMING_WATER: 29;
3021
+ readonly DEVON_SCOPE: 30;
3022
+ readonly FEEBAS_TILE_FISHING: 31;
3023
+ readonly ISLAND_SCAN: 32;
3024
+ readonly SOS: 33;
3025
+ readonly BUBBLING_SPOTS: 34;
3026
+ readonly BERRY_TREES: 35;
3027
+ readonly NPC_TRADE: 36;
3028
+ readonly SOS_FROM_BUBBLING_SPOT: 37;
3029
+ readonly OVERWORLD: 38;
3030
+ readonly OVERWORLD_WATER: 39;
3031
+ readonly OVERWORLD_FLYING: 40;
3032
+ readonly OVERWORLD_SPECIAL: 41;
3033
+ readonly OVERWORLD_FLYING_SPECIAL: 42;
3034
+ readonly OVERWORLD_WATER_SPECIAL: 43;
3035
+ readonly HORDE: 44;
3036
+ readonly COLOSSEUM_BONUS_DISC_US: 45;
3037
+ readonly COLOSSEUM_BONUS_DISC_JPN: 46;
3038
+ readonly POKEMON_CHANNEL_PAL: 47;
3039
+ readonly POKEMON_RANGER: 48;
3040
+ readonly POKEMON_BATTLE_REVOLUTION: 49;
3041
+ readonly NEW_YORK_POKECENTER_WISH_EGGS: 50;
3042
+ readonly SNAG: 51;
3043
+ readonly SNAG_REMATCH: 52;
3044
+ readonly POKESPOT: 53;
3045
+ readonly HIDDEN_GROTTO: 54;
3046
+ readonly HONEY_TREE: 55;
3047
+ readonly OVERWORLD_DIRT: 56;
3048
+ readonly WANDERER: 57;
3049
+ readonly WANDERER_WATER: 58;
3050
+ readonly CHASE_WATER: 59;
3051
+ readonly DYNAMAX_ADVENTURE: 60;
3052
+ readonly MAX_RAID: 61;
3053
+ readonly TRASH_CAN_AMBUSH: 62;
3054
+ readonly RUSTLING_BUSH_AMBUSH: 63;
3055
+ readonly CEILING_AMBUSH: 64;
3056
+ readonly GROUND_AMBUSH: 65;
3057
+ readonly SKY_AMBUSH: 66;
3058
+ /**
3059
+ * @deprecated Misspelled: the endpoint names this `headbutt-high`.
3060
+ * Use {@link ENCOUNTER_METHODS.HEADBUTT_HIGH}. Removed in 3.0.
3061
+ */
3062
+ readonly HEADBUT_HIGH: 24;
3063
+ /**
3064
+ * @deprecated The endpoint names this `static` now.
3065
+ * Use {@link ENCOUNTER_METHODS.STATIC}. Removed in 3.0.
3066
+ */
3067
+ readonly ONLY_ONE: 20;
3001
3068
  };
3002
3069
  declare const ENCOUNTER_CONDITIONS: {
3003
3070
  readonly SWARM: 1;
@@ -3010,6 +3077,26 @@ declare const ENCOUNTER_CONDITIONS: {
3010
3077
  readonly TV_OPTION: 8;
3011
3078
  readonly STORY_PROGRESS: 9;
3012
3079
  readonly OTHER: 10;
3080
+ readonly ITEM: 11;
3081
+ readonly WEEKDAY: 12;
3082
+ readonly FIRST_PARTY_POKEMON: 13;
3083
+ readonly SPECIAL_ENCOUNTER: 14;
3084
+ readonly TRADE: 15;
3085
+ readonly COINS: 16;
3086
+ readonly FRIEND_SAFARI_SLOT: 17;
3087
+ readonly GREAT_MARSH_DAILY_SLOT: 18;
3088
+ readonly HONEY_TREE_GROUP: 19;
3089
+ readonly HEADBUTT_TREE: 20;
3090
+ readonly BACKLOT: 21;
3091
+ readonly BUG_CATCHING_CONTEST: 22;
3092
+ readonly SAVE_DATA: 23;
3093
+ readonly ALOLAN_DIGLETT_FOUND: 24;
3094
+ readonly WEATHER: 25;
3095
+ readonly JOHTO_SAFARI_BLOCKS: 26;
3096
+ readonly MAX_DEN_RARITY: 27;
3097
+ readonly MAX_DEN_RATING: 28;
3098
+ readonly BERRY_TREE_TYPE: 29;
3099
+ readonly TRASH_CAN_TYPE: 30;
3013
3100
  };
3014
3101
  declare const ENCOUNTER_CONDITION_VALUES: {
3015
3102
  readonly SWARM_YES: 1;
@@ -3021,16 +3108,16 @@ declare const ENCOUNTER_CONDITION_VALUES: {
3021
3108
  readonly RADAR_OFF: 7;
3022
3109
  readonly SLOT2_NONE: 8;
3023
3110
  readonly SLOT2_RUBY: 9;
3024
- readonly SLOT2_SAPHIRE: 10;
3111
+ readonly SLOT2_SAPPHIRE: 10;
3025
3112
  readonly SLOT2_EMERALD: 11;
3026
3113
  readonly SLOT2_FIRERED: 12;
3027
3114
  readonly SLOT2_LEAFGREEN: 13;
3028
3115
  readonly RADIO_OFF: 14;
3029
- readonly RADIO_HOEN: 15;
3116
+ readonly RADIO_HOENN: 15;
3030
3117
  readonly RADIO_SINNOH: 16;
3031
3118
  readonly SEASON_SPRING: 17;
3032
3119
  readonly SEASON_SUMMER: 18;
3033
- readonly SWASON_AUTUMN: 19;
3120
+ readonly SEASON_AUTUMN: 19;
3034
3121
  readonly SEASON_WINTER: 20;
3035
3122
  readonly STARTER_BULBASAUR: 21;
3036
3123
  readonly STARTER_SQUIRTLE: 22;
@@ -3043,14 +3130,361 @@ declare const ENCOUNTER_CONDITION_VALUES: {
3043
3130
  readonly STORY_PROGRESS_AWAKENED_BEASTS: 29;
3044
3131
  readonly STORY_PROGRESS_BEAT_GALACTIC_CORONET: 30;
3045
3132
  readonly STORY_PROGRESS_OAK_ETERNA_CITY: 31;
3046
- readonly STORY_PROGRESS_OAK_VERMILION_COPYCAT: 32;
3133
+ readonly STORY_PROGRESS_VERMILION_COPYCAT: 32;
3047
3134
  readonly STORY_PROGRESS_MET_TORNADUS_THUNDURUS: 33;
3048
3135
  readonly STORY_PROGRESS_BEAT_ELITE_FOUR_ROUND_TWO: 34;
3049
3136
  readonly STORY_PROGRESS_HALL_OF_FAME: 35;
3050
3137
  readonly STORY_PROGRESS_NONE: 36;
3051
3138
  readonly STORY_PROGRESS_NATIONAL_DEX: 37;
3052
3139
  readonly OTHER_NONE: 38;
3140
+ readonly OTHER_SNORLAX_11_BEAT_LEAGUE: 39;
3141
+ readonly OTHER_VIRTUAL_CONSOLE: 40;
3142
+ readonly STORY_PROGRESS_CURE_ELDRITCH_NIGHTMARES: 41;
3143
+ readonly OTHER_TALK_TO_CYNTHIAS_GRANDMOTHER: 42;
3144
+ readonly ITEM_NONE: 43;
3145
+ readonly ITEM_ADAMANT_ORB: 44;
3146
+ readonly ITEM_LUSTROUS_ORB: 45;
3147
+ readonly ITEM_HELIX_FOSSIL: 46;
3148
+ readonly ITEM_DOME_FOSSIL: 47;
3149
+ readonly ITEM_OLD_AMBER: 48;
3150
+ readonly ITEM_ROOT_FOSSIL: 49;
3151
+ readonly ITEM_CLAW_FOSSIL: 50;
3152
+ readonly STORY_PROGRESS_DEFEAT_JUPITER: 51;
3153
+ readonly STORY_PROGRESS_BEAT_TEAM_GALACTIC_IRON_ISLAND: 52;
3154
+ readonly OTHER_CORRECT_PASSWORD: 53;
3155
+ readonly STORY_PROGRESS_ZEPHYR_BADGE: 54;
3156
+ readonly STORY_PROGRESS_BEAT_RED: 55;
3157
+ readonly OTHER_RECEIVED_KANTO_STARTER: 56;
3158
+ readonly STORY_PROGRESS_RECEIVE_TM_FROM_CLAIRE: 57;
3159
+ readonly OTHER_REGIROCK_REGICE_REGISTEEL_IN_PARTY: 58;
3160
+ readonly WEEKDAY_SUNDAY: 59;
3161
+ readonly WEEKDAY_MONDAY: 60;
3162
+ readonly WEEKDAY_TUESDAY: 61;
3163
+ readonly WEEKDAY_WEDNESDAY: 62;
3164
+ readonly WEEKDAY_THURSDAY: 63;
3165
+ readonly WEEKDAY_FRIDAY: 64;
3166
+ readonly WEEKDAY_SATURDAY: 65;
3167
+ readonly FIRST_PARTY_POKEMON_HIGH_FRIENDSHIP: 66;
3168
+ readonly STORY_PROGRESS_DEFEAT_MARS: 67;
3169
+ readonly ITEM_ODD_KEYSTONE: 68;
3170
+ readonly OTHER_TALKED_TO_32_PEOPLE_UNDERGROUND: 69;
3171
+ readonly STORY_PROGRESS_RETURNED_MACHINE_PART: 70;
3172
+ readonly OTHER_EVENT_ARCEUS_IN_PARTY: 71;
3173
+ readonly SPECIAL_ENCOUNTER_COULDNT_CAPTURE_BEFORE: 72;
3174
+ readonly ITEM_ICE_KEY: 73;
3175
+ readonly ITEM_IRON_KEY: 74;
3176
+ readonly STORY_PROGRESS_JUNIPER_CAVE_OF_BEING: 75;
3177
+ readonly ITEM_LUNAR_WING: 76;
3178
+ readonly STORY_PROGRESS_QUAKE_BADGE: 77;
3179
+ readonly ITEM_LIGHT_STONE: 78;
3180
+ readonly ITEM_DARK_STONE: 79;
3181
+ readonly OTHER_CAPTURED_RESHIRAM_OR_ZEKROM: 80;
3182
+ readonly DEFEATED_GHETSIS: 81;
3183
+ readonly OTHER_FOUND_11_TIMES_ROAMING: 82;
3184
+ readonly TIME_MINUTE_00_TO_19: 83;
3185
+ readonly TIME_MINUTE_20_TO_39: 84;
3186
+ readonly TIME_MINUTE_40_TO_59: 85;
3187
+ readonly TIME_04_00_TO_19_59: 86;
3188
+ readonly TIME_20_00_TO_21_59: 87;
3189
+ readonly TIME_21_00_TO_03_59: 88;
3190
+ readonly ITEM_TIDAL_BELL: 89;
3191
+ readonly ITEM_CLEAR_BELL: 90;
3192
+ readonly STORY_PROGRESS_DEFEATED_GROUDON_OR_KYOGRE: 91;
3193
+ readonly OTHER_UXIE_MESPRIT_AZELF_IN_PARTY: 92;
3194
+ readonly OTHER_NICKNAMED_COLD_ITEM_REGICE_REGIROCK_REGISTEEL3: 93;
3195
+ readonly OTHER_DIALGA_OR_PALKIA_IN_PARTY: 94;
3196
+ readonly OTHER_CASTFORM_IN_PARTY: 95;
3197
+ readonly OTHER_LEVEL_100_POKEMON_IN_PARTY: 96;
3198
+ readonly OTHER_TORNADUS_THUNDURUS_IN_PARTY: 97;
3199
+ readonly OTHER_RESHIRAM_ZEKROM_IN_PARTY: 98;
3200
+ readonly OTHER_CAPTURED_ALL_ULTRA_BEASTS: 99;
3201
+ readonly STORY_PROGRESS_FINISHED_LOOKER_SIDEQUEST: 100;
3202
+ readonly STORY_PROGRESS_BEAT_OLIVIAS_TRIAL: 101;
3203
+ readonly OTHER_RAIKOU_ENTEI_IN_PARTY: 102;
3204
+ readonly OTHER_GROUDON_KYOGRE_IN_PARTY: 103;
3205
+ readonly OTHER_DIALGA_PALKIA_IN_PARTY: 104;
3206
+ readonly OTHER_SCAN_QR_CODE: 105;
3207
+ readonly OTHER_CAUGHT_ARTICUNO: 106;
3208
+ readonly OTHER_CAUGHT_ZAPDOS: 107;
3209
+ readonly OTHER_CAUGHT_MOLTRES: 108;
3210
+ readonly TRADE_TOGEPI_OR_TOGETIC: 109;
3211
+ readonly TRADE_TRAPINCH: 110;
3212
+ readonly TRADE_SURSKIT: 111;
3213
+ readonly TRADE_WOOPER: 112;
3214
+ readonly STORY_PROGRESS_CATCH_ALL_SHADOW_POKEMON: 113;
3215
+ readonly OTHER_COMPLETE_MT_BATTLE: 114;
3216
+ readonly COINS_180: 115;
3217
+ readonly COINS_500: 116;
3218
+ readonly COINS_1200: 117;
3219
+ readonly COINS_2800: 118;
3220
+ readonly COINS_5500: 119;
3221
+ readonly COINS_9999: 120;
3222
+ readonly COINS_120: 121;
3223
+ readonly COINS_750: 122;
3224
+ readonly COINS_2500: 123;
3225
+ readonly COINS_4600: 124;
3226
+ readonly COINS_6500: 125;
3227
+ readonly COINS_230: 126;
3228
+ readonly COINS_1000: 127;
3229
+ readonly COINS_2680: 128;
3230
+ readonly COINS_3333: 129;
3231
+ readonly COINS_6666: 130;
3232
+ readonly COINS_200: 131;
3233
+ readonly COINS_700: 132;
3234
+ readonly COINS_2100: 133;
3235
+ readonly COINS_100: 134;
3236
+ readonly COINS_800: 135;
3237
+ readonly COINS_1500: 136;
3238
+ readonly COINS_2222: 137;
3239
+ readonly COINS_5555: 138;
3240
+ readonly COINS_8888: 139;
3241
+ readonly COINS_150: 140;
3242
+ readonly COINS_620: 141;
3243
+ readonly COINS_2880: 142;
3244
+ readonly COINS_5400: 143;
3245
+ readonly COINS_8300: 144;
3246
+ readonly TRADE_ABRA: 145;
3247
+ readonly TRADE_NIDORAN_M: 146;
3248
+ readonly TRADE_NIDORINO: 147;
3249
+ readonly TRADE_SLOWBRO: 148;
3250
+ readonly TRADE_POLIWHIRL: 149;
3251
+ readonly TRADE_SPEAROW: 150;
3252
+ readonly TRADE_RAICHU: 151;
3253
+ readonly TRADE_VENONAT: 152;
3254
+ readonly TRADE_PONYTA: 153;
3255
+ readonly TRADE_CLEFAIRY: 154;
3256
+ readonly TRADE_CUBONE: 155;
3257
+ readonly TRADE_LICKITUNG: 156;
3258
+ readonly TRADE_TANGELA: 157;
3259
+ readonly TRADE_GOLDUCK: 158;
3260
+ readonly TRADE_GROWLITHE: 159;
3261
+ readonly TRADE_KANGASKHAN: 160;
3262
+ readonly TRADE_BELLSPROUT: 161;
3263
+ readonly TRADE_DROWZEE: 162;
3264
+ readonly TRADE_KRABBY: 163;
3265
+ readonly TRADE_DRAGONAIR: 164;
3266
+ readonly TRADE_CHANSEY: 165;
3267
+ readonly TRADE_GLOOM: 166;
3268
+ readonly TRADE_HAUNTER: 167;
3269
+ readonly TRADE_DUGTRIO: 168;
3270
+ readonly TRADE_SLAKOTH: 169;
3271
+ readonly TRADE_PIKACHU: 170;
3272
+ readonly TRADE_BELLOSSOM: 171;
3273
+ readonly TRADE_RALTS: 172;
3274
+ readonly TRADE_VOLBEAT: 173;
3275
+ readonly TRADE_BAGON: 174;
3276
+ readonly TRADE_SKITTY: 175;
3277
+ readonly FRIEND_SAFARI_SLOT_1: 176;
3278
+ readonly FRIEND_SAFARI_SLOT_2: 177;
3279
+ readonly FRIEND_SAFARI_SLOT_3: 178;
3280
+ readonly ITEM_SKULL_FOSSIL: 179;
3281
+ readonly ITEM_ARMOR_FOSSIL: 180;
3282
+ readonly GREAT_MARSH_DAILY_SLOT_NONE: 181;
3283
+ readonly GREAT_MARSH_DAILY_SLOT_1_OF_32: 182;
3284
+ readonly GREAT_MARSH_DAILY_SLOT_2_OF_32: 183;
3285
+ readonly GREAT_MARSH_DAILY_SLOT_3_OF_32: 184;
3286
+ readonly GREAT_MARSH_DAILY_SLOT_5_OF_32: 185;
3287
+ readonly STORY_PROGRESS_BEFORE_NATIONAL_DEX: 186;
3288
+ readonly GREAT_MARSH_DAILY_SLOT_4_OF_32: 187;
3289
+ readonly GREAT_MARSH_DAILY_SLOT_15_OF_32: 188;
3290
+ readonly HONEY_TREE_GROUP_A: 189;
3291
+ readonly HONEY_TREE_GROUP_B: 190;
3292
+ readonly HONEY_TREE_GROUP_C: 191;
3293
+ readonly HEADBUTT_TREE_COMMON: 192;
3294
+ readonly HEADBUTT_TREE_RARE: 193;
3295
+ readonly HEADBUTT_TREE_SECRET: 194;
3296
+ readonly TRADE_COTTONEE: 195;
3297
+ readonly TRADE_PETILIL: 196;
3298
+ readonly TRADE_EMOLGA: 197;
3299
+ readonly TRADE_MANTINE: 198;
3300
+ readonly TRADE_DITTO: 199;
3301
+ readonly TRADE_EXCADRILL: 200;
3302
+ readonly TRADE_HIPPOWDON: 201;
3303
+ readonly BACKLOT_NOT_MENTIONED: 202;
3304
+ readonly BACKLOT_MENTIONED: 203;
3305
+ readonly BUG_CATCHING_CONTEST_NO: 204;
3306
+ readonly BUG_CATCHING_CONTEST_YES: 205;
3307
+ readonly SAVE_DATA_FROM_LETS_GO_PIKACHU: 206;
3308
+ readonly SAVE_DATA_FROM_LETS_GO_EEVEE: 207;
3309
+ readonly ITEM_FOSSILIZED_BIRD: 208;
3310
+ readonly ITEM_FOSSILIZED_DRAKE: 209;
3311
+ readonly ITEM_FOSSILIZED_DINO: 210;
3312
+ readonly ITEM_FOSSILIZED_FISH: 211;
3313
+ readonly STORY_PROGRESS_MASTER_DOJO_COMPLETE_FIRST_TRIAL: 212;
3314
+ readonly STORY_PROGRESS_MASTER_DOJO_COMPLETE_THIRD_TRIAL: 213;
3315
+ readonly ALOLAN_DIGLETT_FOUND_5: 214;
3316
+ readonly ALOLAN_DIGLETT_FOUND_10: 215;
3317
+ readonly ALOLAN_DIGLETT_FOUND_20: 216;
3318
+ readonly ALOLAN_DIGLETT_FOUND_30: 217;
3319
+ readonly ALOLAN_DIGLETT_FOUND_40: 218;
3320
+ readonly ALOLAN_DIGLETT_FOUND_50: 219;
3321
+ readonly ALOLAN_DIGLETT_FOUND_75: 220;
3322
+ readonly ALOLAN_DIGLETT_FOUND_100: 221;
3323
+ readonly ALOLAN_DIGLETT_FOUND_150: 222;
3324
+ readonly STARTER_GROOKEY: 223;
3325
+ readonly STARTER_SCORBUNNY: 224;
3326
+ readonly STARTER_SOBBLE: 225;
3327
+ readonly STORY_PROGRESS_SAVE_VILLAGE_FROM_GLASTRIER_SPECTRIER: 226;
3328
+ readonly STORY_PROGRESS_CATCH_FIVE_ULTRA_BEASTS: 227;
3329
+ readonly TRADE_BUNNELBY: 228;
3330
+ readonly TRADE_MEOWTH_GALAR: 229;
3331
+ readonly TRADE_MINCCINO: 230;
3332
+ readonly TRADE_TOXEL: 231;
3333
+ readonly TRADE_MARACTUS: 232;
3334
+ readonly TRADE_YAMASK_GALAR: 233;
3335
+ readonly TRADE_VANILLISH: 234;
3336
+ readonly TRADE_OBSTAGOON: 235;
3337
+ readonly TRADE_FROSMOTH: 236;
3338
+ readonly TRADE_FARFETCHD_GALAR: 237;
3339
+ readonly TRADE_CORSOLA_GALAR: 238;
3340
+ readonly TRADE_PONYTA_GALAR: 239;
3341
+ readonly TRADE_MR_MIME_GALAR: 240;
3342
+ readonly TRADE_DARUMAKA_GALAR: 241;
3343
+ readonly TRADE_ZIGZAGOON_GALAR: 242;
3344
+ readonly TRADE_STUNFISK_GALAR: 243;
3345
+ readonly TRADE_WEEZING_GALAR: 244;
3346
+ readonly TRADE_EXEGGUTOR: 245;
3347
+ readonly TRADE_MAROWAK: 246;
3348
+ readonly WEATHER_NORMAL: 247;
3349
+ readonly WEATHER_OVERCAST: 248;
3350
+ readonly WEATHER_RAINING: 249;
3351
+ readonly WEATHER_THUNDERSTORM: 250;
3352
+ readonly WEATHER_SNOWING: 251;
3353
+ readonly WEATHER_SNOWSTORM: 252;
3354
+ readonly WEATHER_SANDSTORM: 253;
3355
+ readonly WEATHER_INTENSE_SUN: 254;
3356
+ readonly WEATHER_FOG: 255;
3357
+ readonly STORY_PROGRESS_BEFORE_HALL_OF_FAME: 256;
3358
+ readonly JOHTO_SAFARI_BLOCKS_INACTIVE: 257;
3359
+ readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_2: 258;
3360
+ readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_3: 259;
3361
+ readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_4: 260;
3362
+ readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_5: 261;
3363
+ readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_6: 262;
3364
+ readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_10: 263;
3365
+ readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_12: 264;
3366
+ readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_14: 265;
3367
+ readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_15: 266;
3368
+ readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_24: 267;
3369
+ readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_28: 268;
3370
+ readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_35: 269;
3371
+ readonly JOHTO_SAFARI_BLOCKS_PLAINS_MIN_49: 270;
3372
+ readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_3: 271;
3373
+ readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_4: 272;
3374
+ readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_5: 273;
3375
+ readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_8: 274;
3376
+ readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_10: 275;
3377
+ readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_14: 276;
3378
+ readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_15: 277;
3379
+ readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_18: 278;
3380
+ readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_20: 279;
3381
+ readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_28: 280;
3382
+ readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_35: 281;
3383
+ readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_42: 282;
3384
+ readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_49: 283;
3385
+ readonly JOHTO_SAFARI_BLOCKS_FOREST_MIN_56: 284;
3386
+ readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_3: 285;
3387
+ readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_4: 286;
3388
+ readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_5: 287;
3389
+ readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_6: 288;
3390
+ readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_8: 289;
3391
+ readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_10: 290;
3392
+ readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_15: 291;
3393
+ readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_21: 292;
3394
+ readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_24: 293;
3395
+ readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_28: 294;
3396
+ readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_35: 295;
3397
+ readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_42: 296;
3398
+ readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_49: 297;
3399
+ readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_56: 298;
3400
+ readonly JOHTO_SAFARI_BLOCKS_PEAK_MIN_63: 299;
3401
+ readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_2: 300;
3402
+ readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_3: 301;
3403
+ readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_4: 302;
3404
+ readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_5: 303;
3405
+ readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_6: 304;
3406
+ readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_7: 305;
3407
+ readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_8: 306;
3408
+ readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_9: 307;
3409
+ readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_10: 308;
3410
+ readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_12: 309;
3411
+ readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_13: 310;
3412
+ readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_14: 311;
3413
+ readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_15: 312;
3414
+ readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_16: 313;
3415
+ readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_18: 314;
3416
+ readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_20: 315;
3417
+ readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_24: 316;
3418
+ readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_28: 317;
3419
+ readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_35: 318;
3420
+ readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_42: 319;
3421
+ readonly JOHTO_SAFARI_BLOCKS_WATER_MIN_49: 320;
3422
+ readonly ITEM_COVER_FOSSIL: 321;
3423
+ readonly ITEM_PLUME_FOSSIL: 322;
3424
+ readonly OTHER_GIRATINA_NOT_CAUGHT_IN_DISTORTION_WORLD: 323;
3425
+ readonly OTHER_FIND_50_CAVERN_FOOTPRINTS: 324;
3426
+ readonly OTHER_FIND_50_GRASSLAND_FOOTPRINTS: 325;
3427
+ readonly OTHER_FIND_50_IRON_WILL_FOOTPRINTS: 326;
3428
+ readonly OTHER_REGIROCK_REGICE_REGISTEEL_REGIELEKI_REGIDRAGO_IN_PARTY: 327;
3429
+ readonly OTHER_CHOOSE_REGIELEKI_PATTERN: 328;
3430
+ readonly OTHER_CHOOSE_REGIDRAGO_PATTERN: 329;
3431
+ readonly OTHER_GROW_ICEROOT_CARROT: 330;
3432
+ readonly OTHER_GROW_SHADEROOT_CARROT: 331;
3433
+ readonly OTHER_TALKED_TO_32_PEOPLE: 332;
3434
+ readonly OTHER_EAT_CURRY_WITH_COBALION_TERRAKION_VIRIZION: 333;
3435
+ readonly ITEM_REINS_OF_UNITY: 334;
3436
+ readonly OTHER_WITNESS_GALARIAN_BIRD_FIGHT: 335;
3437
+ readonly MAX_DEN_RARITY_COMMON: 336;
3438
+ readonly MAX_DEN_RARITY_RARE: 337;
3439
+ readonly MAX_DEN_RATING_1_STAR: 338;
3440
+ readonly MAX_DEN_RATING_2_STAR: 339;
3441
+ readonly MAX_DEN_RATING_3_STAR: 340;
3442
+ readonly MAX_DEN_RATING_4_STAR: 341;
3443
+ readonly MAX_DEN_RATING_5_STAR: 342;
3444
+ readonly MAX_DEN_RARITY_SPECIAL: 343;
3445
+ readonly BERRY_TREE_TYPE_RED: 344;
3446
+ readonly BERRY_TREE_TYPE_BLUE: 345;
3447
+ readonly BERRY_TREE_TYPE_PURPLE: 346;
3448
+ readonly BERRY_TREE_TYPE_GREEN: 347;
3449
+ readonly BERRY_TREE_TYPE_YELLOW: 348;
3450
+ readonly BERRY_TREE_TYPE_PINK: 349;
3451
+ readonly TRASH_CAN_TYPE_DAILY: 350;
3452
+ readonly TRASH_CAN_TYPE_TUESDAY: 351;
3453
+ readonly TRASH_CAN_TYPE_THURSDAY: 352;
3454
+ readonly TRADE_NIDORAN_F: 353;
3455
+ readonly TRADE_NIDORINA: 354;
3456
+ readonly TRADE_MACHOP: 355;
3457
+ readonly TRADE_BUIZEL: 356;
3458
+ readonly TRADE_MEDICHAM: 357;
3459
+ readonly TRADE_FINNEON: 358;
3460
+ readonly TRADE_FORRETRESS: 359;
3461
+ readonly TRADE_BONSLY: 360;
3462
+ readonly TRADE_ANY_POKEMON: 361;
3463
+ /**
3464
+ * @deprecated Misspelled: the endpoint names this `other-snorlax-11-beat-league`.
3465
+ * Use {@link ENCOUNTER_CONDITION_VALUES.OTHER_SNORLAX_11_BEAT_LEAGUE}. Removed in 3.0.
3466
+ */
3053
3467
  readonly OTHER_SNORLAX_LL_BEAT_LEAGUE: 39;
3468
+ /**
3469
+ * @deprecated Misspelled: the endpoint names this `radio-hoenn`.
3470
+ * Use {@link ENCOUNTER_CONDITION_VALUES.RADIO_HOENN}. Removed in 3.0.
3471
+ */
3472
+ readonly RADIO_HOEN: 15;
3473
+ /**
3474
+ * @deprecated Misspelled: the endpoint names this `slot2-sapphire`.
3475
+ * Use {@link ENCOUNTER_CONDITION_VALUES.SLOT2_SAPPHIRE}. Removed in 3.0.
3476
+ */
3477
+ readonly SLOT2_SAPHIRE: 10;
3478
+ /**
3479
+ * @deprecated The endpoint names this `story-progress-vermilion-copycat` now.
3480
+ * Use {@link ENCOUNTER_CONDITION_VALUES.STORY_PROGRESS_VERMILION_COPYCAT}. Removed in 3.0.
3481
+ */
3482
+ readonly STORY_PROGRESS_OAK_VERMILION_COPYCAT: 32;
3483
+ /**
3484
+ * @deprecated Misspelled: the endpoint names this `season-autumn`.
3485
+ * Use {@link ENCOUNTER_CONDITION_VALUES.SEASON_AUTUMN}. Removed in 3.0.
3486
+ */
3487
+ readonly SWASON_AUTUMN: 19;
3054
3488
  };
3055
3489
  //#endregion
3056
3490
  //#region src/constants/endpoints.d.ts
@@ -3119,10 +3553,21 @@ declare const EVOLUTION_TRIGGERS: {
3119
3553
  readonly SHED: 4;
3120
3554
  readonly SPIN: 5;
3121
3555
  readonly TOWER_OF_DARKNESS: 6;
3122
- readonly TOWER_OF_WATER: 7;
3556
+ readonly TOWER_OF_WATERS: 7;
3123
3557
  readonly THREE_CRITICAL_HITS: 8;
3124
3558
  readonly TAKE_DAMAGE: 9;
3125
3559
  readonly OTHER: 10;
3560
+ readonly AGILE_STYLE_MOVE: 11;
3561
+ readonly STRONG_STYLE_MOVE: 12;
3562
+ readonly RECOIL_DAMAGE: 13;
3563
+ readonly USE_MOVE: 14;
3564
+ readonly THREE_DEFEATED_BISHARP: 15;
3565
+ readonly GIMMIGHOUL_COINS: 16;
3566
+ /**
3567
+ * @deprecated Misspelled: the endpoint names this trigger `tower-of-waters`.
3568
+ * Use {@link EVOLUTION_TRIGGERS.TOWER_OF_WATERS}. Removed in 3.0.
3569
+ */
3570
+ readonly TOWER_OF_WATER: 7;
3126
3571
  };
3127
3572
  //#endregion
3128
3573
  //#region src/constants/games.d.ts
@@ -3135,7 +3580,19 @@ declare const GENERATIONS: {
3135
3580
  readonly GENERATION_VI: 6;
3136
3581
  readonly GENERATION_VII: 7;
3137
3582
  readonly GENERATION_VIII: 8;
3583
+ readonly GENERATION_IX: 9;
3138
3584
  };
3585
+ /**
3586
+ * ## Generation Name
3587
+ * A generation as the PokéAPI names it, which is what a
3588
+ * `NamedAPIResource<Generation>` carries and what the helpers that resolve a
3589
+ * resource's past state are given.
3590
+ *
3591
+ * Written out rather than derived from {@link GENERATIONS}: turning
3592
+ * `GENERATION_VIII` into `generation-viii` in the type system takes a recursive
3593
+ * template literal, and the set is closed and nine long.
3594
+ */
3595
+ type GenerationName = "generation-i" | "generation-ii" | "generation-iii" | "generation-iv" | "generation-v" | "generation-vi" | "generation-vii" | "generation-viii" | "generation-ix";
3139
3596
  declare const POKEDEXES: {
3140
3597
  readonly NATIONAL: 1;
3141
3598
  readonly KANTO: 2;
@@ -3149,7 +3606,7 @@ declare const POKEDEXES: {
3149
3606
  readonly CONQUEST_GALLERY: 11;
3150
3607
  readonly KALOS_CENTRAL: 12;
3151
3608
  readonly KALOS_COASTAL: 13;
3152
- readonly KALOS_MONTAIN: 14;
3609
+ readonly KALOS_MOUNTAIN: 14;
3153
3610
  readonly UPDATED_HOENN: 15;
3154
3611
  readonly ORIGINAL_ALOLA: 16;
3155
3612
  readonly ORIGINAL_MELEMELE: 17;
@@ -3161,10 +3618,27 @@ declare const POKEDEXES: {
3161
3618
  readonly UPDATED_AKALA: 23;
3162
3619
  readonly UPDATED_ULAULA: 24;
3163
3620
  readonly UPDATED_PONI: 25;
3164
- readonly UPDATED_KANTO: 26;
3621
+ readonly LETSGO_KANTO: 26;
3165
3622
  readonly GALAR: 27;
3166
3623
  readonly ISLE_OF_ARMOR: 28;
3167
3624
  readonly CROWN_TUNDRA: 29;
3625
+ readonly HISUI: 30;
3626
+ readonly PALDEA: 31;
3627
+ readonly KITAKAMI: 32;
3628
+ readonly BLUEBERRY: 33;
3629
+ readonly LUMIOSE_CITY: 34;
3630
+ readonly HYPERSPACE: 35;
3631
+ readonly CHAMPIONS: 36;
3632
+ /**
3633
+ * @deprecated Misspelled: the endpoint names this `kalos-mountain`.
3634
+ * Use {@link POKEDEXES.KALOS_MOUNTAIN}. Removed in 3.0.
3635
+ */
3636
+ readonly KALOS_MONTAIN: 14;
3637
+ /**
3638
+ * @deprecated The endpoint names this `letsgo-kanto` now.
3639
+ * Use {@link POKEDEXES.LETSGO_KANTO}. Removed in 3.0.
3640
+ */
3641
+ readonly UPDATED_KANTO: 26;
3168
3642
  };
3169
3643
  declare const VERSIONS: {
3170
3644
  readonly RED: 1;
@@ -3201,11 +3675,35 @@ declare const VERSIONS: {
3201
3675
  readonly LETS_GO_EEVEE: 32;
3202
3676
  readonly SWORD: 33;
3203
3677
  readonly SHIELD: 34;
3204
- readonly THE_ISLE_OF_ARMOR: 35;
3205
- readonly THE_CROWN_TUNDRA: 36;
3678
+ readonly THE_ISLE_OF_ARMOR_SWORD: 35;
3679
+ readonly THE_CROWN_TUNDRA_SWORD: 36;
3206
3680
  readonly BRILLIANT_DIAMOND: 37;
3207
3681
  readonly SHINING_PEARL: 38;
3208
3682
  readonly LEGENDS_ARCEUS: 39;
3683
+ readonly SCARLET: 40;
3684
+ readonly VIOLET: 41;
3685
+ readonly THE_TEAL_MASK_SCARLET: 42;
3686
+ readonly THE_INDIGO_DISK_SCARLET: 43;
3687
+ readonly RED_JAPAN: 44;
3688
+ readonly GREEN_JAPAN: 45;
3689
+ readonly BLUE_JAPAN: 46;
3690
+ readonly LEGENDS_ZA: 47;
3691
+ readonly MEGA_DIMENSION: 48;
3692
+ readonly CHAMPIONS: 49;
3693
+ readonly THE_ISLE_OF_ARMOR_SHIELD: 50;
3694
+ readonly THE_CROWN_TUNDRA_SHIELD: 51;
3695
+ readonly THE_TEAL_MASK_VIOLET: 52;
3696
+ readonly THE_INDIGO_DISK_VIOLET: 53;
3697
+ /**
3698
+ * @deprecated The endpoint names this `the-crown-tundra-sword` now.
3699
+ * Use {@link VERSIONS.THE_CROWN_TUNDRA_SWORD}. Removed in 3.0.
3700
+ */
3701
+ readonly THE_CROWN_TUNDRA: 36;
3702
+ /**
3703
+ * @deprecated The endpoint names this `the-isle-of-armor-sword` now.
3704
+ * Use {@link VERSIONS.THE_ISLE_OF_ARMOR_SWORD}. Removed in 3.0.
3705
+ */
3706
+ readonly THE_ISLE_OF_ARMOR: 35;
3209
3707
  };
3210
3708
  declare const VERSION_GROUPS: {
3211
3709
  readonly RED_BLUE: 1;
@@ -3226,12 +3724,30 @@ declare const VERSION_GROUPS: {
3226
3724
  readonly OMEGA_RUBY_ALPHA_SAPPHIRE: 16;
3227
3725
  readonly SUN_MOON: 17;
3228
3726
  readonly ULTRA_SUN_ULTRA_MOON: 18;
3229
- readonly LETS_GO: 19;
3727
+ readonly LETS_GO_PIKACHU_LETS_GO_EEVEE: 19;
3230
3728
  readonly SWORD_SHIELD: 20;
3231
3729
  readonly THE_ISLE_OF_ARMOR: 21;
3232
3730
  readonly THE_CROWN_TUNDRA: 22;
3233
- readonly BRILLIANT_DIAMOND_AND_SHINING_PEARL: 23;
3731
+ readonly BRILLIANT_DIAMOND_SHINING_PEARL: 23;
3234
3732
  readonly LEGENDS_ARCEUS: 24;
3733
+ readonly SCARLET_VIOLET: 25;
3734
+ readonly THE_TEAL_MASK: 26;
3735
+ readonly THE_INDIGO_DISK: 27;
3736
+ readonly RED_GREEN_JAPAN: 28;
3737
+ readonly BLUE_JAPAN: 29;
3738
+ readonly LEGENDS_ZA: 30;
3739
+ readonly MEGA_DIMENSION: 31;
3740
+ readonly CHAMPIONS: 32;
3741
+ /**
3742
+ * @deprecated The endpoint names this `brilliant-diamond-shining-pearl` now.
3743
+ * Use {@link VERSION_GROUPS.BRILLIANT_DIAMOND_SHINING_PEARL}. Removed in 3.0.
3744
+ */
3745
+ readonly BRILLIANT_DIAMOND_AND_SHINING_PEARL: 23;
3746
+ /**
3747
+ * @deprecated The endpoint names this `lets-go-pikachu-lets-go-eevee` now.
3748
+ * Use {@link VERSION_GROUPS.LETS_GO_PIKACHU_LETS_GO_EEVEE}. Removed in 3.0.
3749
+ */
3750
+ readonly LETS_GO: 19;
3235
3751
  };
3236
3752
  //#endregion
3237
3753
  //#region src/constants/items.d.ts
@@ -3293,9 +3809,18 @@ declare const ITEM_CATEGORIES: {
3293
3809
  readonly Z_CRYSTALS: 46;
3294
3810
  readonly SPECIES_CANDIES: 47;
3295
3811
  readonly CATCHING_BONUS: 48;
3296
- readonly DYNAMAX_CRISTALS: 49;
3812
+ readonly DYNAMAX_CRYSTALS: 49;
3297
3813
  readonly NATURE_MINTS: 50;
3298
3814
  readonly CURRY_INGREDIENTS: 51;
3815
+ readonly TERA_SHARD: 52;
3816
+ readonly SANDWICH_INGREDIENTS: 53;
3817
+ readonly TM_MATERIALS: 54;
3818
+ readonly PICNIC: 55;
3819
+ /**
3820
+ * @deprecated Misspelled: the endpoint names this `dynamax-crystals`.
3821
+ * Use {@link ITEM_CATEGORIES.DYNAMAX_CRYSTALS}. Removed in 3.0.
3822
+ */
3823
+ readonly DYNAMAX_CRISTALS: 49;
3299
3824
  };
3300
3825
  declare const ITEM_FLING_EFFECTS: {
3301
3826
  readonly BADLY_POISON: 1;
@@ -3328,6 +3853,8 @@ declare const REGIONS: {
3328
3853
  readonly ALOLA: 7;
3329
3854
  readonly GALAR: 8;
3330
3855
  readonly HISUI: 9;
3856
+ readonly PALDEA: 10;
3857
+ readonly ORRE: 11;
3331
3858
  };
3332
3859
  declare const PAL_PARK_AREAS: {
3333
3860
  readonly FOREST: 1;
@@ -3399,6 +3926,8 @@ declare const MOVE_LEARN_METHODS: {
3399
3926
  readonly XD_SHADOW: 8;
3400
3927
  readonly XD_PURIFICATION: 9;
3401
3928
  readonly FORM_CHANGE: 10;
3929
+ readonly ZYGARDE_CUBE: 11;
3930
+ readonly TRAIN: 12;
3402
3931
  };
3403
3932
  declare const MOVE_TARGETS: {
3404
3933
  readonly SPECIFIC_MOVE: 1;
@@ -3413,9 +3942,15 @@ declare const MOVE_TARGETS: {
3413
3942
  readonly SELECTED_POKEMON: 10;
3414
3943
  readonly ALL_OPPONENTS: 11;
3415
3944
  readonly ENTIRE_FIELD: 12;
3416
- readonly USER_AND_ALIES: 13;
3945
+ readonly USER_AND_ALLIES: 13;
3417
3946
  readonly ALL_POKEMON: 14;
3418
3947
  readonly ALL_ALLIES: 15;
3948
+ readonly FAINTING_POKEMON: 16;
3949
+ /**
3950
+ * @deprecated Misspelled: the endpoint names this `user-and-allies`.
3951
+ * Use {@link MOVE_TARGETS.USER_AND_ALLIES}. Removed in 3.0.
3952
+ */
3953
+ readonly USER_AND_ALIES: 13;
3419
3954
  };
3420
3955
  //#endregion
3421
3956
  //#region src/constants/pokemon.d.ts
@@ -3499,12 +4034,17 @@ declare const POKEMON_HABITATS: {
3499
4034
  readonly CAVE: 1;
3500
4035
  readonly FOREST: 2;
3501
4036
  readonly GRASSLAND: 3;
3502
- readonly MONTAIN: 4;
4037
+ readonly MOUNTAIN: 4;
3503
4038
  readonly RARE: 5;
3504
4039
  readonly ROUGH_TERRAIN: 6;
3505
4040
  readonly SEA: 7;
3506
4041
  readonly URBAN: 8;
3507
4042
  readonly WATERS_EDGE: 9;
4043
+ /**
4044
+ * @deprecated Misspelled: the endpoint names this `mountain`.
4045
+ * Use {@link POKEMON_HABITATS.MOUNTAIN}. Removed in 3.0.
4046
+ */
4047
+ readonly MONTAIN: 4;
3508
4048
  };
3509
4049
  declare const POKEMON_SHAPES: {
3510
4050
  readonly BALL: 1;
@@ -3531,6 +4071,7 @@ declare const STATS: {
3531
4071
  readonly SPEED: 6;
3532
4072
  readonly ACCURACY: 7;
3533
4073
  readonly EVASION: 8;
4074
+ readonly SPECIAL: 9;
3534
4075
  };
3535
4076
  declare const TYPES: {
3536
4077
  readonly NORMAL: 1;
@@ -3551,9 +4092,26 @@ declare const TYPES: {
3551
4092
  readonly DRAGON: 16;
3552
4093
  readonly DARK: 17;
3553
4094
  readonly FAIRY: 18;
4095
+ readonly STELLAR: 19;
3554
4096
  readonly UNKNOWN: 10001;
3555
4097
  readonly SHADOW: 10002;
3556
4098
  };
4099
+ /**
4100
+ * ## Type Name
4101
+ * A battle type as the PokéAPI names it, which is what a
4102
+ * `NamedAPIResource<Type>` carries and what the type chart is keyed by.
4103
+ *
4104
+ * The eighteen types a Pokémon can be, and `stellar`, which is a Tera type and
4105
+ * nothing else. `unknown` and `shadow` are in {@link TYPES} but not here: they
4106
+ * are artefacts of Generation II's internals and of Colosseum/XD, they appear in
4107
+ * no damage relation, and a table keyed by them would be a table with two entries
4108
+ * nothing can ever fill.
4109
+ *
4110
+ * Written out rather than derived from {@link TYPES}, for the same reason
4111
+ * `GenerationName` is: the set is closed, and the two exclusions are a decision
4112
+ * rather than a transformation.
4113
+ */
4114
+ type TypeName = "normal" | "fighting" | "flying" | "poison" | "ground" | "rock" | "bug" | "ghost" | "steel" | "fire" | "water" | "grass" | "electric" | "psychic" | "ice" | "dragon" | "dark" | "fairy" | "stellar";
3557
4115
  //#endregion
3558
4116
  //#region src/constants/urls.d.ts
3559
4117
  declare const BASE_URL: {
@@ -3580,7 +4138,7 @@ declare const LANGUAGES: {
3580
4138
  readonly ES_419: 14;
3581
4139
  };
3582
4140
  declare namespace index_d_exports {
3583
- 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, 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, VERSIONS, VERSION_GROUPS };
4141
+ 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 };
3584
4142
  }
3585
4143
  //#endregion
3586
4144
  //#region src/clients/base.d.ts
@@ -3668,6 +4226,35 @@ interface ClientOptions {
3668
4226
  */
3669
4227
  revalidate?: boolean | EtagStore;
3670
4228
  }
4229
+ /**
4230
+ * ## Client Stats
4231
+ * How many resolutions came from where, since the client was built.
4232
+ *
4233
+ * One count per `source` a {@link LogResponsePayload} reports, which is the only
4234
+ * thing that tells a cache hit from a revalidation from a real round trip once
4235
+ * the promise has settled. A failed request is counted by neither: it resolved
4236
+ * nothing, and it is the logger's `error` event that has it.
4237
+ */
4238
+ interface ClientStats {
4239
+ /** Responses downloaded in full. */
4240
+ network: number;
4241
+ /** Responses answered from the {@link CacheStore}, with no request made. */
4242
+ cache: number;
4243
+ /** Callers that joined a request already on the wire rather than repeating it. */
4244
+ inFlight: number;
4245
+ /** Responses the PokéAPI answered `304` for, served from the {@link EtagStore}. */
4246
+ revalidated: number;
4247
+ /**
4248
+ * Requests that left the process — what the PokéAPI actually saw.
4249
+ *
4250
+ * Not `network + revalidated`. A revalidation is a round trip that saved a
4251
+ * body rather than a request that never happened, so it is in here; and a
4252
+ * resolution the `retry` option attempted three times is one `network` and
4253
+ * three of these. The attempts are the half a caller cannot see, and they are
4254
+ * the half that shows up in someone else's rate limit.
4255
+ */
4256
+ roundTrips: number;
4257
+ }
3671
4258
  /**
3672
4259
  * ## List Page
3673
4260
  * The part of a resource list a walk needs: how much there is, and this page of
@@ -3733,6 +4320,41 @@ declare abstract class ClientFacade {
3733
4320
  constructor(options?: ClientOptions);
3734
4321
  /** The store backing this client, or `undefined` when caching is disabled. */
3735
4322
  get cache(): CacheStore | undefined;
4323
+ /**
4324
+ * How many resolutions came from where.
4325
+ *
4326
+ * ```ts
4327
+ * await api.pokemon.getPokemonByName('luxray');
4328
+ * await api.pokemon.getPokemonByName('luxray');
4329
+ *
4330
+ * api.stats; // { network: 1, cache: 1, inFlight: 0, revalidated: 0, roundTrips: 1 }
4331
+ * ```
4332
+ *
4333
+ * The counts are the transport's, so they cover every section of a
4334
+ * {@link MainClient} and every client derived with {@link ClientFacade.with} —
4335
+ * the same sharing that makes one cache serve all of them.
4336
+ *
4337
+ * A snapshot, read at the moment it is asked for. Keeping one to compare
4338
+ * against later means keeping the object, not the client.
4339
+ */
4340
+ get stats(): ClientStats;
4341
+ /**
4342
+ * What has been counted since `snapshot` was taken.
4343
+ *
4344
+ * ```ts
4345
+ * const before = api.stats;
4346
+ * await renderTeam();
4347
+ *
4348
+ * api.statsSince(before).roundTrips; // what that render cost
4349
+ * ```
4350
+ *
4351
+ * There is no way to reset the counts, and this is why: the transport behind
4352
+ * them is shared by every section of a {@link MainClient} and by every client
4353
+ * derived with {@link ClientFacade.with}, so zeroing it for one measurement
4354
+ * zeroes it for whatever else is measuring. Subtraction is the same answer
4355
+ * without the shared mutation.
4356
+ */
4357
+ statsSince(snapshot: ClientStats): ClientStats;
3736
4358
  /**
3737
4359
  * Derives a client whose requests carry a signal, a timeout, or both.
3738
4360
  *
@@ -4447,6 +5069,316 @@ declare class PokenodeError extends Error {
4447
5069
  static isPokenodeError(error: unknown): error is PokenodeError;
4448
5070
  }
4449
5071
  //#endregion
5072
+ //#region src/utils/evolution.d.ts
5073
+ /**
5074
+ * ## Evolution Step
5075
+ * One edge of an evolution chain: a species, what it evolves into, and every way
5076
+ * that happens.
5077
+ */
5078
+ interface EvolutionStep {
5079
+ /** The species that evolves. */
5080
+ from: NamedAPIResource<PokemonSpecies>;
5081
+ /** What it evolves into. */
5082
+ to: NamedAPIResource<PokemonSpecies>;
5083
+ /**
5084
+ * The ways this step happens, which are alternatives rather than a sequence —
5085
+ * the API publishes one per version group, so Leafeon carries five mossy-rock
5086
+ * locations and a Leaf Stone. Never empty.
5087
+ */
5088
+ details: EvolutionDetail[];
5089
+ /** How deep in the chain this step sits: `1` for a first evolution. */
5090
+ depth: number;
5091
+ /** Whether {@link EvolutionStep.to} is a baby Pokémon. */
5092
+ isBaby: boolean;
5093
+ }
5094
+ /**
5095
+ * ## Flatten Options
5096
+ * How {@link flattenChain} narrows the chain it walks.
5097
+ */
5098
+ interface FlattenOptions {
5099
+ /**
5100
+ * Keep only the details tagged with this version group, by the name the API
5101
+ * gives it — `sword-shield`, not `Sword/Shield` — and drop the steps left with
5102
+ * none. The tag is the game that introduced the method, not every game it
5103
+ * applies in — see {@link flattenChain}.
5104
+ */
5105
+ versionGroup?: string;
5106
+ }
5107
+ /**
5108
+ * Flattens an evolution chain into one step per evolution, depth-first in the
5109
+ * order the API lists them.
5110
+ *
5111
+ * ```ts
5112
+ * const species = await api.pokemon.getPokemonSpeciesByName('eevee');
5113
+ * const chain = await api.resolve(species.evolution_chain);
5114
+ *
5115
+ * for (const step of flattenChain(chain)) {
5116
+ * console.log(`${step.from.name} → ${step.to.name}`);
5117
+ * }
5118
+ * ```
5119
+ *
5120
+ * The root is not a step: it is what the chain starts from, and the API gives it
5121
+ * no `evolution_details` to describe.
5122
+ *
5123
+ * `versionGroup` keeps only the details tagged with that version group, which is
5124
+ * what picks the Leaf Stone out of Leafeon's six alternatives:
5125
+ *
5126
+ * ```ts
5127
+ * flattenChain(chain, { versionGroup: 'sword-shield' });
5128
+ * ```
5129
+ *
5130
+ * That tag is the game which *introduced* the method, not every game it applies
5131
+ * in: Eevee's Water Stone is tagged `red-blue` alone, so filtering to
5132
+ * `sword-shield` drops Vaporeon even though Sword/Shield evolves it the same way
5133
+ * it always did. The question this answers is what a game changed.
5134
+ *
5135
+ * A step with nothing left after that is dropped, but the chain below it is
5136
+ * still walked — every edge is filtered on its own terms, and `depth` stays the
5137
+ * position in the chain rather than in the result.
5138
+ */
5139
+ declare const flattenChain: (chain: EvolutionChain, options?: FlattenOptions) => EvolutionStep[];
5140
+ /**
5141
+ * The steps leading from the root of a chain to `species`.
5142
+ *
5143
+ * ```ts
5144
+ * pathTo(chain, 'dustox')?.map((step) => step.to.name); // ['cascoon', 'dustox']
5145
+ * ```
5146
+ *
5147
+ * Matched against the name the API gives a species, which is not the name a game
5148
+ * displays: `localize(species.names)` is `Papilord` in French and finds nothing
5149
+ * here. Pass the link itself when you have one.
5150
+ *
5151
+ * @returns The steps, `[]` when `species` is the root the chain starts from, and
5152
+ * `undefined` when the chain does not contain it. The two empty answers are
5153
+ * different questions, so they are different values.
5154
+ */
5155
+ declare const pathTo: (chain: EvolutionChain, species: string | NamedAPIResource<PokemonSpecies>) => EvolutionStep[] | undefined;
5156
+ /**
5157
+ * ## Evolution Requirement
5158
+ * One condition an evolution is subject to, as a discriminated union — what an
5159
+ * {@link EvolutionDetail}'s thirty-odd nullable fields say, without the nulls.
5160
+ *
5161
+ * `is_default` and `version_group` are not here: they describe the record, not
5162
+ * what the Pokémon has to do.
5163
+ */
5164
+ type EvolutionRequirement = {
5165
+ kind: "trigger";
5166
+ trigger: NamedAPIResource<EvolutionTrigger>;
5167
+ } | {
5168
+ kind: "item";
5169
+ item: NamedAPIResource<Item>;
5170
+ } | {
5171
+ kind: "held-item";
5172
+ item: NamedAPIResource<Item>;
5173
+ } | {
5174
+ kind: "min-level";
5175
+ level: number;
5176
+ } | {
5177
+ kind: "min-happiness";
5178
+ happiness: number;
5179
+ } | {
5180
+ kind: "min-beauty";
5181
+ beauty: number;
5182
+ } | {
5183
+ kind: "min-affection";
5184
+ affection: number;
5185
+ } | {
5186
+ kind: "known-move";
5187
+ move: NamedAPIResource<Move>;
5188
+ } | {
5189
+ kind: "known-move-type";
5190
+ type: NamedAPIResource<Type>;
5191
+ } | {
5192
+ kind: "used-move";
5193
+ move: NamedAPIResource<Move>;
5194
+ } | {
5195
+ kind: "min-move-count";
5196
+ count: number;
5197
+ } | {
5198
+ kind: "min-steps";
5199
+ steps: number;
5200
+ } | {
5201
+ kind: "min-damage-taken";
5202
+ damage: number;
5203
+ } | {
5204
+ kind: "location";
5205
+ location: NamedAPIResource<Location>;
5206
+ } | {
5207
+ kind: "region";
5208
+ region: NamedAPIResource<Region>;
5209
+ } | {
5210
+ kind: "time-of-day";
5211
+ time: EvolutionTimeOfDay;
5212
+ } | {
5213
+ kind: "gender";
5214
+ gender: number;
5215
+ } | {
5216
+ kind: "relative-physical-stats";
5217
+ comparison: 1 | 0 | -1;
5218
+ } | {
5219
+ kind: "party-species";
5220
+ species: NamedAPIResource<PokemonSpecies>;
5221
+ } | {
5222
+ kind: "party-type";
5223
+ type: NamedAPIResource<Type>;
5224
+ } | {
5225
+ kind: "trade-species";
5226
+ species: NamedAPIResource<PokemonSpecies>;
5227
+ } | {
5228
+ kind: "base-form";
5229
+ form: NamedAPIResource<PokemonForm>;
5230
+ } | {
5231
+ kind: "evolved-form";
5232
+ form: NamedAPIResource<PokemonForm>;
5233
+ } | {
5234
+ kind: "needs-overworld-rain";
5235
+ } | {
5236
+ kind: "turn-upside-down";
5237
+ } | {
5238
+ kind: "near-special-rock";
5239
+ } | {
5240
+ kind: "needs-multiplayer";
5241
+ };
5242
+ /**
5243
+ * The conditions one {@link EvolutionDetail} sets out, with everything it left
5244
+ * unset dropped.
5245
+ *
5246
+ * ```ts
5247
+ * requirementsOf(step.details[0]); // eevee → umbreon
5248
+ * // [
5249
+ * // { kind: 'trigger', trigger: { name: 'level-up', … } },
5250
+ * // { kind: 'min-happiness', happiness: 160 },
5251
+ * // { kind: 'time-of-day', time: 'night' },
5252
+ * // { kind: 'base-form', form: { name: 'eevee', … } },
5253
+ * // ]
5254
+ * ```
5255
+ *
5256
+ * The trigger leads, so rendering the result is a walk over one array.
5257
+ *
5258
+ * Every field is tested against the value the API uses for "unset" rather than
5259
+ * for truthiness: `relative_physical_stats` is `0` when Attack has to equal
5260
+ * Defense, and `time_of_day` is `''`.
5261
+ */
5262
+ declare const requirementsOf: (detail: EvolutionDetail) => EvolutionRequirement[];
5263
+ /**
5264
+ * ## Requirement Phrases
5265
+ * One renderer per {@link EvolutionRequirement} kind. Exhaustive, so a kind added
5266
+ * to that union has to be given words here too.
5267
+ */
5268
+ type RequirementPhrases = { [K in EvolutionRequirement["kind"]]: (requirement: Extract<EvolutionRequirement, {
5269
+ kind: K;
5270
+ }>) => string; };
5271
+ /**
5272
+ * ## Resource Namer
5273
+ * How a resource a requirement names is written out.
5274
+ *
5275
+ * @param resource The item, move, species, location, region, form or type the
5276
+ * requirement carries.
5277
+ * @returns What to print for it.
5278
+ */
5279
+ type ResourceNamer = (resource: NamedAPIResource<unknown>) => string;
5280
+ /**
5281
+ * Builds the English table around a way of naming resources.
5282
+ *
5283
+ * Everything except the name is fixed; `namer` is the one thing a caller who
5284
+ * keeps the English sentence still has to replace, because `spaced` prints what
5285
+ * the API calls a resource and no localized name is derivable from it.
5286
+ *
5287
+ * ```ts
5288
+ * const names = new Map([['water-stone', 'Pedra da Água']]);
5289
+ *
5290
+ * requirementPhrases((resource) => names.get(resource.name) ?? resource.name);
5291
+ * ```
5292
+ *
5293
+ * @param namer How to write a resource out. Defaults to the API's own name, with
5294
+ * the hyphens turned to spaces.
5295
+ */
5296
+ declare const requirementPhrases: (namer?: ResourceNamer) => RequirementPhrases;
5297
+ /**
5298
+ * ## Requirement Phrases
5299
+ * The English {@link formatRequirements} renders with, naming resources the way
5300
+ * the API does. Exported so a caller can replace the wording of one kind — or
5301
+ * all of them, in another language — without rebuilding the rest of the renderer
5302
+ * around it, and so an override can fall back to the default for what it does
5303
+ * not handle.
5304
+ *
5305
+ * ```ts
5306
+ * formatRequirements(requirements, {
5307
+ * phrases: { 'min-happiness': ({ happiness }) => `com ${happiness} de felicidade` },
5308
+ * });
5309
+ *
5310
+ * formatRequirements(requirements, {
5311
+ * phrases: {
5312
+ * trigger: (requirement) => MINE[requirement.trigger.name] ?? REQUIREMENT_PHRASES.trigger(requirement),
5313
+ * },
5314
+ * });
5315
+ * ```
5316
+ */
5317
+ declare const REQUIREMENT_PHRASES: RequirementPhrases;
5318
+ /**
5319
+ * ## Format Options
5320
+ * How {@link formatRequirements} words what it renders.
5321
+ */
5322
+ interface FormatOptions {
5323
+ /**
5324
+ * How to write out the resources the requirements name. Defaults to the API's
5325
+ * own name with the hyphens turned to spaces — `water stone`.
5326
+ *
5327
+ * This is the half of a translation that `phrases` cannot do: a display name
5328
+ * is `localize(item.names)`, which is a request, so it has to come from the
5329
+ * caller. Applied to the default table, and to nothing a `phrases` entry
5330
+ * overrides — that entry is handed the resource and names it however it likes.
5331
+ *
5332
+ * Hold the function rather than writing it inline: the table built around a
5333
+ * namer is kept and reused, and a new closure per call is a new table per call.
5334
+ */
5335
+ name?: ResourceNamer;
5336
+ /**
5337
+ * Wording for the kinds named, {@link REQUIREMENT_PHRASES} for the rest —
5338
+ * everything around it, including the `use-item` de-duplication, stays.
5339
+ */
5340
+ phrases?: Partial<RequirementPhrases>;
5341
+ }
5342
+ /**
5343
+ * Renders requirements as an English phrase.
5344
+ *
5345
+ * ```ts
5346
+ * formatRequirements(requirementsOf(detail)); // eevee → umbreon
5347
+ * // 'level up, with at least 160 happiness, during the night, in its eevee form'
5348
+ * ```
5349
+ *
5350
+ * The only English in the library, and a separate export for that reason: an
5351
+ * application rendering its own copy — in its own language, or as anything other
5352
+ * than a sentence — drops this and the phrase table with it. Use
5353
+ * {@link requirementsOf} for that, or `phrases` to keep the sentence and change
5354
+ * the words:
5355
+ *
5356
+ * ```ts
5357
+ * formatRequirements(requirements, { phrases: { trade: () => 'by trade' } });
5358
+ * ```
5359
+ *
5360
+ * Resources are named the way the API names them, not the way a game displays
5361
+ * them. `localize(item.names)` is the display name, it costs a request, and
5362
+ * `name` is where it goes:
5363
+ *
5364
+ * ```ts
5365
+ * const items = await api.resolveAll(links);
5366
+ * const display = new Map(items.map((item) => [item.name, localize(item.names)?.name]));
5367
+ *
5368
+ * formatRequirements(requirements, { name: (resource) => display.get(resource.name) ?? resource.name });
5369
+ * // 'use Water Stone'
5370
+ * ```
5371
+ *
5372
+ * The two options are the two halves of a translation and are independent:
5373
+ * `phrases` is the words the library supplies, `name` the words the API does.
5374
+ *
5375
+ * A `use-item` trigger and the item it uses are one phrase, since "use an item,
5376
+ * use water stone" says it twice. That holds under `phrases` too: the trigger is
5377
+ * dropped before anything is rendered, so an overridden `item` is still what says
5378
+ * the item is used.
5379
+ */
5380
+ declare const formatRequirements: (requirements: readonly EvolutionRequirement[], options?: FormatOptions) => string;
5381
+ //#endregion
4450
5382
  //#region src/utils/localize.d.ts
4451
5383
  /**
4452
5384
  * ## Localized
@@ -4456,6 +5388,20 @@ declare class PokenodeError extends Error {
4456
5388
  interface Localized {
4457
5389
  language: NamedAPIResource<Language>;
4458
5390
  }
5391
+ /**
5392
+ * ## Localize Options
5393
+ * Which language to pick, and which to settle for.
5394
+ */
5395
+ interface LocalizeOptions {
5396
+ /** The language wanted, by the name the PokéAPI gives it. Defaults to `en`. */
5397
+ language?: string;
5398
+ /**
5399
+ * The language to try when the first one is absent. Left out, nothing is tried
5400
+ * and the answer is `undefined` — a fallback is a decision about the product,
5401
+ * not a default.
5402
+ */
5403
+ fallback?: string;
5404
+ }
4459
5405
  /**
4460
5406
  * Picks the entry written in `language`, by the name the PokéAPI gives that
4461
5407
  * language: `en`, `ja`, `ja-hrkt`, `zh-hans`, `es-419`, and so on.
@@ -4465,6 +5411,7 @@ interface Localized {
4465
5411
  *
4466
5412
  * localize(species.names)?.name; // 'Eevee'
4467
5413
  * localize(species.names, 'ja')?.name; // 'イーブイ'
5414
+ * localize(species.names, { language: 'gd', fallback: 'en' })?.name; // 'Eevee'
4468
5415
  * ```
4469
5416
  *
4470
5417
  * Matched without regard to case: the PokéAPI writes these tags in lower case,
@@ -4472,13 +5419,56 @@ interface Localized {
4472
5419
  * to language tags will reach for, and it should not silently match nothing.
4473
5420
  *
4474
5421
  * A section may list several entries for one language — flavor text, one per
4475
- * version — and the first is the one returned. Filter first when you want a
4476
- * particular version.
5422
+ * version — and the first is the one returned. {@link localizeAll} is the way to
5423
+ * see the rest and pick by version.
5424
+ *
5425
+ * @returns The entry, the one in `fallback` when that language is absent, or
5426
+ * `undefined` when neither is there.
5427
+ */
5428
+ declare const localize: <T extends Localized>(entries: readonly T[], language?: string | LocalizeOptions) => T | undefined;
5429
+ /**
5430
+ * Every entry written in `language`, in the order the API lists them.
4477
5431
  *
4478
- * @returns The entry, or `undefined` when that language is absent. Which
4479
- * language to try instead is the caller's decision, so nothing is guessed here.
5432
+ * ```ts
5433
+ * const species = await api.pokemon.getPokemonSpeciesByName('eevee');
5434
+ *
5435
+ * const entries = localizeAll(species.flavor_text_entries, 'en');
5436
+ * entries.find((entry) => entry.version.name === 'sword')?.flavor_text;
5437
+ * ```
5438
+ *
5439
+ * Which is what a section publishing one entry per version needs: `localize`
5440
+ * answers with the first, and the first is an arbitrary game's Pokédex entry
5441
+ * rather than the one asked for. The version is on the entry — `version` on
5442
+ * flavor text, `version_group` on the sections that change per group — so the
5443
+ * filter belongs to the caller, who knows which of the two is there.
5444
+ *
5445
+ * @returns The entries, those in `fallback` when the language is absent, or `[]`
5446
+ * when neither is there.
5447
+ */
5448
+ declare const localizeAll: <T extends Localized>(entries: readonly T[], language?: string | LocalizeOptions) => T[];
5449
+ //#endregion
5450
+ //#region src/utils/resource-id.d.ts
5451
+ /**
5452
+ * The id inside a resource URL, without a request.
5453
+ *
5454
+ * ```ts
5455
+ * const page = await api.pokemon.listPokemons(0, 20);
5456
+ *
5457
+ * page.results.map((link) => getPokemonSpriteUrl(resourceId(link)));
5458
+ * ```
5459
+ *
5460
+ * A list page gives names and URLs and no ids, while the sprite repository is
5461
+ * keyed by id alone — this is what joins the two, and it is what lets a grid of
5462
+ * every Pokémon render off one list request instead of one request per card.
5463
+ *
5464
+ * The id is read off the URL rather than fetched, so it is only as good as the
5465
+ * link: a URL the API did not write is not promised to end in one.
5466
+ *
5467
+ * @param resource The link, as a URL or as the resource object carrying one.
5468
+ * @returns The id.
5469
+ * @throws {TypeError} If the URL does not end in an id.
4480
5470
  */
4481
- declare const localize: <T extends Localized>(entries: readonly T[], language?: string) => T | undefined;
5471
+ declare const resourceId: (resource: ResourceLink<unknown>) => number;
4482
5472
  //#endregion
4483
5473
  //#region src/utils/sprites.d.ts
4484
5474
  /**
@@ -4540,5 +5530,120 @@ type PokemonSpriteOptions = {
4540
5530
  */
4541
5531
  declare const getPokemonSpriteUrl: (id: number, options?: PokemonSpriteOptions) => string;
4542
5532
  //#endregion
4543
- 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, ContestClient, ContestComboDetail, ContestComboSets, ContestEffect, ContestFlavorText, ContestName, ContestType, Crystal, 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, EvolutionTrigger, type FetchLike, FireredLeafgreen, FlavorBerryMap, FlavorText, GENDERS, GENERATIONS, GROWTH_RATES, GameClient, Gender, Generation, GenerationGameIndex, GenerationIIISprites, GenerationIIITypeSprites, GenerationIISprites, GenerationISprites, GenerationIVSprites, GenerationIVTypeSprites, GenerationIXSprites, GenerationIXTypeSprites, GenerationVIIISprites, GenerationVIIITypeSprites, GenerationVIISprites, GenerationVIITypeSprites, GenerationVISprites, GenerationVITypeSprites, 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 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, RedBlue, Region, type RequestScope, type ResolveOptions, type ResourceLink, type RetryOptions, RubySapphire, STATS, ScarletViolet, Showdown, Silver, type SpriteVariant, Stat, SuperContestEffect, TYPES, Type, TypeGameSprites, TypePokemon, TypeRelations, TypeRelationsPast, TypeSprites, UltraSunUltraMoon, UtilityClient, VERSIONS, VERSION_GROUPS, VerboseEffect, Version, VersionEncounterDetail, VersionGameIndex, VersionGroup, VersionGroupFlavorText, VersionSprites, WebStorageCache, type WebStorageCacheOptions, type WebStorageLike, XY, Yellow, consoleLogger, getPokemonSpriteUrl, localize };
5533
+ //#region src/utils/type-chart.d.ts
5534
+ /**
5535
+ * ## Generation Scope
5536
+ * Which generation's type chart to read. Leave it out for the current one.
5537
+ */
5538
+ interface GenerationScope {
5539
+ generation?: GenerationName;
5540
+ }
5541
+ /**
5542
+ * The damage relations `type` had in `generation`, or the current ones when no
5543
+ * generation is named.
5544
+ *
5545
+ * ```ts
5546
+ * const ghost = await api.pokemon.getTypeByName('ghost');
5547
+ *
5548
+ * relationsFor(ghost).half_damage_to; // [dark]
5549
+ * relationsFor(ghost, 'generation-iii')?.half_damage_to; // [dark, steel]
5550
+ * ```
5551
+ *
5552
+ * Each entry in `past_damage_relations` records the *last* generation it applied
5553
+ * to, so the chart in force is the first entry still at or after the generation
5554
+ * asked for — Ghost's `generation-v` entry is what Ghost looked like from II
5555
+ * through V, and the current relations take over at VI.
5556
+ *
5557
+ * @returns The relations, or `undefined` when `type` did not exist yet in
5558
+ * `generation`. Nothing is guessed: Steel in generation I has no chart, and a
5559
+ * neutral one would be a confidently wrong answer rather than a missing one.
5560
+ */
5561
+ declare const relationsFor: (type: Type, generation?: GenerationName) => TypeRelations | undefined;
5562
+ /**
5563
+ * The damage multiplier `attacking` deals to a defender that has `defending`
5564
+ * types — `0`, `0.25`, `0.5`, `1`, `2` or `4`.
5565
+ *
5566
+ * ```ts
5567
+ * const fire = await api.pokemon.getTypeByName('fire');
5568
+ * const ferrothorn = await api.pokemon.getPokemonByName('ferrothorn');
5569
+ *
5570
+ * effectiveness(fire, ferrothorn.types.map((slot) => slot.type)); // 4
5571
+ * ```
5572
+ *
5573
+ * Read from the attacking type's own offensive relations, so this needs the one
5574
+ * type fetched rather than one per defending type.
5575
+ *
5576
+ * With a `generation`, the chart of that generation is used and the result is
5577
+ * `undefined` when `attacking` postdates it. Only the attacker is checked that
5578
+ * way: the defenders arrive as links, which carry no generation to check
5579
+ * against. `Pokemon.past_types` is where a historically correct defender comes
5580
+ * from.
5581
+ */
5582
+ declare function effectiveness(attacking: Type, defending: readonly NamedAPIResource<Type>[]): number;
5583
+ declare function effectiveness(attacking: Type, defending: readonly NamedAPIResource<Type>[], options: {
5584
+ generation: GenerationName;
5585
+ }): number | undefined;
5586
+ /**
5587
+ * What every one of `types` does to a defender that has `defending` types, keyed
5588
+ * by attacking type name — the "what is this Pokémon weak to" table.
5589
+ *
5590
+ * ```ts
5591
+ * const types: Type[] = [];
5592
+ * for await (const type of api.pokemon.paginate('listTypes', { resolve: true })) {
5593
+ * types.push(type);
5594
+ * }
5595
+ *
5596
+ * const profile = defensiveProfile(types, gengar.types.map((slot) => slot.type));
5597
+ * profile.psychic; // 2
5598
+ * profile.normal; // 0
5599
+ * ```
5600
+ *
5601
+ * The whole `type` section is one cached walk, and every lookup after that is
5602
+ * local. A type that did not exist in the generation asked for is left out of the
5603
+ * table rather than reported as neutral.
5604
+ *
5605
+ * `Partial` because of that, and because `types` is whatever the caller resolved:
5606
+ * an entry is there when the attacking type is, so every lookup is `number |
5607
+ * undefined`. `unknown` and `shadow` are not {@link TypeName}s and are skipped —
5608
+ * they hold no damage relations, so they have no place in a matchup table.
5609
+ *
5610
+ * Reach for {@link defensiveProfileFrom} unless you are asking about a past
5611
+ * generation: it answers the same question from the defender's own types, which
5612
+ * is one or two resources rather than the whole section. This is the form that
5613
+ * takes a `generation`, because only the attacking type carries the history.
5614
+ *
5615
+ * Keyed by the name the API gives a type, which is not the name a game displays:
5616
+ * `localize(type.names)` is what a table headed in French needs, and it is a
5617
+ * property of the resource rather than of this table.
5618
+ */
5619
+ declare const defensiveProfile: (types: readonly Type[], defending: readonly NamedAPIResource<Type>[], options?: GenerationScope) => Partial<Record<TypeName, number>>;
5620
+ /**
5621
+ * The same table, read off the defending types themselves — what every type does
5622
+ * to a Pokémon that has `defending` types.
5623
+ *
5624
+ * ```ts
5625
+ * const gengar = await api.pokemon.getPokemonByName('gengar');
5626
+ * const types = await api.resolveAll(gengar.types.map((slot) => slot.type));
5627
+ *
5628
+ * const profile = defensiveProfileFrom(types);
5629
+ * profile.psychic; // 2
5630
+ * profile.normal; // 0
5631
+ * ```
5632
+ *
5633
+ * Two requests for a dual-typed Pokémon, against the whole `type` section that
5634
+ * {@link defensiveProfile} needs — the answer is the same because the chart is
5635
+ * symmetric, which `tests/live/relations.live.spec.ts` is what keeps honest.
5636
+ *
5637
+ * Every {@link TypeName} is present: the defending types name every attacker
5638
+ * they interact with, and the rest are neutral rather than unknown. There is no
5639
+ * `generation` option for exactly the reason the entries are total — a defending
5640
+ * type's arrays are the current chart, and they have no way to say that an
5641
+ * attacking type did not exist yet. That question needs {@link defensiveProfile}.
5642
+ *
5643
+ * Keyed by the API's name for a type, as {@link defensiveProfile} is;
5644
+ * `localize(type.names)` is the displayed one.
5645
+ */
5646
+ declare const defensiveProfileFrom: (defending: readonly Type[]) => Record<TypeName, number>;
5647
+ //#endregion
5648
+ 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, 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, GenerationVIIISprites, GenerationVIIITypeSprites, GenerationVIISprites, GenerationVIITypeSprites, GenerationVISprites, GenerationVITypeSprites, 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 };
4544
5649
  //# sourceMappingURL=index.d.ts.map