import * as React from 'react'; import { DistributiveOmit } from '@mui/types'; import { StyledComponentProps } from "../styles/index.js"; /** * A component whose root component can be controlled via a `component` prop. * * Adjusts valid props based on the type of `component`. */ export interface OverridableComponent { (props: { /** * The component used for the root node. * Either a string to use a HTML element or a component. */ component: RootComponent; } & OverrideProps): React.JSX.Element | null; (props: DefaultComponentProps): React.JSX.Element | null; } /** * Props of the component if `component={Component}` is used. */ export type OverrideProps = (BaseProps & DistributiveOmit, keyof BaseProps>); /** * Props if `component={Component}` is NOT used. */ export type DefaultComponentProps = BaseProps & DistributiveOmit, keyof BaseProps>; /** * Props defined on the component (+ common material-ui props). */ export type BaseProps = TypeMap['props'] & CommonProps; /** * Props that are valid for material-ui components. */ export interface CommonProps extends StyledComponentProps { className?: string; style?: React.CSSProperties; } export interface OverridableTypeMap { props: {}; defaultComponent: React.ElementType; }