Skip to content

Commit

Permalink
fix: cannot work completion for Composer interface (#1707)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Dec 8, 2022
1 parent 7a4788e commit 1876cf8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export default defineNuxtModule<NuxtI18nOptions>({
filename: nuxtAppExtendFilename,
getContents: () => {
return [
`import type { ${isLegacyMode() ? 'VueI18n' : 'ExportedGlobalComposer'} } from 'vue-i18n'`,
`import type { ${isLegacyMode() ? 'VueI18n' : 'ExportedGlobalComposer, Composer'} } from 'vue-i18n'`,
// prettier-ignore
`import type { NuxtI18nRoutingCustomProperties } from '${resolve(runtimeDir, 'types')}'`,
`import type { I18nRoutingCustomProperties } from '${vueI18nRoutingVueI18nDtsPath}'`,
Expand All @@ -214,13 +214,13 @@ export default defineNuxtModule<NuxtI18nOptions>({
`declare module '#app' {`,
' interface NuxtApp {',
// prettier-ignore
` $i18n: ${isLegacyMode() ? 'VueI18n' : 'ExportedGlobalComposer'} & NuxtI18nRoutingCustomProperties & I18nRoutingCustomProperties`,
` $i18n: ${isLegacyMode() ? 'VueI18n' : 'ExportedGlobalComposer & Composer'} & NuxtI18nRoutingCustomProperties & I18nRoutingCustomProperties`,
' }',
'}',
`declare module 'nuxt/dist/app/nuxt' {`,
' interface NuxtApp {',
// prettier-ignore
` $i18n: ${isLegacyMode() ? 'VueI18n' : 'ExportedGlobalComposer'} & NuxtI18nRoutingCustomProperties & I18nRoutingCustomProperties`,
` $i18n: ${isLegacyMode() ? 'VueI18n' : 'ExportedGlobalComposer & Composer'} & NuxtI18nRoutingCustomProperties & I18nRoutingCustomProperties`,
' }',
'}'
].join('\n')
Expand Down

0 comments on commit 1876cf8

Please sign in to comment.