import { DistributiveOmit, Overwrite } from '@mui/types';
import * as React from 'react';
import {
CreateCSSProperties,
StyledComponentProps,
WithStylesOptions,
} from '@mui/styles/withStyles';
import { DefaultTheme } from '../defaultTheme';
// We don't want a union type here (like React.JSXElementConstructor) in order to support mapped types.
export type StyledComponent
= (props: P) => React.ReactElement
| null;
/**
* @internal
*/
export type ComponentCreator = <
Theme = DefaultTheme,
Props extends {} = React.ComponentPropsWithoutRef,
>(
styles:
| CreateCSSProperties
| ((props: { theme: Theme } & Props) => CreateCSSProperties),
options?: WithStylesOptions,
) => StyledComponent<
DistributiveOmit<
React.JSX.LibraryManagedAttributes>,
'classes' | 'className'
> &
StyledComponentProps<'root'> &
Overwrite
>;
export interface StyledProps {
className: string;
}
export default function styled(
Component: Component,
): ComponentCreator;