import { InitOptions, TFunction, TOptionsBase as TOptionsBase$1, TOptions as TOptions$1 } from 'i18next'; export { InitOptions, TFunction, TOptions, TOptionsBase, default as i18next } from 'i18next'; import { NonNullObject } from '@sapphire/utilities'; import { LocaleString, APIInteraction, APIPingInteraction, LocalizationMap } from 'discord-api-types/v10'; import { PathLike } from 'node:fs'; type TypedT = string & { __type__: TCustom; }; type TypedFT = string & { __args__: TArgs; __return__: TReturn; }; interface Value { value: T; } interface Values { values: readonly T[]; count: number; } interface Difference { previous: T; next: T; } type LocalePrefixKey = `commands/${string}:${string}`; declare function T(k: string): TypedT; declare function FT(k: string): TypedFT; declare const supportedLanguages: ReadonlySet; declare function isSupportedDiscordLocale(language: string): language is LocaleString; declare const loadedLocales: Set<"id" | "en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "es-419" | "sv-SE" | "th" | "tr" | "uk" | "vi">; declare const loadedNamespaces: Set; declare const loadedPaths: Set; declare const loadedFormatters: Formatter[]; interface Formatter { name: string; format: (value: any, lng: string | undefined, options: any) => string; } declare function addFormatters(...formatters: readonly Formatter[]): void; declare function init(options?: InitOptions): Promise; declare function load(directory: PathLike): Promise; declare function getT(locale: LocaleString): TFunction<'translation', undefined, 'translation'>; type Interaction = Pick, 'locale' | 'guild_locale' | 'guild_id'>; declare function getSupportedUserLanguageName(interaction: Interaction): LocaleString; declare function getSupportedUserLanguageT(interaction: Interaction): TFunction; declare function getSupportedLanguageName(interaction: Interaction): LocaleString; declare function getSupportedLanguageT(interaction: Interaction): TFunction; declare function resolveUserKey(interaction: Interaction, key: TypedT, options?: TOptionsBase$1 | string): TReturn; declare function resolveUserKey(interaction: Interaction, key: TypedT, defaultValue: TReturn, options?: TOptionsBase$1 | string): TReturn; declare function resolveUserKey(interaction: Interaction, key: TypedFT, options?: TOptions$1): TReturn; declare function resolveUserKey(interaction: Interaction, key: TypedFT, defaultValue: TReturn, options?: TOptions$1): TReturn; declare function resolveKey(interaction: Interaction, key: TypedT, options?: TOptionsBase$1 | string): TReturn; declare function resolveKey(interaction: Interaction, key: TypedT, defaultValue: TReturn, options?: TOptionsBase$1 | string): TReturn; declare function resolveKey(interaction: Interaction, key: TypedFT, options?: TOptions$1): TReturn; declare function resolveKey(interaction: Interaction, key: TypedFT, defaultValue: TReturn, options?: TOptions$1): TReturn; /** * Gets the value and the localizations from a language key. * @param key The key to get the localizations from. * @returns The retrieved data. * @remarks This should be called **strictly** after loading the locales. */ declare function getLocalizedData(key: TypedT): LocalizedData; /** * Applies the localized names on the builder, calling `setName` and `setNameLocalizations`. * @param builder The builder to apply the localizations to. * @param key The key to get the localizations from. * @returns The updated builder. */ declare function applyNameLocalizedBuilder(builder: T, key: TypedT): T; /** * Applies the localized descriptions on the builder, calling `setDescription` and `setDescriptionLocalizations`. * @param builder The builder to apply the localizations to. * @param key The key to get the localizations from. * @returns The updated builder. */ declare function applyDescriptionLocalizedBuilder(builder: T, key: TypedT): T; /** * Applies the localized names and descriptions on the builder, calling {@link applyNameLocalizedBuilder} and * {@link applyDescriptionLocalizedBuilder}. * @param builder The builder to apply the localizations to. * @param params The root key or the key for the name and description keys. * @returns The updated builder. * @remarks If only 2 parameters were passed, `name` will be defined as `${root}Name` and `description` as * `${root}Description`, being `root` the second parameter in the function, after `builder`. */ declare function applyLocalizedBuilder(builder: T, ...params: [root: LocalePrefixKey] | [name: TypedT, description: TypedT]): T; declare function createSelectMenuChoiceName(key: TypedT, value?: V): createSelectMenuChoiceName.Result; declare namespace createSelectMenuChoiceName { type Result = V & { name: string; name_localizations: LocalizationMap; }; } interface LocalizedData { value: string; localizations: LocalizationMap; } interface BuilderWithName { setName(name: string): this; setNameLocalizations(localizedNames: LocalizationMap | null): this; } interface BuilderWithDescription { setDescription(description: string): this; setDescriptionLocalizations(localizedDescriptions: LocalizationMap | null): this; } type BuilderWithNameAndDescription = BuilderWithName & BuilderWithDescription; declare module 'i18next' { interface TFunction { lng: string; ns?: string; (key: TypedT, options?: TOptionsBase | string): TReturn; (key: TypedT, defaultValue: TReturn, options?: TOptionsBase | string): TReturn; (key: TypedFT, options?: TOptions): TReturn; (key: TypedFT, defaultValue: TReturn, options?: TOptions): TReturn; } } export { type BuilderWithDescription, type BuilderWithName, type BuilderWithNameAndDescription, type Difference, FT, type Formatter, type Interaction, type LocalePrefixKey, type LocalizedData, T, type TypedFT, type TypedT, type Value, type Values, addFormatters, applyDescriptionLocalizedBuilder, applyLocalizedBuilder, applyNameLocalizedBuilder, createSelectMenuChoiceName, getLocalizedData, getSupportedLanguageName, getSupportedLanguageT, getSupportedUserLanguageName, getSupportedUserLanguageT, getT, init, isSupportedDiscordLocale, load, loadedFormatters, loadedLocales, loadedNamespaces, loadedPaths, resolveKey, resolveUserKey, supportedLanguages };