/**
 * Translation registry for managing translation specs.
 *
 * Provides registration, lookup, and resolution of translation specs
 * with support for locale fallback chains.
 *
 * @module translations/registry
 *
 * @example
 * ```typescript
 * import { TranslationRegistry } from '@contractspec/lib.contracts-spec';
 *
 * const registry = new TranslationRegistry();
 *
 * // Register translations
 * registry.register(englishMessages);
 * registry.register(frenchMessages);
 *
 * // Get a translation spec
 * const spec = registry.get('auth.messages', '1.0.0', 'en');
 *
 * // Get a specific message
 * const message = registry.getMessage('auth.messages', 'login.success', 'en');
 *
 * // Get with fallback
 * const messageWithFallback = registry.getWithFallback(
 *   'auth.messages',
 *   'login.success',
 *   'de', // German
 *   'en'  // Fallback to English
 * );
 * ```
 */
import type { Locale, MessageKey, TranslationMessage, TranslationSpec } from './spec';
export interface TranslationLookupResult {
    spec: TranslationSpec;
    message: TranslationMessage;
    locale: Locale;
    fromFallback: boolean;
}
export interface TranslationRegistryStats {
    totalSpecs: number;
    locales: Locale[];
    domains: string[];
    totalMessages: number;
}
/**
 * Registry for translation specs with locale-aware lookup.
 */
export declare class TranslationRegistry {
    private readonly specs;
    private readonly latestByLocale;
    private readonly locales;
    private readonly domains;
    constructor(items?: TranslationSpec[]);
    /**
     * Register a translation spec.
     *
     * @param spec - Translation spec to register
     */
    register(spec: TranslationSpec): void;
    /**
     * Get a translation spec by key, version, and locale.
     *
     * @param key - Translation spec key
     * @param version - Version string
     * @param locale - Locale code
     * @returns Translation spec or undefined
     */
    get(key: string, version: string, locale: Locale): TranslationSpec | undefined;
    /**
     * Get the latest version of a translation spec for a locale.
     *
     * @param key - Translation spec key
     * @param locale - Locale code
     * @returns Translation spec or undefined
     */
    getLatest(key: string, locale: Locale): TranslationSpec | undefined;
    /**
     * Get a specific message from a translation spec.
     *
     * @param specKey - Translation spec key
     * @param messageKey - Message key within the spec
     * @param locale - Locale code
     * @param version - Optional version (uses latest if not specified)
     * @returns Translation message or undefined
     */
    getMessage(specKey: string, messageKey: MessageKey, locale: Locale, version?: string): TranslationMessage | undefined;
    /**
     * Get a message value with fallback chain support.
     *
     * @param specKey - Translation spec key
     * @param messageKey - Message key within the spec
     * @param locale - Primary locale
     * @param fallbackLocale - Fallback locale (optional, uses spec's fallback if not provided)
     * @param version - Optional version (uses latest if not specified)
     * @returns Translation lookup result or undefined
     */
    getWithFallback(specKey: string, messageKey: MessageKey, locale: Locale, fallbackLocale?: Locale, version?: string): TranslationLookupResult | undefined;
    /**
     * Get a message value string with fallback.
     *
     * Convenience method that returns just the string value or a fallback.
     *
     * @param specKey - Translation spec key
     * @param messageKey - Message key
     * @param locale - Primary locale
     * @param fallback - String to return if message not found (default: messageKey)
     * @returns Message value or fallback
     */
    getValue(specKey: string, messageKey: MessageKey, locale: Locale, fallback?: string): string;
    /**
     * List all locales available for a spec key.
     *
     * @param specKey - Translation spec key
     * @returns Array of available locales
     */
    listLocales(specKey: string): Locale[];
    /**
     * List all translation specs.
     *
     * @returns Array of all registered translation specs
     */
    list(): TranslationSpec[];
    /**
     * List translation specs by locale.
     *
     * @param locale - Locale to filter by
     * @returns Array of translation specs for the locale
     */
    listByLocale(locale: Locale): TranslationSpec[];
    /**
     * List translation specs by domain.
     *
     * @param domain - Domain to filter by
     * @returns Array of translation specs for the domain
     */
    listByDomain(domain: string): TranslationSpec[];
    /**
     * Check if a translation spec exists.
     *
     * @param key - Translation spec key
     * @param locale - Locale code
     * @param version - Optional version
     * @returns True if spec exists
     */
    has(key: string, locale: Locale, version?: string): boolean;
    /**
     * Get all registered locales.
     *
     * @returns Set of all registered locales
     */
    getLocales(): ReadonlySet<Locale>;
    /**
     * Get all registered domains.
     *
     * @returns Set of all registered domains
     */
    getDomains(): ReadonlySet<string>;
    /**
     * Get registry statistics.
     *
     * @returns Registry statistics
     */
    getStats(): TranslationRegistryStats;
    /**
     * Clear all registered specs.
     */
    clear(): void;
    private makeKey;
    private isNewerVersion;
}
