mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: expose app instance on excalidrawAPI
This commit is contained in:
parent
7dbd0c5e0a
commit
a834a4fda0
2 changed files with 2 additions and 0 deletions
|
@ -332,6 +332,7 @@ class App extends React.Component<AppProps, AppState> {
|
||||||
importLibrary: this.importLibraryFromUrl,
|
importLibrary: this.importLibraryFromUrl,
|
||||||
setToastMessage: this.setToastMessage,
|
setToastMessage: this.setToastMessage,
|
||||||
id: this.id,
|
id: this.id,
|
||||||
|
app: this,
|
||||||
} as const;
|
} as const;
|
||||||
if (typeof excalidrawRef === "function") {
|
if (typeof excalidrawRef === "function") {
|
||||||
excalidrawRef(api);
|
excalidrawRef(api);
|
||||||
|
|
|
@ -378,4 +378,5 @@ export type ExcalidrawImperativeAPI = {
|
||||||
readyPromise: ResolvablePromise<ExcalidrawImperativeAPI>;
|
readyPromise: ResolvablePromise<ExcalidrawImperativeAPI>;
|
||||||
ready: true;
|
ready: true;
|
||||||
id: string;
|
id: string;
|
||||||
|
app: InstanceType<typeof App>;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue