@excalidraw/math 0.18.0-4e471c107 → 0.18.0-4f68076

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 (370) hide show
  1. package/dist/dev/index.js +363 -163
  2. package/dist/dev/index.js.map +4 -4
  3. package/dist/prod/index.js +1 -1
  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 +81 -39
  8. package/dist/types/common/src/constants.d.ts +104 -33
  9. package/dist/types/common/src/editorInterface.d.ts +34 -0
  10. package/dist/types/common/src/font-metadata.d.ts +1 -3
  11. package/dist/types/common/src/index.d.ts +5 -0
  12. package/dist/types/common/src/keys.d.ts +5 -1
  13. package/dist/types/common/src/points.d.ts +1 -1
  14. package/dist/types/common/src/random.d.ts +7 -0
  15. package/dist/types/common/src/utility-types.d.ts +0 -1
  16. package/dist/types/common/src/utils.d.ts +52 -77
  17. package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
  18. package/dist/types/element/src/Scene.d.ts +18 -10
  19. package/dist/types/element/src/align.d.ts +3 -2
  20. package/dist/types/element/src/arrowEndpointText.d.ts +49 -0
  21. package/dist/types/element/src/arrowheads.d.ts +3 -0
  22. package/dist/types/element/src/arrows/focus.d.ts +30 -0
  23. package/dist/types/element/src/arrows/helpers.d.ts +5 -0
  24. package/dist/types/element/src/binding.d.ts +85 -51
  25. package/dist/types/element/src/bounds.d.ts +26 -19
  26. package/dist/types/element/src/bucketFill.d.ts +110 -0
  27. package/dist/types/element/src/collision.d.ts +17 -3
  28. package/dist/types/element/src/comparisons.d.ts +10 -7
  29. package/dist/types/element/src/convertToShape.d.ts +23 -0
  30. package/dist/types/element/src/delta.d.ts +39 -5
  31. package/dist/types/element/src/distribute.d.ts +4 -2
  32. package/dist/types/element/src/dragElements.d.ts +30 -3
  33. package/dist/types/element/src/duplicate.d.ts +67 -6
  34. package/dist/types/element/src/elbowArrow.d.ts +2 -0
  35. package/dist/types/element/src/embeddable.d.ts +2 -2
  36. package/dist/types/element/src/flowchart.d.ts +11 -7
  37. package/dist/types/element/src/fractionalIndex.d.ts +4 -4
  38. package/dist/types/element/src/frame.d.ts +16 -11
  39. package/dist/types/element/src/groups.d.ts +9 -8
  40. package/dist/types/element/src/heading.d.ts +2 -1
  41. package/dist/types/element/src/image.d.ts +1 -11
  42. package/dist/types/element/src/index.d.ts +11 -4
  43. package/dist/types/element/src/linearElementEditor.d.ts +50 -31
  44. package/dist/types/element/src/listMarker.d.ts +34 -0
  45. package/dist/types/element/src/mutateElement.d.ts +6 -2
  46. package/dist/types/element/src/newElement.d.ts +59 -9
  47. package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
  48. package/dist/types/element/src/renderElement.d.ts +23 -12
  49. package/dist/types/element/src/resizeElements.d.ts +12 -12
  50. package/dist/types/element/src/resizeTest.d.ts +6 -5
  51. package/dist/types/element/src/selection.d.ts +14 -14
  52. package/dist/types/element/src/shape.d.ts +36 -9
  53. package/dist/types/element/src/sizeHelpers.d.ts +6 -0
  54. package/dist/types/element/src/sortElements.d.ts +10 -0
  55. package/dist/types/element/src/stickyNote.d.ts +183 -0
  56. package/dist/types/element/src/store.d.ts +6 -1
  57. package/dist/types/element/src/textElement.d.ts +22 -11
  58. package/dist/types/element/src/textMeasurements.d.ts +1 -3
  59. package/dist/types/element/src/textWrapping.d.ts +26 -0
  60. package/dist/types/{excalidraw/data → element/src}/transform.d.ts +27 -8
  61. package/dist/types/element/src/transformHandles.d.ts +8 -27
  62. package/dist/types/element/src/typeChecks.d.ts +30 -31
  63. package/dist/types/element/src/types.d.ts +55 -20
  64. package/dist/types/element/src/utils.d.ts +22 -6
  65. package/dist/types/element/src/zindex.d.ts +7 -1
  66. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +248 -222
  67. package/dist/types/excalidraw/actions/actionAlign.d.ts +12 -13
  68. package/dist/types/excalidraw/actions/actionBoundText.d.ts +150 -133
  69. package/dist/types/excalidraw/actions/actionCanvas.d.ts +543 -1575
  70. package/dist/types/excalidraw/actions/actionClipboard.d.ts +177 -904
  71. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +73 -65
  72. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +237 -214
  73. package/dist/types/excalidraw/actions/actionDeselect.d.ts +182 -0
  74. package/dist/types/excalidraw/actions/actionDistribute.d.ts +4 -6
  75. package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +3 -4
  76. package/dist/types/excalidraw/actions/actionElementLink.d.ts +80 -78
  77. package/dist/types/excalidraw/actions/actionElementLock.d.ts +149 -132
  78. package/dist/types/excalidraw/actions/actionExport.d.ts +228 -1423
  79. package/dist/types/excalidraw/actions/actionFinalize.d.ts +11 -395
  80. package/dist/types/excalidraw/actions/actionFlip.d.ts +2 -3
  81. package/dist/types/excalidraw/actions/actionFrame.d.ts +359 -507
  82. package/dist/types/excalidraw/actions/actionGroup.d.ts +160 -151
  83. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +244 -191
  84. package/dist/types/excalidraw/actions/actionLink.d.ts +86 -78
  85. package/dist/types/excalidraw/actions/actionMenu.d.ts +75 -441
  86. package/dist/types/excalidraw/actions/actionNavigate.d.ts +18 -361
  87. package/dist/types/excalidraw/actions/actionProperties.d.ts +238 -2548
  88. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +80 -76
  89. package/dist/types/excalidraw/actions/actionStyles.d.ts +74 -65
  90. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +4 -4
  91. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +195 -0
  92. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +88 -81
  93. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +195 -0
  94. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +87 -79
  95. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +76 -75
  96. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +2 -2
  97. package/dist/types/excalidraw/actions/actionToggleShowHints.d.ts +197 -0
  98. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +86 -78
  99. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +87 -79
  100. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +87 -79
  101. package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -9
  102. package/dist/types/excalidraw/actions/colorTargets.d.ts +39 -0
  103. package/dist/types/excalidraw/actions/index.d.ts +6 -3
  104. package/dist/types/excalidraw/actions/manager.d.ts +1 -0
  105. package/dist/types/excalidraw/actions/register.d.ts +2 -2
  106. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  107. package/dist/types/excalidraw/actions/types.d.ts +11 -7
  108. package/dist/types/excalidraw/{animated-trail.d.ts → animatedTrail.d.ts} +4 -3
  109. package/dist/types/excalidraw/appState.d.ts +57 -26
  110. package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -0
  111. package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
  112. package/dist/types/excalidraw/charts/charts.helpers.d.ts +32 -0
  113. package/dist/types/excalidraw/charts/charts.line.d.ts +2 -0
  114. package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
  115. package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -0
  116. package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
  117. package/dist/types/excalidraw/charts/index.d.ts +7 -0
  118. package/dist/types/excalidraw/clipboard.d.ts +57 -19
  119. package/dist/types/excalidraw/components/Actions.d.ts +32 -14
  120. package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -1
  121. package/dist/types/excalidraw/components/App.arrowText.d.ts +70 -0
  122. package/dist/types/excalidraw/components/App.bucketFill.d.ts +48 -0
  123. package/dist/types/excalidraw/components/App.clipboard.d.ts +31 -0
  124. package/dist/types/excalidraw/components/App.cursor.d.ts +38 -0
  125. package/dist/types/excalidraw/components/App.d.ts +404 -155
  126. package/dist/types/excalidraw/components/App.drawshape.d.ts +55 -0
  127. package/dist/types/excalidraw/components/App.duplicate.d.ts +101 -0
  128. package/dist/types/excalidraw/components/App.flowchart.d.ts +21 -0
  129. package/dist/types/excalidraw/components/App.modifiers.d.ts +38 -0
  130. package/dist/types/excalidraw/components/App.pan.d.ts +62 -0
  131. package/dist/types/excalidraw/components/App.selectionTool.d.ts +57 -0
  132. package/dist/types/excalidraw/components/App.text.d.ts +146 -0
  133. package/dist/types/excalidraw/components/App.textTool.d.ts +140 -0
  134. package/dist/types/excalidraw/components/App.toolDrag.d.ts +63 -0
  135. package/dist/types/excalidraw/components/App.viewport.d.ts +113 -0
  136. package/dist/types/excalidraw/components/App.wheel.d.ts +26 -0
  137. package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
  138. package/dist/types/excalidraw/components/Card.d.ts +1 -3
  139. package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -4
  140. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +9 -4
  141. package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +3 -1
  142. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +7 -1
  143. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +10 -2
  144. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +5 -2
  145. package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +8 -1
  146. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -2
  147. package/dist/types/excalidraw/components/ColorPicker/colorTopPicksDnD.d.ts +11 -0
  148. package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -2
  149. package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
  150. package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -2
  151. package/dist/types/excalidraw/components/CommandPalette/types.d.ts +2 -4
  152. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +4 -4
  153. package/dist/types/excalidraw/components/CursorHint.d.ts +46 -0
  154. package/dist/types/excalidraw/components/DarkModeToggle.d.ts +1 -1
  155. package/dist/types/excalidraw/components/DefaultSidebar.d.ts +9 -13
  156. package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +1 -1
  157. package/dist/types/excalidraw/components/Ellipsify.d.ts +3 -0
  158. package/dist/types/excalidraw/components/ErrorDialog.d.ts +1 -1
  159. package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -2
  160. package/dist/types/excalidraw/components/FileDropOverlay.d.ts +2 -0
  161. package/dist/types/excalidraw/components/FilledButton.d.ts +2 -1
  162. package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +5 -1
  163. package/dist/types/excalidraw/components/FontPicker/FontPickerList.d.ts +6 -1
  164. package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
  165. package/dist/types/excalidraw/components/FontPicker/fontTopPicksDnD.d.ts +12 -0
  166. package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +0 -1
  167. package/dist/types/excalidraw/components/HelpDialog.d.ts +1 -1
  168. package/dist/types/excalidraw/components/HintViewer.d.ts +4 -3
  169. package/dist/types/excalidraw/components/IconButton.d.ts +48 -0
  170. package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
  171. package/dist/types/excalidraw/components/InlineIcon.d.ts +3 -1
  172. package/dist/types/excalidraw/components/Island.d.ts +7 -0
  173. package/dist/types/excalidraw/components/LaserPointerButton.d.ts +2 -4
  174. package/dist/types/excalidraw/components/LayerUI.d.ts +6 -2
  175. package/dist/types/excalidraw/components/LibraryMenu.d.ts +1 -1
  176. package/dist/types/excalidraw/components/LibraryMenuControlButtons.d.ts +1 -1
  177. package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +1 -2
  178. package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +7 -3
  179. package/dist/types/excalidraw/components/LibraryUnit.d.ts +9 -5
  180. package/dist/types/excalidraw/components/LoadingMessage.d.ts +0 -1
  181. package/dist/types/excalidraw/components/LockButton.d.ts +3 -4
  182. package/dist/types/excalidraw/components/MagicButton.d.ts +0 -2
  183. package/dist/types/excalidraw/components/MobileMenu.d.ts +5 -7
  184. package/dist/types/excalidraw/components/MobileToolbar.d.ts +9 -0
  185. package/dist/types/excalidraw/components/Modal.d.ts +0 -1
  186. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +1 -1
  187. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
  188. package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
  189. package/dist/types/excalidraw/components/PenModeButton.d.ts +2 -5
  190. package/dist/types/excalidraw/components/Popover.d.ts +2 -3
  191. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +2 -1
  192. package/dist/types/excalidraw/components/{ButtonIcon.d.ts → RadioButton.d.ts} +2 -5
  193. package/dist/types/excalidraw/components/RadioGroup.d.ts +0 -1
  194. package/dist/types/excalidraw/components/RadioSelection.d.ts +4 -4
  195. package/dist/types/excalidraw/components/Range.d.ts +10 -4
  196. package/dist/types/excalidraw/components/SVGLayer.d.ts +1 -1
  197. package/dist/types/excalidraw/components/ScrollableList.d.ts +0 -1
  198. package/dist/types/excalidraw/components/SearchMenu.d.ts +1 -1
  199. package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +16 -22
  200. package/dist/types/excalidraw/components/Sidebar/SidebarHeader.d.ts +1 -1
  201. package/dist/types/excalidraw/components/Sidebar/SidebarTab.d.ts +1 -2
  202. package/dist/types/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +1 -2
  203. package/dist/types/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +1 -2
  204. package/dist/types/excalidraw/components/Sidebar/SidebarTabs.d.ts +1 -2
  205. package/dist/types/excalidraw/components/Spinner.d.ts +4 -4
  206. package/dist/types/excalidraw/components/Stats/Angle.d.ts +2 -2
  207. package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +0 -1
  208. package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +0 -1
  209. package/dist/types/excalidraw/components/Stats/Dimension.d.ts +2 -2
  210. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +2 -3
  211. package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +2 -2
  212. package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +2 -2
  213. package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +2 -2
  214. package/dist/types/excalidraw/components/Stats/Position.d.ts +3 -3
  215. package/dist/types/excalidraw/components/Stats/index.d.ts +7 -8
  216. package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
  217. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatHistoryMenu.d.ts +15 -0
  218. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatInterface.d.ts +23 -0
  219. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatMessage.d.ts +14 -0
  220. package/dist/types/excalidraw/components/TTDDialog/Chat/TTDChatPanel.d.ts +27 -0
  221. package/dist/types/excalidraw/components/TTDDialog/Chat/index.d.ts +3 -0
  222. package/dist/types/excalidraw/components/TTDDialog/Chat/useChatAgent.d.ts +8 -0
  223. package/dist/types/excalidraw/components/TTDDialog/CodeMirrorEditor.d.ts +11 -0
  224. package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +3 -2
  225. package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +13 -0
  226. package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +12 -29
  227. package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +3 -3
  228. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +5 -2
  229. package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +13 -9
  230. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +1 -2
  231. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +1 -2
  232. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +1 -2
  233. package/dist/types/excalidraw/components/TTDDialog/TTDPreviewPanel.d.ts +9 -0
  234. package/dist/types/excalidraw/components/TTDDialog/TTDWelcomeMessage.d.ts +1 -0
  235. package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +9 -0
  236. package/dist/types/excalidraw/components/TTDDialog/common.d.ts +16 -16
  237. package/dist/types/excalidraw/components/TTDDialog/hooks/useChatManagement.d.ts +13 -0
  238. package/dist/types/excalidraw/components/TTDDialog/hooks/useMermaidRenderer.d.ts +14 -0
  239. package/dist/types/excalidraw/components/TTDDialog/hooks/useTextGeneration.d.ts +7 -0
  240. package/dist/types/excalidraw/components/TTDDialog/mermaid-lang-lite.d.ts +2 -0
  241. package/dist/types/excalidraw/components/TTDDialog/types.d.ts +95 -0
  242. package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +22 -0
  243. package/dist/types/excalidraw/components/TTDDialog/utils/chat.d.ts +10 -0
  244. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidAutoFix.d.ts +1 -0
  245. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +10 -0
  246. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidValidation.d.ts +1 -0
  247. package/dist/types/excalidraw/components/TextField.d.ts +1 -0
  248. package/dist/types/excalidraw/components/Toast.d.ts +11 -7
  249. package/dist/types/excalidraw/components/ToolPopover.d.ts +22 -0
  250. package/dist/types/excalidraw/components/Toolbar.d.ts +11 -0
  251. package/dist/types/excalidraw/components/Tools.d.ts +151 -0
  252. package/dist/types/excalidraw/components/Tooltip.d.ts +15 -1
  253. package/dist/types/excalidraw/components/TopPicksDnD/TopPicksContextMenu.d.ts +14 -0
  254. package/dist/types/excalidraw/components/TopPicksDnD/TopPicksTip.d.ts +11 -0
  255. package/dist/types/excalidraw/components/TopPicksDnD/topPicksDnD.d.ts +58 -0
  256. package/dist/types/excalidraw/components/Trans.d.ts +2 -2
  257. package/dist/types/excalidraw/components/UserList.d.ts +3 -2
  258. package/dist/types/excalidraw/components/ViewportStatusFrame/ViewportStatusFrame.d.ts +11 -0
  259. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +10 -4
  260. package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +3 -0
  261. package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
  262. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +47 -35
  263. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +7 -5
  264. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +3 -3
  265. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +13 -22
  266. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCheckbox.d.ts +5 -0
  267. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +5 -4
  268. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -2
  269. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +2 -2
  270. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +6 -6
  271. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSub.d.ts +23 -0
  272. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubContent.d.ts +8 -0
  273. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubTrigger.d.ts +12 -0
  274. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +3 -4
  275. package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +2 -2
  276. package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -0
  277. package/dist/types/excalidraw/components/footer/Footer.d.ts +3 -1
  278. package/dist/types/excalidraw/components/hoc/withInternalFallback.d.ts +1 -1
  279. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +3 -3
  280. package/dist/types/excalidraw/components/icons.d.ts +56 -22
  281. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +26 -3
  282. package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +39 -35
  283. package/dist/types/excalidraw/components/positionElementBesideCursor.d.ts +26 -0
  284. package/dist/types/excalidraw/components/shapeActionPredicates.d.ts +39 -0
  285. package/dist/types/excalidraw/data/blob.d.ts +373 -12
  286. package/dist/types/excalidraw/data/encode.d.ts +4 -4
  287. package/dist/types/excalidraw/data/encryption.d.ts +5 -5
  288. package/dist/types/excalidraw/data/filesystem.d.ts +5 -7
  289. package/dist/types/excalidraw/data/index.d.ts +8 -9
  290. package/dist/types/excalidraw/data/json.d.ts +192 -3
  291. package/dist/types/excalidraw/data/library.d.ts +25 -10
  292. package/dist/types/excalidraw/data/resave.d.ts +7 -2
  293. package/dist/types/excalidraw/data/restore.d.ts +27 -7
  294. package/dist/types/excalidraw/data/types.d.ts +4 -1
  295. package/dist/types/excalidraw/drawShapeTrail.d.ts +16 -0
  296. package/dist/types/excalidraw/editor-jotai.d.ts +11 -11
  297. package/dist/types/excalidraw/eraser/index.d.ts +2 -3
  298. package/dist/types/excalidraw/errors.d.ts +14 -0
  299. package/dist/types/excalidraw/fonts/Fonts.d.ts +3 -2
  300. package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +29 -0
  301. package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +2 -2
  302. package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +4 -3
  303. package/dist/types/excalidraw/hooks/useScrollPosition.d.ts +1 -2
  304. package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
  305. package/dist/types/excalidraw/i18n.d.ts +2 -2
  306. package/dist/types/excalidraw/{laser-trails.d.ts → laserTrails.d.ts} +5 -7
  307. package/dist/types/excalidraw/lasso/index.d.ts +2 -3
  308. package/dist/types/excalidraw/lasso/utils.d.ts +2 -0
  309. package/dist/types/excalidraw/renderOverrides.d.ts +9 -0
  310. package/dist/types/excalidraw/renderer/animation.d.ts +16 -0
  311. package/dist/types/excalidraw/renderer/helpers.d.ts +31 -8
  312. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +7 -15
  313. package/dist/types/excalidraw/renderer/staticScene.d.ts +4 -1
  314. package/dist/types/excalidraw/scene/Renderer.d.ts +491 -19
  315. package/dist/types/excalidraw/scene/export.d.ts +4 -4
  316. package/dist/types/excalidraw/scene/index.d.ts +2 -2
  317. package/dist/types/excalidraw/scene/types.d.ts +28 -8
  318. package/dist/types/excalidraw/shortcut.d.ts +1 -0
  319. package/dist/types/excalidraw/snapping.d.ts +12 -12
  320. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-bindings.d.ts +1 -1
  321. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-loader.d.ts +1 -1
  322. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-wasm.d.ts +1 -1
  323. package/dist/types/excalidraw/subset/woff2/woff2-loader.d.ts +2 -2
  324. package/dist/types/excalidraw/subset/woff2/woff2-wasm.d.ts +1 -1
  325. package/dist/types/excalidraw/textAutoResizeHandle.d.ts +15 -0
  326. package/dist/types/excalidraw/types.d.ts +658 -64
  327. package/dist/types/excalidraw/viewport.d.ts +302 -0
  328. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +19 -5
  329. package/dist/types/fractional-indexing/src/index.d.ts +29 -0
  330. package/dist/types/laser-pointer/src/index.d.ts +2 -0
  331. package/dist/types/laser-pointer/src/math.d.ts +16 -0
  332. package/dist/types/laser-pointer/src/simplify.d.ts +2 -0
  333. package/dist/types/laser-pointer/src/state.d.ts +36 -0
  334. package/dist/types/math/src/constants.d.ts +0 -1
  335. package/dist/types/math/src/curve.d.ts +23 -13
  336. package/dist/types/math/src/index.d.ts +1 -0
  337. package/dist/types/math/src/pca.d.ts +79 -0
  338. package/dist/types/math/src/point.d.ts +8 -2
  339. package/dist/types/math/src/polygon.d.ts +26 -2
  340. package/dist/types/math/src/range.d.ts +1 -3
  341. package/dist/types/math/src/segment.d.ts +10 -3
  342. package/dist/types/math/src/types.d.ts +25 -1
  343. package/dist/types/utils/src/export.d.ts +9 -8
  344. package/dist/types/utils/src/index.d.ts +1 -2
  345. package/dist/types/utils/src/shape.d.ts +8 -8
  346. package/package.json +2 -2
  347. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +0 -186
  348. package/dist/types/excalidraw/animation-frame-handler.d.ts +0 -16
  349. package/dist/types/excalidraw/charts.d.ts +0 -27
  350. package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
  351. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -16
  352. package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +0 -10
  353. package/dist/types/excalidraw/components/HandButton.d.ts +0 -10
  354. package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
  355. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -9
  356. package/dist/types/excalidraw/components/ToolButton.d.ts +0 -49
  357. package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
  358. package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -10
  359. package/dist/types/excalidraw/components/shapes.d.ts +0 -62
  360. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
  361. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
  362. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -85
  363. package/dist/types/excalidraw/cursor.d.ts +0 -5
  364. package/dist/types/excalidraw/data/reconcile.d.ts +0 -6
  365. package/dist/types/excalidraw/index.d.ts +0 -46
  366. package/dist/types/excalidraw/polyfill.d.ts +0 -2
  367. package/dist/types/excalidraw/scene/scroll.d.ts +0 -23
  368. package/dist/types/excalidraw/scene/zoom.d.ts +0 -12
  369. package/dist/types/utils/src/bbox.d.ts +0 -9
  370. package/dist/types/utils/src/withinBounds.d.ts +0 -19
