express-intlayer
Version:
Manage internationalization i18n in a simple way for express application.
15 lines • 882 B
TypeScript
import { type Locales } from '@intlayer/config';
import { getDictionary as getDictionaryFunction, getIntlayer as getIntlayerFunction, type LanguageContent } from '@intlayer/core';
import type { NextFunction, Request, RequestHandler, Response } from 'express';
export declare const translateFunction: (_req: Request, res: Response, _next?: NextFunction) => <T extends string>(content: LanguageContent<T> | string, locale?: Locales) => T;
/**
* Detect locale used by the user and load it into res locale storage
*
* @returns
*/
export declare const intlayer: () => RequestHandler;
export declare const t: <Content = string>(content: LanguageContent<Content>, locale?: Locales) => Content;
export declare const getIntlayer: typeof getIntlayerFunction;
export declare const getDictionary: typeof getDictionaryFunction;
export { LanguageContent };
//# sourceMappingURL=index.d.ts.map