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:
Gasim Gasimzada 2020-01-06 16:49:05 +04:00
parent e3eef04e00
commit 6604a5c2be
27 changed files with 1411 additions and 1182 deletions

View file

@ -0,0 +1,7 @@
import { ExcalidrawElement, ExcalidrawTextElement } from "./types";
export function isTextElement(
element: ExcalidrawElement
): element is ExcalidrawTextElement {
return element.type === "text";
}