import { ChakraTheme, Theme } from "@chakra-ui/theme"; import { AnyFunction, Dict } from "@chakra-ui/utils"; declare type CloneKey = Key extends keyof Target ? Target[Key] : unknown; export declare 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. */ declare 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; }; export declare type ThemeOverride = DeepPartial & DeepThemeExtension & Dict; export declare type ThemeExtension = (themeOverride: Override) => Override; export declare type BaseThemeWithExtensions = BaseTheme & (Extensions extends [infer L, ...infer R] ? L extends AnyFunction ? ReturnType & BaseThemeWithExtensions : L & BaseThemeWithExtensions : Extensions); /** * NOTE: This got too complex to manage, and it's not worth the extra complexity. * We'll re-evaluate this API in the future releases. * * Function to override or customize the Chakra UI theme conveniently. * First extension overrides the baseTheme and following extensions override the preceding extensions. * * @example: * import { theme as baseTheme, extendTheme, withDefaultColorScheme } from '@chakra-ui/react' * * const customTheme = extendTheme( * { * colors: { * brand: { * 500: "#b4d455", * }, * }, * }, * withDefaultColorScheme({ colorScheme: "red" }), * baseTheme // optional * ) */ export declare function extendTheme(...extensions: Array Dict)>): Dict; export declare function mergeThemeOverride(...overrides: any[]): any; export {}; //# sourceMappingURL=extend-theme.d.ts.map