@excalidraw/common 0.18.0-d1f3982 → 0.18.0-d9e8a33

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.
Files changed (254) hide show
  1. package/dist/dev/index.js +1483 -216
  2. package/dist/dev/index.js.map +4 -4
  3. package/dist/prod/index.js +3 -3
  4. package/dist/types/common/debug.d.ts +21 -0
  5. package/dist/types/common/src/appEventBus.d.ts +27 -0
  6. package/dist/types/common/src/bounds.d.ts +10 -0
  7. package/dist/types/common/src/colors.d.ts +59 -39
  8. package/dist/types/common/src/constants.d.ts +20 -12
  9. package/dist/types/common/src/editorInterface.d.ts +1 -1
  10. package/dist/types/common/src/font-metadata.d.ts +1 -3
  11. package/dist/types/common/src/index.d.ts +4 -0
  12. package/dist/types/common/src/keys.d.ts +1 -1
  13. package/dist/types/common/src/utility-types.d.ts +0 -1
  14. package/dist/types/common/src/utils.d.ts +52 -41
  15. package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
  16. package/dist/types/element/src/Scene.d.ts +6 -4
  17. package/dist/types/element/src/arrowheads.d.ts +3 -0
  18. package/dist/types/element/src/arrows/focus.d.ts +27 -0
  19. package/dist/types/element/src/arrows/helpers.d.ts +5 -0
  20. package/dist/types/element/src/binding.d.ts +67 -48
  21. package/dist/types/element/src/bounds.d.ts +7 -13
  22. package/dist/types/element/src/collision.d.ts +7 -2
  23. package/dist/types/element/src/comparisons.d.ts +7 -7
  24. package/dist/types/element/src/distribute.d.ts +2 -1
  25. package/dist/types/element/src/dragElements.d.ts +3 -3
  26. package/dist/types/element/src/duplicate.d.ts +3 -3
  27. package/dist/types/element/src/elbowArrow.d.ts +2 -0
  28. package/dist/types/element/src/fractionalIndex.d.ts +2 -2
  29. package/dist/types/element/src/frame.d.ts +8 -4
  30. package/dist/types/element/src/heading.d.ts +2 -1
  31. package/dist/types/element/src/image.d.ts +1 -11
  32. package/dist/types/element/src/index.d.ts +4 -3
  33. package/dist/types/element/src/linearElementEditor.d.ts +23 -22
  34. package/dist/types/element/src/mutateElement.d.ts +5 -1
  35. package/dist/types/element/src/newElement.d.ts +6 -6
  36. package/dist/types/element/src/renderElement.d.ts +1 -7
  37. package/dist/types/element/src/resizeElements.d.ts +10 -10
  38. package/dist/types/element/src/resizeTest.d.ts +1 -1
  39. package/dist/types/element/src/selection.d.ts +10 -10
  40. package/dist/types/element/src/shape.d.ts +9 -8
  41. package/dist/types/element/src/textElement.d.ts +1 -1
  42. package/dist/types/element/src/textMeasurements.d.ts +1 -3
  43. package/dist/types/element/src/textWrapping.d.ts +26 -0
  44. package/dist/types/{excalidraw/data → element/src}/transform.d.ts +3 -3
  45. package/dist/types/element/src/transformHandles.d.ts +3 -23
  46. package/dist/types/element/src/typeChecks.d.ts +4 -7
  47. package/dist/types/element/src/types.d.ts +12 -13
  48. package/dist/types/element/src/utils.d.ts +9 -4
  49. package/dist/types/element/src/zindex.d.ts +7 -1
  50. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +152 -201
  51. package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -7
  52. package/dist/types/excalidraw/actions/actionBoundText.d.ts +82 -115
  53. package/dist/types/excalidraw/actions/actionCanvas.d.ts +518 -903
  54. package/dist/types/excalidraw/actions/actionClipboard.d.ts +113 -903
  55. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +39 -56
  56. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +132 -185
  57. package/dist/types/excalidraw/actions/actionDeselect.d.ts +160 -0
  58. package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -3
  59. package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +2 -3
  60. package/dist/types/excalidraw/actions/actionElementLink.d.ts +48 -71
  61. package/dist/types/excalidraw/actions/actionElementLock.d.ts +80 -113
  62. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +54 -71
  63. package/dist/types/excalidraw/actions/actionExport.d.ts +162 -1428
  64. package/dist/types/excalidraw/actions/actionFinalize.d.ts +10 -402
  65. package/dist/types/excalidraw/actions/actionFlip.d.ts +2 -3
  66. package/dist/types/excalidraw/actions/actionFrame.d.ts +280 -383
  67. package/dist/types/excalidraw/actions/actionGroup.d.ts +85 -126
  68. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +173 -228
  69. package/dist/types/excalidraw/actions/actionLink.d.ts +56 -73
  70. package/dist/types/excalidraw/actions/actionMenu.d.ts +42 -65
  71. package/dist/types/excalidraw/actions/actionNavigate.d.ts +18 -367
  72. package/dist/types/excalidraw/actions/actionProperties.d.ts +142 -2566
  73. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +42 -63
  74. package/dist/types/excalidraw/actions/actionStyles.d.ts +39 -55
  75. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +4 -4
  76. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +173 -0
  77. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +54 -71
  78. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +173 -0
  79. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +54 -71
  80. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +42 -65
  81. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +1 -1
  82. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +53 -70
  83. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +54 -71
  84. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +54 -71
  85. package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -9
  86. package/dist/types/excalidraw/actions/index.d.ts +3 -0
  87. package/dist/types/excalidraw/actions/register.d.ts +2 -2
  88. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  89. package/dist/types/excalidraw/actions/types.d.ts +4 -4
  90. package/dist/types/excalidraw/appState.d.ts +38 -34
  91. package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -0
  92. package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
  93. package/dist/types/excalidraw/charts/charts.helpers.d.ts +32 -0
  94. package/dist/types/excalidraw/charts/charts.line.d.ts +2 -0
  95. package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
  96. package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -0
  97. package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
  98. package/dist/types/excalidraw/charts/index.d.ts +7 -0
  99. package/dist/types/excalidraw/clipboard.d.ts +15 -40
  100. package/dist/types/excalidraw/components/Actions.d.ts +5 -2
  101. package/dist/types/excalidraw/components/App.d.ts +92 -55
  102. package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
  103. package/dist/types/excalidraw/components/Card.d.ts +1 -3
  104. package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -4
  105. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +0 -1
  106. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +0 -1
  107. package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +0 -1
  108. package/dist/types/excalidraw/components/CommandPalette/types.d.ts +2 -4
  109. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +2 -2
  110. package/dist/types/excalidraw/components/DarkModeToggle.d.ts +1 -1
  111. package/dist/types/excalidraw/components/DefaultSidebar.d.ts +9 -13
  112. package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +1 -1
  113. package/dist/types/excalidraw/components/Ellipsify.d.ts +1 -2
  114. package/dist/types/excalidraw/components/ErrorDialog.d.ts +1 -1
  115. package/dist/types/excalidraw/components/EyeDropper.d.ts +0 -1
  116. package/dist/types/excalidraw/components/FilledButton.d.ts +2 -1
  117. package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +0 -1
  118. package/dist/types/excalidraw/components/HelpDialog.d.ts +1 -1
  119. package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
  120. package/dist/types/excalidraw/components/InlineIcon.d.ts +2 -2
  121. package/dist/types/excalidraw/components/LibraryMenuControlButtons.d.ts +1 -1
  122. package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +1 -2
  123. package/dist/types/excalidraw/components/LibraryUnit.d.ts +2 -3
  124. package/dist/types/excalidraw/components/LoadingMessage.d.ts +0 -1
  125. package/dist/types/excalidraw/components/MobileMenu.d.ts +1 -1
  126. package/dist/types/excalidraw/components/MobileToolBar.d.ts +0 -1
  127. package/dist/types/excalidraw/components/Modal.d.ts +0 -1
  128. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +1 -1
  129. package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
  130. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -1
  131. package/dist/types/excalidraw/components/RadioGroup.d.ts +0 -1
  132. package/dist/types/excalidraw/components/RadioSelection.d.ts +4 -4
  133. package/dist/types/excalidraw/components/Range.d.ts +10 -4
  134. package/dist/types/excalidraw/components/ScrollableList.d.ts +0 -1
  135. package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +15 -21
  136. package/dist/types/excalidraw/components/Sidebar/SidebarHeader.d.ts +1 -1
  137. package/dist/types/excalidraw/components/Sidebar/SidebarTab.d.ts +1 -2
  138. package/dist/types/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +1 -2
  139. package/dist/types/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +1 -2
  140. package/dist/types/excalidraw/components/Sidebar/SidebarTabs.d.ts +1 -2
  141. package/dist/types/excalidraw/components/Spinner.d.ts +4 -4
  142. package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +0 -1
  143. package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +0 -1
  144. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +0 -1
  145. package/dist/types/excalidraw/components/Stats/index.d.ts +7 -8
  146. package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
  147. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatHistoryMenu.d.ts +15 -0
  148. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatInterface.d.ts +23 -0
  149. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatMessage.d.ts +14 -0
  150. package/dist/types/excalidraw/components/TTDDialog/Chat/TTDChatPanel.d.ts +27 -0
  151. package/dist/types/excalidraw/components/TTDDialog/Chat/index.d.ts +3 -0
  152. package/dist/types/excalidraw/components/TTDDialog/Chat/useChatAgent.d.ts +8 -0
  153. package/dist/types/excalidraw/components/TTDDialog/CodeMirrorEditor.d.ts +11 -0
  154. package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +3 -2
  155. package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +13 -0
  156. package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +12 -29
  157. package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +3 -3
  158. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +5 -2
  159. package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +13 -9
  160. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +1 -2
  161. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +1 -2
  162. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +1 -2
  163. package/dist/types/excalidraw/components/TTDDialog/TTDPreviewPanel.d.ts +9 -0
  164. package/dist/types/excalidraw/components/TTDDialog/TTDWelcomeMessage.d.ts +1 -0
  165. package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +9 -0
  166. package/dist/types/excalidraw/components/TTDDialog/common.d.ts +16 -16
  167. package/dist/types/excalidraw/components/TTDDialog/hooks/useChatManagement.d.ts +13 -0
  168. package/dist/types/excalidraw/components/TTDDialog/hooks/useMermaidRenderer.d.ts +14 -0
  169. package/dist/types/excalidraw/components/TTDDialog/hooks/useTextGeneration.d.ts +7 -0
  170. package/dist/types/excalidraw/components/TTDDialog/mermaid-lang-lite.d.ts +2 -0
  171. package/dist/types/excalidraw/components/TTDDialog/types.d.ts +95 -0
  172. package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +22 -0
  173. package/dist/types/excalidraw/components/TTDDialog/utils/chat.d.ts +10 -0
  174. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidAutoFix.d.ts +1 -0
  175. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +10 -0
  176. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidValidation.d.ts +1 -0
  177. package/dist/types/excalidraw/components/Toast.d.ts +11 -7
  178. package/dist/types/excalidraw/components/Trans.d.ts +2 -2
  179. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +5 -2
  180. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +48 -38
  181. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +7 -6
  182. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +3 -3
  183. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +13 -22
  184. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCheckbox.d.ts +5 -0
  185. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +5 -4
  186. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -2
  187. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +2 -2
  188. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +6 -6
  189. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSub.d.ts +23 -0
  190. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubContent.d.ts +8 -0
  191. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubTrigger.d.ts +12 -0
  192. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +3 -4
  193. package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +2 -2
  194. package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -0
  195. package/dist/types/excalidraw/components/hoc/withInternalFallback.d.ts +1 -1
  196. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +1 -1
  197. package/dist/types/excalidraw/components/icons.d.ts +44 -21
  198. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +20 -2
  199. package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +39 -32
  200. package/dist/types/excalidraw/components/shapes.d.ts +74 -1
  201. package/dist/types/excalidraw/data/blob.d.ts +328 -7
  202. package/dist/types/excalidraw/data/encode.d.ts +4 -4
  203. package/dist/types/excalidraw/data/encryption.d.ts +5 -5
  204. package/dist/types/excalidraw/data/filesystem.d.ts +5 -7
  205. package/dist/types/excalidraw/data/index.d.ts +4 -5
  206. package/dist/types/excalidraw/data/json.d.ts +171 -4
  207. package/dist/types/excalidraw/data/library.d.ts +24 -9
  208. package/dist/types/excalidraw/data/resave.d.ts +7 -2
  209. package/dist/types/excalidraw/data/restore.d.ts +25 -10
  210. package/dist/types/excalidraw/editor-jotai.d.ts +11 -11
  211. package/dist/types/excalidraw/errors.d.ts +14 -0
  212. package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +4 -3
  213. package/dist/types/excalidraw/hooks/useScrollPosition.d.ts +1 -2
  214. package/dist/types/excalidraw/i18n.d.ts +2 -2
  215. package/dist/types/excalidraw/renderer/animation.d.ts +12 -0
  216. package/dist/types/excalidraw/renderer/helpers.d.ts +6 -8
  217. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +8 -14
  218. package/dist/types/excalidraw/scene/Renderer.d.ts +5 -2
  219. package/dist/types/excalidraw/scene/export.d.ts +2 -2
  220. package/dist/types/excalidraw/scene/scroll.d.ts +1 -6
  221. package/dist/types/excalidraw/scene/types.d.ts +19 -2
  222. package/dist/types/excalidraw/snapping.d.ts +5 -5
  223. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-bindings.d.ts +1 -1
  224. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-loader.d.ts +1 -1
  225. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-wasm.d.ts +1 -1
  226. package/dist/types/excalidraw/subset/woff2/woff2-loader.d.ts +2 -2
  227. package/dist/types/excalidraw/subset/woff2/woff2-wasm.d.ts +1 -1
  228. package/dist/types/excalidraw/textAutoResizeHandle.d.ts +15 -0
  229. package/dist/types/excalidraw/types.d.ts +109 -21
  230. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +7 -3
  231. package/dist/types/math/src/curve.d.ts +4 -1
  232. package/dist/types/math/src/point.d.ts +7 -2
  233. package/dist/types/math/src/polygon.d.ts +2 -2
  234. package/dist/types/math/src/range.d.ts +1 -3
  235. package/dist/types/math/src/segment.d.ts +3 -3
  236. package/dist/types/math/src/types.d.ts +25 -1
  237. package/dist/types/utils/src/bbox.d.ts +1 -1
  238. package/dist/types/utils/src/export.d.ts +5 -5
  239. package/dist/types/utils/src/shape.d.ts +6 -6
  240. package/dist/types/utils/src/withinBounds.d.ts +2 -2
  241. package/package.json +7 -1
  242. package/dist/types/excalidraw/charts.d.ts +0 -27
  243. package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
  244. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -16
  245. package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
  246. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -8
  247. package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
  248. package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -22
  249. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
  250. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
  251. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -85
  252. package/dist/types/excalidraw/data/reconcile.d.ts +0 -7
  253. package/dist/types/excalidraw/index.d.ts +0 -46
  254. package/dist/types/excalidraw/polyfill.d.ts +0 -2
