excalidraw/src/element/typeChecks.ts
Faustino Kialungila 2ad0716f3d
fix style pasting (#832)
* fix style pasting

* Update src/actions/actionStyles.ts
2020-02-24 15:21:13 +01:00

19 lines
485 B
TypeScript

import { ExcalidrawElement, ExcalidrawTextElement } from "./types";
export function isTextElement(
element: ExcalidrawElement,
): element is ExcalidrawTextElement {
return element.type === "text";
}
export function isExcalidrawElement(element: any): boolean {
return (
element?.type === "text" ||
element?.type === "diamond" ||
element?.type === "rectangle" ||
element?.type === "ellipse" ||
element?.type === "arrow" ||
element?.type === "line"
);
}