Skip to content

Commit

Permalink
fix(types): more specific types for $nuxtI18nHead/$nuxtI18nSeo
Browse files Browse the repository at this point in the history
Fixes #1133
  • Loading branch information
rchl committed Apr 8, 2021
1 parent bda35de commit 02cc072
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions types/vue.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ interface NuxtI18nHeadOptions {
addSeoAttributes?: boolean
}

interface NuxtI18nSeo {
htmlAttrs?: MetaInfo['htmlAttrs']
link?: MetaInfo['link']
meta?: MetaInfo['meta']
}
type NuxtI18nMeta = Required<Pick<MetaInfo, 'htmlAttrs' | 'link' | 'meta'>>

declare module 'vue-i18n' {
// the VueI18n class expands here: https://goo.gl/Xtp9EG
Expand Down Expand Up @@ -59,9 +55,9 @@ interface NuxtI18nApi {
declare module 'vue/types/vue' {
interface Vue extends NuxtI18nApi {
// $i18n is already added by vue-i18n.
$nuxtI18nHead(options?: NuxtI18nHeadOptions): MetaInfo
$nuxtI18nHead(options?: NuxtI18nHeadOptions): NuxtI18nMeta
/** @deprecated Use `$nuxtI18nHead({ addDirAttribute: true, addSeoAttributes: true })` instead. */
$nuxtI18nSeo(): NuxtI18nSeo
$nuxtI18nSeo(): NuxtI18nMeta
}
}

Expand Down

0 comments on commit 02cc072

Please sign in to comment.