Для добавления типов стилей для объекта styles
const styles = {
root: {color: 'red'}
};
type PropsType = {
[$Keys<typeof styles>]: string
};
Для добавления типов стилей для функции styles
const styles = (theme: any) => ({
root: {
height: theme.sizing.appbarHeight,
},
});
type PropsType = {
[$Keys<$Call<typeof styles>>]: string
};