import { Provider, InjectionToken } from '@angular/core';

type DefaultModuleImport = Promise<{
    [key: string]: unknown;
    default?: unknown;
}>;

interface G11nLocale {
    base: () => DefaultModuleImport;
    extra?: () => DefaultModuleImport;
    datefns?: () => DefaultModuleImport;
}

declare enum G11nDebug {
    SHOW_KEYS = 0,
    DUMMY_TRANSLATIONS = 1,
    NO_DEBUG = 2
}

interface G11nOptions {
    defaultLanguage?: string;
    defaultCurrency?: string;
    useNavigatorLanguage?: boolean;
    loadLocaleExtra?: boolean;
    useTranslations?: boolean;
    translationsPath?: string;
    queryParamName?: string;
    storage?: Storage;
    debug?: G11nDebug;
}

interface G11nFeature<T = Provider> {
    providers: T[];
}

/**
 * @internal
 */
declare const DEFAULT_OPTIONS: G11nOptions;
declare const currentLanguage: () => string;
declare const setLanguage: (value: string) => void;
/**
 * @internal
 */
declare const init: () => Provider[];

declare const LOCALES: InjectionToken<Record<string, G11nLocale>>;
declare const G11N_OPTIONS: InjectionToken<G11nOptions>;

export { DEFAULT_OPTIONS, G11N_OPTIONS, G11nDebug, LOCALES, currentLanguage, init, setLanguage };
export type { DefaultModuleImport, G11nFeature, G11nLocale, G11nOptions };
