mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +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
|
// TODO: Also inherit from @nuxt/types.NuxtConfig for legacy type compat
|
||||||
export interface NuxtConfig extends _NuxtConfig {
|
export interface NuxtConfig extends _NuxtConfig {
|
||||||
bridge?: Partial<BridgeConfig> | false
|
|
||||||
head?: _NuxtConfig['head'] | MetaInfo
|
head?: _NuxtConfig['head'] | MetaInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
declare module '@nuxt/kit' {
|
declare module '@nuxt/schema' {
|
||||||
interface ConfigSchema {
|
interface NuxtConfig {
|
||||||
bridge: BridgeConfig
|
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 './shims'
|
||||||
import { NitroInput } from '../dist'
|
import { NitroInput } from '../dist'
|
||||||
|
|
||||||
declare module '@nuxt/kit' {
|
declare module '@nuxt/schema' {
|
||||||
interface ConfigSchema {
|
interface NuxtConfig {
|
||||||
nitro: NitroInput
|
nitro?: NitroInput
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
import { ConfigSchema } from '../../schema/config'
|
import { ConfigSchema } from '../../schema/config'
|
||||||
|
|
||||||
|
/** Normalized Nuxt options available as `nuxt.options.*` */
|
||||||
export interface NuxtOptions extends ConfigSchema { }
|
export interface NuxtOptions extends ConfigSchema { }
|
||||||
|
|
||||||
type DeepPartial<T> = T extends Record<string, any> ? { [P in keyof T]?: DeepPartial<T[P]> | T[P] } : T
|
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> { }
|
export interface NuxtConfig extends DeepPartial<ConfigSchema> { }
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user