@excalidraw/math
Version:
Excalidraw math functions
29 lines (28 loc) • 1.19 kB
TypeScript
/// <reference types="react" />
import type { ExcalidrawElement } from "@excalidraw/element/types";
import "./EyeDropper.scss";
import type { ColorPickerType } from "./ColorPicker/colorPickerUtils";
export type EyeDropperProperties = {
keepOpenOnAlt: boolean;
swapPreviewOnAlt?: boolean;
/** called when user picks color (on pointerup) */
onSelect: (color: string, event: PointerEvent) => void;
/**
* property of selected elements to update live when alt-dragging.
* Supply `null` if not applicable (e.g. updating the canvas bg instead of
* elements)
**/
colorPickerType: ColorPickerType;
};
export declare const activeEyeDropperAtom: import("jotai/vanilla/atom").PrimitiveAtom<EyeDropperProperties | null> & {
init: EyeDropperProperties | null;
};
export declare const EyeDropper: React.FC<{
onCancel: () => void;
onSelect: EyeDropperProperties["onSelect"];
/** called when color changes, on pointerdown for preview */
onChange: (type: ColorPickerType, color: string, selectedElements: ExcalidrawElement[], event: {
altKey: boolean;
}) => void;
colorPickerType: EyeDropperProperties["colorPickerType"];
}>;