fix(theme): improve app config types for ui object

Resolves #3579
This commit is contained in:
Benjamin Canac
2025-05-02 17:06:20 +02:00
parent caa3bf9c7e
commit 591d59fe89
4 changed files with 77 additions and 73 deletions

View File

@@ -20,10 +20,10 @@ import PluginsPlugin from './plugins/plugins'
import AppConfigPlugin from './plugins/app-config'
import ComponentImportPlugin from './plugins/components'
import NuxtEnvironmentPlugin from './plugins/nuxt-environment'
import type { DeepPartial } from './runtime/types/utils'
import AutoImportPlugin from './plugins/auto-import'
import type { TVConfig } from './runtime/types/tv'
type NeutralColor = 'slate' | 'gray' | 'zinc' | 'neutral' | 'stone'
type Color = Exclude<keyof typeof colors, 'inherit' | 'current' | 'transparent' | 'black' | 'white' | NeutralColor> | (string & {})
@@ -31,7 +31,7 @@ type AppConfigUI = {
// TODO: add type hinting for colors from `options.theme.colors`
colors?: Record<string, Color> & { neutral?: NeutralColor }
icons?: Partial<typeof icons>
} & DeepPartial<typeof ui>
} & TVConfig<typeof ui>
export interface NuxtUIOptions extends Omit<ModuleOptions, 'fonts' | 'colorMode'> {
/** Whether to generate declaration files for auto-imported components. */