Skip to content

Commit

Permalink
🏷️ fix: 修正相关类型导出丢失的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Feb 17, 2023
1 parent 7675d64 commit 1cb24d9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/factories/createThemeProvider/type.ts
Original file line number Diff line number Diff line change
@@ -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<T, S = Record<string, string>> {
Expand All @@ -24,7 +25,7 @@ export interface ThemeProviderProps<T, S = Record<string, string>> {
* 自定义 Stylish
*/
customStylish?: GetCustomStylish<S>;
StyledThemeProvider: StyledThemeProvider;
StyledThemeProvider?: StyledThemeProvider;
useTheme?: () => Theme;

// --------------------- antd 主题 --------------------- //
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export { styled } from './core';
export * from './factories/createThemeProvider/type';
export * from './functions';
export * from './hooks';
export * from './types';
7 changes: 7 additions & 0 deletions src/types/theme.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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 {}

Expand Down

0 comments on commit 1cb24d9

Please sign in to comment.