Skip to content

Commit 8fafa66

Browse files
authored
fix(nuxt): constrain global defineAppConfig type (#32760)
1 parent d4d0472 commit 8fafa66

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/nuxt/src/core/templates.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -447,12 +447,12 @@ export const appConfigDeclarationTemplate: NuxtTemplate = {
447447
const configPaths = app.configs.map(path => relative(typesDir, path).replace(EXTENSION_RE, ''))
448448

449449
return `
450-
import type { CustomAppConfig } from 'nuxt/schema'
450+
import type { AppConfigInput, CustomAppConfig } from 'nuxt/schema'
451451
import type { Defu } from 'defu'
452452
${configPaths.map((id: string, index: number) => `import ${`cfg${index}`} from ${JSON.stringify(id)}`).join('\n')}
453453
454454
declare global {
455-
const defineAppConfig: <T>(appConfig: T) => T
455+
const defineAppConfig: <C extends AppConfigInput> (config: C) => C
456456
}
457457
458458
declare const inlineConfig = ${JSON.stringify(nuxt.options.appConfig, null, 2)}

0 commit comments

Comments
 (0)