import { OnDestroy, Signal } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { BehaviorSubject, Observable } from 'rxjs';
import { GlobalConfig, EuiLazyService, EuiServiceStatus, I18nLoaderConfig, I18nServiceConfig, I18nState, ModuleConfig, DeepPartial } from '@eui/base';
import { LogService } from '../log';
import { StoreService } from '../store';
import * as i0 from "@angular/core";
export interface ModuleLoadEvent {
    ready: boolean;
    name: string;
    error?: any;
}
export declare class I18nService<T extends I18nState = I18nState> extends EuiLazyService<T | I18nState> implements OnDestroy {
    protected baseGlobalConfig: GlobalConfig;
    protected translateService: TranslateService;
    protected logService: LogService;
    protected store: StoreService<T>;
    private document;
    protected config: I18nServiceConfig;
    protected onModuleLoad: BehaviorSubject<ModuleLoadEvent>;
    private static readonly DEFAULT_STATE;
    /**
     * a single signal holding the state - initial state is null
     */
    private state;
    /**
     * a BehaviorSubject holding the state - initial state is null
     * This is the main source of truth for the state
     */
    private stateSubject;
    private subNotifier;
    constructor(baseGlobalConfig: GlobalConfig, translateService: TranslateService, logService: LogService, store: StoreService<T>, document: Document);
    ngOnDestroy(): void;
    getState(): Observable<T>;
    /**
     * @deprecated this will be removed in a future version
     * @param mapFn
     */
    getState<K = T>(mapFn?: (state: T) => K): Observable<K>;
    getState<a extends keyof DeepPartial<T>>(key?: a): Observable<DeepPartial<a>>;
    updateState(state: DeepPartial<T>): void;
    /**
     * @deprecated it will be removed in next version. Use updateState(partialState: DeepPartial<T>) instead
     * @param slice
     * @param reducer
     */
    updateState(slice: DeepPartial<T>, reducer: (state: T, action: DeepPartial<T>) => T): void;
    /**
     * This method is used to get the state as readonly signal.
     */
    getSignal(): Signal<T>;
    init(langState?: T): Observable<EuiServiceStatus>;
    /**
     * A pipe function that could serve as a wrapper of another observable
     * e.g. ngx-translate i18n.onReady('my_module').pipe(switchMap(()=>translate.get('eui.KEY')));
     * WARNING: onReady will emit only once for a loaded Module, going to another and then going back will not result
     * into another emission.
     *
     * @param moduleName the name of the module that has been given through the eUI globalConfig. In case non provided
     * fetch module name from the state.
     */
    onReady(moduleName?: string): Observable<ModuleLoadEvent>;
    lazyLoad(config: I18nLoaderConfig): Observable<EuiServiceStatus>;
    lazyLoadInit(moduleConfig: ModuleConfig, moduleName?: string): Observable<EuiServiceStatus>;
    /**
     * Add resources based of a config loader
     *
     * @param config I18nLoaderConfig
     * @param moduleName
     * @return Promise<EuiServiceStatus> an EuiServiceStatus when translation has fully loaded
     */
    addResources(config: I18nLoaderConfig, moduleName?: string): Observable<EuiServiceStatus>;
    /**
     * Prepares the default language
     */
    private preparedDefaultLanguage;
    /**
     * @param initLanguage if given default language to override default language coming from the
     * configuration token.
     */
    private setup;
    private bindActiveLangStateToTranslateService;
    private bindTranslateServiceLangChangeToState;
    private setDefaultLanguage;
    /**
     * change the currently used language
     *
     * @param lang is the language code based on the convention you used e.g. (en or en-EN)
     * @returns Observable that returns an object contain the object translation for given language after language
     * fully loaded.
     */
    private use;
    /**
     * updates the HTML element lang attribute
     *
     * @private
     */
    private updateHTMLDOMLang;
    static ɵfac: i0.ɵɵFactoryDeclaration<I18nService<any>, [null, null, { optional: true; }, null, null]>;
    static ɵprov: i0.ɵɵInjectableDeclaration<I18nService<any>>;
}
//# sourceMappingURL=i18n.service.d.ts.map