/// import Polyglot from 'node-polyglot'; import { IncomingHttpHeaders } from 'http'; import { IncomingHttpHeaders as IncomingHttpHeaders$1 } from 'http2'; import * as type_fest from 'type-fest'; import { ReadonlyDeep, ValueOf } from 'type-fest'; import { IClassContainer } from '@maeum/tools'; interface II18nContainerOptions { localeRoot: string; defaultLanguage: string; polyglot?: { allowMissing?: Polyglot.PolyglotOptions['allowMissing']; interpolation?: Polyglot.PolyglotOptions['interpolation']; onMissingKey?: Polyglot.PolyglotOptions['onMissingKey']; warn?: Polyglot.PolyglotOptions['warn']; pluralRules?: Polyglot.PolyglotOptions['pluralRules']; }; } interface II18nParameters { phrase: string; option?: Parameters[1]; } declare class I18nContainer { #private; constructor(options: II18nContainerOptions, locales: Map); get options(): ReadonlyDeep; get locales(): ReadonlyDeep>; getLanguageFromRequestHeader(languages?: string | string[]): string; getLocale(nullableLanguages?: string | string[]): Polyglot; t(language: string | string[] | undefined, phrase: string, option?: number | Polyglot.InterpolationOptions): string; pt(phrase: string, option?: number | Polyglot.InterpolationOptions): string; pt(language: string | { headers: IncomingHttpHeaders | IncomingHttpHeaders$1; }, phrase?: string, option?: number | Polyglot.InterpolationOptions): string; ptu(req: { headers: IncomingHttpHeaders | IncomingHttpHeaders$1; }, options: II18nParameters): string; } declare const CE_DI: { readonly I18N_CONTROLLER: "di-symbol-key-i18n-controller-i18n-controller"; }; type CE_DI = (typeof CE_DI)[keyof typeof CE_DI]; declare module '@maeum/tools' { interface IClassContainer { resolve(name: typeof CE_DI.I18N_CONTROLLER): I18nContainer; } } //# sourceMappingURL=declarations.d.ts.map declare function getI18nContainerOption(nullableOption?: Partial> & { polyglot?: Partial; }): II18nContainerOptions; declare function makeAsyncI18nContainer(container: IClassContainer, nullableOption?: Parameters[0]): Promise; declare function makeSyncI18nContainer(container: IClassContainer, nullableOption?: Parameters[0]): I18nContainer; type TResourceFileContent = { [key: string]: string | TResourceFileContent; }; declare function getAsyncLocaleResource(localeRoot: string, locale: string): Promise<{ [x: string]: type_fest.ValueOf; }>; declare function getAsyncLocales(languages: string[], option: Pick): Promise>; declare function getPolyglotOptions(resources: TResourceFileContent, option: Pick): Polyglot.PolyglotOptions; declare function getSyncLocaleResource(localeDirPath: string, locale: string): { [x: string]: type_fest.ValueOf; }; declare function getSyncLocales(languages: string[], option: Pick): Map; declare function mergeResourceContent(prev: string | TResourceFileContent, next: TResourceFileContent): ValueOf; export { CE_DI, I18nContainer, type II18nContainerOptions, type II18nParameters, type TResourceFileContent, getAsyncLocaleResource, getAsyncLocales, getI18nContainerOption, getPolyglotOptions, getSyncLocaleResource, getSyncLocales, makeAsyncI18nContainer, makeSyncI18nContainer, mergeResourceContent };