mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-09-20 07:49:59 +02:00
19 lines
485 B
TypeScript
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"
|
|
);
|
|
}
|