mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Move scene, elements, and history into their respective modules
- Add "elements" argument to all scene functions to break reliance on global vars - Move all scene functions under scene directory encapsulated by `index.ts` - Move all element functions under `element` directory encapsulated by index.ts - Create a SceneHistory class to store scene history state - Add `createScene` function to create scene object
This commit is contained in:
parent
e3eef04e00
commit
6604a5c2be
27 changed files with 1411 additions and 1182 deletions
7
src/element/typeChecks.ts
Normal file
7
src/element/typeChecks.ts
Normal file
|
@ -0,0 +1,7 @@
|
|||
import { ExcalidrawElement, ExcalidrawTextElement } from "./types";
|
||||
|
||||
export function isTextElement(
|
||||
element: ExcalidrawElement
|
||||
): element is ExcalidrawTextElement {
|
||||
return element.type === "text";
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue