refactor: rewrite collabWrapper to remove TDZs and simplify (#2834)

This commit is contained in:
David Luzar
2021-01-25 10:47:35 +01:00
committed by GitHub
parent 03f6d9c783
commit 0a0be839b9
16 changed files with 312 additions and 264 deletions

View File

@ -248,6 +248,7 @@ export type ExcalidrawImperativeAPI = {
};
setScrollToCenter: InstanceType<typeof App>["setScrollToCenter"];
getSceneElements: InstanceType<typeof App>["getSceneElements"];
getAppState: () => InstanceType<typeof App>["state"];
readyPromise: ResolvablePromise<ExcalidrawImperativeAPI>;
ready: true;
};
@ -298,6 +299,7 @@ class App extends React.Component<ExcalidrawProps, AppState> {
},
setScrollToCenter: this.setScrollToCenter,
getSceneElements: this.getSceneElements,
getAppState: () => this.state,
} as const;
if (typeof excalidrawRef === "function") {
excalidrawRef(api);