@@ -2,24 +2,345 @@ import { IMAGE_MIME_TYPES, MIME_TYPES } from "@excalidraw/common";
2
2
  import type { ValueOf } from "@excalidraw/common/utility-types";
3
3
  import type { ExcalidrawElement, FileId } from "@excalidraw/element/types";
4
4
  import type { AppState, DataURL, LibraryItem } from "../types";
5
- import type { FileSystemHandle } from "browser-fs-access";
6
5
  import type { ImportedLibraryData } from "./types";
7
6
  export declare const getMimeType: (blob: Blob | string) => string;
8
- export declare const getFileHandleType: (handle: FileSystemHandle | null) => string | null;
7
+ export declare const getFileHandleType: (handle: FileSystemFileHandle | null) => string | null;
9
8
  export declare const isImageFileHandleType: (type: string | null) => type is "png" | "svg";
10
- export declare const isImageFileHandle: (handle: FileSystemHandle | null) => boolean;
9
+ export declare const isImageFileHandle: (handle: FileSystemFileHandle | null) => handle is FileSystemFileHandle;
11
10
  export declare const isSupportedImageFileType: (type: string | null | undefined) => boolean;
12
11
  export declare const isSupportedImageFile: (blob: Blob | null | undefined) => blob is Blob & {
13
12
  type: ValueOf<typeof IMAGE_MIME_TYPES>;
14
13
  };