@@ -35,11 +35,14 @@ export declare const ClearCanvas: {
35
35
  export declare const ToggleTheme: {
36
36
  (props: {
37
37
  allowSystemTheme: true;
38
+ /**
39
+ * Controls the theme of this UI component only.
40
+ * You should subscribe to `props.onThemeChange` and control the theme
41
+ * upstream.
42
+ */
38
43
  theme: Theme | "system";
39
- onSelect: (theme: Theme | "system") => void;
40
44
  } | {
41
- allowSystemTheme?: false | undefined;
42
- onSelect?: ((theme: Theme) => void) | undefined;
45
+ allowSystemTheme: false;
43
46
  }): import("react/jsx-runtime").JSX.Element | null;
44
47
  displayName: string;
45
48
  };
@@ -62,3 +65,23 @@ export declare const LiveCollaborationTrigger: {
62
65
  }): import("react/jsx-runtime").JSX.Element;
63
66
  displayName: string;
64
67
  };
68
+ export declare const PreferencesToggleGridModeItem: () => import("react/jsx-runtime").JSX.Element;
69
+ export declare const PreferencesToggleZenModeItem: () => import("react/jsx-runtime").JSX.Element;
70
+ export declare const Preferences: {
71
+ ({ children, additionalItems, }: {
72
+ children?: React.ReactNode;
73
+ additionalItems?: React.ReactNode;
74
+ }): import("react/jsx-runtime").JSX.Element;
75
+ ToggleToolLock: () => import("react/jsx-runtime").JSX.Element;
76
+ BoxSelectionMode: () => import("react/jsx-runtime").JSX.Element;
77
+ InputDevice: () => import("react/jsx-runtime").JSX.Element;
78
+ ToggleSnapMode: () => import("react/jsx-runtime").JSX.Element;
79
+ ToggleArrowBinding: () => import("react/jsx-runtime").JSX.Element;
80
+ ToggleMidpointSnapping: () => import("react/jsx-runtime").JSX.Element;
81
+ ToggleShowHints: () => import("react/jsx-runtime").JSX.Element;
82
+ ToggleGridMode: () => import("react/jsx-runtime").JSX.Element;
83
+ ToggleZenMode: () => import("react/jsx-runtime").JSX.Element;
84
+ ToggleViewMode: () => import("react/jsx-runtime").JSX.Element | null;
85
+ ToggleElementProperties: () => import("react/jsx-runtime").JSX.Element;
86
+ displayName: string;
87
+ };
@@ -5,43 +5,25 @@ declare const MainMenu: React.FC<{
5
5
  /**
6
6
  * Called when any menu item is selected (clicked on).
7
7
  */
8
- onSelect?: ((event: Event) => void) | undefined;
8
+ onSelect?: (event: Event) => void;
9
9
  } & {
10
- __fallback?: boolean | undefined;
10
+ __fallback?: boolean;
11
11
  }> & {
12
12
  Trigger: {
13
13
  ({ className, children, onToggle, title, ...rest }: {
14
- className?: string | undefined;
14
+ className?: string;
15
15
  children: React.ReactNode;
16
16
  onToggle: () => void;
17
- title?: string | undefined;
17
+ title?: string;
18
18
  } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): import("react/jsx-runtime").JSX.Element;
19
19
  displayName: string;
20
20
  };
21
21
  Item: {
22
- ({ icon, value, order, children, shortcut, className, hovered, selected, textStyle, onSelect, onClick, ...rest }: {
23
- icon?: React.JSX.Element | undefined;
24
- value?: string | number | undefined;
25
- order?: number | undefined;
26
- onSelect?: ((event: Event) => void) | undefined;
27
- children: React.ReactNode;
28
- /**
29
- * Called when any menu item is selected (clicked on).
30
- */
31
- shortcut?: string | undefined;
32
- hovered?: boolean | undefined;
33
- selected?: boolean | undefined;
34
- textStyle?: React.CSSProperties | undefined;
35
- className?: string | undefined;
36
- } & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "onSelect">): import("react/jsx-runtime").JSX.Element;
22
+ ({ icon, badge, value, children, shortcut, className, selected, onSelect, ...rest }: import("../dropdownMenu/DropdownMenuItem").DropdownMenuItemProps): import("react/jsx-runtime").JSX.Element;
37
23
  displayName: string;
38
24
  Badge: {
39
25
  ({ type, children, }: {
40
- type?: import("../../../common/src/utility-types").ValueOf<{
41
- readonly GREEN: "green";
42
- readonly RED: "red";
43
- readonly BLUE: "blue";
44
- }> | undefined;
26
+ type?: import("@excalidraw/common/utility-types").ValueOf<typeof import("../dropdownMenu/DropdownMenuItem").DropDownMenuItemBadgeType>;
45
27
  children: React.ReactNode;
46
28
  }): import("react/jsx-runtime").JSX.Element;
47
29
  displayName: string;
@@ -50,27 +32,27 @@ declare const MainMenu: React.FC<{
50
32
  ItemLink: {
51
33
  ({ icon, shortcut, href, children, onSelect, className, selected, rel, ...rest }: {
52
34
  href: string;
53
- icon?: React.JSX.Element | undefined;
35
+ icon?: React.JSX.Element;
54
36
  children: React.ReactNode;
55
- shortcut?: string | undefined;
56
- className?: string | undefined;
57
- selected?: boolean | undefined;
58
- onSelect?: ((event: Event) => void) | undefined;
59
- rel?: string | undefined;
37
+ shortcut?: string;
38
+ className?: string;
39
+ selected?: boolean;
40
+ onSelect?: (event: Event) => void;
41
+ rel?: string;
60
42
  } & React.AnchorHTMLAttributes<HTMLAnchorElement>): import("react/jsx-runtime").JSX.Element;
61
43
  displayName: string;
62
44
  };
63
45
  ItemCustom: ({ children, className, selected, ...rest }: {
64
46
  children: React.ReactNode;
65
- className?: string | undefined;
66
- selected?: boolean | undefined;
47
+ className?: string;
48
+ selected?: boolean;
67
49
  } & React.HTMLAttributes<HTMLDivElement>) => import("react/jsx-runtime").JSX.Element;
68
50
  Group: {
69
51
  ({ children, className, style, title, }: {
70
52
  children: React.ReactNode;
71
- className?: string | undefined;
72
- style?: React.CSSProperties | undefined;
73
- title?: string | undefined;
53
+ className?: string;
54
+ style?: React.CSSProperties;
55
+ title?: string;
74
56
  }): import("react/jsx-runtime").JSX.Element;
75
57
  displayName: string;
76
58
  };
@@ -78,6 +60,28 @@ declare const MainMenu: React.FC<{
78
60
  (): import("react/jsx-runtime").JSX.Element;
79
61
  displayName: string;
80
62
  };
63
+ Sub: {
64
+ ({ children }: {
65
+ children?: React.ReactNode;
66
+ }): import("react/jsx-runtime").JSX.Element;
67
+ Trigger: {
68
+ ({ children, icon, shortcut, className, }: {
69
+ children: React.ReactNode;
70
+ icon?: React.JSX.Element;
71
+ shortcut?: string;
72
+ className?: string;
73
+ }): import("react/jsx-runtime").JSX.Element;
74
+ displayName: string;
75
+ };
76
+ Content: {
77
+ ({ children, className, }: {
78
+ children?: React.ReactNode;
79
+ className?: string;
80
+ }): import("react/jsx-runtime").JSX.Element;
81
+ displayName: string;
82
+ };
83
+ displayName: string;
84
+ };
81
85
  DefaultItems: typeof DefaultItems;
82
86
  };
83
87
  export default MainMenu;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Positions an element beside a cursor within a container, flipping the
3
+ * element to the other side of the cursor when it would overflow the
4
+ * container, resolved independently on each axis.
5
+ *
6
+ * Takes the cursor in client (viewport) coordinates and returns
7
+ * container-local coordinates.
8
+ */
9
+ export declare const positionElementBesideCursor: ({ cursor, element, container, gap, }: {
10
+ /** client (viewport) coordinates */
11
+ cursor: {
12
+ x: number;
13
+ y: number;
14
+ };
15
+ element: {
16
+ width: number;
17
+ height: number;
18
+ };
19
+ /** the container's bounding client rect */
20
+ container: Pick<DOMRect, "left" | "top" | "width" | "height">;
21
+ /** distance between the cursor and the positioned element */
22
+ gap: number;
23
+ }) => {
24
+ left: number;
25
+ top: number;
26
+ };
@@ -0,0 +1,39 @@
1
+ import type { ElementsMap, ExcalidrawElement, NonDeletedElementsMap, NonDeletedSceneElementsMap } from "@excalidraw/element/types";
2
+ import type { AppClassProperties, UIAppState } from "../types";
3
+ export declare const canChangeStrokeColor: (appState: UIAppState, targetElements: ExcalidrawElement[]) => boolean;
4
+ export declare const canChangeBackgroundColor: (appState: UIAppState, targetElements: ExcalidrawElement[], elementsMap: ElementsMap) => boolean;
5
+ /**
6
+ * Single source of truth for "which shape-action controls are relevant right
7
+ * now". Each flag answers whether a given control should be shown, given the
8
+ * active tool and the current selection. All three styles-panel layouts
9
+ * (full / compact / mobile) and the compact popovers consume these flags so
10
+ * that visibility logic lives in one place and layout stays pure.
11
+ */
12
+ export declare const getShapeActionPredicates: (appState: UIAppState, targetElements: ExcalidrawElement[], elementsMap: NonDeletedElementsMap | NonDeletedSceneElementsMap, app: AppClassProperties) => {
13
+ /** some element(s) selected */
14
+ hasSelection: boolean;
15
+ /** actions on selected elements (delete/duplicate/...) */
16
+ showExtraActions: boolean;
17
+ strokeColor: boolean;
18
+ backgroundColor: boolean;
19
+ fill: boolean;
20
+ strokeWidth: boolean;
21
+ freedrawMode: boolean;
22
+ strokeStyle: boolean;
23
+ sloppiness: boolean;
24
+ roundness: boolean;
25
+ arrowType: boolean;
26
+ arrowheads: boolean;
27
+ text: boolean;
28
+ textAlign: boolean;
29
+ verticalAlign: boolean;
30
+ opacity: boolean;
31
+ layers: boolean;
32
+ align: boolean;
33
+ distribute: boolean;
34
+ link: boolean;
35
+ linkSingleOnly: boolean;
36
+ cropEditor: boolean;
37
+ lineEditor: boolean;
38
+ };
39
+ export type ShapeActionPredicates = ReturnType<typeof getShapeActionPredicates>;
@@ -2,24 +2,389 @@ 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 "./filesystem";
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
+ viewBackgroundColor: string;
24
+ theme: import("@excalidraw/element/types").Theme;
25
+ frameRendering: {
26
+ enabled: boolean;
27
+ name: boolean;
28
+ outline: boolean;
29
+ clip: boolean;
30
+ };
31
+ name: string | null;
32
+ zoom: import("../types").Zoom;
33
+ scrollX: number;
34
+ scrollY: number;
35
+ viewModeEnabled: boolean;
36
+ openDialog: null | {
37
+ name: "imageExport" | "help" | "jsonExport";
38
+ } | {
39
+ name: "ttd";
40
+ tab: "text-to-diagram" | "mermaid";
41
+ } | {
42
+ name: "commandPalette";
43
+ } | {
44
+ name: "settings";
45
+ } | {
46
+ name: "elementLinkSelector";
47
+ sourceElementId: ExcalidrawElement["id"];
48
+ } | {
49
+ name: "charts";
50
+ data: import("../charts").Spreadsheet;
51
+ rawText: string;
52
+ };
53
+ editingGroupId: import("@excalidraw/element/types").GroupId | null;
54
+ selectedElementIds: Readonly<{
55
+ [id: string]: true;
56
+ }>;
57
+ frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
58
+ activeTool: {
59
+ lastActiveTool: import("../types").ActiveTool | null;
60
+ locked: boolean;
61
+ fromSelection: boolean;
62
+ } & import("../types").ActiveTool;
63
+ activeEmbeddable: {
64
+ element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
65
+ state: "hover" | "active";
66
+ } | null;
67
+ selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
68
+ selectedGroupIds: {
69
+ [groupId: string]: boolean;
70
+ };
71
+ selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
72
+ multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
73
+ newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
74
+ isBindingEnabled: boolean;
75
+ isMidpointSnappingEnabled: boolean;
76
+ gridModeEnabled: boolean;
77
+ suggestedBinding: {
78
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
79
+ midPoint?: import("@excalidraw/math").GlobalPoint;
80
+ } | null;
81
+ textToolHover: {
82
+ type: "text";
83
+ elementId: ExcalidrawElement["id"];
84
+ } | {
85
+ type: "container";
86
+ elementId: ExcalidrawElement["id"];
87
+ } | {
88
+ type: "arrow";
89
+ elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
90
+ anchor: "start" | "end" | "label";
91
+ } | null;
92
+ isRotating: boolean;
93
+ elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
94
+ collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
95
+ snapLines: readonly import("../snapping").SnapLine[];
96
+ zenModeEnabled: boolean;
97
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
98
+ isCropping: boolean;
99
+ croppingElementId: ExcalidrawElement["id"] | null;
100
+ searchMatches: Readonly<{
101
+ focusedId: ExcalidrawElement["id"] | null;
102
+ matches: readonly import("../types").SearchMatch[];
103
+ }> | null;
104
+ activeLockedId: string | null;
105
+ hoveredElementIds: Readonly<{
106
+ [id: string]: true;
107
+ }>;
108
+ shouldCacheIgnoreZoom: boolean;
109
+ exportScale: number;
110
+ currentItemArrowType: "sharp" | "round" | "elbow";
111
+ gridSize: number;
112
+ bindMode: import("@excalidraw/element/types").BindMode;
113
+ contextMenu: {
114
+ items: import("../components/ContextMenu").ContextMenuItems;
115
+ top: number;
116
+ left: number;
117
+ } | null;
118
+ showWelcomeScreen: boolean;
119
+ isLoading: boolean;
120
+ errorMessage: React.ReactNode;
121
+ resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
122
+ boxSelectionMode: import("../types").BoxSelectionMode;
123
+ bindingPreference: "enabled" | "disabled";
124
+ showHints: boolean;
125
+ inputDevice: import("../types").InputDevice;
126
+ editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
127
+ preferredSelectionTool: {
128
+ type: "selection" | "lasso";
129
+ initialized: boolean;
130
+ };
131
+ penMode: boolean;
132
+ penDetected: boolean;
133
+ exportBackground: boolean;
134
+ exportEmbedScene: boolean;
135
+ exportWithDarkMode: boolean;
136
+ currentItemStrokeColor: string;
137
+ currentItemStickynoteStrokeColor: string;
138
+ currentItemStickynoteBackgroundColor: string;
139
+ currentItemBackgroundColor: string;
140
+ currentItemFillStyle: ExcalidrawElement["fillStyle"];
141
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
142
+ currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
143
+ currentItemRoughness: number;
144
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
145
+ currentItemOpacity: number;
146
+ currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
147
+ currentItemFontSize: number;
148
+ currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
149
+ currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
150
+ currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
151
+ currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
152
+ currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
153
+ scrollConstraints: import("../types").ScrollConstraints | null;
154
+ cursorButton: "up" | "down";
155
+ scrolledOutside: boolean;
156
+ isResizing: boolean;
157
+ openMenu: "canvas" | null;
158
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
159
+ openSidebar: {
160
+ name: import("../types").SidebarName;
161
+ tab?: import("../types").SidebarTabName;
162
+ } | null;
163
+ defaultSidebarDockedPreference: boolean;
164
+ lastPointerDownWith: import("@excalidraw/element/types").PointerType;
165
+ previousSelectedElementIds: {
166
+ [id: string]: true;
167
+ };
168
+ selectedElementsAreBeingDragged: boolean;
169
+ toast: {
170
+ message: React.ReactNode;
171
+ closable?: boolean;
172
+ duration?: number;
173
+ } | null;
174
+ gridStep: number;
175
+ fileHandle: FileSystemFileHandle | null;
176
+ stats: {
177
+ open: boolean;
178
+ panels: number;
179
+ };
180
+ showHyperlinkPopup: false | "info" | "editor";
181
+ originSnapOffset: {
182
+ x: number;
183
+ y: number;
184
+ } | null;
185
+ objectsSnapModeEnabled: boolean;
186
+ lockedMultiSelections: {
187
+ [groupId: string]: true;
188
+ };
189
+ colorTopPicks: {
190
+ elementStroke: readonly string[] | null;
191
+ elementBackground: readonly string[] | null;
192
+ bucketFill: readonly string[] | null;
193
+ stickyNoteStroke: readonly string[] | null;
194
+ stickyNoteBackground: readonly string[] | null;
195
+ };
196
+ fontTopPicks: readonly import("@excalidraw/element/types").FontFamilyValues[] | null;
197
+ };
198
+ files: import("../types").BinaryFiles;
199
+ };
18
200
  } | {
19
201
  type: "application/vnd.excalidrawlib+json";
20
202
  data: ImportedLibraryData;
21
203
  }>;
