diff --git a/src/containers/ThemeProvider/type.ts b/src/containers/ThemeProvider/type.ts index 3cf4df9f..49662c0d 100644 --- a/src/containers/ThemeProvider/type.ts +++ b/src/containers/ThemeProvider/type.ts @@ -1,10 +1,14 @@ -import { GetAntdThemeConfig, GetCustomStylish, GetCustomToken } from '@/types'; +import { GetCustomStylish, GetCustomToken, ThemeAppearance } from '@/types'; import { ThemeConfig } from 'antd/es/config-provider/context'; import { MessageInstance } from 'antd/es/message/interface'; import { ModalStaticFunctions } from 'antd/es/modal/confirm'; import { NotificationInstance } from 'antd/es/notification/interface'; import { ReactNode } from 'react'; +export interface GetAntdTheme { + (appearance: ThemeAppearance): ThemeConfig | undefined; +} + export interface ThemeProviderProps> { children: ReactNode; /** @@ -18,7 +22,7 @@ export interface ThemeProviderProps> { /** * 直接传入 antd 主题,或者传入一个函数,根据当前的主题模式返回对应的主题 */ - theme?: ThemeConfig | GetAntdThemeConfig; + theme?: ThemeConfig | GetAntdTheme; prefixCls?: string; /** * 从 ThemeProvider 中获取静态方法的实例对象