/** * Internationalization (i18n) Utilities for NA-Kit UI * * Provides locale management, RTL support, date/number/currency formatting, * and a lightweight translation system. * * @module i18n */ export interface LocaleConfig { /** BCP 47 language tag (e.g. 'en-US', 'ar-SA', 'he-IL') */ locale: string; /** Text direction */ dir: 'ltr' | 'rtl'; /** Translation messages */ messages?: Record; /** Number formatting options */ numberFormat?: Intl.NumberFormatOptions; /** Date formatting options */ dateFormat?: Intl.DateTimeFormatOptions; /** Currency code (e.g. 'USD', 'EUR') */ currency?: string; } export interface TranslationOptions { /** Variable substitutions: { name: "John" } → "Hello, {name}" → "Hello, John" */ params?: Record; /** Pluralization count */ count?: number; /** Default value if key not found */ defaultValue?: string; } /** * Detect if a locale uses RTL text direction */ export declare function isRTL(locale: string): boolean; /** * Get the text direction for a locale */ export declare function getDirection(locale: string): 'ltr' | 'rtl'; /** * Singleton locale provider for managing the active locale */ declare class LocaleProviderImpl { private _locale; private _dir; private _messages; private _listeners; constructor(); /** Get current locale */ get locale(): string; /** Get current text direction */ get dir(): 'ltr' | 'rtl'; /** * Set the active locale */ setLocale(locale: string): void; /** * Register translations for a locale */ registerLocale(locale: string, messages: Record): void; /** * Extend an existing locale with additional messages */ extendLocale(locale: string, messages: Record): void; /** * Translate a key */ t(key: string, options?: TranslationOptions): string; /** * Subscribe to locale changes */ onChange(listener: (locale: string, dir: 'ltr' | 'rtl') => void): () => void; /** * Get all registered locale codes */ getAvailableLocales(): string[]; private _notify; } /** Singleton locale provider instance */ export declare const LocaleProvider: LocaleProviderImpl; /** * Format a number according to the current locale */ export declare function formatNumber(value: number, options?: Intl.NumberFormatOptions, locale?: string): string; /** * Format a currency value */ export declare function formatCurrency(value: number, currency?: string, options?: Intl.NumberFormatOptions, locale?: string): string; /** * Format a date according to the current locale */ export declare function formatDate(date: Date | string | number, options?: Intl.DateTimeFormatOptions, locale?: string): string; /** * Format a relative time (e.g. "2 hours ago", "in 3 days") */ export declare function formatRelativeTime(date: Date | string | number, locale?: string): string; /** * Format a percentage value */ export declare function formatPercent(value: number, decimals?: number, locale?: string): string; /** * Format a file size in human-readable format */ export declare function formatFileSize(bytes: number, locale?: string): string; /** * Format a list (e.g. "Alice, Bob, and Charlie") */ export declare function formatList(items: string[], type?: 'conjunction' | 'disjunction', locale?: string): string; /** * Generate CSS custom properties for RTL-aware logical properties. * Use these in component styles for bidirectional support. */ export declare const rtlStyles = "\n /* RTL-aware logical properties */\n :host {\n --ui-start: left;\n --ui-end: right;\n --ui-text-align: left;\n }\n\n :host([dir=\"rtl\"]),\n :host-context([dir=\"rtl\"]) {\n --ui-start: right;\n --ui-end: left;\n --ui-text-align: right;\n direction: rtl;\n }\n\n /* Use CSS logical properties for RTL support */\n /* margin-inline-start, margin-inline-end, padding-inline-start, etc. */\n"; /** * Mixin to add RTL support to a Lit component * Adds a `dir` property that auto-detects from the document */ export declare function withRTL import('lit').LitElement>(base: T): T & (new (...args: any[]) => { dir: "ltr" | "rtl"; }); export {}; //# sourceMappingURL=i18n.d.ts.map