22
- export declare const loadFromBlob: (blob: Blob, localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null, fileHandle?: FileSystemHandle | null) => Promise<import("./restore").RestoredDataState>;
204
+ export declare const loadFromBlob: (blob: Blob,
205
+ /** @see restore.localAppState */
206
+ localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null,
207
+ /** FileSystemFileHandle. Defaults to `blob.handle` if defined, otherwise null. */
208
+ fileHandle?: FileSystemFileHandle | null) => Promise<{
209
+ elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
210
+ appState: {
211
+ viewBackgroundColor: string;
212
+ theme: import("@excalidraw/element/types").Theme;
213
+ frameRendering: {
214
+ enabled: boolean;
215
+ name: boolean;
216
+ outline: boolean;
217
+ clip: boolean;
218
+ };
219
+ name: string | null;
220
+ zoom: import("../types").Zoom;
221
+ scrollX: number;
222
+ scrollY: number;
223
+ viewModeEnabled: boolean;
224
+ openDialog: null | {
225
+ name: "imageExport" | "help" | "jsonExport";
226
+ } | {
227
+ name: "ttd";
228
+ tab: "text-to-diagram" | "mermaid";
229
+ } | {
230
+ name: "commandPalette";
231
+ } | {
232
+ name: "settings";
233
+ } | {
234
+ name: "elementLinkSelector";
235
+ sourceElementId: ExcalidrawElement["id"];
236
+ } | {
237
+ name: "charts";
238
+ data: import("../charts").Spreadsheet;
239
+ rawText: string;
240
+ };
241
+ editingGroupId: import("@excalidraw/element/types").GroupId | null;
242
+ selectedElementIds: Readonly<{
243
+ [id: string]: true;
244
+ }>;
245
+ frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
246
+ activeTool: {
247
+ lastActiveTool: import("../types").ActiveTool | null;
248
+ locked: boolean;
249
+ fromSelection: boolean;
250
+ } & import("../types").ActiveTool;
251
+ activeEmbeddable: {
252
+ element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
253
+ state: "hover" | "active";
254
+ } | null;
255
+ selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
256
+ selectedGroupIds: {
257
+ [groupId: string]: boolean;
258
+ };
259
+ selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
260
+ multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
261
+ newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
262
+ isBindingEnabled: boolean;
263
+ isMidpointSnappingEnabled: boolean;
264
+ gridModeEnabled: boolean;
265
+ suggestedBinding: {
266
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
267
+ midPoint?: import("@excalidraw/math").GlobalPoint;
268
+ } | null;
269
+ textToolHover: {
270
+ type: "text";
271
+ elementId: ExcalidrawElement["id"];
272
+ } | {
273
+ type: "container";
274
+ elementId: ExcalidrawElement["id"];
275
+ } | {
276
+ type: "arrow";
277
+ elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
278
+ anchor: "start" | "end" | "label";
279
+ } | null;
280
+ isRotating: boolean;
281
+ elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
282
+ collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
283
+ snapLines: readonly import("../snapping").SnapLine[];
284
+ zenModeEnabled: boolean;
285
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
286
+ isCropping: boolean;
287
+ croppingElementId: ExcalidrawElement["id"] | null;
288
+ searchMatches: Readonly<{
289
+ focusedId: ExcalidrawElement["id"] | null;
290
+ matches: readonly import("../types").SearchMatch[];
291
+ }> | null;
292
+ activeLockedId: string | null;
293
+ hoveredElementIds: Readonly<{
294
+ [id: string]: true;
295
+ }>;
296
+ shouldCacheIgnoreZoom: boolean;
297
+ exportScale: number;
298
+ currentItemArrowType: "sharp" | "round" | "elbow";
299
+ gridSize: number;
300
+ bindMode: import("@excalidraw/element/types").BindMode;
301
+ contextMenu: {
302
+ items: import("../components/ContextMenu").ContextMenuItems;
303
+ top: number;
304
+ left: number;
305
+ } | null;
306
+ showWelcomeScreen: boolean;
307
+ isLoading: boolean;
308
+ errorMessage: React.ReactNode;
309
+ resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
310
+ boxSelectionMode: import("../types").BoxSelectionMode;
311
+ bindingPreference: "enabled" | "disabled";
312
+ showHints: boolean;
313
+ inputDevice: import("../types").InputDevice;
314
+ editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
315
+ preferredSelectionTool: {
316
+ type: "selection" | "lasso";
317
+ initialized: boolean;
318
+ };
319
+ penMode: boolean;
320
+ penDetected: boolean;
321
+ exportBackground: boolean;
322
+ exportEmbedScene: boolean;
323
+ exportWithDarkMode: boolean;
324
+ currentItemStrokeColor: string;
325
+ currentItemStickynoteStrokeColor: string;
326
+ currentItemStickynoteBackgroundColor: string;
327
+ currentItemBackgroundColor: string;
328
+ currentItemFillStyle: ExcalidrawElement["fillStyle"];
329
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
330
+ currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
331
+ currentItemRoughness: number;
332
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
333
+ currentItemOpacity: number;
334
+ currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
335
+ currentItemFontSize: number;
336
+ currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
337
+ currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
338
+ currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
339
+ currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
340
+ currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
341
+ scrollConstraints: import("../types").ScrollConstraints | null;
342
+ cursorButton: "up" | "down";
343
+ scrolledOutside: boolean;
344
+ isResizing: boolean;
345
+ openMenu: "canvas" | null;
346
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
347
+ openSidebar: {
348
+ name: import("../types").SidebarName;
349
+ tab?: import("../types").SidebarTabName;
350
+ } | null;
351
+ defaultSidebarDockedPreference: boolean;
352
+ lastPointerDownWith: import("@excalidraw/element/types").PointerType;
353
+ previousSelectedElementIds: {
354
+ [id: string]: true;
355
+ };
356
+ selectedElementsAreBeingDragged: boolean;
357
+ toast: {
358
+ message: React.ReactNode;
359
+ closable?: boolean;
360
+ duration?: number;
361
+ } | null;
362
+ gridStep: number;
363
+ fileHandle: FileSystemFileHandle | null;
364
+ stats: {
365
+ open: boolean;
366
+ panels: number;
367
+ };
368
+ showHyperlinkPopup: false | "info" | "editor";
369
+ originSnapOffset: {
370
+ x: number;
371
+ y: number;
372
+ } | null;
373
+ objectsSnapModeEnabled: boolean;
374
+ lockedMultiSelections: {
375
+ [groupId: string]: true;
376
+ };
377
+ colorTopPicks: {
378
+ elementStroke: readonly string[] | null;
379
+ elementBackground: readonly string[] | null;
380
+ bucketFill: readonly string[] | null;
381
+ stickyNoteStroke: readonly string[] | null;
382
+ stickyNoteBackground: readonly string[] | null;
383
+ };
384
+ fontTopPicks: readonly import("@excalidraw/element/types").FontFamilyValues[] | null;
385
+ };
386
+ files: import("../types").BinaryFiles;
387
+ }>;
23
388
  export declare const parseLibraryJSON: (json: string, defaultStatus?: LibraryItem["status"]) => LibraryItem[];
24
389
  export declare const loadLibraryFromBlob: (blob: Blob, defaultStatus?: LibraryItem["status"]) => Promise<LibraryItem[]>;
25
390
  export declare const canvasToBlob: (canvas: HTMLCanvasElement | Promise<HTMLCanvasElement>) => Promise<Blob>;
@@ -40,12 +405,8 @@ export declare const SVGStringToFile: (SVGString: string, filename?: string) =>
40
405
  type: typeof MIME_TYPES.svg;
41
406
  };
42
407
  export declare const ImageURLToFile: (imageUrl: string, filename?: string) => Promise<File | undefined>;
43
- export declare const getFileFromEvent: (event: React.DragEvent<HTMLDivElement>) => Promise<{
44
- file: File | null;
45
- fileHandle: FileSystemHandle | null;
46
- }>;
47
- export declare const getFileHandle: (event: React.DragEvent<HTMLDivElement>) => Promise<FileSystemHandle | null>;
48
- export declare const createFile: (blob: File | Blob | ArrayBuffer, mimeType: ValueOf<typeof MIME_TYPES>, name: string | undefined) => File;
408
+ export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTransferItem) => Promise<FileSystemFileHandle | null>;
409
+ export declare const createFile: (blob: File | Blob | ArrayBuffer, mimeType: string, name: string | undefined) => File;
49
410
  /** attempts to detect correct mimeType if none is set, or if an image
50
411
  * has an incorrect extension.
51
412
  * Note: doesn't handle missing .excalidraw/.excalidrawlib 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 {};