15
- export declare const loadSceneOrLibraryFromBlob: (blob: Blob | File, localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null, fileHandle?: FileSystemHandle | null) => Promise<{
14
+ export declare const loadSceneOrLibraryFromBlob: (blob: Blob | File,
15
+ /** @see restore.localAppState */
16
+ localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null,
17
+ /** FileSystemFileHandle. Defaults to `blob.handle` if defined, otherwise null. */
18
+ fileHandle?: FileSystemFileHandle | null) => Promise<{
16
19
  type: "application/vnd.excalidraw+json";
17
- data: import("./restore").RestoredDataState;
20
+ data: {
21
+ elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
22
+ appState: {
23
+ viewModeEnabled: boolean;
24
+ zenModeEnabled: boolean;
25
+ gridModeEnabled: boolean;
26
+ objectsSnapModeEnabled: boolean;
27
+ theme: import("@excalidraw/element/types").Theme;
28
+ name: string | null;
29
+ currentItemArrowType: "sharp" | "round" | "elbow";
30
+ gridSize: number;
31
+ activeTool: {
32
+ lastActiveTool: import("../types").ActiveTool | null;
33
+ locked: boolean;
34
+ fromSelection: boolean;
35
+ } & import("../types").ActiveTool;
36
+ contextMenu: {
37
+ items: import("../components/ContextMenu").ContextMenuItems;
38
+ top: number;
39
+ left: number;
40
+ } | null;
41
+ showWelcomeScreen: boolean;
42
+ isLoading: boolean;
43
+ errorMessage: React.ReactNode;
44
+ activeEmbeddable: {
45
+ element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
46
+ state: "hover" | "active";
47
+ } | null;
48
+ newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
49
+ resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
50
+ multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
51
+ selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
52
+ isBindingEnabled: boolean;
53
+ boxSelectionMode: import("../types").BoxSelectionMode;
54
+ bindingPreference: "enabled" | "disabled";
55
+ isMidpointSnappingEnabled: boolean;
56
+ startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
57
+ suggestedBinding: {
58
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
59
+ midPoint?: import("@excalidraw/math").GlobalPoint;
60
+ } | null;
61
+ frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
62
+ frameRendering: {
63
+ enabled: boolean;
64
+ name: boolean;
65
+ outline: boolean;
66
+ clip: boolean;
67
+ };
68
+ editingFrame: string | null;
69
+ elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
70
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
71
+ preferredSelectionTool: {
72
+ type: "selection" | "lasso";
73
+ initialized: boolean;
74
+ };
75
+ penMode: boolean;
76
+ penDetected: boolean;
77
+ exportBackground: boolean;
78
+ exportEmbedScene: boolean;
79
+ exportWithDarkMode: boolean;
80
+ exportScale: number;
81
+ currentItemStrokeColor: string;
82
+ currentItemBackgroundColor: string;
83
+ currentItemFillStyle: ExcalidrawElement["fillStyle"];
84
+ currentItemStrokeWidth: number;
85
+ currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
86
+ currentItemRoughness: number;
87
+ currentItemOpacity: number;
88
+ currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
89
+ currentItemFontSize: number;
90
+ currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
91
+ currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
92
+ currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
93
+ currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
94
+ currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
95
+ viewBackgroundColor: string;
96
+ scrollX: number;
97
+ scrollY: number;
98
+ cursorButton: "up" | "down";
99
+ scrolledOutside: boolean;
100
+ isResizing: boolean;
101
+ isRotating: boolean;
102
+ zoom: import("../types").Zoom;
103
+ openMenu: "canvas" | null;
104
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
105
+ openSidebar: {
106
+ name: import("../types").SidebarName;
107
+ tab?: import("../types").SidebarTabName;
108
+ } | null;
109
+ openDialog: null | {
110
+ name: "imageExport" | "help" | "jsonExport";
111
+ } | {
112
+ name: "ttd";
113
+ tab: "text-to-diagram" | "mermaid";
114
+ } | {
115
+ name: "commandPalette";
116
+ } | {
117
+ name: "settings";
118
+ } | {
119
+ name: "elementLinkSelector";
120
+ sourceElementId: ExcalidrawElement["id"];
121
+ } | {
122
+ name: "charts";
123
+ data: import("../charts").Spreadsheet;
124
+ rawText: string;
125
+ };
126
+ defaultSidebarDockedPreference: boolean;
127
+ lastPointerDownWith: import("@excalidraw/element/types").PointerType;
128
+ selectedElementIds: Readonly<{
129
+ [id: string]: true;
130
+ }>;
131
+ hoveredElementIds: Readonly<{
132
+ [id: string]: true;
133
+ }>;
134
+ previousSelectedElementIds: {
135
+ [id: string]: true;
136
+ };
137
+ selectedElementsAreBeingDragged: boolean;
138
+ shouldCacheIgnoreZoom: boolean;
139
+ toast: {
140
+ message: React.ReactNode;
141
+ closable?: boolean;
142
+ duration?: number;
143
+ } | null;
144
+ gridStep: number;
145
+ selectedGroupIds: {
146
+ [groupId: string]: boolean;
147
+ };
148
+ editingGroupId: import("@excalidraw/element/types").GroupId | null;
149
+ fileHandle: FileSystemFileHandle | null;
150
+ collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
151
+ stats: {
152
+ open: boolean;
153
+ panels: number;
154
+ };
155
+ showHyperlinkPopup: false | "info" | "editor";
156
+ selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
157
+ snapLines: readonly import("../snapping").SnapLine[];
158
+ originSnapOffset: {
159
+ x: number;
160
+ y: number;
161
+ } | null;
162
+ userToFollow: import("../types").UserToFollow | null;
163
+ followedBy: Set<import("../types").SocketId>;
164
+ isCropping: boolean;
165
+ croppingElementId: ExcalidrawElement["id"] | null;
166
+ searchMatches: Readonly<{
167
+ focusedId: ExcalidrawElement["id"] | null;
168
+ matches: readonly import("../types").SearchMatch[];
169
+ }> | null;
170
+ activeLockedId: string | null;
171
+ lockedMultiSelections: {
172
+ [groupId: string]: true;
173
+ };
174
+ bindMode: import("@excalidraw/element/types").BindMode;
175
+ };
176
+ files: import("../types").BinaryFiles;
177
+ };
18
178
  } | {
19
179
  type: "application/vnd.excalidrawlib+json";
20
180
  data: ImportedLibraryData;
21
181
  }>;
22
- export declare const loadFromBlob: (blob: Blob, localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null, fileHandle?: FileSystemHandle | null) => Promise<import("./restore").RestoredDataState>;
182
+ export declare const loadFromBlob: (blob: Blob,
183
+ /** @see restore.localAppState */
184
+ localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null,
185
+ /** FileSystemFileHandle. Defaults to `blob.handle` if defined, otherwise null. */
186
+ fileHandle?: FileSystemFileHandle | null) => Promise<{
187
+ elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
188
+ appState: {
189
+ viewModeEnabled: boolean;
190
+ zenModeEnabled: boolean;
191
+ gridModeEnabled: boolean;
192
+ objectsSnapModeEnabled: boolean;
193
+ theme: import("@excalidraw/element/types").Theme;
194
+ name: string | null;
195
+ currentItemArrowType: "sharp" | "round" | "elbow";
196
+ gridSize: number;
197
+ activeTool: {
198
+ lastActiveTool: import("../types").ActiveTool | null;
199
+ locked: boolean;
200
+ fromSelection: boolean;
201
+ } & import("../types").ActiveTool;
202
+ contextMenu: {
203
+ items: import("../components/ContextMenu").ContextMenuItems;
204
+ top: number;
205
+ left: number;
206
+ } | null;
207
+ showWelcomeScreen: boolean;
208
+ isLoading: boolean;
209
+ errorMessage: React.ReactNode;
210
+ activeEmbeddable: {
211
+ element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
212
+ state: "hover" | "active";
213
+ } | null;
214
+ newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
215
+ resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
216
+ multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
217
+ selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
218
+ isBindingEnabled: boolean;
219
+ boxSelectionMode: import("../types").BoxSelectionMode;
220
+ bindingPreference: "enabled" | "disabled";
221
+ isMidpointSnappingEnabled: boolean;
222
+ startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
223
+ suggestedBinding: {
224
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
225
+ midPoint?: import("@excalidraw/math").GlobalPoint;
226
+ } | null;
227
+ frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
228
+ frameRendering: {
229
+ enabled: boolean;
230
+ name: boolean;
231
+ outline: boolean;
232
+ clip: boolean;
233
+ };
234
+ editingFrame: string | null;
235
+ elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
236
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
237
+ preferredSelectionTool: {
238
+ type: "selection" | "lasso";
239
+ initialized: boolean;
240
+ };
241
+ penMode: boolean;
242
+ penDetected: boolean;
243
+ exportBackground: boolean;
244
+ exportEmbedScene: boolean;
245
+ exportWithDarkMode: boolean;
246
+ exportScale: number;
247
+ currentItemStrokeColor: string;
248
+ currentItemBackgroundColor: string;
249
+ currentItemFillStyle: ExcalidrawElement["fillStyle"];
250
+ currentItemStrokeWidth: number;
251
+ currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
252
+ currentItemRoughness: number;
253
+ currentItemOpacity: number;
254
+ currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
255
+ currentItemFontSize: number;
256
+ currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
257
+ currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
258
+ currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
259
+ currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
260
+ currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
261
+ viewBackgroundColor: string;
262
+ scrollX: number;
263
+ scrollY: number;
264
+ cursorButton: "up" | "down";
265
+ scrolledOutside: boolean;
266
+ isResizing: boolean;
267
+ isRotating: boolean;
268
+ zoom: import("../types").Zoom;
269
+ openMenu: "canvas" | null;
270
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
271
+ openSidebar: {
272
+ name: import("../types").SidebarName;
273
+ tab?: import("../types").SidebarTabName;
274
+ } | null;
275
+ openDialog: null | {
276
+ name: "imageExport" | "help" | "jsonExport";
277
+ } | {
278
+ name: "ttd";
279
+ tab: "text-to-diagram" | "mermaid";
280
+ } | {
281
+ name: "commandPalette";
282
+ } | {
283
+ name: "settings";
284
+ } | {
285
+ name: "elementLinkSelector";
286
+ sourceElementId: ExcalidrawElement["id"];
287
+ } | {
288
+ name: "charts";
289
+ data: import("../charts").Spreadsheet;
290
+ rawText: string;
291
+ };
292
+ defaultSidebarDockedPreference: boolean;
293
+ lastPointerDownWith: import("@excalidraw/element/types").PointerType;
294
+ selectedElementIds: Readonly<{
295
+ [id: string]: true;
296
+ }>;
297
+ hoveredElementIds: Readonly<{
298
+ [id: string]: true;
299
+ }>;
300
+ previousSelectedElementIds: {
301
+ [id: string]: true;
302
+ };
303
+ selectedElementsAreBeingDragged: boolean;
304
+ shouldCacheIgnoreZoom: boolean;
305
+ toast: {
306
+ message: React.ReactNode;
307
+ closable?: boolean;
308
+ duration?: number;
309
+ } | null;
310
+ gridStep: number;
311
+ selectedGroupIds: {
312
+ [groupId: string]: boolean;
313
+ };
314
+ editingGroupId: import("@excalidraw/element/types").GroupId | null;
315
+ fileHandle: FileSystemFileHandle | null;
316
+ collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
317
+ stats: {
318
+ open: boolean;
319
+ panels: number;
320
+ };
321
+ showHyperlinkPopup: false | "info" | "editor";
322
+ selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
323
+ snapLines: readonly import("../snapping").SnapLine[];
324
+ originSnapOffset: {
325
+ x: number;
326
+ y: number;
327
+ } | null;
328
+ userToFollow: import("../types").UserToFollow | null;
329
+ followedBy: Set<import("../types").SocketId>;
330
+ isCropping: boolean;
331
+ croppingElementId: ExcalidrawElement["id"] | null;
332
+ searchMatches: Readonly<{
333
+ focusedId: ExcalidrawElement["id"] | null;
334
+ matches: readonly import("../types").SearchMatch[];
335
+ }> | null;
336
+ activeLockedId: string | null;
337
+ lockedMultiSelections: {
338
+ [groupId: string]: true;
339
+ };
340
+ bindMode: import("@excalidraw/element/types").BindMode;
341
+ };
342
+ files: import("../types").BinaryFiles;
343
+ }>;
23
344
  export declare const parseLibraryJSON: (json: string, defaultStatus?: LibraryItem["status"]) => LibraryItem[];
24
345
  export declare const loadLibraryFromBlob: (blob: Blob, defaultStatus?: LibraryItem["status"]) => Promise<LibraryItem[]>;
25
346
  export declare const canvasToBlob: (canvas: HTMLCanvasElement | Promise<HTMLCanvasElement>) => Promise<Blob>;
@@ -40,7 +361,7 @@ export declare const SVGStringToFile: (SVGString: string, filename?: string) =>
40
361
  type: typeof MIME_TYPES.svg;
41
362
  };
42
363
  export declare const ImageURLToFile: (imageUrl: string, filename?: string) => Promise<File | undefined>;
43
- export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTransferItem) => Promise<FileSystemHandle | null>;
364
+ export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTransferItem) => Promise<FileSystemFileHandle | null>;
44
365
  export declare const createFile: (blob: File | Blob | ArrayBuffer, mimeType: string, name: string | undefined) => File;
45
366
  /** attempts to detect correct mimeType if none is set, or if an image
46
367
  * has an incorrect extension.
@@ -21,7 +21,7 @@ type EncodedData = {
21
21
  export declare const encode: ({ text, compress, }: {
22
22
  text: string;
23
23
  /** defaults to `true`. If compression fails, falls back to bstring alone. */
24
- compress?: boolean | undefined;
24
+ compress?: boolean;
25
25
  }) => EncodedData;
26
26
  export declare const decode: (data: EncodedData) => string;
27
27
  /**
@@ -40,16 +40,16 @@ export declare const decode: (data: EncodedData) => string;
40
40
  export declare const compressData: <T extends Record<string, any> = never>(dataBuffer: Uint8Array, options: {
41
41
  encryptionKey: string;
42
42
  } & ([T] extends [never] ? {
43
- metadata?: T | undefined;
43
+ metadata?: T;
44
44
  } : {
45
45
  metadata: T;
46
- })) => Promise<Uint8Array>;
46
+ })) => Promise<Uint8Array<ArrayBuffer>>;
47
47
  export declare const decompressData: <T extends Record<string, any>>(bufferView: Uint8Array, options: {
48
48
  decryptionKey: string;
49
49
  }) => Promise<{
50
50
  /** metadata source is always JSON so we can decode it here */
