fix(schema): extend NuxtOptions for nitro & bridge types (#2131)

This commit is contained in:
Daniel Roe 2021-11-24 15:51:26 +00:00 committed by GitHub
parent ae80e5bdc8
commit 7a78bce449
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 7 deletions

View File

@ -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
}
}

View File

@ -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
}
}

View File

@ -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> { }