Skip to content

Commit

Permalink
fix: extend nuxt/schema as well
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed May 1, 2023
1 parent 16f112b commit 796d6ab
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/build.ts
Expand Up @@ -118,6 +118,7 @@ async function writeTypes (distDir: string, meta: ModuleMeta) {
import { ${moduleImports.join(', ')} } from './module'
${schemaShims.length ? `declare module '@nuxt/schema' {\n${schemaShims.join('\n')}\n}\n` : ''}
${schemaShims.length ? `declare module 'nuxt/schema' {\n${schemaShims.join('\n')}\n}\n` : ''}
export { ${typeExports[0].names.join(', ')} } from './module'
`
Expand Down
8 changes: 8 additions & 0 deletions test/build.spec.ts
Expand Up @@ -52,6 +52,14 @@ describe('module builder', () => {
interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {}
}
declare module 'nuxt/schema' {
interface NuxtConfig { ['myModule']?: Partial<ModuleOptions> }
interface NuxtOptions { ['myModule']?: ModuleOptions }
interface NuxtHooks extends ModuleHooks {}
interface RuntimeConfig extends ModuleRuntimeConfig {}
interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {}
}
export { ModuleHooks, ModuleOptions, ModulePublicRuntimeConfig, ModuleRuntimeConfig, default } from './module'
"
Expand Down

0 comments on commit 796d6ab

Please sign in to comment.