51
51
  metadata: T;
52
52
  /** data can be anything so the caller must decode it */
53
- data: Uint8Array;
53
+ data: Uint8Array<ArrayBuffer>;
54
54
  }>;
55
55
  export {};
@@ -1,9 +1,9 @@
1
1
  export declare const IV_LENGTH_BYTES = 12;
2
- export declare const createIV: () => Uint8Array;
3
- export declare const generateEncryptionKey: <T extends "string" | "cryptoKey" = "string">(returnAs?: T | undefined) => Promise<T extends "cryptoKey" ? CryptoKey : string>;
2
+ export declare const createIV: () => Uint8Array<ArrayBuffer>;
3
+ export declare const generateEncryptionKey: <T extends "string" | "cryptoKey" = "string">(returnAs?: T) => Promise<T extends "cryptoKey" ? CryptoKey : string>;
4
4
  export declare const getCryptoKey: (key: string, usage: KeyUsage) => Promise<CryptoKey>;
5
- export declare const encryptData: (key: string | CryptoKey, data: Uint8Array | ArrayBuffer | Blob | File | string) => Promise<{
5
+ export declare const encryptData: (key: string | CryptoKey, data: Uint8Array<ArrayBuffer> | ArrayBuffer | Blob | File | string) => Promise<{
6
6
  encryptedBuffer: ArrayBuffer;
7
- iv: Uint8Array;
7
+ iv: Uint8Array<ArrayBuffer>;
8
8
  }>;
9
- export declare const decryptData: (iv: Uint8Array, encrypted: Uint8Array | ArrayBuffer, privateKey: string) => Promise<ArrayBuffer>;
9
+ export declare const decryptData: (iv: Uint8Array<ArrayBuffer>, encrypted: Uint8Array<ArrayBuffer> | ArrayBuffer, privateKey: string) => Promise<ArrayBuffer>;
@@ -1,11 +1,10 @@
1
1
  import { supported as nativeFileSystemSupported } from "browser-fs-access";
2
2
  import { MIME_TYPES } from "@excalidraw/common";
3
- import type { FileSystemHandle } from "browser-fs-access";
4
3
  type FILE_EXTENSION = Exclude<keyof typeof MIME_TYPES, "binary">;
5
4
  export declare const fileOpen: <M extends boolean | undefined = false>(opts: {
6
- extensions?: FILE_EXTENSION[] | undefined;
5
+ extensions?: FILE_EXTENSION[];
7
6
  description: string;
8
- multiple?: M | undefined;
7
+ multiple?: M;
9
8
  }) => Promise<M extends false | undefined ? File : File[]>;
10
9
  export declare const fileSave: (blob: Blob | Promise<Blob>, opts: {
11
10
  /** supply without the extension */
@@ -14,8 +13,7 @@ export declare const fileSave: (blob: Blob | Promise<Blob>, opts: {
14
13
  extension: FILE_EXTENSION;
15
14
  mimeTypes?: string[];
16
15
  description: string;
17
- /** existing FileSystemHandle */
18
- fileHandle?: FileSystemHandle | null;
19
- }) => Promise<FileSystemHandle | null>;
16
+ /** existing FileSystemFileHandle */
17
+ fileHandle?: FileSystemFileHandle | null;
18
+ }) => Promise<FileSystemFileHandle | null>;
20
19
  export { nativeFileSystemSupported };
21
- export type { FileSystemHandle };
@@ -1,5 +1,4 @@
1
1
  import type { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
2
- import type { FileSystemHandle } from "./filesystem";
3
2
  import type { ExportType } from "../scene/types";
4
3
  import type { AppState, BinaryFiles } from "../types";
5
4
  export { loadFromBlob } from "./blob";
@@ -13,10 +12,10 @@ export declare const prepareElementsForExport: (elements: readonly ExcalidrawEle
13
12
  };
14
13
  export declare const exportCanvas: (type: Omit<ExportType, "backend">, elements: ExportedElements, appState: AppState, files: BinaryFiles, { exportBackground, exportPadding, viewBackgroundColor, name, fileHandle, exportingFrame, }: {
15
14
  exportBackground: boolean;
16
- exportPadding?: number | undefined;
15
+ exportPadding?: number;
17
16
  viewBackgroundColor: string;
18
17
  /** filename, if applicable */
19
- name?: string | undefined;
20
- fileHandle?: FileSystemHandle | null | undefined;
18
+ name?: string;
19
+ fileHandle?: FileSystemFileHandle | null;
21
20
  exportingFrame: ExcalidrawFrameLikeElement | null;
22
- }) => Promise<FileSystemHandle | null | undefined>;
21
+ }) => Promise<FileSystemFileHandle | null | undefined>;
@@ -1,11 +1,178 @@
1
- import type { ExcalidrawElement } from "@excalidraw/element/types";
1
+ import type { ExcalidrawElement, NonDeleted } from "@excalidraw/element/types";
2
+ import type { MaybePromise } from "@excalidraw/common/utility-types";
2
3
  import type { AppState, BinaryFiles, LibraryItems } from "../types";
