mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
expose resetScene and getSceneElementsIncludingDeleted && move excalidrawApp to excalidraw-app folder (#2272)
Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
parent
1845b5e32c
commit
e916d7f6f6
6 changed files with 191 additions and 182 deletions
|
@ -271,6 +271,10 @@ export type PointerDownState = Readonly<{
|
|||
export type ExcalidrawImperativeAPI =
|
||||
| {
|
||||
updateScene: InstanceType<typeof App>["updateScene"];
|
||||
resetScene: InstanceType<typeof App>["resetScene"];
|
||||
getSceneElementsIncludingDeleted: InstanceType<
|
||||
typeof App
|
||||
>["getSceneElementsIncludingDeleted"];
|
||||
}
|
||||
| undefined;
|
||||
|
||||
|
@ -306,6 +310,8 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||
if (forwardedRef && "current" in forwardedRef) {
|
||||
forwardedRef.current = {
|
||||
updateScene: this.updateScene,
|
||||
resetScene: this.resetScene,
|
||||
getSceneElementsIncludingDeleted: this.getSceneElementsIncludingDeleted,
|
||||
};
|
||||
}
|
||||
this.scene = new Scene();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue