import { Theme } from "./createTheme.js"; import { Components } from "./components.js"; export interface ThemeWithProps { components?: Components>; } export type ThemedProps = Theme extends { components: Record; } ? Props : {}; /** * Merges input `props` with the `defaultProps` for a component that were defined in the theme. * * The `defaultProps` are defined in the theme under `theme.components[componentName].defaultProps`. * * @example * * ```tsx * const createTheme = () => ({ * components: { * MuiStat: { * defaultProps: { * variant: 'outlined', * }, * }, * }, * }); * * function Stat(props) { * const themeProps = useThemeProps({ props, name: 'MuiStat' }); * return
; * } * ``` * * @param params.props The input props * @param params.name The name of the component as defined in the theme */ export default function useThemeProps(params: { props: Props; name: Name; }): Props & ThemedProps;