/**
 * @fileoverview Translation service functions for internationalization and localization.
 *
 * This module provides service functions for loading translation data, managing locale
 * descriptors, and handling multi-language content in KOS applications. Supports both
 * static file-based translations and dynamic translation service integration.
 *
 * @module TranslationServices
 */
/**
 * Generic translation data response format.
 *
 * Represents the structure of translation data returned from various translation
 * endpoints, supporting flexible key-value structures for different locales
 * and translation namespaces.
 *
 * @group KOS Model
 * @category i18n
 */
export type TranslationResponse = Record<string, any>;
/**
 * Locale descriptor defining translation file location and fallback behavior.
 *
 * Describes how to locate and load translation files for a specific locale,
 * including fallback chains for graceful degradation when translations are
 * missing or incomplete.
 *
 * @group KOS Model
 * @category i18n
 */
export interface LocaleDescriptor {
    /** Default locale to use when this locale's translations are unavailable */
    defaultLocale: string;
    /** Path to the translation file for this locale */
    file: string;
    /** Optional array of fallback locales to try in order */
    fallbacks?: string[];
}
/**
 * Complete localization configuration for organizing translation namespaces.
 *
 * Defines the structure for managing multiple translation namespaces with
 * locale-specific configurations. Enables organized translation management
 * across different features or components of an application.
 *
 * @group KOS Model
 * @category i18n
 */
export interface Localization {
    /**
     * Translation namespaces organized by feature or component.
     * Each namespace contains locale configurations and file paths.
     */
    namespaces: {
        [key: string]: {
            /** Locale-specific configuration for this namespace */
            locales: {
                [key: string]: LocaleDescriptor;
            };
            /** Base path for translation files in this namespace */
            basePath: string;
        };
    };
    /** Root path for the localization configuration */
    path: string;
}
/**
 * Loads translation data from a specified URL.
 *
 * Fetches translation JSON files from static resources or translation services.
 * Handles network errors gracefully by returning empty objects rather than
 * throwing exceptions, enabling fallback behavior in translation systems.
 *
 * @param url - Relative or absolute URL to the translation file
 * @param root - Optional root URL override (defaults to current window origin)
 * @returns Promise resolving to translation data object
 *
 * @throws {Error} When network request fails unexpectedly (non-200 responses return empty object)
 *
 * @example Load Translation File
 * ```typescript
 * const frenchTranslations = await getTranslations('/assets/locales/fr/common.json');
 * console.log('Welcome message:', frenchTranslations.welcome);
 *
 * const customTranslations = await getTranslations('/api/translations/dashboard', 'https://translations.example.com');
 * ```
 *
 * @group KOS Model
 * @category i18n
 */
export declare const getTranslations: (url: string, root?: string) => Promise<any>;
/**
 * Retrieves the system-wide localization configuration descriptor.
 *
 * Fetches the complete localization configuration from the KOS system,
 * including namespace definitions, locale mappings, and file path information.
 * Used for initializing translation containers with proper configuration.
 *
 * @returns Promise resolving to complete localization descriptor
 *
 * @throws {Error} When service request fails or returns non-200 status
 *
 * @example Initialize Translation System
 * ```typescript
 * const localizationConfig = await getLocalizationDescriptor();
 * const translationContainer = TranslationContainer.instance('app-i18n')
 *   .options({
 *     lang: 'en',
 *     descriptor: localizationConfig
 *   })
 *   .build();
 * ```
 *
 * @group KOS Model
 * @category i18n
 */
export declare const getLocalizationDescriptor: () => Promise<Localization>;
/**
 * Creates a context-specific localization descriptor retrieval function.
 *
 * Returns a curried function that fetches localization configuration for a
 * specific context from the KOS system. Useful for creating context-aware
 * translation loaders that can be configured once and used multiple times.
 *
 * @param context - Context identifier for localization configuration
 * @returns Async function that retrieves context-specific localization descriptor
 *
 * @throws {Error} When service request fails or context is not found
 *
 * @example Create Context-Specific Loader
 * ```typescript
 * const getStudioTranslations = getKosLocalizationDescriptor('studio');
 * const studioConfig = await getStudioTranslations();
 *
 * const getDeviceTranslations = getKosLocalizationDescriptor('device');
 * const deviceConfig = await getDeviceTranslations();
 *
 * // Use in translation container initialization
 * const container = TranslationContainer.instance('context-aware')
 *   .options({
 *     lang: 'es',
 *     descriptor: studioConfig
 *   })
 *   .build();
 * ```
 *
 * @group KOS Model
 * @category i18n
 */
export declare const getKosLocalizationDescriptor: (context: string) => () => Promise<Localization>;
//# sourceMappingURL=translation-services.d.ts.map