/** The DOM-free locale controller. No document reads, globals or peer imports. */ declare const I18N_VERSION = "0.2.0"; type Direction = 'ltr' | 'rtl'; type Primitive = string | number | boolean; type Values = Readonly>; interface LocaleSnapshot { readonly locale: string; readonly revision: number; readonly fallback: readonly string[]; readonly direction: Direction; } interface I18nOptions { locale?: string; fallback?: string | readonly string[]; direction?: (locale: string) => Direction; } interface SubscribeOptions { immediate?: boolean; phase?: 'render' | 'notify'; } type LocaleListener = (snapshot: LocaleSnapshot) => void; interface LoadResult { readonly status: 'applied' | 'superseded'; readonly snapshot: LocaleSnapshot; } interface I18n { readonly snapshot: LocaleSnapshot; readonly locale: string; readonly disposed: boolean; setLocale(locale: string): LocaleSnapshot; refresh(): LocaleSnapshot; subscribe(listener: LocaleListener, options?: SubscribeOptions): () => void; resolveLocale(available: Iterable, requested?: string): string | undefined; directionFor(locale?: string): Direction; formatNumber(value: number | bigint, options?: Intl.NumberFormatOptions): string; formatDate(value: Date | number, options?: Intl.DateTimeFormatOptions): string; plural(value: number, options?: Intl.PluralRulesOptions): Intl.LDMLPluralRule; loadLocale(locale: string, load: (locale: string, signal: AbortSignal) => Promise, commit?: (data: T) => void): Promise; dispose(): void; } declare function canonicalLocale(locale: string): string; /** Strip extensions before walking region/script parents; retain requested tag first. */ declare function localeChain(locale: string, fallback?: readonly string[]): string[]; declare function resolveLocale(available: Iterable, locale: string, fallback?: readonly string[]): string | undefined; /** CLDR likely-subtag script resolution; an explicit script overrides the language. */ declare function localeDirection(locale: string): Direction; declare function createI18n(options?: I18nOptions): I18n; /** Content attributes only. ARIA state and ID-reference attributes are deliberately absent. */ declare const TRANSLATABLE_ATTRIBUTES: readonly ["aria-roledescription", "aria-description", "aria-placeholder", "aria-valuetext", "aria-label", "placeholder", "download", "srcset", "poster", "title", "sizes", "label", "alt", "src", "href", "content"]; type TranslatableAttribute = typeof TRANSLATABLE_ATTRIBUTES[number]; interface AttributeVariant { readonly attribute: TranslatableAttribute; readonly locale: string; } declare function parseTranslationAttribute(name: string): AttributeVariant | undefined; declare function chooseAttribute(variants: ReadonlyMap, locale: string, fallback: readonly string[]): string | undefined; /** Structural dependency injection boundary, satisfied by the real df$ runtime. */ interface QuerySelection { html(content: string): unknown; text(content: string): unknown; attr(name: string, value: string | null): unknown; prop(name: string, value: unknown): unknown; } interface QueryRuntime { (element: Element): QuerySelection; morph?: unknown; } interface RenderContext { readonly state: S; readonly locale: string; readonly snapshot: LocaleSnapshot; readonly i18n: I18n; readonly values: Values; readonly root: Element; readonly query: QueryRuntime; } interface BindOptions { getState?: () => S; values?: Values | ((state: S, snapshot: LocaleSnapshot) => Values); render?: (context: RenderContext) => string; afterRender?: (context: RenderContext) => void; reflectLocale?: boolean; eventTarget?: EventTarget; } interface I18nBinding { readonly root: Element; readonly controller: I18n; readonly disposed: boolean; refresh(): void; setValues(values: Values): void; rescan(): void; dispose(): void; /** Last state snapshot supplied to the renderer. */ readonly context: RenderContext | undefined; } interface Diagnostic { readonly code: string; readonly message: string; readonly element: Element; } interface ValidationOptions { locales?: readonly string[]; values?: readonly string[]; } declare const PLURAL_CATEGORIES: Set; /** Include root, but never cross a nested component boundary or template content. */ declare function ownedElements(root: Element): Element[]; declare function validateI18n(root: Element, options?: ValidationOptions): Diagnostic[]; declare function assertValidI18n(root: Element, options?: ValidationOptions): void; declare const I18N_CHANGE_EVENT = "defuss-i18n:change"; declare function createDomI18n(runtime: QueryRuntime): Readonly<{ bind: (root: Element, controller: I18n, options?: BindOptions) => I18nBinding; mount: (scope: ParentNode, controller: I18n) => { bindings: readonly I18nBinding[]; dispose(): void; }; }>; export { I18N_CHANGE_EVENT, I18N_VERSION, PLURAL_CATEGORIES, TRANSLATABLE_ATTRIBUTES, assertValidI18n, canonicalLocale, chooseAttribute, createDomI18n, createI18n, localeChain, localeDirection, ownedElements, parseTranslationAttribute, resolveLocale, validateI18n }; export type { AttributeVariant, BindOptions, Diagnostic, Direction, I18n, I18nBinding, I18nOptions, LoadResult, LocaleListener, LocaleSnapshot, Primitive, QueryRuntime, QuerySelection, RenderContext, SubscribeOptions, TranslatableAttribute, ValidationOptions, Values }; //# sourceMappingURL=core.d.cts.map