Skip to content

Commit ed4143b

Browse files
authored
fix: error in typing for colorpalette props (#124)
1 parent dcbb1b2 commit ed4143b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/types/index.d.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ declare module 'material-ui-color' {
3838

3939
type Color = ColorType | ColorError;
4040
type ColorValue = Color | string | number | Array<string | number>;
41+
type PaletteRecord = Record<string,string>;
4142

4243
interface ColorPickerProps {
4344
value?: ColorValue;
@@ -54,11 +55,11 @@ declare module 'material-ui-color' {
5455
openAtStart?: boolean;
5556
doPopup?: () => void;
5657
}
57-
interface ColorPickerPaletteProps<T extends Record<string, string>> extends ColorPickerProps {
58-
palette: T;
58+
interface ColorPickerPaletteProps<T extends PaletteRecord | null> extends ColorPickerProps {
59+
palette?: T;
5960
}
6061

61-
function ColorPicker<T extends Record<string, string> | null>(
62+
function ColorPicker<T extends PaletteRecord | null>(
6263
props: ColorPickerPaletteProps<T> | ColorPickerProps
6364
): JSX.Element;
6465

0 commit comments

Comments
 (0)