import { HttpClient } from '@angular/common/http';
import { TranslateLoader } from '@ngx-translate/core';
import { Observable } from 'rxjs';
import { type EuiAppConfig, I18nLoaderConfig } from '@eui/base';
import { I18nResourceImpl } from './i18n.resource';
import { LogService } from '../log/log.service';
import * as i0 from "@angular/core";
interface ResourceError {
    isError: boolean;
    error?: string;
    resource?: I18nResourceImpl;
}
export interface LoadedResources {
    translations: object;
    hasError: boolean;
    errors?: Array<LoadedResourcesError>;
}
export interface LoadedResourcesError {
    resource: I18nResourceImpl;
    error: string;
}
export interface TranslationKeys {
    [key: string]: string;
}
export declare class I18nLoader implements TranslateLoader {
    protected http: HttpClient;
    protected logService: LogService;
    protected euiAppConfig: EuiAppConfig;
    protected resources: I18nResourceImpl[];
    protected failedResources: Array<LoadedResourcesError>;
    private logger;
    constructor(http: HttpClient, logService: LogService, euiAppConfig: EuiAppConfig);
    /**
     * Gets the translations from the server
     *
     * @param lang
     * @returns Observable<object>
     */
    getTranslation(lang: string): Observable<object>;
    /**
     * Adds resources
     *
     * @param config loader configuration
     * @returns Observable<any> | false
     */
    addResources(config: I18nLoaderConfig): I18nResourceImpl[];
    /**
     * Removes resources from the loader instance
     */
    removeResources(removedResources: I18nResourceImpl[]): void;
    /**
     * Loads an array of resources, by language
     *
     * @param resources the definition of the resources
     * @param lang the resource language to load
     * @returns Observable<any>
     */
    loadResources(resources: I18nResourceImpl[], lang: string): Observable<{
        hasError: boolean;
        translations: object;
        errors?: LoadedResourcesError[];
    }>;
    /**
     * Returns resources that failed
     */
    getFailedResources(): Array<LoadedResourcesError>;
    /**
     * Create resources from a config file
     *
     * @param config loader configuration
     * @returns I18nResourceImpl[] resources
     */
    protected createResources(config: I18nLoaderConfig): I18nResourceImpl[];
    /**
     * Loads a resource, by language
     *
     * @param resource the definition of the resource
     * @param lang the resource language to load
     * @returns Observable<any>
     */
    protected loadResource(resource: I18nResourceImpl, lang: string): Observable<TranslationKeys | ResourceError>;
    private getResourceCompileFunction;
    static ɵfac: i0.ɵɵFactoryDeclaration<I18nLoader, [null, { optional: true; }, null]>;
    static ɵprov: i0.ɵɵInjectableDeclaration<I18nLoader>;
}
export declare const translateConfig: {
    loader: {
        provide: typeof TranslateLoader;
        useClass: typeof I18nLoader;
    };
};
export {};
//# sourceMappingURL=i18n.loader.d.ts.map