import * as React from 'react'; import { Omit } from '@material-ui/types'; import { CreateCSSProperties, StyledComponentProps, WithStylesOptions, } from '@material-ui/styles/withStyles'; import { Theme as DefaultTheme } from './createMuiTheme'; // These definitions are almost identical to the ones in @material-ui/styles/styled // Only difference is that ComponentCreator has a default theme type // If you need to change these types, update the ones in @material-ui/styles as well /** * @internal */ export type ComponentCreator = < Theme = DefaultTheme, Props extends {} = {} >( styles: | CreateCSSProperties | ((props: { theme: Theme } & Props) => CreateCSSProperties), options?: WithStylesOptions ) => React.ComponentType< Omit< JSX.LibraryManagedAttributes>, 'classes' | 'className' > & StyledComponentProps<'root'> & { className?: string } & (Props extends { theme: Theme } ? Omit & { theme?: Theme } : Props) >; export interface StyledProps { className: string; } export default function styled( Component: Component ): ComponentCreator;