1 | import { Theme } from './createTheme';
|
2 | import { Components } from './components';
|
3 |
|
4 | export interface ThemeWithProps {
|
5 | components?: Components<Omit<Theme, 'components'>>;
|
6 | }
|
7 |
|
8 | export type ThemedProps<Theme, Name extends keyof any> = Theme extends {
|
9 | components: Record<Name, { defaultProps: infer Props }>;
|
10 | }
|
11 | ? Props
|
12 | : {};
|
13 |
|
14 | export default function useThemeProps<
|
15 | Theme extends ThemeWithProps,
|
16 | Props,
|
17 | Name extends keyof any,
|
18 | >(params: { props: Props; name: Name }): Props & ThemedProps<Theme, Name>;
|