You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1022 B
31 lines
1022 B
|
|
import type { CustomAppConfig } from 'nuxt/schema'
|
|
import type { Defu } from 'defu'
|
|
|
|
|
|
declare const inlineConfig = {
|
|
"nuxt": {}
|
|
}
|
|
type ResolvedAppConfig = Defu<typeof inlineConfig, []>
|
|
type IsAny<T> = 0 extends 1 & T ? true : false
|
|
|
|
type MergedAppConfig<Resolved extends Record<string, unknown>, Custom extends Record<string, unknown>> = {
|
|
[K in keyof (Resolved & Custom)]: K extends keyof Custom
|
|
? unknown extends Custom[K]
|
|
? Resolved[K]
|
|
: IsAny<Custom[K]> extends true
|
|
? Resolved[K]
|
|
: Custom[K] extends Record<string, any>
|
|
? Resolved[K] extends Record<string, any>
|
|
? MergedAppConfig<Resolved[K], Custom[K]>
|
|
: Exclude<Custom[K], undefined>
|
|
: Exclude<Custom[K], undefined>
|
|
: Resolved[K]
|
|
}
|
|
|
|
declare module 'nuxt/schema' {
|
|
interface AppConfig extends MergedAppConfig<ResolvedAppConfig, CustomAppConfig> { }
|
|
}
|
|
declare module '@nuxt/schema' {
|
|
interface AppConfig extends MergedAppConfig<ResolvedAppConfig, CustomAppConfig> { }
|
|
}
|