mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(schema): extend NuxtOptions
for nitro & bridge types (#2131)
This commit is contained in:
parent
ae80e5bdc8
commit
7a78bce449
7
packages/bridge/types.d.ts
vendored
7
packages/bridge/types.d.ts
vendored
@ -19,13 +19,12 @@ export interface BridgeConfig {
|
||||
|
||||
// TODO: Also inherit from @nuxt/types.NuxtConfig for legacy type compat
|
||||
export interface NuxtConfig extends _NuxtConfig {
|
||||
bridge?: Partial<BridgeConfig> | false
|
||||
head?: _NuxtConfig['head'] | MetaInfo
|
||||
}
|
||||
|
||||
declare module '@nuxt/kit' {
|
||||
interface ConfigSchema {
|
||||
bridge: BridgeConfig
|
||||
declare module '@nuxt/schema' {
|
||||
interface NuxtConfig {
|
||||
bridge?: Partial<BridgeConfig> | false
|
||||
}
|
||||
}
|
||||
|
||||
|
6
packages/nitro/types/index.d.ts
vendored
6
packages/nitro/types/index.d.ts
vendored
@ -1,9 +1,9 @@
|
||||
import './shims'
|
||||
import { NitroInput } from '../dist'
|
||||
|
||||
declare module '@nuxt/kit' {
|
||||
interface ConfigSchema {
|
||||
nitro: NitroInput
|
||||
declare module '@nuxt/schema' {
|
||||
interface NuxtConfig {
|
||||
nitro?: NitroInput
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,9 +1,11 @@
|
||||
import { ConfigSchema } from '../../schema/config'
|
||||
|
||||
/** Normalized Nuxt options available as `nuxt.options.*` */
|
||||
export interface NuxtOptions extends ConfigSchema { }
|
||||
|
||||
type DeepPartial<T> = T extends Record<string, any> ? { [P in keyof T]?: DeepPartial<T[P]> | T[P] } : T
|
||||
|
||||
/** User configuration in `nuxt.config` file */
|
||||
export interface NuxtConfig extends DeepPartial<ConfigSchema> { }
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user