diff --git a/docs/2.guide/3.going-further/10.runtime-config.md b/docs/2.guide/3.going-further/10.runtime-config.md index d9c76dc972..268b5dd945 100644 --- a/docs/2.guide/3.going-further/10.runtime-config.md +++ b/docs/2.guide/3.going-further/10.runtime-config.md @@ -150,9 +150,9 @@ It is also possible to type your runtime config manually: declare module 'nuxt/schema' { interface RuntimeConfig { apiSecret: string - public: { - apiBase: string - } + } + interface PublicRuntimeConfig { + apiBase: string } } // It is always important to ensure you import/export something when augmenting a type diff --git a/packages/nuxt/config.d.ts b/packages/nuxt/config.d.ts index ddd2beade0..8eab74f3c6 100644 --- a/packages/nuxt/config.d.ts +++ b/packages/nuxt/config.d.ts @@ -2,4 +2,5 @@ import type { NuxtConfig } from 'nuxt/schema' import type { DefineConfig, InputConfig, UserInputConfig, ConfigLayerMeta } from 'c12' export { NuxtConfig } from 'nuxt/schema' -export declare const defineNuxtConfig: DefineConfig +export interface DefineNuxtConfig extends DefineConfig {} +export declare const defineNuxtConfig: DefineNuxtConfig diff --git a/packages/nuxt/types.d.ts b/packages/nuxt/types.d.ts index 220045a6a6..d2dddd2211 100644 --- a/packages/nuxt/types.d.ts +++ b/packages/nuxt/types.d.ts @@ -1,12 +1,13 @@ /// export * from './dist/index' +import type { DefineNuxtConfig } from 'nuxt/config' import type { SchemaDefinition, RuntimeConfig } from 'nuxt/schema' import type { H3Event } from 'h3' import type { NuxtIslandContext, NuxtIslandResponse, NuxtRenderHTMLContext } from './dist/core/runtime/nitro/renderer' declare global { - const defineNuxtConfig: typeof import('nuxt/config')['defineNuxtConfig'] + const defineNuxtConfig: DefineNuxtConfig const defineNuxtSchema: (schema: SchemaDefinition) => SchemaDefinition }