koalazak / i18n-express

A simple i18n middleware for Express.js
55 stars 14 forks source link

Cannot use in TS, missing d.ts #38

Open recallwei opened 1 year ago

leandroluk commented 6 months ago

to solve we need only add a file in lib like this:

// <rootDir>/index.ts
export type Opts = {
    /** @default 'i18n'  */ translationsPath?: string,
    /** @default 'ulang' */ cookieLangName?: string,
    /** @default false   */ browserEnable?: boolean,
    /** @default 'en'    */ defaultLang?: string,
    /** @default 'clang' */ paramLangName?: string,
    /** @default ['en']  */ siteLangs?: string[],
    /** @default 'texts' */ textsVarName?: string,
}
export function i18n(opts: Opts): import('express').RequestHandler
export default i18n