@mui/types 7.1.2 → 7.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1576 -47
- package/index.d.ts +12 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -67,7 +67,7 @@ type GenerateStringUnion<T> = Extract<
|
|
|
67
67
|
>;
|
|
68
68
|
|
|
69
69
|
// https://stackoverflow.com/questions/53807517/how-to-test-if-two-types-are-exactly-the-same
|
|
70
|
-
type IfEquals<T, U, Y = unknown, N = never> = (<G>() => G extends T ? 1 : 2) extends <
|
|
70
|
+
export type IfEquals<T, U, Y = unknown, N = never> = (<G>() => G extends T ? 1 : 2) extends <
|
|
71
71
|
G,
|
|
72
72
|
>() => G extends U ? 1 : 2
|
|
73
73
|
? Y
|
|
@@ -92,6 +92,10 @@ export function expectType<Expected, Actual>(actual: IfEquals<Actual, Expected,
|
|
|
92
92
|
* Adjusts valid props based on the type of `component`.
|
|
93
93
|
*/
|
|
94
94
|
export interface OverridableComponent<M extends OverridableTypeMap> {
|
|
95
|
+
// If you make any changes to this interface, please make sure to update the
|
|
96
|
+
// `OverridableComponent` type in `mui-material/src/OverridableComponent.d.ts` as well.
|
|
97
|
+
// Also, there are types in MUI Base that have a similar shape to this interface
|
|
98
|
+
// (e.g. SelectUnstyledType, OptionUnstyledType, etc.).
|
|
95
99
|
<C extends React.ElementType>(
|
|
96
100
|
props: {
|
|
97
101
|
/**
|
|
@@ -135,3 +139,10 @@ export interface OverridableTypeMap {
|
|
|
135
139
|
props: {};
|
|
136
140
|
defaultComponent: React.ElementType;
|
|
137
141
|
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Simplifies the display of a type (without modifying it).
|
|
145
|
+
* Taken from https://effectivetypescript.com/2022/02/25/gentips-4-display/
|
|
146
|
+
*/
|
|
147
|
+
// tslint:disable-next-line: ban-types
|
|
148
|
+
export type Simplify<T> = T extends Function ? T : { [K in keyof T]: T[K] };
|