export interface INLSPluginConfigAvailableLanguages { '*'?: string; [module: string]: string | undefined; } interface IBundledStrings { [moduleId: string]: string[]; } export interface ILocalizeInfo { key: string; comment: string[]; } interface ILocalizedString { original: string; value: string; } interface ILocalizeFunc { (info: ILocalizeInfo, message: string, ...args: (string | number | boolean | undefined | null)[]): string; (key: string, message: string, ...args: (string | number | boolean | undefined | null)[]): string; } interface IBoundLocalizeFunc { (idx: number, defaultValue: null): string; } interface ILocalize2Func { (info: ILocalizeInfo, message: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString; (key: string, message: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString; } interface IBoundLocalize2Func { (idx: number, defaultValue: string): ILocalizedString; } interface IConsumerAPI { localize: ILocalizeFunc | IBoundLocalizeFunc; localize2: ILocalize2Func | IBoundLocalize2Func; getConfiguredDefaultLocale(stringFromLocalizeCall: string): string | undefined; } /** * Marks a string to be localized. Returns the localized string. * * @param info The {@linkcode ILocalizeInfo} which describes the id and comments associated with the localized string. * @param message The string to localize * @param args The arguments to the string * * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args` * @example `localize({ key: 'sayHello', comment: ['Welcomes user'] }, 'hello {0}', name)` * * @returns string The localized string. */ export declare function localize(info: ILocalizeInfo, message: string, ...args: (string | number | boolean | undefined | null)[]): string; /** * Marks a string to be localized. Returns the localized string. * * @param key The key to use for localizing the string * @param message The string to localize * @param args The arguments to the string * * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args` * @example For example, `localize('sayHello', 'hello {0}', name)` * * @returns string The localized string. */ export declare function localize(key: string, message: string, ...args: (string | number | boolean | undefined | null)[]): string; /** * Marks a string to be localized. Returns an {@linkcode ILocalizedString} * which contains the localized string and the original string. * * @param info The {@linkcode ILocalizeInfo} which describes the id and comments associated with the localized string. * @param message The string to localize * @param args The arguments to the string * * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args` * @example `localize2({ key: 'sayHello', comment: ['Welcomes user'] }, 'hello {0}', name)` * * @returns ILocalizedString which contains the localized string and the original string. */ export declare function localize2(info: ILocalizeInfo, message: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString; /** * Marks a string to be localized. Returns an {@linkcode ILocalizedString} * which contains the localized string and the original string. * * @param key The key to use for localizing the string * @param message The string to localize * @param args The arguments to the string * * @note `message` can contain `{n}` notation where it is replaced by the nth value in `...args` * @example `localize('sayHello', 'hello {0}', name)` * * @returns ILocalizedString which contains the localized string and the original string. */ export declare function localize2(key: string, message: string, ...args: (string | number | boolean | undefined | null)[]): ILocalizedString; /** * * @param stringFromLocalizeCall You must pass in a string that was returned from a `nls.localize()` call * in order to ensure the loader plugin has been initialized before this function is called. */ export declare function getConfiguredDefaultLocale(stringFromLocalizeCall: string): string | undefined; /** * @skipMangle */ export declare function setPseudoTranslation(value: boolean): void; /** * Invoked in a built product at run-time * @skipMangle */ export declare function create(key: string, data: IBundledStrings & IConsumerAPI): IConsumerAPI; /** * Invoked by the loader at run-time * @skipMangle */ export declare function load(name: string, req: AMDLoader.IRelativeRequire, load: AMDLoader.IPluginLoadCallback, config: AMDLoader.IConfigurationOptions): void; export {};