diff --git a/package.json b/package.json index 9be3eb853..8a61ce8ae 100755 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ } ], "main": "src/index.js", + "types": "types/index.d.ts", "repository": "https://github.com/nuxt-community/nuxt-i18n", "homepage": "https://nuxt-community.github.io/nuxt-i18n/", "bugs": { diff --git a/types/index.d.ts b/types/index.d.ts new file mode 100644 index 000000000..5d2adf5f4 --- /dev/null +++ b/types/index.d.ts @@ -0,0 +1,10 @@ +import Vue from 'vue' +import { Route } from 'vue-router' + +declare module 'vue/types/vue' { + interface Vue { + localePath(route: string | Route, locale?: string): string + switchLocalePath(locale: string): string + getRouteBaseName(route: Route): string + } +}