import type { RetrieveValue, ProjectLanguage, ParticularConfig, InternalConfig } from './types'; /** * retrieve a value from the cache * based on specified langCodeOrLocale * and fallback to default locale if langCodeOrLocale is a langCode */ declare function retrieveLangCodeOrLocale(key: string, langCodeOrLocale: string, languages: ProjectLanguage[]): RetrieveValue; export declare type LanguageSource = 'explicitLanguage' | 'defaultLanguage' | 'acceptLanguage' | 'random' | 'currentGlobal' | 'none'; declare type SelectLanguageResponse = [language: string | undefined, source: LanguageSource]; /** * selectLanguage optimistically selects a language based on the provided paramenters. * The source return value marks the "confidence" of the selected language. * @param activeLanguagesOnly as per ParticularConfig * @param language explicitly provided language * @param acceptLanguage as per ParticularConfig * @param defaultLanguage as per ParticularConfig * @param projectLanguages from @particular.cloud/texts * @param currentLangCodeOrLocale as stored from prior t (translation) and fetchT calls * @returns */ declare function selectLanguage(activeLanguagesOnly: boolean, language?: string, acceptLanguage?: string, defaultLanguage?: string, projectLanguages?: ProjectLanguage[], currentLangCodeOrLocale?: string): SelectLanguageResponse; declare function parseAcceptHeader(acceptLanguage: string): string[]; declare function pickRandomFromArray(array: T[]): T; declare function populateValues(template: string, values: Record): string; declare function warnForTemplateSyntax(template: string): void; declare function throwForTemplateSyntax(template: string): void; declare function throwOnParticularTextsMissing(): void; declare function handleError(error: Error | null, onError: 'warn' | 'throw', message?: string): void; declare function internalConfigToConfig(internalConfig: InternalConfig): ParticularConfig; export { retrieveLangCodeOrLocale, parseAcceptHeader, selectLanguage, pickRandomFromArray, populateValues, warnForTemplateSyntax, throwForTemplateSyntax, throwOnParticularTextsMissing, handleError, internalConfigToConfig, };