@zsviczian/excalidraw
Version:
Excalidraw as a React component
14 lines (13 loc) • 885 B
TypeScript
import type { Mutable } from "@excalidraw/common/utility-types";
import type { ExcalidrawElement } from "./types";
export type ElementUpdate<TElement extends ExcalidrawElement> = Omit<Partial<TElement>, "id" | "version" | "versionNonce" | "updated">;
export declare const mutateElement: <TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, informMutation?: boolean, options?: {
isDragging?: boolean;
}) => TElement;
export declare const newElementWith: <TElement extends ExcalidrawElement>(element: TElement, updates: ElementUpdate<TElement>, force?: boolean) => TElement;
/**
* Mutates element, bumping `version`, `versionNonce`, and `updated`.
*
* NOTE: does not trigger re-render.
*/
export declare const bumpVersion: <T extends Mutable<ExcalidrawElement>>(element: T, version?: ExcalidrawElement["version"]) => T;