From 2b77efc792eb651f980c3e4944524b223563a9d7 Mon Sep 17 00:00:00 2001 From: flx-sta <50131232+flx-sta@users.noreply.github.com> Date: Mon, 30 Sep 2024 22:01:28 -0700 Subject: [PATCH] update i18next.d.ts --- src/@types/i18next.d.ts | 113 +++++++++++++++++++++++++++++++++++----- 1 file changed, 99 insertions(+), 14 deletions(-) diff --git a/src/@types/i18next.d.ts b/src/@types/i18next.d.ts index 8da06165eb5..6dcfda0f358 100644 --- a/src/@types/i18next.d.ts +++ b/src/@types/i18next.d.ts @@ -1,17 +1,102 @@ -import { TOptions } from "i18next"; +import "i18next"; -//TODO: this needs to be type properly in the future -// Module declared to make referencing keys in the localization files type-safe. declare module "i18next" { - interface CustomTypeOptions { - defaultNS: "menu", // needed here as well for typedoc - // resources: typeof enConfig - } - - interface TFunction { - ( - key: string | string[], - options?: TOptions & Record - ): string; - } + interface CustomTypeOptions { + defaultNS: "menu"; + namespaces: [ + "ability", + "abilityTriggers", + "arenaFlyout", + "arenaTag", + "battle", + "battleScene", + "battleInfo", + "battleMessageUiHandler", + "battlePokemonForm", + "battlerTags", + "berry", + "bgmName", + "biome", + "challenges", + "commandUiHandler", + "common", + "achv", + "dialogue", + "battleSpecDialogue", + "miscDialogue", + "doubleBattleDialogue", + "egg", + "fightUiHandler", + "filterBar", + "gameMode", + "gameStatsUiHandler", + "growth", + "menu", + "menuUiHandler", + "modifier", + "modifierType", + "move", + "nature", + "pokeball", + "pokemon", + "pokemonForm", + "pokemonInfo", + "pokemonInfoContainer", + "pokemonSummary", + "saveSlotSelectUiHandler", + "settings", + "splashMessages", + "starterSelectUiHandler", + "statusEffect", + "terrain", + "titles", + "trainerClasses", + "trainerNames", + "tutorial", + "voucher", + "weather", + "partyUiHandler", + "modifierSelectUiHandler", + "moveTriggers", + "runHistory", + "mysteryEncounters/mysteriousChallengers", + "mysteryEncounters/mysteriousChest", + "mysteryEncounters/darkDeal", + "mysteryEncounters/fightOrFlight", + "mysteryEncounters/slumberingSnorlax", + "mysteryEncounters/trainingSession", + "mysteryEncounters/departmentStoreSale", + "mysteryEncounters/shadyVitaminDealer", + "mysteryEncounters/fieldTrip", + "mysteryEncounters/safariZone", + "mysteryEncounters/lostAtSea", + "mysteryEncounters/fieryFallout", + "mysteryEncounters/theStrongStuff", + "mysteryEncounters/thePokemonSalesman", + "mysteryEncounters/anOfferYouCantRefuse", + "mysteryEncounters/delibirdy", + "mysteryEncounters/absoluteAvarice", + "mysteryEncounters/aTrainersTest", + "mysteryEncounters/trashToTreasure", + "mysteryEncounters/berriesAbound", + "mysteryEncounters/clowningAround", + "mysteryEncounters/partTimer", + "mysteryEncounters/dancingLessons", + "mysteryEncounters/weirdDream", + "mysteryEncounters/theWinstrateChallenge", + "mysteryEncounters/teleportingHijinks", + "mysteryEncounters/bugTypeSuperfan", + "mysteryEncounters/funAndGames", + "mysteryEncounters/uncommonBreed", + "mysteryEncounters/globalTradeSystem", + "mysteryEncounters/theExpertPokemonBreeder", + "mysteryEncounterMessages" + ]; + // Extend the translation keys with your specific keys + resources: { + [key: string]: { + [key: string]: string; + }; + }; } +}