From 1cb24d914bf63212f9ea221b3e97e7d68d90cd9d Mon Sep 17 00:00:00 2001 From: arvinxx Date: Fri, 17 Feb 2023 13:18:02 +0800 Subject: [PATCH] =?UTF-8?q?:label:=20fix:=20=E4=BF=AE=E6=AD=A3=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E7=B1=BB=E5=9E=8B=E5=AF=BC=E5=87=BA=E4=B8=A2=E5=A4=B1?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/factories/createThemeProvider/type.ts | 19 ++++++++++--------- src/index.ts | 1 + src/types/theme.ts | 7 +++++++ 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/factories/createThemeProvider/type.ts b/src/factories/createThemeProvider/type.ts index 1615faf4..39890871 100644 --- a/src/factories/createThemeProvider/type.ts +++ b/src/factories/createThemeProvider/type.ts @@ -1,16 +1,17 @@ -import { GetCustomStylish, GetCustomToken, Theme, ThemeAppearance, ThemeMode } from '@/types'; -import { MappingAlgorithm, ThemeConfig } from 'antd/es/config-provider/context'; +import { + GetAntdTheme, + GetCustomStylish, + GetCustomToken, + Theme, + ThemeAppearance, + ThemeMode, +} from '@/types'; +import { 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 { FC, ReactNode } from 'react'; -export type { ThemeConfig, MappingAlgorithm }; - -export interface GetAntdTheme { - (appearance: ThemeAppearance): ThemeConfig | undefined; -} - export type StyledThemeProvider = FC<{ theme: Theme; children: ReactNode }>; export interface ThemeProviderProps> { @@ -24,7 +25,7 @@ export interface ThemeProviderProps> { * 自定义 Stylish */ customStylish?: GetCustomStylish; - StyledThemeProvider: StyledThemeProvider; + StyledThemeProvider?: StyledThemeProvider; useTheme?: () => Theme; // --------------------- antd 主题 --------------------- // diff --git a/src/index.ts b/src/index.ts index 9a562d69..5f4ed355 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,5 @@ export { styled } from './core'; +export * from './factories/createThemeProvider/type'; export * from './functions'; export * from './hooks'; export * from './types'; diff --git a/src/types/theme.ts b/src/types/theme.ts index 7ebc3e97..2cf9fa8d 100644 --- a/src/types/theme.ts +++ b/src/types/theme.ts @@ -1,3 +1,5 @@ +import { ThemeConfig } from 'antd'; +import { MappingAlgorithm } from 'antd/es/config-provider/context'; import { AliasToken } from 'antd/es/theme/interface'; import { ThemeAppearance, ThemeMode } from './appearance'; @@ -19,6 +21,11 @@ export interface AntdStylish { buttonDefaultHover: string; } +export interface GetAntdTheme { + (appearance: ThemeAppearance): ThemeConfig | undefined; +} +export type { MappingAlgorithm }; + // eslint-disable-next-line @typescript-eslint/no-empty-interface export interface CustomToken {}