Open evgeniyparanyuk-textmagic opened 4 years ago
I use typescript 3.9.5
+1, the same issue. Seems like simple d.ts could fix it
+1 here, using typescript 4.7.3
I believe that the following code snippet may help those of you who would like to add types for the exported member translate
themselves in their own project. In ours, I created a file vue-gettext.d.ts
with the following content:
declare module 'vue-gettext' {
const translate: {
getTranslation(msgid: any, n?: number, context?: any, defaultPlural?: any, language?: string): any;
gettext(msgid: any, language?: string): any;
pgettext(context: any, msgid: any, language?: string): any;
ngettext(msgid: any, plural: any, n: any, language?: string): any;
npgettext(context: any, msgid: any, plural: any, n: any, language?: string): any;
initTranslations(translations: any, config: any): void;
gettextInterpolate: any;
}
}
There are a lot of 'any' types in there which should probably be replaced with more specific types. But I hope this is a useful scaffolding to help you or anyone reading this in the future get started.