import { Theme, ChakraTheme } from '@chakra-ui/theme'; type CloneKey = Key extends keyof Target ? Target[Key] : unknown; type DeepPartial = { [P in keyof T]?: T[P] extends object ? DeepPartial : T[P]; }; /** * Represents a loose but specific type for the theme override. * It provides autocomplete hints for extending the theme, but leaves room * for adding properties. */ type DeepThemeExtension = { [Key in keyof BaseTheme]?: BaseTheme[Key] extends (...args: any[]) => any ? DeepThemeExtension>, CloneKey> : BaseTheme[Key] extends Array ? CloneKey : BaseTheme[Key] extends object ? DeepThemeExtension, CloneKey> : CloneKey; }; declare type ThemeOverride = DeepPartial & DeepThemeExtension & Record; type ThemeExtension = (themeOverride: Override) => Override; type AnyFunction = (...args: T[]) => any; type BaseThemeWithExtensions = BaseTheme & (Extensions extends [infer L, ...infer R] ? L extends AnyFunction ? ReturnType & BaseThemeWithExtensions : L & BaseThemeWithExtensions : Extensions); declare const extendTheme: (...extensions: (Record | ((theme: Record) => Record))[]) => Record; declare const extendBaseTheme: (...extensions: (Record | ((theme: Record) => Record))[]) => Record; declare function mergeThemeOverride(...overrides: any[]): any; export { BaseThemeWithExtensions, DeepPartial, ThemeExtension, ThemeOverride, extendBaseTheme, extendTheme, mergeThemeOverride };