@zsviczian/excalidraw 0.11.0-obsidian-17 → 0.11.0-obsidian-20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zsviczian/excalidraw",
3
- "version": "0.11.0-obsidian-17",
3
+ "version": "0.11.0-obsidian-20",
4
4
  "main": "main.js",
5
5
  "types": "types/packages/excalidraw/index.d.ts",
6
6
  "files": [
@@ -49,11 +49,11 @@
49
49
  "@babel/plugin-transform-async-to-generator": "7.16.0",
50
50
  "@babel/plugin-transform-runtime": "7.17.10",
51
51
  "@babel/plugin-transform-typescript": "7.16.1",
52
- "@babel/preset-env": "7.16.7",
52
+ "@babel/preset-env": "7.17.10",
53
53
  "@babel/preset-react": "7.16.7",
54
54
  "@babel/preset-typescript": "7.16.7",
55
- "autoprefixer": "10.4.5",
56
- "babel-loader": "8.2.3",
55
+ "autoprefixer": "10.4.7",
56
+ "babel-loader": "8.2.5",
57
57
  "babel-plugin-transform-class-properties": "6.24.1",
58
58
  "cross-env": "7.0.3",
59
59
  "css-loader": "6.7.1",
@@ -61,12 +61,12 @@
61
61
  "postcss-loader": "6.2.1",
62
62
  "sass-loader": "12.4.0",
63
63
  "terser-webpack-plugin": "5.3.1",
64
- "ts-loader": "9.2.8",
65
- "typescript": "4.5.4",
64
+ "ts-loader": "9.3.0",
65
+ "typescript": "4.6.4",
66
66
  "webpack": "5.72.0",
67
67
  "webpack-bundle-analyzer": "4.5.0",
68
68
  "webpack-cli": "4.9.2",
69
- "webpack-dev-server": "4.7.4",
69
+ "webpack-dev-server": "4.9.0",
70
70
  "webpack-merge": "5.8.0"
71
71
  },
72
72
  "bugs": "https://github.com/excalidraw/excalidraw/issues",
