pokerogue/src/@types/biomes.ts
Sirz Benjie e5e0835a96
[Misc][Refactor] Add scaffolding for TypedArrays and improve typing on methods related to arrays (#6547)
* make IVs use Uint8Array

* Add many typed array helpers

* Move array utils to its own file

* Add suppression comment

* Adjust type of `getStats`

* Adjust test mocks to use typed arrays

* Adjust signatures of some phases to use ArrayLike<T>

* Adjust signature of src/ui/containers/stats-container#updateIvs

* Remove comment gap to try to satisfy typedoc

* Ensure ivs are always set

* fix: fun-and-games me to use typed array

* Add new tests for array utilities

* Update type of ivs in save-data.ts

* Update part-timer-encounter.test.ts

* Convert uses of StatusEffect[] to Uint8Array

* Update ssui to use uint8array for ivs

* Revert use of typed arrays

* Move `nil` to @types/common

* Make more arrays readonly

* fix: remnant change to immune effects

* Even more array improvements

* Apply kev's suggestions from code review

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>

* address Bertie's comments from code review

* tests: remove undefined check for bigint array types

* fixup abilities.ts

---------

Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-10-06 12:21:58 -05:00

47 lines
1.1 KiB
TypeScript

import type { BiomeId } from "#enums/biome-id";
import type { BiomePoolTier } from "#enums/biome-pool-tier";
import type { SpeciesId } from "#enums/species-id";
import type { TimeOfDay } from "#enums/time-of-day";
import type { TrainerType } from "#enums/trainer-type";
export interface BiomeLinks {
[key: number]: BiomeId | (BiomeId | [BiomeId, number])[];
}
export interface BiomeDepths {
[key: number]: [number, number];
}
interface SpeciesTree {
readonly [key: number]: SpeciesId[];
}
export interface PokemonPools {
readonly [key: number]: (SpeciesId | SpeciesTree)[];
}
interface BiomeTierPokemonPools {
readonly [key: number]: PokemonPools;
}
export interface BiomePokemonPools {
readonly [key: number]: BiomeTierPokemonPools;
}
export interface BiomeTierTod {
biome: BiomeId;
tier: BiomePoolTier;
tod: TimeOfDay[];
}
export interface CatchableSpecies {
readonly [key: number]: readonly BiomeTierTod[];
}
export interface BiomeTierTrainerPools {
readonly [key: number]: readonly TrainerType[];
}
export interface BiomeTrainerPools {
readonly [key: number]: BiomeTierTrainerPools;
}