import type { i18n as I18nType, Namespace as I18nNamespace, SelectorOptions as I18nSelectorOptions, TFunction as I18nTFunction, TOptions as I18nTOptions } from 'i18next'; import type { i18nextResources } from './i18next'; export type i18n = I18nType; export type Namespace = I18nNamespace; export type SelectorOptions = I18nSelectorOptions; export type TFunction = I18nTFunction; export type TOptions = I18nTOptions; export type Translations = Record, string>; /** * @deprecated as an alternative, please use `NsTranslatable` */ export type Translatable = NsTranslationKey<'common'> | NsTranslationObject<'common'>; export type NamespaceToKeyMap = { [K in keyof i18nextResources]: keyof i18nextResources[K]; }; export type NsTranslationKey = NS extends keyof NamespaceToKeyMap ? NamespaceToKeyMap[NS] : never; export type NsTranslationObject = { key: NsTranslationKey; values: Omit, 'ns'> & Record; }; export type NsTranslatable = NsTranslationKey | NsTranslationObject;