@@ -3,7 +3,7 @@ export declare const getDefaultAppState: () => Omit<AppState, "offsetTop" | "off
3
3
  export declare const clearAppStateForLocalStorage: (appState: Partial<AppState>) => {
4
4
  activeTool?: {
5
5
  type: "line" | "arrow" | "text" | "selection" | "rectangle" | "diamond" | "ellipse" | "image" | "freedraw" | "eraser";
6
- lastActiveToolBeforeEraser: import("./types").LastActiveToolBeforeEraser; /** whether to keep when exporting to file/database */
6
+ lastActiveToolBeforeEraser: import("./types").LastActiveToolBeforeEraser;
7
7
  locked: boolean;
8
8
  customType: null;
9
9
  } | {
package/types/charts.d.ts CHANGED
@@ -14,6 +14,14 @@ declare type ParseSpreadsheetResult = {
14
14
  type: typeof VALID_SPREADSHEET;
15
15
  spreadsheet: Spreadsheet;
16
16
  };
17
+ /**
18
+ * @private exported for testing
19
+ */
20
+ export declare const tryParseNumber: (s: string) => number | null;
21
+ /**
22
+ * @private exported for testing
23
+ */
24
+ export declare const tryParseCells: (cells: string[][]) => ParseSpreadsheetResult;
17
25
  export declare const tryParseSpreadsheet: (text: string) => ParseSpreadsheetResult;
18
26
  export declare const renderSpreadsheet: (chartType: string, spreadsheet: Spreadsheet, x: number, y: number) => ChartElements;
19
27
  export {};
@@ -5,6 +5,7 @@ import { RestoredDataState } from "../data/restore";
5
5
  import { ExcalidrawElement, NonDeletedExcalidrawElement } from "../element/types";
6
6
  import History from "../history";
7
7
  import { AppClassProperties, AppProps, AppState, ExcalidrawImperativeAPI, BinaryFiles, LibraryItems, SceneData, DeviceType } from "../types";
8
+ import { FileSystemHandle } from "../data/filesystem";
8
9
  import { ImportedDataState } from "../data/types";
9
10
  export declare let showFourthFont: boolean;
10
11
  export declare const useDeviceType: () => DeviceType;
@@ -51,7 +52,6 @@ declare class App extends React.Component<AppProps, AppState> {
51
52
  private onUnload;
52
53
  private disableEvent;
53
54
  private onFontLoaded;
54
- private importLibraryFromUrl;
55
55
  private resetHistory;
56
56
  /**
57
57
  * Resets scene & history.
@@ -103,7 +103,6 @@ declare class App extends React.Component<AppProps, AppState> {
103
103
  appState?: Pick<AppState, K> | null | undefined;
104
104
  collaborators?: SceneData["collaborators"];
105
105
  commitToHistory?: SceneData["commitToHistory"];
106
- libraryItems?: LibraryItems | import("../types").LibraryItems_v1 | Promise<LibraryItems | import("../types").LibraryItems_v1> | ((currentLibraryItems: LibraryItems) => Required<SceneData>["libraryItems"] | Promise<Required<SceneData>["libraryItems"]>) | undefined;
107
106
  }) => void;
108
107
  private onSceneUpdated;
109
108
  private updateCurrentCursorPosition;
@@ -176,7 +175,7 @@ declare class App extends React.Component<AppProps, AppState> {
176
175
  private clearSelection;
177
176
  private handleCanvasRef;
178
177
  private handleAppOnDrop;
179
- loadFileToCanvas: (file: Blob) => void;
178
+ loadFileToCanvas: (file: File, fileHandle: FileSystemHandle | null) => Promise<void>;
180
179
  private handleCanvasContextMenu;
181
180
  private maybeDragNewGenericElement;
182
181
  private maybeHandleResize;
@@ -1,11 +1,11 @@
1
1
  /// <reference types="react" />
2
2
  import Library from "../data/library";
3
- import { LibraryItem, AppState, BinaryFiles, ExcalidrawProps } from "../types";
3
+ import { LibraryItems, LibraryItem, AppState, BinaryFiles, ExcalidrawProps } from "../types";
4
4
  import "./LibraryMenu.scss";
5
- export declare const LibraryMenu: ({ onClose, onInsertShape, pendingElements, onAddToLibrary, theme, setAppState, files, libraryReturnUrl, focusContainer, library, id, appState, }: {
5
+ export declare const LibraryMenu: ({ onClose, onInsertLibraryItems, pendingElements, onAddToLibrary, theme, setAppState, files, libraryReturnUrl, focusContainer, library, id, appState, }: {
6
6
  pendingElements: LibraryItem["elements"];
7
7
  onClose: () => void;
8
- onInsertShape: (elements: LibraryItem["elements"]) => void;
8
+ onInsertLibraryItems: (libraryItems: LibraryItems) => void;
9
9
  onAddToLibrary: () => void;
10
10
  theme: AppState["theme"];
11
11
  files: BinaryFiles;
@@ -1,13 +1,13 @@
1
- /// <reference types="react" />
1
+ import React from "react";
2
2
  import Library from "../data/library";
3
3
  import { AppState, BinaryFiles, ExcalidrawProps, LibraryItem, LibraryItems } from "../types";
4
4
  import "./LibraryMenuItems.scss";
5
- declare const LibraryMenuItems: ({ isLoading, libraryItems, onRemoveFromLibrary, onAddToLibrary, onInsertShape, pendingElements, theme, setAppState, libraryReturnUrl, library, files, id, selectedItems, onToggle, onPublish, resetLibrary, }: {
5
+ declare const LibraryMenuItems: ({ isLoading, libraryItems, onRemoveFromLibrary, onAddToLibrary, onInsertLibraryItems, pendingElements, theme, setAppState, libraryReturnUrl, library, files, id, selectedItems, onSelectItems, onPublish, resetLibrary, }: {
6
6
  isLoading: boolean;
7
7
  libraryItems: LibraryItems;
8
8
  pendingElements: LibraryItem["elements"];
9
9
  onRemoveFromLibrary: () => void;
10
- onInsertShape: (elements: LibraryItem["elements"]) => void;
10
+ onInsertLibraryItems: (libraryItems: LibraryItems) => void;
11
11
  onAddToLibrary: (elements: LibraryItem["elements"]) => void;
12
12
  theme: AppState["theme"];
13
13
  files: BinaryFiles;
@@ -16,7 +16,7 @@ declare const LibraryMenuItems: ({ isLoading, libraryItems, onRemoveFromLibrary,
16
16
  library: Library;
17
17
  id: string;
18
18
  selectedItems: LibraryItem["id"][];
19
- onToggle: (id: LibraryItem["id"], event: React.MouseEvent) => void;
19
+ onSelectItems: (id: LibraryItem["id"][]) => void;
20
20
  onPublish: () => void;
21
21
  resetLibrary: () => void;
22
22
  }) => JSX.Element;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  import { BinaryFiles, LibraryItem } from "../types";
3
3
  import "./LibraryUnit.scss";
4
- export declare const LibraryUnit: ({ id, elements, files, isPending, onClick, selected, onToggle, }: {
4
+ export declare const LibraryUnit: ({ id, elements, files, isPending, onClick, selected, onToggle, onDrag, }: {
5
5
  id: LibraryItem["id"] | /** for pending item */ null;
6
6
  elements?: readonly import("../element/types").NonDeleted<import("../element/types").ExcalidrawElement>[] | undefined;
7
7
  files: BinaryFiles;
@@ -9,4 +9,5 @@ export declare const LibraryUnit: ({ id, elements, files, isPending, onClick, se
9
9
  onClick: () => void;
10
10
  selected: boolean;
11
11
  onToggle: (id: string, event: React.MouseEvent) => void;
12
+ onDrag: (id: string, event: React.DragEvent) => void;
12
13
  }) => JSX.Element;
@@ -2,6 +2,7 @@ import { ALLOWED_IMAGE_MIME_TYPES, MIME_TYPES } from "../constants";
2
2
  import { ExcalidrawElement, FileId } from "../element/types";
3
3
  import { AppState, DataURL, LibraryItem } from "../types";
4
4
  import { FileSystemHandle } from "./filesystem";
5
+ import { ImportedLibraryData } from "./types";
5
6
  export declare const getMimeType: (blob: Blob | string) => string;
6
7
  export declare const getFileHandleType: (handle: FileSystemHandle | null) => string | null;
7
8
  export declare const isImageFileHandleType: (type: string | null) => type is "svg" | "png";
@@ -9,7 +10,15 @@ export declare const isImageFileHandle: (handle: FileSystemHandle | null) => boo
9
10
  export declare const isSupportedImageFile: (blob: Blob | null | undefined) => blob is Blob & {
10
11
  type: typeof ALLOWED_IMAGE_MIME_TYPES[number];
11
12
  };
12
- export declare const loadFromBlob: (blob: Blob, localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null) => Promise<import("./restore").RestoredDataState>;
13
+ export declare const loadSceneOrLibraryFromBlob: (blob: Blob | File, localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null, fileHandle?: FileSystemHandle | null | undefined) => Promise<{
14
+ type: "application/vnd.excalidraw+json";
15
+ data: import("./restore").RestoredDataState;
16
+ } | {
17
+ type: "application/vnd.excalidrawlib+json";
18
+ data: ImportedLibraryData;
19
+ }>;
20
+ export declare const loadFromBlob: (blob: Blob, localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null, fileHandle?: FileSystemHandle | null | undefined) => Promise<import("./restore").RestoredDataState>;
21
+ export declare const parseLibraryJSON: (json: string, defaultStatus?: LibraryItem["status"]) => LibraryItem[];
13
22
  export declare const loadLibraryFromBlob: (blob: Blob, defaultStatus?: LibraryItem["status"]) => Promise<LibraryItem[]>;
14
23
  export declare const canvasToBlob: (canvas: HTMLCanvasElement) => Promise<Blob>;
15
24
  /** generates SHA-1 digest from supplied file (if not supported, falls back
@@ -25,3 +34,14 @@ export declare const resizeImageFile: (file: File, opts: {
25
34
  export declare const SVGStringToFile: (SVGString: string, filename?: string) => File & {
26
35
  type: typeof MIME_TYPES.svg;
27
36
  };
37
+ export declare const getFileFromEvent: (event: React.DragEvent<HTMLDivElement>) => Promise<{
38
+ file: File | null;
39
+ fileHandle: FileSystemHandle | null;
40
+ }>;
41
+ export declare const getFileHandle: (event: React.DragEvent<HTMLDivElement>) => Promise<FileSystemHandle | null>;
42
+ export declare const createFile: (blob: File | Blob | ArrayBuffer, mimeType: ValueOf<typeof MIME_TYPES>, name: string | undefined) => File;
43
+ /** attemps to detect correct mimeType if none is set, or if an image
44
+ * has an incorrect extension.
45
+ * Note: doesn't handle missing .excalidraw/.excalidrawlib extension */
46
+ export declare const normalizeFile: (file: File) => Promise<File>;
47
+ export declare const blobToArrayBuffer: (blob: Blob) => Promise<ArrayBuffer>;
@@ -1,7 +1,6 @@
1
1
  import { ExcalidrawElement } from "../element/types";
2
2
  import { AppState, BinaryFiles, LibraryItems } from "../types";
3
3
  import { ImportedDataState, ImportedLibraryData } from "./types";
4
- import Library from "./library";
5
4
  export declare const serializeAsJSON: (elements: readonly ExcalidrawElement[], appState: Partial<AppState>, files: BinaryFiles, type: "local" | "database") => string;
6
5
  export declare const saveAsJSON: (elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles) => Promise<{
7
6
  fileHandle: import("browser-fs-access").FileSystemHandle | null;
@@ -15,4 +14,3 @@ export declare const isValidExcalidrawData: (data?: {
15
14
  export declare const isValidLibrary: (json: any) => json is ImportedLibraryData;
16
15
  export declare const serializeLibraryAsJSON: (libraryItems: LibraryItems) => string;
17
16
  export declare const saveLibraryAsJSON: (libraryItems: LibraryItems) => Promise<void>;
18
- export declare const importLibraryFromJSON: (library: Library) => Promise<void>;
@@ -1,6 +1,6 @@
1
- import { LibraryItems, LibraryItem } from "../types";
1
+ import { LibraryItems, ExcalidrawImperativeAPI, LibraryItemsSource } from "../types";
2
2
  import type App from "../components/App";
3
- import { ImportedDataState } from "./types";
3
+ import { ExcalidrawElement } from "../element/types";
4
4
  export declare const libraryItemsAtom: import("jotai").Atom<{
5
5
  status: "loading" | "loaded";
6
6
  isInitialized: boolean;
@@ -71,15 +71,26 @@ declare class Library {
71
71
  private getLastUpdateTask;
72
72
  private notifyListeners;
73
73
  resetLibrary: () => Promise<LibraryItems>;
74
- /**
75
- * imports library (from blob or libraryItems), merging with current library
76
- * (attempting to remove duplicates)
77
- */
78
- importLibrary(library: Blob | Required<ImportedDataState>["libraryItems"] | Promise<Required<ImportedDataState>["libraryItems"]>, defaultStatus?: LibraryItem["status"]): Promise<LibraryItems>;
79
74
  /**
80
75
  * @returns latest cloned libraryItems. Awaits all in-progress updates first.
81
76
  */
82
77
  getLatestLibrary: () => Promise<LibraryItems>;
78
+ updateLibrary: ({ libraryItems, prompt, merge, openLibraryMenu, defaultStatus, }: {
79
+ libraryItems: LibraryItemsSource;
80
+ merge?: boolean | undefined;
81
+ prompt?: boolean | undefined;
82
+ openLibraryMenu?: boolean | undefined;
83
+ defaultStatus?: "published" | "unpublished" | undefined;
84
+ }) => Promise<LibraryItems>;
83
85
  setLibrary: (libraryItems: LibraryItems | Promise<LibraryItems> | ((latestLibraryItems: LibraryItems) => LibraryItems | Promise<LibraryItems>)) => Promise<LibraryItems>;
84
86
  }
85
87
  export default Library;
88
+ export declare const distributeLibraryItemsOnSquareGrid: (libraryItems: LibraryItems) => ExcalidrawElement[];
89
+ export declare const parseLibraryTokensFromUrl: () => {
90
+ libraryUrl: string;
91
+ idToken: string | null;
92
+ } | null;
93
+ export declare const useHandleLibrary: ({ excalidrawAPI, getInitialLibraryItems, }: {
94
+ excalidrawAPI: ExcalidrawImperativeAPI | null;
95
+ getInitialLibraryItems?: (() => LibraryItemsSource) | undefined;
96
+ }) => void;
@@ -1,5 +1,5 @@
1
1
  import { ExcalidrawElement } from "../element/types";
2
- import { AppState, BinaryFiles, LibraryItems, LibraryItems_v1 } from "../types";
2
+ import { AppState, BinaryFiles, LibraryItems, LibraryItems_anyVersion } from "../types";
3
3
  import type { cleanAppStateForExport } from "../appState";
4
4
  import { VERSIONS } from "../constants";
5
5
  export interface ExportedDataState {
@@ -17,7 +17,7 @@ export interface ImportedDataState {
17
17
  elements?: readonly ExcalidrawElement[] | null;
18
18
  appState?: Readonly<Partial<AppState>> | null;
19
19
  scrollToContent?: boolean;
20
- libraryItems?: LibraryItems | LibraryItems_v1;
20
+ libraryItems?: LibraryItems_anyVersion;
21
21
  files?: BinaryFiles;
22
22
  }
23
23
  export interface ExportedLibraryData {
@@ -0,0 +1,6 @@
1
+ import { ExcalidrawElement } from "./element/types";
2
+ export interface Distribution {
3
+ space: "between";
4
+ axis: "x" | "y";
5
+ }
6
+ export declare const distributeElements: (selectedElements: ExcalidrawElement[], distribution: Distribution) => ExcalidrawElement[];
@@ -8,7 +8,7 @@ export default _default;
8
8
  export { getSceneVersion, isInvisiblySmallElement, getNonDeletedElements, } from "../../element";
9
9
  export { defaultLang, languages } from "../../i18n";
10
10
  export { restore, restoreAppState, restoreElements, restoreLibraryItems, } from "../../data/restore";
11
- export { exportToCanvas, exportToBlob, exportToSvg, serializeAsJSON, serializeLibraryAsJSON, loadLibraryFromBlob, loadFromBlob, getFreeDrawSvgPath, getCommonBoundingBox, //zsviczian
11
+ export { exportToCanvas, exportToBlob, exportToSvg, serializeAsJSON, serializeLibraryAsJSON, loadLibraryFromBlob, loadFromBlob, loadSceneOrLibraryFromBlob, getFreeDrawSvgPath, getCommonBoundingBox, //zsviczian
12
12
  getMaximumGroups, //zsviczian
13
13
  intersectElementWithLine, //zsviczian
14
14
  determineFocusDistance, //zsviczian
@@ -17,3 +17,4 @@ exportToClipboard, mergeLibraryItems, } from "../../packages/utils";
17
17
  export { isLinearElement } from "../../element/typeChecks";
18
18
  export { FONT_FAMILY, THEME, MIME_TYPES } from "../../constants";
19
19
  export { mutateElement, newElementWith, bumpVersion, } from "../../element/mutateElement";
20
+ export { parseLibraryTokensFromUrl, useHandleLibrary, } from "../../data/library";
@@ -1,5 +1,7 @@
1
1
  import { AppState, BinaryFiles } from "../types";
2
2
  import { ExcalidrawElement, NonDeleted } from "../element/types";
3
+ import { MIME_TYPES } from "../constants";
4
+ export { MIME_TYPES };
3
5
  declare type ExportOpts = {
4
6
  elements: readonly NonDeleted<ExcalidrawElement>[];
5
7
  appState?: Partial<Omit<AppState, "offsetTop" | "offsetLeft">>;
@@ -25,7 +27,7 @@ export declare const exportToClipboard: (opts: ExportOpts & {
25
27
  type: "png" | "svg" | "json";
26
28
  }) => Promise<void>;
27
29
  export { serializeAsJSON, serializeLibraryAsJSON } from "../data/json";
28
- export { loadFromBlob, loadLibraryFromBlob } from "../data/blob";
30
+ export { loadFromBlob, loadSceneOrLibraryFromBlob, loadLibraryFromBlob, } from "../data/blob";
29
31
  export { getFreeDrawSvgPath } from "../renderer/renderElement";
30
32
  export { getCommonBoundingBox } from "../element/bounds";
31
33
  export { getMaximumGroups } from "../groups";
@@ -14,10 +14,9 @@ declare class Scene {
14
14
  private elements;
15
15
  private elementsMap;
16
16
  getElementsIncludingDeleted(): readonly ExcalidrawElement[];
17
- getElements(): readonly NonDeletedExcalidrawElement[];
17
+ getNonDeletedElements(): readonly NonDeletedExcalidrawElement[];
18
18
  getElement<T extends ExcalidrawElement>(id: T["id"]): T | null;
19
19
  getNonDeletedElement(id: ExcalidrawElement["id"]): NonDeleted<ExcalidrawElement> | null;
20
- getNonDeletedElements(ids: readonly ExcalidrawElement["id"][]): NonDeleted<ExcalidrawElement>[];
21
20
  replaceAllElements(nextElements: readonly ExcalidrawElement[]): void;
22
21
  informMutation(): void;
23
22
  addCallback(cb: SceneStateCallback): SceneStateCallbackRemover;
package/types/types.d.ts CHANGED
@@ -29,7 +29,7 @@ export declare type Collaborator = {
29
29
  background: string;
30
30
  stroke: string;
31
31
  };
32
- src?: string;
32
+ avatarUrl?: string;
33
33
  };
34
34
  export declare type DataURL = string & {
35
35
  _brand: "DataURL";
@@ -177,7 +177,7 @@ export declare class GestureEvent extends UIEvent {
177
177
  /** @deprecated legacy: do not use outside of migration paths */
178
178
  export declare type LibraryItem_v1 = readonly NonDeleted<ExcalidrawElement>[];
179
179
  /** @deprecated legacy: do not use outside of migration paths */
180
- export declare type LibraryItems_v1 = readonly LibraryItem_v1[];
180
+ declare type LibraryItems_v1 = readonly LibraryItem_v1[];
181
181
  /** v2 library item */
182
182
  export declare type LibraryItem = {
183
183
  id: string;
@@ -189,6 +189,8 @@ export declare type LibraryItem = {
189
189
  error?: string;
190
190
  };
191
191
  export declare type LibraryItems = readonly LibraryItem[];
192
+ export declare type LibraryItems_anyVersion = LibraryItems | LibraryItems_v1;
193
+ export declare type LibraryItemsSource = ((currentLibraryItems: LibraryItems) => Blob | LibraryItems_anyVersion | Promise<LibraryItems_anyVersion | Blob>) | Blob | LibraryItems_anyVersion | Promise<LibraryItems_anyVersion | Blob>;
192
194
  export declare type ExcalidrawAPIRefValue = ExcalidrawImperativeAPI | {
193
195
  readyPromise?: ResolvablePromise<ExcalidrawImperativeAPI>;
194
196
  ready?: false;
@@ -236,13 +238,14 @@ export interface ExcalidrawProps {
236
238
  nativeEvent: MouseEvent | React.PointerEvent<HTMLCanvasElement>;
237
239
  }>) => void;
238
240
  onLinkHover?: (element: NonDeletedExcalidrawElement, event: React.PointerEvent<HTMLCanvasElement>) => void;
241
+ onPointerDown?: (activeTool: AppState["activeTool"], pointerDownState: PointerDownState) => void;
242
+ onScrollChange?: (scrollX: number, scrollY: number) => void;
239
243
  }
240
244
  export declare type SceneData = {
241
245
  elements?: ImportedDataState["elements"];
242
246
  appState?: ImportedDataState["appState"];
243
247
  collaborators?: Map<string, Collaborator>;
244
248
  commitToHistory?: boolean;
245
- libraryItems?: LibraryItems | LibraryItems_v1;
246
249
  };
247
250
  export declare enum UserIdleState {
248
251
  ACTIVE = "active",
@@ -352,6 +355,7 @@ export declare type PointerDownState = Readonly<{
352
355
  }>;
353
356
  export declare type ExcalidrawImperativeAPI = {
354
357
  updateScene: InstanceType<typeof App>["updateScene"];
358
+ updateLibrary: InstanceType<typeof Library>["updateLibrary"];
355
359
  resetScene: InstanceType<typeof App>["resetScene"];
356
360
  getSceneElementsIncludingDeleted: InstanceType<typeof App>["getSceneElementsIncludingDeleted"];
357
361
  history: {
@@ -363,7 +367,6 @@ export declare type ExcalidrawImperativeAPI = {
363
367
  getAppState: () => InstanceType<typeof App>["state"];
364
368
  getFiles: () => InstanceType<typeof App>["files"];
365
369
  refresh: InstanceType<typeof App>["refresh"];
366
- importLibrary: InstanceType<typeof App>["importLibraryFromUrl"];
367
370
  setToastMessage: InstanceType<typeof App>["setToastMessage"];
368
371
  addFiles: (data: BinaryFileData[]) => void;
369
372
  updateContainerSize: InstanceType<typeof App>["updateContainerSize"];
@@ -378,6 +381,7 @@ export declare type ExcalidrawImperativeAPI = {
378
381
  bringToFront: (elements: readonly ExcalidrawElement[]) => void;
379
382
  restore: InstanceType<typeof App>["restore"];
380
383
  setMobileModeAllowed: (allow: boolean) => void;
384
+ setActiveTool: InstanceType<typeof App>["setActiveTool"];
381
385
  };
382
386
  export declare type DeviceType = {
383
387
  isMobile: boolean;