diff --git a/packages/mui-material/src/styles/responsiveFontSize.spec.ts b/packages/mui-material/src/styles/responsiveFontSize.spec.ts new file mode 100644 index 00000000000000..d5fd3b16662fa7 --- /dev/null +++ b/packages/mui-material/src/styles/responsiveFontSize.spec.ts @@ -0,0 +1,16 @@ +import { + responsiveFontSizes, + experimental_extendTheme, + createTheme, + Theme, + CssVarsTheme, +} from '@mui/material/styles'; +import { expectType } from '@mui/types'; + +const cssVarsTheme = responsiveFontSizes(experimental_extendTheme()); +expectType & CssVarsTheme, typeof cssVarsTheme>( + cssVarsTheme, +); + +const theme = responsiveFontSizes(createTheme()); +expectType(theme); diff --git a/packages/mui-material/src/styles/responsiveFontSizes.d.ts b/packages/mui-material/src/styles/responsiveFontSizes.d.ts index 394419e5a8ef0f..ce66cf94eb1347 100644 --- a/packages/mui-material/src/styles/responsiveFontSizes.d.ts +++ b/packages/mui-material/src/styles/responsiveFontSizes.d.ts @@ -1,6 +1,5 @@ import { Breakpoint } from '@mui/system'; import { Typography } from './createTypography'; -import { Theme } from './createTheme'; export interface ResponsiveFontSizesOptions { breakpoints?: Breakpoint[]; @@ -9,7 +8,7 @@ export interface ResponsiveFontSizesOptions { variants?: Array; } -export default function responsiveFontSizes( - theme: Theme, +export default function responsiveFontSizes( + theme: T, options?: ResponsiveFontSizesOptions, -): Theme; +): T;