UNPKG

660 BTypeScriptView Raw
1import { Theme as DefaultTheme } from './createTheme';
2import { ClassNameMap, Styles, WithStylesOptions } from '@material-ui/styles/withStyles';
3
4import { Omit } from '@material-ui/types';
5
6export default function makeStyles<
7 Theme = DefaultTheme,
8 Props extends object = {},
9 ClassKey extends string = string
10>(
11 styles: Styles<Theme, Props, ClassKey>,
12 options?: Omit<WithStylesOptions<Theme>, 'withTheme'>
13): keyof Props extends never // `makeStyles` where the passed `styles` do not depend on props
14 ? (props?: any) => ClassNameMap<ClassKey> // `makeStyles` where the passed `styles` do depend on props
15 : (props: Props) => ClassNameMap<ClassKey>;