You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
440 B
TypeScript
21 lines
440 B
TypeScript
export interface ThemeWithProps {
|
|
components?: any;
|
|
}
|
|
|
|
export type ThemedProps<Theme, Name extends keyof any> = Theme extends {
|
|
components: Record<Name, { defaultProps: infer Props }>;
|
|
}
|
|
? Props
|
|
: {};
|
|
|
|
export default function useThemeProps<
|
|
Theme extends ThemeWithProps,
|
|
Props,
|
|
Name extends keyof any,
|
|
>(params: {
|
|
props: Props;
|
|
name: Name;
|
|
defaultTheme?: Theme;
|
|
themeId?: string;
|
|
}): Props & ThemedProps<Theme, Name>;
|