import { InjectionToken, OnDestroy, Signal } from '@angular/core';
import { DeepPartial, EuiService, EuiServiceStatus, GlobalConfig, LocaleServiceConfig, LocaleState } from '@eui/base';
import { Observable } from 'rxjs';
import { StoreService } from '../store';
import { LogService } from '../log';
import { I18nService } from '../i18n';
import * as i0 from "@angular/core";
export type LocaleMapper = (locale: string) => string;
export declare const LOCALE_ID_MAPPER: InjectionToken<LocaleMapper>;
/**
 * LocaleService is responsible for managing locale states and configurations in an Angular application.
 * It utilizes the CLDR library to load and construct the locale for each region. This service allows
 * for dynamic loading of locales upon request and updates the state of the EUI app accordingly.
 *
 * Key functionalities include:
 *  - Binding to a translation service for locale changes.
 *  - Updating the Angular LOCALE_ID token.
 *
 * @template T - Extends LocaleState, representing the state structure for locales.
 * @template L - The type of the locale data.
 * @extends EuiService<T | LocaleState>
 */
export declare class LocaleService<T extends LocaleState = LocaleState> extends EuiService<T | LocaleState> implements OnDestroy {
    protected store: StoreService;
    protected baseGlobalConfig: GlobalConfig;
    protected locale_id: string;
    private localeMapper;
    private i18n;
    private log;
    private static readonly DEFAULT_STATE;
    private readonly logger;
    private subNotifier;
    protected config: LocaleServiceConfig;
    /**
     * 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;
    constructor(store: StoreService, baseGlobalConfig: GlobalConfig, locale_id: string, localeMapper: LocaleMapper, i18n: I18nService, log: LogService);
    ngOnDestroy(): void;
    getState(): Observable<T>;
    /**
     * Retrieves the state of the locale service. This method is overloaded to allow different ways of accessing the state.
     *
     * @template K - The type of the value to be returned. Defaults to the type of the locale state (T).
     *
     * @param {((state: T) => K)} [mapFn] - A function that maps the state to a specific form.
     *                                      Takes the current state as an argument and returns the transformed state.
     * @returns {Observable<K>} - An observable that emits the transformed state.
     */
    getState<K = T>(mapFn?: (state: T) => K): Observable<K>;
    /**
     * @template a - A key that extends the keys of the state type T.
     * @param {a} [key] - A specific key to access a part of the state.
     *                    The key should be a property name of the state object.
     * @returns {Observable<Partial<a>>} - An observable that emits the value of the specified key in the state.
     * @param key
     */
    getState<a extends keyof DeepPartial<T>>(key?: a): Observable<DeepPartial<a>>;
    /**
     * Initializes the LocaleService with necessary configurations and state.
     * Binds language changes to the state and dynamically loads the appropriate locales.
     *
     * @param {LocaleState} [state] - Optional initial state for the locale service.
     * @returns {Observable<EuiServiceStatus>} - Observable emitting the status of the initialization.
     */
    init(state?: LocaleState): Observable<EuiServiceStatus>;
    /**
     * This method is used to update the state of the service with a new state.
     *
     * @param state
     */
    updateState(state: DeepPartial<T>): void;
    /**
     * This method is used to get the state as readonly signal.
     */
    getSignal(): Signal<T>;
    /**
     * Retrieves the previous locale used in the application.
     *
     * @returns {string} - The previous locale identifier.
     */
    get previousLocale(): string;
    /**
     * Retrieves the current locale used in the application.
     *
     * @returns {string} - The current locale identifier.
     */
    get currentLocale(): string;
    /**
     * Listens for language changes and dynamically sets the locale accordingly.
     *
     * @private
     */
    private bindTranslateServiceLangChangeToState;
    /**
     * Checks if a given locale string is valid according to the Intl.Locale API. (based on BCP 47)
     * A valid locale string can be used to create a new Intl.Locale object without throwing an error.
     *
     * @param localeString - The locale string to be validated.
     * @returns {boolean} - Returns true if the locale string is valid, false otherwise.
     */
    private isValidLocale;
    static ɵfac: i0.ɵɵFactoryDeclaration<LocaleService<any>, [null, null, null, { optional: true; }, { optional: true; }, { optional: true; }]>;
    static ɵprov: i0.ɵɵInjectableDeclaration<LocaleService<any>>;
}
//# sourceMappingURL=locale.service.d.ts.map