From 817c58ec5b5c5ef653731cbe0f3174af8ddb3d0c Mon Sep 17 00:00:00 2001 From: Kevin Marrec Date: Sat, 6 Oct 2018 13:34:15 +0200 Subject: [PATCH] feat: add TypeScript types (#133) --- package.json | 1 + types/index.d.ts | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 types/index.d.ts 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 + } +}