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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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.