-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[typescript] Allow module augmentation for
Mixins
(#32798)
- Loading branch information
Showing
3 changed files
with
19 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
packages/mui-material/test/typescript/moduleAugmentation/createTheme.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Interpolation } from '@mui/system'; | ||
import { createTheme, styled } from '@mui/material/styles'; | ||
|
||
declare module '@mui/material/styles' { | ||
interface Mixins { | ||
customMixin: Interpolation<{}>; | ||
} | ||
} | ||
|
||
// ensure MixinsOptions work | ||
const theme = createTheme({ mixins: { customMixin: { paddingLeft: 2 } } }); | ||
|
||
// ensure Mixins work | ||
const Example = styled('div')(({ theme: t }) => t.mixins.customMixin); |
4 changes: 4 additions & 0 deletions
4
packages/mui-material/test/typescript/moduleAugmentation/createTheme.tsconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"extends": "../../../../../tsconfig", | ||
"files": ["createTheme.spec.ts"] | ||
} |