@zsviczian/excalidraw
Version:
Excalidraw as a React component
35 lines (34 loc) • 2.1 kB
TypeScript
import React from "react";
import { type EditorInterface } from "@excalidraw/common";
import type { RenderableElementsMap, RenderInteractiveSceneCallback } from "@excalidraw/excalidraw/scene/types";
import type { NonDeletedExcalidrawElement, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
import type { AppClassProperties, InteractiveCanvasAppState } from "../../types";
import type { DOMAttributes } from "react";
type InteractiveCanvasProps = {
containerRef: React.RefObject<HTMLDivElement | null>;
canvas: HTMLCanvasElement | null;
elementsMap: RenderableElementsMap;
visibleElements: readonly NonDeletedExcalidrawElement[];
selectedElements: readonly NonDeletedExcalidrawElement[];
allElementsMap: NonDeletedSceneElementsMap;
canvasNonce: string;
selectionNonce: number | undefined;
scale: number;
appState: InteractiveCanvasAppState;
renderScrollbars: boolean;
editorInterface: EditorInterface;
app: AppClassProperties;
renderInteractiveSceneCallback: (data: RenderInteractiveSceneCallback) => void;
handleCanvasRef: (canvas: HTMLCanvasElement | null) => void;
onContextMenu: Exclude<DOMAttributes<HTMLCanvasElement | HTMLDivElement>["onContextMenu"], undefined>;
onClick: Exclude<DOMAttributes<HTMLCanvasElement>["onClick"], undefined>;
onPointerMove: Exclude<DOMAttributes<HTMLCanvasElement>["onPointerMove"], undefined>;
onPointerUp: Exclude<DOMAttributes<HTMLCanvasElement>["onPointerUp"], undefined>;
onPointerCancel: Exclude<DOMAttributes<HTMLCanvasElement>["onPointerCancel"], undefined>;
onTouchMove: Exclude<DOMAttributes<HTMLCanvasElement>["onTouchMove"], undefined>;
onPointerDown: Exclude<DOMAttributes<HTMLCanvasElement>["onPointerDown"], undefined>;
onDoubleClick: Exclude<DOMAttributes<HTMLCanvasElement>["onDoubleClick"], undefined>;
};
export declare const INTERACTIVE_SCENE_ANIMATION_KEY = "animateInteractiveScene";
declare const _default: React.MemoExoticComponent<(props: InteractiveCanvasProps) => import("react/jsx-runtime").JSX.Element>;
export default _default;