import { ReactiveController, ReactiveControllerHost } from 'lit';

export type FunctionParams<T> = T extends (...args: infer U) => string ? U : [];
export interface Translation {
    $code: string;
    $dir: 'ltr' | 'rtl';
    $name: string;
}
export interface DefaultTranslation extends Translation {
    [key: string]: any;
}
export interface ExistsOptions {
    includeFallback: boolean;
    lang: string;
}
/**
 * Gets the host element's directionality as determined by the `dir` attribute. The return value is transformed to
 * lowercase.
 */
export declare function dir(host: ReactiveControllerHost & HTMLElement): string;
export declare function registerDefaultTranslation(...translation: Translation[]): void;
/** Registers one or more translations */
export declare function registerTranslation(...translation: Translation[]): void;
/** Updates all localized elements that are currently connected */
export declare function update(): void;
/**
 * Localize Reactive Controller for components built with Lit
 *
 * To use this controller, import the class and instantiate it in a custom element constructor:
 *
 * private localize = new LocalizeController(this);
 *
 * This will add the element to the set and make it respond to changes to <html dir|lang> automatically. To make it
 * respond to changes to its own dir|lang properties, make it a property:
 *
 *   @property() dir: string;
 *   @property() lang: string;
 *
 * To use a translation method, call it like this:
 *
 *   ${this.localize.term('term_key_here')}
 *   ${this.localize.date('2021-12-03')}
 *   ${this.localize.number(1000000)}
 */
export declare class LocalizeController<UserTranslation extends Translation = DefaultTranslation> implements ReactiveController {
    host: ReactiveControllerHost & HTMLElement;
    constructor(host: ReactiveControllerHost & HTMLElement);
    hostConnected(): void;
    hostDisconnected(): void;
    /**
     * Gets the host element's directionality as determined by the `dir` attribute. The return value is transformed to
     * lowercase.
     */
    dir(): string;
    /**
     * Gets the host element's language as determined by the `lang` attribute. The return value is transformed to
     * lowercase.
     */
    lang(): string;
    private getTranslationData;
    /** Determines if the specified term exists, optionally checking the fallback translation. */
    exists<K extends keyof UserTranslation>(key: K, options: Partial<ExistsOptions>): boolean;
    /** Outputs a translated term. */
    term<K extends keyof UserTranslation>(key: K, ...args: FunctionParams<UserTranslation[K]>): string;
    languageName(language: string): string;
    /** Outputs a localized date in the specified format. */
    date(dateToFormat: Date | string, options?: Intl.DateTimeFormatOptions): string;
    /** Outputs a localized number in the specified format. */
    number(numberToFormat: number | string, options?: Intl.NumberFormatOptions): string;
    /** Outputs a localized time in relative format. */
    relativeTime(value: number, unit: Intl.RelativeTimeFormatUnit, options?: Intl.RelativeTimeFormatOptions): string;
}
