[Refactor] Merged interfaces/ into @types/; removed runtime orphan modules

https://github.com/pagefaultgames/pokerogue/pull/5951
This commit is contained in:
Bertie690 2025-06-07 20:28:01 -04:00 committed by GitHub
parent c5db827381
commit 1ff45687c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
24 changed files with 31 additions and 94 deletions

View File

@ -1,6 +1,7 @@
/**
* Dex entry for a single Pokemon Species
*/
export interface DexData {
[key: number]: DexEntry;
}
export interface DexEntry {
seenAttr: bigint;
caughtAttr: bigint;
@ -10,7 +11,3 @@ export interface DexEntry {
hatchedCount: number;
ivs: number[];
}
export interface DexData {
[key: number]: DexEntry;
}

View File

@ -2,9 +2,6 @@ export interface Localizable {
localize(): void;
}
export interface TranslationEntries {
[key: string]: string | { [key: string]: string };
}
export interface SimpleTranslationEntries {
[key: string]: string;
}

View File

@ -2,8 +2,8 @@ import type { EnemyPokemon } from "#app/field/pokemon";
import type { PersistentModifier } from "#app/modifier/modifier";
import type { PartyMemberStrength } from "#enums/party-member-strength";
import type { SpeciesId } from "#enums/species-id";
import type { TrainerConfig } from "./trainer-config";
import type { TrainerPartyTemplate } from "./TrainerPartyTemplate";
import type { TrainerConfig } from "../data/trainers/trainer-config";
import type { TrainerPartyTemplate } from "../data/trainers/TrainerPartyTemplate";
export type PartyTemplateFunc = () => TrainerPartyTemplate;
export type PartyMemberFunc = (level: number, strength: PartyMemberStrength) => EnemyPokemon;

View File

@ -120,7 +120,7 @@ import { SceneBase } from "#app/scene-base";
import CandyBar from "#app/ui/candy-bar";
import type { Variant } from "#app/sprites/variant";
import { variantData, clearVariantData } from "#app/sprites/variant";
import type { Localizable } from "#app/interfaces/locales";
import type { Localizable } from "#app/@types/locales";
import Overrides from "#app/overrides";
import { InputsController } from "#app/inputs-controller";
import { UiInputs } from "#app/ui-inputs";
@ -169,7 +169,7 @@ import {
import { MysteryEncounterSaveData } from "#app/data/mystery-encounters/mystery-encounter-save-data";
import { MysteryEncounterType } from "#enums/mystery-encounter-type";
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
import type HeldModifierConfig from "#app/interfaces/held-modifier-config";
import type HeldModifierConfig from "#app/@types/held-modifier-config";
import { ExpPhase } from "#app/phases/exp-phase";
import { ShowPartyExpBarPhase } from "#app/phases/show-party-exp-bar-phase";
import { MysteryEncounterMode } from "#enums/mystery-encounter-mode";

View File

@ -2,7 +2,7 @@ import { AbilityId } from "#enums/ability-id";
import type { AbAttrCondition } from "#app/@types/ability-types";
import type { AbAttr } from "#app/data/abilities/ab-attrs/ab-attr";
import i18next from "i18next";
import type { Localizable } from "#app/interfaces/locales";
import type { Localizable } from "#app/@types/locales";
import type { Constructor } from "#app/utils/common";
export class Ability implements Localizable {

View File

@ -1,6 +1,7 @@
import { globalScene } from "#app/global-scene";
import type { PlayerPokemon } from "#app/field/pokemon";
import type { DexEntry, StarterDataEntry } from "#app/system/game-data";
import type { StarterDataEntry } from "#app/system/game-data";
import type { DexEntry } from "#app/@types/dex-data";
/**
* Stores data associated with a specific egg and the hatched pokemon

View File

@ -81,7 +81,7 @@ import { TerrainType } from "../terrain";
import { ModifierPoolType } from "#app/modifier/modifier-type";
import { Command } from "../../ui/command-ui-handler";
import i18next from "i18next";
import type { Localizable } from "#app/interfaces/locales";
import type { Localizable } from "#app/@types/locales";
import { getBerryEffectFunc } from "../berry";
import { AbilityId } from "#enums/ability-id";
import { ArenaTagType } from "#enums/arena-tag-type";

View File

@ -33,7 +33,7 @@ import {
} from "#app/data/mystery-encounters/utils/encounter-pokemon-utils";
import { TrainerSlot } from "#enums/trainer-slot";
import { PokeballType } from "#enums/pokeball";
import type HeldModifierConfig from "#app/interfaces/held-modifier-config";
import type HeldModifierConfig from "#app/@types/held-modifier-config";
import type { BerryType } from "#enums/berry-type";
import { StatStageChangePhase } from "#app/phases/stat-stage-change-phase";
import { Stat } from "#enums/stat";

View File

@ -25,7 +25,7 @@ import { MysteryEncounterOptionBuilder } from "#app/data/mystery-encounters/myst
import { queueEncounterMessage, showEncounterText } from "#app/data/mystery-encounters/utils/encounter-dialogue-utils";
import { MysteryEncounterTier } from "#enums/mystery-encounter-tier";
import { MysteryEncounterOptionMode } from "#enums/mystery-encounter-option-mode";
import type HeldModifierConfig from "#app/interfaces/held-modifier-config";
import type HeldModifierConfig from "#app/@types/held-modifier-config";
import i18next from "i18next";
import { getStatKey } from "#enums/stat";
import { CLASSIC_MODE_MYSTERY_ENCOUNTER_WAVES } from "#app/constants";

View File

@ -39,7 +39,7 @@ import { PlayerGender } from "#enums/player-gender";
import { TrainerType } from "#enums/trainer-type";
import PokemonData from "#app/system/pokemon-data";
import { Nature } from "#enums/nature";
import type HeldModifierConfig from "#app/interfaces/held-modifier-config";
import type HeldModifierConfig from "#app/@types/held-modifier-config";
import { trainerConfigs } from "#app/data/trainers/trainer-config";
import { TrainerPartyTemplate } from "#app/data/trainers/TrainerPartyTemplate";
import { PartyMemberStrength } from "#enums/party-member-strength";

View File

@ -50,7 +50,7 @@ import type PokemonSpecies from "#app/data/pokemon-species";
import type { IEggOptions } from "#app/data/egg";
import { Egg } from "#app/data/egg";
import type { CustomPokemonData } from "#app/data/custom-pokemon-data";
import type HeldModifierConfig from "#app/interfaces/held-modifier-config";
import type HeldModifierConfig from "#app/@types/held-modifier-config";
import { MovePhase } from "#app/phases/move-phase";
import { EggLapsePhase } from "#app/phases/egg-lapse-phase";
import { TrainerVictoryPhase } from "#app/phases/trainer-victory-phase";

View File

@ -1,4 +1,4 @@
import type { Localizable } from "#app/interfaces/locales";
import type { Localizable } from "#app/@types/locales";
import { AbilityId } from "#enums/ability-id";
import { PartyMemberStrength } from "#enums/party-member-strength";
import { SpeciesId } from "#enums/species-id";

View File

@ -1,4 +1,4 @@
import type { TrainerTierPools } from "#app/data/trainers/typedefs";
import type { TrainerTierPools } from "#app/@types/trainer-funcs";
import { TrainerPoolTier } from "#enums/trainer-pool-tier";
import { SpeciesId } from "#enums/species-id";

View File

@ -48,7 +48,7 @@ import type {
TrainerTierPools,
TrainerConfigs,
PartyMemberFuncs,
} from "./typedefs";
} from "../../@types/trainer-funcs";
/** Minimum BST for Pokemon generated onto the Elite Four's teams */
const ELITE_FOUR_MINIMUM_BST = 460;

View File

@ -1,17 +0,0 @@
export function getData() {
const dataStr = localStorage.getItem("data");
if (!dataStr) {
return null;
}
return JSON.parse(atob(dataStr), (k, v) =>
k.endsWith("Attr") && !["natureAttr", "abilityAttr", "passiveAttr"].includes(k) ? BigInt(v) : v,
);
}
export function getSession() {
const sessionStr = localStorage.getItem("sessionData");
if (!sessionStr) {
return null;
}
return JSON.parse(atob(sessionStr));
}

View File

@ -1,4 +1,3 @@
export const starterColors: StarterColors = {};
interface StarterColors {
export const starterColors: {
[key: string]: [string, string];
}
} = {};

View File

@ -1,4 +0,0 @@
export const starterColors: StarterColors = {};
interface StarterColors {
[key: string]: [string, string];
}

View File

@ -62,6 +62,7 @@ import { pokerogueApi } from "#app/plugins/api/pokerogue-api";
import { ArenaTrapTag } from "#app/data/arena-tag";
import { pokemonFormChanges } from "#app/data/pokemon-forms";
import type { PokemonType } from "#enums/pokemon-type";
import type { DexData, DexEntry } from "../@types/dex-data";
export const defaultStarterSpecies: SpeciesId[] = [
SpeciesId.BULBASAUR,
@ -131,6 +132,7 @@ export function decrypt(data: string, bypassLogin: boolean): string {
)(data);
}
// TODO: Move all these exported interfaces to @types
export interface SystemSaveData {
trainerId: number;
secretId: number;
@ -191,20 +193,6 @@ export interface VoucherCounts {
[type: string]: number;
}
export interface DexData {
[key: number]: DexEntry;
}
export interface DexEntry {
seenAttr: bigint;
caughtAttr: bigint;
natureAttr: number;
seenCount: number;
caughtCount: number;
hatchedCount: number;
ivs: number[];
}
export type StarterMoveset = [MoveId] | [MoveId, MoveId] | [MoveId, MoveId, MoveId] | [MoveId, MoveId, MoveId, MoveId];
export interface StarterFormMoveData {

View File

@ -1,22 +0,0 @@
import type { GameModes } from "../game-mode";
import type PokemonData from "./pokemon-data";
import type PersistentModifierData from "./modifier-data";
export enum SessionHistoryResult {
ACTIVE,
WIN,
LOSS,
}
export interface SessionHistory {
seed: string;
playTime: number;
result: SessionHistoryResult;
gameMode: GameModes;
party: PokemonData[];
modifiers: PersistentModifierData[];
money: number;
waveIndex: number;
gameVersion: string;
timestamp: number;
}

View File

@ -20,7 +20,8 @@ import { allSpecies, getPokemonSpecies, getPokemonSpeciesForm, normalForm } from
import { getStarterValueFriendshipCap, speciesStarterCosts } from "#app/data/balance/starters";
import { starterPassiveAbilities } from "#app/data/balance/passives";
import { PokemonType } from "#enums/pokemon-type";
import type { DexEntry, StarterAttributes } from "#app/system/game-data";
import type { StarterAttributes } from "#app/system/game-data";
import type { DexEntry } from "#app/@types/dex-data";
import { AbilityAttr, DexAttr } from "#app/system/game-data";
import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";
import MessageUiHandler from "#app/ui/message-ui-handler";

View File

@ -11,7 +11,8 @@ import { allSpecies, getPokemonSpeciesForm, getPokerusStarters, normalForm } fro
import { getStarterValueFriendshipCap, speciesStarterCosts, POKERUS_STARTER_COUNT } from "#app/data/balance/starters";
import { catchableSpecies } from "#app/data/balance/biomes";
import { PokemonType } from "#enums/pokemon-type";
import type { DexAttrProps, DexEntry, StarterAttributes, StarterPreferences } from "#app/system/game-data";
import type { DexAttrProps, StarterAttributes, StarterPreferences } from "#app/system/game-data";
import type { DexEntry } from "#app/@types/dex-data";
import { AbilityAttr, DexAttr, loadStarterPreferences } from "#app/system/game-data";
import MessageUiHandler from "#app/ui/message-ui-handler";
import PokemonIconAnimHandler, { PokemonIconAnimMode } from "#app/ui/pokemon-icon-anim-handler";

View File

@ -6,7 +6,8 @@ import { getNatureName } from "../data/nature";
import { PokemonType } from "#enums/pokemon-type";
import type Pokemon from "../field/pokemon";
import i18next from "i18next";
import type { DexEntry, StarterDataEntry } from "../system/game-data";
import type { StarterDataEntry } from "../system/game-data";
import type { DexEntry } from "#app/@types/dex-data";
import { DexAttr } from "../system/game-data";
import { fixedInt, getShinyDescriptor } from "#app/utils/common";
import ConfirmUiHandler from "./confirm-ui-handler";

View File

@ -23,13 +23,8 @@ import { allSpecies, getPokemonSpeciesForm, getPokerusStarters } from "#app/data
import { getStarterValueFriendshipCap, speciesStarterCosts, POKERUS_STARTER_COUNT } from "#app/data/balance/starters";
import { PokemonType } from "#enums/pokemon-type";
import { GameModes } from "#app/game-mode";
import type {
DexAttrProps,
DexEntry,
StarterMoveset,
StarterAttributes,
StarterPreferences,
} from "#app/system/game-data";
import type { DexAttrProps, StarterMoveset, StarterAttributes, StarterPreferences } from "#app/system/game-data";
import type { DexEntry } from "#app/@types/dex-data";
import { AbilityAttr, DexAttr, loadStarterPreferences, saveStarterPreferences } from "#app/system/game-data";
import { Tutorial, handleTutorial } from "#app/tutorial";
import type { OptionSelectItem } from "#app/ui/abstact-option-select-ui-handler";