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