UNPKG

759 BTypeScriptView Raw
1import { ComponentClass, FunctionComponent } from "react";
2import { HSLColor, RGBColor, ColorChangeHandler, Color, ColorResult } from "../../..";
3
4export type ColorWrapChangeHandler = (color: Color | ColorResult) => void;
5
6export interface InjectedColorProps {
7 hex?: string | undefined;
8 hsl?: HSLColor | undefined;
9 rgb?: RGBColor | undefined;
10 onChange?: ColorWrapChangeHandler | undefined;
11}
12
13export interface ExportedColorProps {
14 color?: Color | undefined;
15 onChange?: ColorChangeHandler | undefined;
16 onChangeComplete?: ColorChangeHandler | undefined;
17}
18
19export default function CustomPicker<A>(component: ComponentClass<A & InjectedColorProps> | FunctionComponent<A & InjectedColorProps>): ComponentClass<A & ExportedColorProps>;