Skip to content

Commit

Permalink
✨ feat: 将主题配置中的 antd 主题配置与算法导出供自定义时使用
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Jan 20, 2023
1 parent 0df7616 commit 90a291d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/containers/ThemeProvider/type.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import { GetCustomStylish, GetCustomToken, ThemeAppearance, ThemeMode } from '@/types';
import { ThemeConfig } from 'antd/es/config-provider/context';
import { MappingAlgorithm, ThemeConfig } from 'antd/es/config-provider/context';
import { ConfigOptions as MessageConfig, MessageInstance } from 'antd/es/message/interface';
import { ModalStaticFunctions } from 'antd/es/modal/confirm';
import { NotificationConfig, NotificationInstance } from 'antd/es/notification/interface';
import { ReactNode } from 'react';

export type { ThemeConfig, MappingAlgorithm };

export interface GetAntdTheme {
(appearance: ThemeAppearance): ThemeConfig | undefined;
}
Expand All @@ -21,11 +23,11 @@ export interface ThemeProviderProps<T, S = Record<string, string>> {
*/
customStylish?: S | GetCustomStylish<S>;
// --------------------- antd 主题 --------------------- //
prefixCls?: string;
/**
* 直接传入 antd 主题,或者传入一个函数,根据当前的主题模式返回对应的主题
*/
theme?: ThemeConfig | GetAntdTheme;
prefixCls?: string;

/**
* 从 ThemeProvider 中获取静态方法的实例对象
Expand Down

0 comments on commit 90a291d

Please sign in to comment.