diff --git a/src/components/App.tsx b/src/components/App.tsx index 858de1186..5386d28a9 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -332,6 +332,7 @@ class App extends React.Component { importLibrary: this.importLibraryFromUrl, setToastMessage: this.setToastMessage, id: this.id, + app: this, } as const; if (typeof excalidrawRef === "function") { excalidrawRef(api); diff --git a/src/types.ts b/src/types.ts index 46a9b7c9b..d79409cb6 100644 --- a/src/types.ts +++ b/src/types.ts @@ -378,4 +378,5 @@ export type ExcalidrawImperativeAPI = { readyPromise: ResolvablePromise; ready: true; id: string; + app: InstanceType; };