import type { AssessmentDefinition, InventoryLocalePack, LocalizedText } from "./types.ts"; /** * Resolves a `LocalizedText` to a string for the given locale. * * Resolution order: exact locale -> base language of the locale * (`"de-AT"` -> `"de"`) -> `fallbackLocale` -> first available entry. */ export declare function localizeText(text: LocalizedText, locale: string, fallbackLocale?: string): string; /** * Merges a locale pack into a definition, returning a new definition that * additionally carries the pack's language in every localized text. The * original definition and the pack are not modified. * * Packs may be partial (untranslated entries keep their existing locales), * but entries referencing unknown question/band/flag/subscale ids or * mismatched option counts throw `invalid_argument`. */ export declare function applyLocale(definition: AssessmentDefinition, pack: InventoryLocalePack): AssessmentDefinition; /** * Returns a copy of a definition containing only the given locales in every * localized text (questions, options, bands, flags, subscales). The * definition's `defaultLocale` is always kept as the fallback. * * Use this at the server boundary to avoid shipping unused languages to a * client: `res.json(pickLocales(phq9, [userLocale]))`. The original * definition is not modified. */ export declare function pickLocales(definition: AssessmentDefinition, locales: string[]): AssessmentDefinition; /** Collects the union of locales present in a set of localized texts. */ export declare function collectLocales(texts: Array): string[];