-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Module 'vue-gettext/types' has no exported member 'translate'. #116
Comments
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
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. |
thanks @annyanich for the inspiration. i've adapted your shims to more comprehensive type definitions, which can be copy-pasted into a file named import GetTextPlugin from 'vue-gettext';
declare module 'vue-gettext' {
export default GetTextPlugin;
const translate: {
gettext(msgid: string, language?: string): string;
ngettext(
msgid: string,
plural: string,
n: number,
language?: string
): string;
npgettext(
context: string,
msgid: string,
plural: string,
n: number,
language?: string
): string;
pgettext(context: string, msgid: string, language?: string): string;
gettextInterpolate(
msgid: string,
context: object,
disableHtmlEscaping?: boolean
): string;
};
export { translate };
} |
The text was updated successfully, but these errors were encountered: