import type { i18n, ResourceLanguage } from "i18next"; /** * Loads the resources of a language for an i18next instance. Resolves to a map of namespace to resource bundle, * the same shape as a single language entry of the i18next `resources` option. */ export type LoadResourcesFunction = (language: T) => Promise; export interface RegisterInstanceOptions { /** * When provided, the plugin loads the resources of a language the instance doesn't hold yet, at registration for * the current language, then whenever the language changes. The instance must have been initialized with * `resources: {}` so that i18next initializes synchronously and creates its store. */ loadResources?: LoadResourcesFunction; } export interface i18nextInstanceRegistryEntry { readonly key: string; readonly instance: i18n; readonly loadResources?: LoadResourcesFunction; readonly loadedLanguages: Set; readonly failedLanguages: Set; readonly pendingLoads: Map>; } export declare class i18nextInstanceRegistry { #private; add(key: string, instance: i18n, { loadResources }?: RegisterInstanceOptions): i18nextInstanceRegistryEntry; getInstance(key: string): i18n | undefined; getInstances(): i18n[]; getEntries(): i18nextInstanceRegistryEntry[]; }