Skip to content

Commit

Permalink
feat: add TypeScript types (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Marrec authored and paulgv committed Oct 6, 2018
1 parent 66ba9f7 commit 817c58e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -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": {
Expand Down
10 changes: 10 additions & 0 deletions 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
}
}

0 comments on commit 817c58e

Please sign in to comment.