mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
chore(templates): improve DeepPartial type
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
export type DeepPartial<T> = Partial<{
|
||||
[P in keyof T]: DeepPartial<T[P]> | { [key: string]: string | object }
|
||||
}>
|
||||
export interface TightMap<O = any> {
|
||||
[key: string]: TightMap | O
|
||||
}
|
||||
|
||||
export type DeepPartial<T, O = any> = {
|
||||
[P in keyof T]?: T[P] extends object
|
||||
? DeepPartial<T[P], O>
|
||||
: T[P];
|
||||
} & {
|
||||
[key: string]: O | TightMap<O>
|
||||
}
|
||||
|
||||
export type DynamicSlots<T extends { slot?: string }, SlotProps, Slot = T['slot']> =
|
||||
Record<string, SlotProps> & (Slot extends string ? Record<Slot, SlotProps> : Record<string, never>)
|
||||
|
||||
@@ -101,7 +101,7 @@ type AppConfigUI = {
|
||||
gray?: 'slate' | 'cool' | 'zinc' | 'neutral' | 'stone'
|
||||
}
|
||||
icons?: Partial<typeof icons>
|
||||
} & DeepPartial<typeof ui>
|
||||
} & DeepPartial<typeof ui, string>
|
||||
|
||||
declare module 'nuxt/schema' {
|
||||
interface AppConfigInput {
|
||||
|
||||
Reference in New Issue
Block a user