2020-01-06 20:24:54 +04:00
|
|
|
import { ExcalidrawElement } from "../element/types";
|
|
|
|
|
2020-03-14 21:48:51 -07:00
|
|
|
class SceneState {
|
|
|
|
constructor(private _elements: readonly ExcalidrawElement[] = []) {}
|
|
|
|
|
|
|
|
getAllElements() {
|
|
|
|
return this._elements;
|
|
|
|
}
|
|
|
|
|
|
|
|
replaceAllElements(nextElements: readonly ExcalidrawElement[]) {
|
|
|
|
this._elements = nextElements;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-01-06 20:24:54 +04:00
|
|
|
export const createScene = () => {
|
2020-03-14 21:48:51 -07:00
|
|
|
return new SceneState();
|
2020-01-06 20:24:54 +04:00
|
|
|
};
|