3
4
  import type { ImportedDataState, ImportedLibraryData } from "./types";
5
+ export type JSONExportData = {
6
+ elements: readonly NonDeleted<ExcalidrawElement>[];
7
+ appState: AppState;
8
+ files: BinaryFiles;
9
+ };
4
10
  export declare const serializeAsJSON: (elements: readonly ExcalidrawElement[], appState: Partial<AppState>, files: BinaryFiles, type: "local" | "database") => string;
5
- export declare const saveAsJSON: (elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles, name?: string) => Promise<{
6
- fileHandle: import("browser-fs-access").FileSystemHandle | null;
11
+ export declare const saveAsJSON: ({ data, filename, fileHandle, }: {
12
+ data: MaybePromise<JSONExportData>;
13
+ filename: string;
14
+ fileHandle: AppState["fileHandle"];
15
+ }) => Promise<{
16
+ fileHandle: FileSystemFileHandle | null;
17
+ }>;
18
+ export declare const loadFromJSON: (localAppState: AppState, localElements: readonly ExcalidrawElement[] | null) => Promise<{
19
+ elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
20
+ appState: {
21
+ viewModeEnabled: boolean;
22
+ zenModeEnabled: boolean;
23
+ gridModeEnabled: boolean;
24
+ objectsSnapModeEnabled: boolean;
25
+ theme: import("@excalidraw/element/types").Theme;
26
+ name: string | null;
27
+ currentItemArrowType: "sharp" | "round" | "elbow";
28
+ gridSize: number;
29
+ activeTool: {
30
+ lastActiveTool: import("../types").ActiveTool | null;
31
+ locked: boolean;
32
+ fromSelection: boolean;
33
+ } & import("../types").ActiveTool;
34
+ contextMenu: {
35
+ items: import("../components/ContextMenu").ContextMenuItems;
36
+ top: number;
37
+ left: number;
38
+ } | null;
39
+ showWelcomeScreen: boolean;
40
+ isLoading: boolean;
41
+ errorMessage: React.ReactNode;
42
+ activeEmbeddable: {
43
+ element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
44
+ state: "hover" | "active";
45
+ } | null;
46
+ newElement: NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
47
+ resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
48
+ multiElement: NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
49
+ selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
50
+ isBindingEnabled: boolean;
51
+ boxSelectionMode: import("../types").BoxSelectionMode;
52
+ bindingPreference: "enabled" | "disabled";
53
+ isMidpointSnappingEnabled: boolean;
54
+ startBoundElement: NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
55
+ suggestedBinding: {
56
+ element: NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
57
+ midPoint?: import("@excalidraw/math").GlobalPoint;
58
+ } | null;
59
+ frameToHighlight: NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
60
+ frameRendering: {
61
+ enabled: boolean;
62
+ name: boolean;
63
+ outline: boolean;
64
+ clip: boolean;
65
+ };
66
+ editingFrame: string | null;
67
+ elementsToHighlight: NonDeleted<ExcalidrawElement>[] | null;
68
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
69
+ preferredSelectionTool: {
70
+ type: "selection" | "lasso";
71
+ initialized: boolean;
72
+ };
73
+ penMode: boolean;
74
+ penDetected: boolean;
75
+ exportBackground: boolean;
76
+ exportEmbedScene: boolean;
77
+ exportWithDarkMode: boolean;
78
+ exportScale: number;
79
+ currentItemStrokeColor: string;
80
+ currentItemBackgroundColor: string;
81
+ currentItemFillStyle: ExcalidrawElement["fillStyle"];
82
+ currentItemStrokeWidth: number;
83
+ currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
84
+ currentItemRoughness: number;
85
+ currentItemOpacity: number;
86
+ currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
87
+ currentItemFontSize: number;
88
+ currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
89
+ currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
90
+ currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
91
+ currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
92
+ currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
93
+ viewBackgroundColor: string;
94
+ scrollX: number;
95
+ scrollY: number;
96
+ cursorButton: "up" | "down";
97
+ scrolledOutside: boolean;
98
+ isResizing: boolean;
99
+ isRotating: boolean;
100
+ zoom: import("../types").Zoom;
101
+ openMenu: "canvas" | null;
102
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
103
+ openSidebar: {
104
+ name: import("../types").SidebarName;
105
+ tab?: import("../types").SidebarTabName;
106
+ } | null;
107
+ openDialog: null | {
108
+ name: "imageExport" | "help" | "jsonExport";
109
+ } | {
110
+ name: "ttd";
111
+ tab: "text-to-diagram" | "mermaid";
112
+ } | {
113
+ name: "commandPalette";
114
+ } | {
115
+ name: "settings";
116
+ } | {
117
+ name: "elementLinkSelector";
118
+ sourceElementId: ExcalidrawElement["id"];
119
+ } | {
120
+ name: "charts";
121
+ data: import("../charts").Spreadsheet;
122
+ rawText: string;
123
+ };
124
+ defaultSidebarDockedPreference: boolean;
125
+ lastPointerDownWith: import("@excalidraw/element/types").PointerType;
126
+ selectedElementIds: Readonly<{
127
+ [id: string]: true;
128
+ }>;
129
+ hoveredElementIds: Readonly<{
130
+ [id: string]: true;
131
+ }>;
132
+ previousSelectedElementIds: {
133
+ [id: string]: true;
134
+ };
135
+ selectedElementsAreBeingDragged: boolean;
136
+ shouldCacheIgnoreZoom: boolean;
137
+ toast: {
138
+ message: React.ReactNode;
139
+ closable?: boolean;
140
+ duration?: number;
141
+ } | null;
142
+ gridStep: number;
143
+ selectedGroupIds: {
144
+ [groupId: string]: boolean;
145
+ };
146
+ editingGroupId: import("@excalidraw/element/types").GroupId | null;
147
+ fileHandle: FileSystemFileHandle | null;
148
+ collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
149
+ stats: {
150
+ open: boolean;
151
+ panels: number;
152
+ };
153
+ showHyperlinkPopup: false | "info" | "editor";
154
+ selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
155
+ snapLines: readonly import("../snapping").SnapLine[];
156
+ originSnapOffset: {
157
+ x: number;
158
+ y: number;
159
+ } | null;
160
+ userToFollow: import("../types").UserToFollow | null;
161
+ followedBy: Set<import("../types").SocketId>;
162
+ isCropping: boolean;
163
+ croppingElementId: ExcalidrawElement["id"] | null;
164
+ searchMatches: Readonly<{
165
+ focusedId: ExcalidrawElement["id"] | null;
166
+ matches: readonly import("../types").SearchMatch[];
167
+ }> | null;
168
+ activeLockedId: string | null;
169
+ lockedMultiSelections: {
170
+ [groupId: string]: true;
171
+ };
172
+ bindMode: import("@excalidraw/element/types").BindMode;
173
+ };
174
+ files: BinaryFiles;
7
175
  }>;
8
- export declare const loadFromJSON: (localAppState: AppState, localElements: readonly ExcalidrawElement[] | null) => Promise<import("./restore").RestoredDataState>;
9
176
  export declare const isValidExcalidrawData: (data?: {
10
177
  type?: any;
11
178
  elements?: any;