Skip to content

Commit

Permalink
fix(types): add types for in-component options
Browse files Browse the repository at this point in the history
  • Loading branch information
rchl committed Sep 3, 2019
1 parent 906a776 commit e2e3bca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
7 changes: 7 additions & 0 deletions types/nuxt-i18n.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,10 @@ export interface NuxtI18nSeo {
link?: MetaInfo['link']
meta?: MetaInfo['meta']
}

export interface NuxtI18nComponentOptions {
paths?: {
[key: string]: string | false
}
locales?: Array<string>
}
9 changes: 8 additions & 1 deletion types/vue.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import Vue from 'vue'
import { RawLocation } from 'vue-router'
import VueI18n, { IVueI18n } from 'vue-i18n'
import { MetaInfo } from 'vue-meta'
import { NuxtVueI18n, NuxtI18nSeo } from './nuxt-i18n'
import { NuxtI18nComponentOptions, NuxtVueI18n, NuxtI18nSeo } from './nuxt-i18n'

/**
* Extends types in vue-i18n
Expand Down Expand Up @@ -30,6 +31,12 @@ declare module 'vue/types/vue' {
}
}

declare module 'vue/types/options' {
interface ComponentOptions<V extends Vue> {
nuxtI18n?: NuxtI18nComponentOptions | false
}
}

/**
* Extends types in Nuxt
*/
Expand Down

0 comments on commit e2e3bca

Please sign in to comment.