@excalidraw/math 0.18.0-3bdaafe → 0.18.0-4872083

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 (337) hide show
  1. package/dist/dev/index.js +348 -148
  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 +75 -39
  8. package/dist/types/common/src/constants.d.ts +48 -34
  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 +3 -1
  13. package/dist/types/common/src/points.d.ts +1 -1
  14. package/dist/types/common/src/utility-types.d.ts +0 -1
  15. package/dist/types/common/src/utils.d.ts +47 -77
  16. package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
  17. package/dist/types/element/src/Scene.d.ts +11 -7
  18. package/dist/types/element/src/align.d.ts +2 -2
  19. package/dist/types/element/src/arrowEndpointText.d.ts +49 -0
  20. package/dist/types/element/src/arrowheads.d.ts +3 -0
  21. package/dist/types/element/src/arrows/focus.d.ts +30 -0
  22. package/dist/types/element/src/arrows/helpers.d.ts +5 -0
  23. package/dist/types/element/src/binding.d.ts +79 -51
  24. package/dist/types/element/src/bounds.d.ts +25 -18
  25. package/dist/types/element/src/bucketFill.d.ts +110 -0
  26. package/dist/types/element/src/collision.d.ts +7 -2
  27. package/dist/types/element/src/comparisons.d.ts +8 -7
  28. package/dist/types/element/src/convertToShape.d.ts +23 -0
  29. package/dist/types/element/src/distribute.d.ts +3 -2
  30. package/dist/types/element/src/dragElements.d.ts +30 -3
  31. package/dist/types/element/src/duplicate.d.ts +7 -6
  32. package/dist/types/element/src/elbowArrow.d.ts +2 -0
  33. package/dist/types/element/src/embeddable.d.ts +2 -2
  34. package/dist/types/element/src/flowchart.d.ts +7 -7
  35. package/dist/types/element/src/fractionalIndex.d.ts +4 -4
  36. package/dist/types/element/src/frame.d.ts +14 -9
  37. package/dist/types/element/src/groups.d.ts +9 -9
  38. package/dist/types/element/src/heading.d.ts +2 -1
  39. package/dist/types/element/src/image.d.ts +1 -11
  40. package/dist/types/element/src/index.d.ts +8 -4
  41. package/dist/types/element/src/linearElementEditor.d.ts +38 -30
  42. package/dist/types/element/src/mutateElement.d.ts +5 -1
  43. package/dist/types/element/src/newElement.d.ts +20 -6
  44. package/dist/types/element/src/renderElement.d.ts +4 -10
  45. package/dist/types/element/src/resizeElements.d.ts +12 -12
  46. package/dist/types/element/src/resizeTest.d.ts +6 -5
  47. package/dist/types/element/src/selection.d.ts +14 -14
  48. package/dist/types/element/src/shape.d.ts +21 -8
  49. package/dist/types/element/src/sortElements.d.ts +10 -0
  50. package/dist/types/element/src/textElement.d.ts +13 -10
  51. package/dist/types/element/src/textMeasurements.d.ts +1 -3
  52. package/dist/types/element/src/textWrapping.d.ts +26 -0
  53. package/dist/types/{excalidraw/data → element/src}/transform.d.ts +3 -3
  54. package/dist/types/element/src/transformHandles.d.ts +8 -27
  55. package/dist/types/element/src/typeChecks.d.ts +29 -31
  56. package/dist/types/element/src/types.d.ts +20 -14
  57. package/dist/types/element/src/utils.d.ts +9 -4
  58. package/dist/types/element/src/zindex.d.ts +7 -1
  59. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +191 -219
  60. package/dist/types/excalidraw/actions/actionAlign.d.ts +12 -13
  61. package/dist/types/excalidraw/actions/actionBoundText.d.ts +112 -131
  62. package/dist/types/excalidraw/actions/actionCanvas.d.ts +412 -1578
  63. package/dist/types/excalidraw/actions/actionClipboard.d.ts +139 -899
  64. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +54 -64
  65. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +177 -208
  66. package/dist/types/excalidraw/actions/actionDeselect.d.ts +160 -0
  67. package/dist/types/excalidraw/actions/actionDistribute.d.ts +4 -6
  68. package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +3 -4
  69. package/dist/types/excalidraw/actions/actionElementLink.d.ts +61 -77
  70. package/dist/types/excalidraw/actions/actionElementLock.d.ts +111 -130
  71. package/dist/types/excalidraw/actions/actionExport.d.ts +190 -1414
  72. package/dist/types/excalidraw/actions/actionFinalize.d.ts +10 -394
  73. package/dist/types/excalidraw/actions/actionFlip.d.ts +2 -3
  74. package/dist/types/excalidraw/actions/actionFrame.d.ts +253 -504
  75. package/dist/types/excalidraw/actions/actionGroup.d.ts +122 -149
  76. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +151 -197
  77. package/dist/types/excalidraw/actions/actionLink.d.ts +67 -77
  78. package/dist/types/excalidraw/actions/actionMenu.d.ts +56 -438
  79. package/dist/types/excalidraw/actions/actionNavigate.d.ts +18 -359
  80. package/dist/types/excalidraw/actions/actionProperties.d.ts +194 -2531
  81. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +61 -75
  82. package/dist/types/excalidraw/actions/actionStyles.d.ts +54 -63
  83. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +4 -4
  84. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +176 -0
  85. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +69 -80
  86. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +176 -0
  87. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +68 -78
  88. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +57 -74
  89. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +2 -2
  90. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +67 -77
  91. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +68 -78
  92. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +68 -78
  93. package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -9
  94. package/dist/types/excalidraw/actions/index.d.ts +5 -3
  95. package/dist/types/excalidraw/actions/manager.d.ts +1 -0
  96. package/dist/types/excalidraw/actions/register.d.ts +2 -2
  97. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  98. package/dist/types/excalidraw/actions/types.d.ts +11 -7
  99. package/dist/types/excalidraw/{animated-trail.d.ts → animatedTrail.d.ts} +4 -3
  100. package/dist/types/excalidraw/appState.d.ts +34 -25
  101. package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -0
  102. package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
  103. package/dist/types/excalidraw/charts/charts.helpers.d.ts +32 -0
  104. package/dist/types/excalidraw/charts/charts.line.d.ts +2 -0
  105. package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
  106. package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -0
  107. package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
  108. package/dist/types/excalidraw/charts/index.d.ts +7 -0
  109. package/dist/types/excalidraw/clipboard.d.ts +56 -19
  110. package/dist/types/excalidraw/components/Actions.d.ts +33 -11
  111. package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -1
  112. package/dist/types/excalidraw/components/App.arrowText.d.ts +72 -0
  113. package/dist/types/excalidraw/components/App.bucketFill.d.ts +38 -0
  114. package/dist/types/excalidraw/components/App.cursor.d.ts +30 -0
  115. package/dist/types/excalidraw/components/App.d.ts +455 -119
  116. package/dist/types/excalidraw/components/App.drawshape.d.ts +55 -0
  117. package/dist/types/excalidraw/components/App.flowchart.d.ts +21 -0
  118. package/dist/types/excalidraw/components/App.viewport.d.ts +73 -0
  119. package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
  120. package/dist/types/excalidraw/components/Card.d.ts +1 -3
  121. package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -4
  122. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +5 -4
  123. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +3 -0
  124. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +7 -1
  125. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +2 -1
  126. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -2
  127. package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -2
  128. package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +1 -0
  129. package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -2
  130. package/dist/types/excalidraw/components/CommandPalette/types.d.ts +2 -4
  131. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +4 -4
  132. package/dist/types/excalidraw/components/CursorHint.d.ts +46 -0
  133. package/dist/types/excalidraw/components/DarkModeToggle.d.ts +1 -1
  134. package/dist/types/excalidraw/components/DefaultSidebar.d.ts +9 -13
  135. package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +1 -1
  136. package/dist/types/excalidraw/components/Ellipsify.d.ts +1 -2
  137. package/dist/types/excalidraw/components/ErrorDialog.d.ts +1 -1
  138. package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -2
  139. package/dist/types/excalidraw/components/FilledButton.d.ts +2 -1
  140. package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +2 -1
  141. package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +3 -1
  142. package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +0 -1
  143. package/dist/types/excalidraw/components/HelpDialog.d.ts +1 -1
  144. package/dist/types/excalidraw/components/HintViewer.d.ts +4 -3
  145. package/dist/types/excalidraw/components/{ToolButton.d.ts → IconButton.d.ts} +16 -19
  146. package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
  147. package/dist/types/excalidraw/components/InlineIcon.d.ts +3 -1
  148. package/dist/types/excalidraw/components/Island.d.ts +7 -0
  149. package/dist/types/excalidraw/components/LaserPointerButton.d.ts +2 -4
  150. package/dist/types/excalidraw/components/LayerUI.d.ts +6 -2
  151. package/dist/types/excalidraw/components/LibraryMenu.d.ts +1 -1
  152. package/dist/types/excalidraw/components/LibraryMenuControlButtons.d.ts +1 -1
  153. package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +1 -2
  154. package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +1 -1
  155. package/dist/types/excalidraw/components/LibraryUnit.d.ts +2 -3
  156. package/dist/types/excalidraw/components/LoadingMessage.d.ts +0 -1
  157. package/dist/types/excalidraw/components/LockButton.d.ts +3 -4
  158. package/dist/types/excalidraw/components/MagicButton.d.ts +0 -2
  159. package/dist/types/excalidraw/components/MobileMenu.d.ts +5 -7
  160. package/dist/types/excalidraw/components/MobileToolbar.d.ts +9 -0
  161. package/dist/types/excalidraw/components/Modal.d.ts +0 -1
  162. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +1 -1
  163. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
  164. package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
  165. package/dist/types/excalidraw/components/PenModeButton.d.ts +2 -5
  166. package/dist/types/excalidraw/components/Popover.d.ts +2 -3
  167. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +2 -1
  168. package/dist/types/excalidraw/components/{ButtonIcon.d.ts → RadioButton.d.ts} +2 -5
  169. package/dist/types/excalidraw/components/RadioGroup.d.ts +0 -1
  170. package/dist/types/excalidraw/components/RadioSelection.d.ts +4 -4
  171. package/dist/types/excalidraw/components/Range.d.ts +10 -4
  172. package/dist/types/excalidraw/components/SVGLayer.d.ts +1 -1
  173. package/dist/types/excalidraw/components/ScrollableList.d.ts +0 -1
  174. package/dist/types/excalidraw/components/SearchMenu.d.ts +1 -1
  175. package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +16 -22
  176. package/dist/types/excalidraw/components/Sidebar/SidebarHeader.d.ts +1 -1
  177. package/dist/types/excalidraw/components/Sidebar/SidebarTab.d.ts +1 -2
  178. package/dist/types/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +1 -2
  179. package/dist/types/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +1 -2
  180. package/dist/types/excalidraw/components/Sidebar/SidebarTabs.d.ts +1 -2
  181. package/dist/types/excalidraw/components/Spinner.d.ts +4 -4
  182. package/dist/types/excalidraw/components/Stats/Angle.d.ts +2 -2
  183. package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +0 -1
  184. package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +0 -1
  185. package/dist/types/excalidraw/components/Stats/Dimension.d.ts +2 -2
  186. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +2 -3
  187. package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +2 -2
  188. package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +2 -2
  189. package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +2 -2
  190. package/dist/types/excalidraw/components/Stats/Position.d.ts +3 -3
  191. package/dist/types/excalidraw/components/Stats/index.d.ts +7 -8
  192. package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
  193. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatHistoryMenu.d.ts +15 -0
  194. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatInterface.d.ts +23 -0
  195. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatMessage.d.ts +14 -0
  196. package/dist/types/excalidraw/components/TTDDialog/Chat/TTDChatPanel.d.ts +27 -0
  197. package/dist/types/excalidraw/components/TTDDialog/Chat/index.d.ts +3 -0
  198. package/dist/types/excalidraw/components/TTDDialog/Chat/useChatAgent.d.ts +8 -0
  199. package/dist/types/excalidraw/components/TTDDialog/CodeMirrorEditor.d.ts +11 -0
  200. package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +3 -2
  201. package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +13 -0
  202. package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +12 -29
  203. package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +3 -3
  204. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +5 -2
  205. package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +13 -9
  206. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +1 -2
  207. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +1 -2
  208. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +1 -2
  209. package/dist/types/excalidraw/components/TTDDialog/TTDPreviewPanel.d.ts +9 -0
  210. package/dist/types/excalidraw/components/TTDDialog/TTDWelcomeMessage.d.ts +1 -0
  211. package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +9 -0
  212. package/dist/types/excalidraw/components/TTDDialog/common.d.ts +16 -16
  213. package/dist/types/excalidraw/components/TTDDialog/hooks/useChatManagement.d.ts +13 -0
  214. package/dist/types/excalidraw/components/TTDDialog/hooks/useMermaidRenderer.d.ts +14 -0
  215. package/dist/types/excalidraw/components/TTDDialog/hooks/useTextGeneration.d.ts +7 -0
  216. package/dist/types/excalidraw/components/TTDDialog/mermaid-lang-lite.d.ts +2 -0
  217. package/dist/types/excalidraw/components/TTDDialog/types.d.ts +95 -0
  218. package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +22 -0
  219. package/dist/types/excalidraw/components/TTDDialog/utils/chat.d.ts +10 -0
  220. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidAutoFix.d.ts +1 -0
  221. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +10 -0
  222. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidValidation.d.ts +1 -0
  223. package/dist/types/excalidraw/components/TextField.d.ts +1 -0
  224. package/dist/types/excalidraw/components/Toast.d.ts +11 -7
  225. package/dist/types/excalidraw/components/ToolPopover.d.ts +22 -0
  226. package/dist/types/excalidraw/components/Toolbar.d.ts +11 -0
  227. package/dist/types/excalidraw/components/Tools.d.ts +146 -0
  228. package/dist/types/excalidraw/components/Trans.d.ts +2 -2
  229. package/dist/types/excalidraw/components/UserList.d.ts +3 -2
  230. package/dist/types/excalidraw/components/ViewportStatusFrame/ViewportStatusFrame.d.ts +11 -0
  231. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +10 -4
  232. package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +1 -0
  233. package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
  234. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +47 -35
  235. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +7 -5
  236. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +3 -3
  237. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +13 -22
  238. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCheckbox.d.ts +5 -0
  239. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +5 -4
  240. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -2
  241. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +2 -2
  242. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +6 -6
  243. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSub.d.ts +23 -0
  244. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubContent.d.ts +8 -0
  245. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubTrigger.d.ts +12 -0
  246. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +3 -4
  247. package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +2 -2
  248. package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -0
  249. package/dist/types/excalidraw/components/footer/Footer.d.ts +3 -1
  250. package/dist/types/excalidraw/components/hoc/withInternalFallback.d.ts +1 -1
  251. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +3 -3
  252. package/dist/types/excalidraw/components/icons.d.ts +54 -22
  253. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +24 -3
  254. package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +39 -35
  255. package/dist/types/excalidraw/components/positionElementBesideCursor.d.ts +26 -0
  256. package/dist/types/excalidraw/components/shapeActionPredicates.d.ts +39 -0
  257. package/dist/types/excalidraw/data/blob.d.ts +335 -15
  258. package/dist/types/excalidraw/data/encode.d.ts +4 -4
  259. package/dist/types/excalidraw/data/encryption.d.ts +5 -5
  260. package/dist/types/excalidraw/data/filesystem.d.ts +5 -7
  261. package/dist/types/excalidraw/data/index.d.ts +8 -9
  262. package/dist/types/excalidraw/data/json.d.ts +173 -3
  263. package/dist/types/excalidraw/data/library.d.ts +25 -10
  264. package/dist/types/excalidraw/data/resave.d.ts +7 -2
  265. package/dist/types/excalidraw/data/restore.d.ts +25 -10
  266. package/dist/types/excalidraw/data/types.d.ts +4 -1
  267. package/dist/types/excalidraw/drawShapeTrail.d.ts +16 -0
  268. package/dist/types/excalidraw/editor-jotai.d.ts +11 -11
  269. package/dist/types/excalidraw/eraser/index.d.ts +2 -3
  270. package/dist/types/excalidraw/errors.d.ts +14 -0
  271. package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +29 -0
  272. package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +2 -2
  273. package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +4 -3
  274. package/dist/types/excalidraw/hooks/useScrollPosition.d.ts +1 -2
  275. package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
  276. package/dist/types/excalidraw/i18n.d.ts +2 -2
  277. package/dist/types/excalidraw/{laser-trails.d.ts → laserTrails.d.ts} +5 -7
  278. package/dist/types/excalidraw/lasso/index.d.ts +2 -3
  279. package/dist/types/excalidraw/renderer/animation.d.ts +16 -0
  280. package/dist/types/excalidraw/renderer/helpers.d.ts +6 -8
  281. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +7 -15
  282. package/dist/types/excalidraw/scene/Renderer.d.ts +428 -18
  283. package/dist/types/excalidraw/scene/export.d.ts +4 -4
  284. package/dist/types/excalidraw/scene/index.d.ts +2 -2
  285. package/dist/types/excalidraw/scene/types.d.ts +26 -8
  286. package/dist/types/excalidraw/shortcut.d.ts +1 -0
  287. package/dist/types/excalidraw/snapping.d.ts +12 -12
  288. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-bindings.d.ts +1 -1
  289. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-loader.d.ts +1 -1
  290. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-wasm.d.ts +1 -1
  291. package/dist/types/excalidraw/subset/woff2/woff2-loader.d.ts +2 -2
  292. package/dist/types/excalidraw/subset/woff2/woff2-wasm.d.ts +1 -1
  293. package/dist/types/excalidraw/textAutoResizeHandle.d.ts +15 -0
  294. package/dist/types/excalidraw/types.d.ts +521 -55
  295. package/dist/types/excalidraw/viewport.d.ts +270 -0
  296. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +8 -5
  297. package/dist/types/fractional-indexing/src/index.d.ts +29 -0
  298. package/dist/types/laser-pointer/src/index.d.ts +2 -0
  299. package/dist/types/laser-pointer/src/math.d.ts +16 -0
  300. package/dist/types/laser-pointer/src/simplify.d.ts +2 -0
  301. package/dist/types/laser-pointer/src/state.d.ts +36 -0
  302. package/dist/types/math/src/constants.d.ts +0 -1
  303. package/dist/types/math/src/curve.d.ts +4 -1
  304. package/dist/types/math/src/index.d.ts +1 -0
  305. package/dist/types/math/src/pca.d.ts +79 -0
  306. package/dist/types/math/src/point.d.ts +8 -2
  307. package/dist/types/math/src/polygon.d.ts +26 -2
  308. package/dist/types/math/src/range.d.ts +1 -3
  309. package/dist/types/math/src/segment.d.ts +4 -3
  310. package/dist/types/math/src/types.d.ts +25 -1
  311. package/dist/types/utils/src/export.d.ts +8 -8
  312. package/dist/types/utils/src/index.d.ts +1 -2
  313. package/dist/types/utils/src/shape.d.ts +6 -6
  314. package/package.json +2 -2
  315. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +0 -185
  316. package/dist/types/excalidraw/animation-frame-handler.d.ts +0 -16
  317. package/dist/types/excalidraw/charts.d.ts +0 -27
  318. package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
  319. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -16
  320. package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +0 -10
  321. package/dist/types/excalidraw/components/HandButton.d.ts +0 -10
  322. package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
  323. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -9
  324. package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
  325. package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -10
  326. package/dist/types/excalidraw/components/shapes.d.ts +0 -190
  327. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
  328. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
  329. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -85
  330. package/dist/types/excalidraw/cursor.d.ts +0 -5
  331. package/dist/types/excalidraw/data/reconcile.d.ts +0 -7
  332. package/dist/types/excalidraw/index.d.ts +0 -47
  333. package/dist/types/excalidraw/polyfill.d.ts +0 -2
  334. package/dist/types/excalidraw/scene/scroll.d.ts +0 -23
  335. package/dist/types/excalidraw/scene/zoom.d.ts +0 -12
  336. package/dist/types/utils/src/bbox.d.ts +0 -9
  337. package/dist/types/utils/src/withinBounds.d.ts +0 -19
@@ -2,24 +2,351 @@ 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
+ hoveredArrowTextAnchor: {
82
+ elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
83
+ anchor: "start" | "end" | "label";
84
+ } | null;
85
+ isRotating: boolean;
86
+ elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
87
+ collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
88
+ snapLines: readonly import("../snapping").SnapLine[];
89
+ zenModeEnabled: boolean;
90
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
91
+ isCropping: boolean;
92
+ croppingElementId: ExcalidrawElement["id"] | null;
93
+ searchMatches: Readonly<{
94
+ focusedId: ExcalidrawElement["id"] | null;
95
+ matches: readonly import("../types").SearchMatch[];
96
+ }> | null;
97
+ activeLockedId: string | null;
98
+ hoveredElementIds: Readonly<{
99
+ [id: string]: true;
100
+ }>;
101
+ shouldCacheIgnoreZoom: boolean;
102
+ exportScale: number;
103
+ currentItemArrowType: "sharp" | "round" | "elbow";
104
+ gridSize: number;
105
+ bindMode: import("@excalidraw/element/types").BindMode;
106
+ contextMenu: {
107
+ items: import("../components/ContextMenu").ContextMenuItems;
108
+ top: number;
109
+ left: number;
110
+ } | null;
111
+ showWelcomeScreen: boolean;
112
+ isLoading: boolean;
113
+ errorMessage: React.ReactNode;
114
+ resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
115
+ boxSelectionMode: import("../types").BoxSelectionMode;
116
+ bindingPreference: "enabled" | "disabled";
117
+ editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
118
+ preferredSelectionTool: {
119
+ type: "selection" | "lasso";
120
+ initialized: boolean;
121
+ };
122
+ penMode: boolean;
123
+ penDetected: boolean;
124
+ exportBackground: boolean;
125
+ exportEmbedScene: boolean;
126
+ exportWithDarkMode: boolean;
127
+ currentItemStrokeColor: string;
128
+ currentItemBackgroundColor: string;
129
+ currentItemFillStyle: ExcalidrawElement["fillStyle"];
130
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
131
+ currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
132
+ currentItemRoughness: number;
133
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
134
+ currentItemOpacity: number;
135
+ currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
136
+ currentItemFontSize: number;
137
+ currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
138
+ currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
139
+ currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
140
+ currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
141
+ currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
142
+ scrollConstraints: import("../types").ScrollConstraints | null;
143
+ cursorButton: "up" | "down";
144
+ scrolledOutside: boolean;
145
+ isResizing: boolean;
146
+ openMenu: "canvas" | null;
147
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
148
+ openSidebar: {
149
+ name: import("../types").SidebarName;
150
+ tab?: import("../types").SidebarTabName;
151
+ } | null;
152
+ defaultSidebarDockedPreference: boolean;
153
+ lastPointerDownWith: import("@excalidraw/element/types").PointerType;
154
+ previousSelectedElementIds: {
155
+ [id: string]: true;
156
+ };
157
+ selectedElementsAreBeingDragged: boolean;
158
+ toast: {
159
+ message: React.ReactNode;
160
+ closable?: boolean;
161
+ duration?: number;
162
+ } | null;
163
+ gridStep: number;
164
+ fileHandle: FileSystemFileHandle | null;
165
+ stats: {
166
+ open: boolean;
167
+ panels: number;
168
+ };
169
+ showHyperlinkPopup: false | "info" | "editor";
170
+ originSnapOffset: {
171
+ x: number;
172
+ y: number;
173
+ } | null;
174
+ objectsSnapModeEnabled: boolean;
175
+ lockedMultiSelections: {
176
+ [groupId: string]: true;
177
+ };
178
+ };
179
+ files: import("../types").BinaryFiles;
180
+ };
18
181
  } | {
19
182
  type: "application/vnd.excalidrawlib+json";
20
183
  data: ImportedLibraryData;
21
184
  }>;
22
- export declare const loadFromBlob: (blob: Blob, localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null, fileHandle?: FileSystemHandle | null) => Promise<import("./restore").RestoredDataState>;
185
+ export declare const loadFromBlob: (blob: Blob,
186
+ /** @see restore.localAppState */
187
+ localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null,
188
+ /** FileSystemFileHandle. Defaults to `blob.handle` if defined, otherwise null. */
189
+ fileHandle?: FileSystemFileHandle | null) => Promise<{
190
+ elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
191
+ appState: {
192
+ viewBackgroundColor: string;
193
+ theme: import("@excalidraw/element/types").Theme;
194
+ frameRendering: {
195
+ enabled: boolean;
196
+ name: boolean;
197
+ outline: boolean;
198
+ clip: boolean;
199
+ };
200
+ name: string | null;
201
+ zoom: import("../types").Zoom;
202
+ scrollX: number;
203
+ scrollY: number;
204
+ viewModeEnabled: boolean;
205
+ openDialog: null | {
206
+ name: "imageExport" | "help" | "jsonExport";
207
+ } | {
208
+ name: "ttd";
209
+ tab: "text-to-diagram" | "mermaid";
210
+ } | {
211
+ name: "commandPalette";
212
+ } | {
213
+ name: "settings";
214
+ } | {
215
+ name: "elementLinkSelector";
216
+ sourceElementId: ExcalidrawElement["id"];
217
+ } | {
218
+ name: "charts";
219
+ data: import("../charts").Spreadsheet;
220
+ rawText: string;
221
+ };
222
+ editingGroupId: import("@excalidraw/element/types").GroupId | null;
223
+ selectedElementIds: Readonly<{
224
+ [id: string]: true;
225
+ }>;
226
+ frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
227
+ activeTool: {
228
+ lastActiveTool: import("../types").ActiveTool | null;
229
+ locked: boolean;
230
+ fromSelection: boolean;
231
+ } & import("../types").ActiveTool;
232
+ activeEmbeddable: {
233
+ element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
234
+ state: "hover" | "active";
235
+ } | null;
236
+ selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
237
+ selectedGroupIds: {
238
+ [groupId: string]: boolean;
239
+ };
240
+ selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
241
+ multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
242
+ newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
243
+ isBindingEnabled: boolean;
244
+ isMidpointSnappingEnabled: boolean;
245
+ gridModeEnabled: boolean;
246
+ suggestedBinding: {
247
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
248
+ midPoint?: import("@excalidraw/math").GlobalPoint;
249
+ } | null;
250
+ hoveredArrowTextAnchor: {
251
+ elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
252
+ anchor: "start" | "end" | "label";
253
+ } | null;
254
+ isRotating: boolean;
255
+ elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
256
+ collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
257
+ snapLines: readonly import("../snapping").SnapLine[];
258
+ zenModeEnabled: boolean;
259
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
260
+ isCropping: boolean;
261
+ croppingElementId: ExcalidrawElement["id"] | null;
262
+ searchMatches: Readonly<{
263
+ focusedId: ExcalidrawElement["id"] | null;
264
+ matches: readonly import("../types").SearchMatch[];
265
+ }> | null;
266
+ activeLockedId: string | null;
267
+ hoveredElementIds: Readonly<{
268
+ [id: string]: true;
269
+ }>;
270
+ shouldCacheIgnoreZoom: boolean;
271
+ exportScale: number;
272
+ currentItemArrowType: "sharp" | "round" | "elbow";
273
+ gridSize: number;
274
+ bindMode: import("@excalidraw/element/types").BindMode;
275
+ contextMenu: {
276
+ items: import("../components/ContextMenu").ContextMenuItems;
277
+ top: number;
278
+ left: number;
279
+ } | null;
280
+ showWelcomeScreen: boolean;
281
+ isLoading: boolean;
282
+ errorMessage: React.ReactNode;
283
+ resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
284
+ boxSelectionMode: import("../types").BoxSelectionMode;
285
+ bindingPreference: "enabled" | "disabled";
286
+ editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
287
+ preferredSelectionTool: {
288
+ type: "selection" | "lasso";
289
+ initialized: boolean;
290
+ };
291
+ penMode: boolean;
292
+ penDetected: boolean;
293
+ exportBackground: boolean;
294
+ exportEmbedScene: boolean;
295
+ exportWithDarkMode: boolean;
296
+ currentItemStrokeColor: string;
297
+ currentItemBackgroundColor: string;
298
+ currentItemFillStyle: ExcalidrawElement["fillStyle"];
299
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
300
+ currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
301
+ currentItemRoughness: number;
302
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
303
+ currentItemOpacity: number;
304
+ currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
305
+ currentItemFontSize: number;
306
+ currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
307
+ currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
308
+ currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
309
+ currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
310
+ currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
311
+ scrollConstraints: import("../types").ScrollConstraints | null;
312
+ cursorButton: "up" | "down";
313
+ scrolledOutside: boolean;
314
+ isResizing: boolean;
315
+ openMenu: "canvas" | null;
316
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
317
+ openSidebar: {
318
+ name: import("../types").SidebarName;
319
+ tab?: import("../types").SidebarTabName;
320
+ } | null;
321
+ defaultSidebarDockedPreference: boolean;
322
+ lastPointerDownWith: import("@excalidraw/element/types").PointerType;
323
+ previousSelectedElementIds: {
324
+ [id: string]: true;
325
+ };
326
+ selectedElementsAreBeingDragged: boolean;
327
+ toast: {
328
+ message: React.ReactNode;
329
+ closable?: boolean;
330
+ duration?: number;
331
+ } | null;
332
+ gridStep: number;
333
+ fileHandle: FileSystemFileHandle | null;
334
+ stats: {
335
+ open: boolean;
336
+ panels: number;
337
+ };
338
+ showHyperlinkPopup: false | "info" | "editor";
339
+ originSnapOffset: {
340
+ x: number;
341
+ y: number;
342
+ } | null;
343
+ objectsSnapModeEnabled: boolean;
344
+ lockedMultiSelections: {
345
+ [groupId: string]: true;
346
+ };
347
+ };
348
+ files: import("../types").BinaryFiles;
349
+ }>;
23
350
  export declare const parseLibraryJSON: (json: string, defaultStatus?: LibraryItem["status"]) => LibraryItem[];
24
351
  export declare const loadLibraryFromBlob: (blob: Blob, defaultStatus?: LibraryItem["status"]) => Promise<LibraryItem[]>;
25
352
  export declare const canvasToBlob: (canvas: HTMLCanvasElement | Promise<HTMLCanvasElement>) => Promise<Blob>;
@@ -40,15 +367,8 @@ export declare const SVGStringToFile: (SVGString: string, filename?: string) =>
40
367
  type: typeof MIME_TYPES.svg;
41
368
  };
42
369
  export declare const ImageURLToFile: (imageUrl: string, filename?: string) => Promise<File | undefined>;
43
- export declare const getFilesFromEvent: (event: React.DragEvent<HTMLDivElement> | ClipboardEvent) => Promise<({
44
- file: File;
45
- fileHandle: FileSystemHandle | null;
46
- } | {
47
- file: null;
48
- fileHandle: null;
49
- })[]>;
50
- export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTransferItem) => Promise<FileSystemHandle | null>;
51
- export declare const createFile: (blob: File | Blob | ArrayBuffer, mimeType: ValueOf<typeof MIME_TYPES>, name: string | undefined) => File;
370
+ export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTransferItem) => Promise<FileSystemFileHandle | null>;
371
+ export declare const createFile: (blob: File | Blob | ArrayBuffer, mimeType: string, name: string | undefined) => File;
52
372
  /** attempts to detect correct mimeType if none is set, or if an image
53
373
  * has an incorrect extension.
54
374
  * 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 {};
@@ -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
- import type { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
2
- import type { FileSystemHandle } from "./filesystem";
1
+ import type { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeleted, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
3
2
  import type { ExportType } from "../scene/types";
4
3
  import type { AppState, BinaryFiles } from "../types";
5
4
  export { loadFromBlob } from "./blob";
@@ -7,16 +6,16 @@ export { loadFromJSON, saveAsJSON } from "./json";
7
6
  export type ExportedElements = readonly NonDeletedExcalidrawElement[] & {
8
7
  _brand: "exportedElements";
9
8
  };
10
- export declare const prepareElementsForExport: (elements: readonly ExcalidrawElement[], { selectedElementIds }: Pick<AppState, "selectedElementIds">, exportSelectionOnly: boolean) => {
11
- exportingFrame: ExcalidrawFrameLikeElement | null;
9
+ export declare const prepareElementsForExport: (allElements: readonly ExcalidrawElement[], { selectedElementIds }: Pick<AppState, "selectedElementIds">, exportSelectionOnly: boolean) => {
10
+ exportingFrame: NonDeleted<ExcalidrawFrameLikeElement> | null;
12
11
  exportedElements: ExportedElements;
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;
21
- exportingFrame: ExcalidrawFrameLikeElement | null;
22
- }) => Promise<FileSystemHandle | null | undefined>;
18
+ name?: string;
19
+ fileHandle?: FileSystemFileHandle | null;
20
+ exportingFrame: NonDeleted<ExcalidrawFrameLikeElement> | null;
21
+ }) => Promise<FileSystemFileHandle | null | undefined>;
@@ -1,11 +1,181 @@
1
1
  import type { ExcalidrawElement } 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 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
+ viewBackgroundColor: string;
22
+ theme: import("@excalidraw/element/types").Theme;
23
+ frameRendering: {
24
+ enabled: boolean;
25
+ name: boolean;
26
+ outline: boolean;
27
+ clip: boolean;
28
+ };
29
+ name: string | null;
30
+ zoom: import("../types").Zoom;
31
+ scrollX: number;
32
+ scrollY: number;
33
+ viewModeEnabled: boolean;
34
+ openDialog: null | {
35
+ name: "imageExport" | "help" | "jsonExport";
36
+ } | {
37
+ name: "ttd";
38
+ tab: "text-to-diagram" | "mermaid";
39
+ } | {
40
+ name: "commandPalette";
41
+ } | {
42
+ name: "settings";
43
+ } | {
44
+ name: "elementLinkSelector";
45
+ sourceElementId: ExcalidrawElement["id"];
46
+ } | {
47
+ name: "charts";
48
+ data: import("../charts").Spreadsheet;
49
+ rawText: string;
50
+ };
51
+ editingGroupId: import("@excalidraw/element/types").GroupId | null;
52
+ selectedElementIds: Readonly<{
53
+ [id: string]: true;
54
+ }>;
55
+ frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
56
+ activeTool: {
57
+ lastActiveTool: import("../types").ActiveTool | null;
58
+ locked: boolean;
59
+ fromSelection: boolean;
60
+ } & import("../types").ActiveTool;
61
+ activeEmbeddable: {
62
+ element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
63
+ state: "hover" | "active";
64
+ } | null;
65
+ selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
66
+ selectedGroupIds: {
67
+ [groupId: string]: boolean;
68
+ };
69
+ selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
70
+ multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
71
+ newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
72
+ isBindingEnabled: boolean;
73
+ isMidpointSnappingEnabled: boolean;
74
+ gridModeEnabled: boolean;
75
+ suggestedBinding: {
76
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
77
+ midPoint?: import("@excalidraw/math").GlobalPoint;
78
+ } | null;
79
+ hoveredArrowTextAnchor: {
80
+ elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
81
+ anchor: "start" | "end" | "label";
82
+ } | null;
83
+ isRotating: boolean;
84
+ elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
85
+ collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
86
+ snapLines: readonly import("../snapping").SnapLine[];
87
+ zenModeEnabled: boolean;
88
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
89
+ isCropping: boolean;
90
+ croppingElementId: ExcalidrawElement["id"] | null;
91
+ searchMatches: Readonly<{
92
+ focusedId: ExcalidrawElement["id"] | null;
93
+ matches: readonly import("../types").SearchMatch[];
94
+ }> | null;
95
+ activeLockedId: string | null;
96
+ hoveredElementIds: Readonly<{
97
+ [id: string]: true;
98
+ }>;
99
+ shouldCacheIgnoreZoom: boolean;
100
+ exportScale: number;
101
+ currentItemArrowType: "sharp" | "round" | "elbow";
102
+ gridSize: number;
103
+ bindMode: import("@excalidraw/element/types").BindMode;
104
+ contextMenu: {
105
+ items: import("../components/ContextMenu").ContextMenuItems;
106
+ top: number;
107
+ left: number;
108
+ } | null;
109
+ showWelcomeScreen: boolean;
110
+ isLoading: boolean;
111
+ errorMessage: React.ReactNode;
112
+ resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
113
+ boxSelectionMode: import("../types").BoxSelectionMode;
114
+ bindingPreference: "enabled" | "disabled";
115
+ editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
116
+ preferredSelectionTool: {
117
+ type: "selection" | "lasso";
118
+ initialized: boolean;
119
+ };
120
+ penMode: boolean;
121
+ penDetected: boolean;
122
+ exportBackground: boolean;
123
+ exportEmbedScene: boolean;
124
+ exportWithDarkMode: boolean;
125
+ currentItemStrokeColor: string;
126
+ currentItemBackgroundColor: string;
127
+ currentItemFillStyle: ExcalidrawElement["fillStyle"];
128
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
129
+ currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
130
+ currentItemRoughness: number;
131
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
132
+ currentItemOpacity: number;
133
+ currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
134
+ currentItemFontSize: number;
135
+ currentItemTextAlign: import("@excalidraw/element/types").TextAlign;
136
+ currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null;
137
+ currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
138
+ currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
139
+ currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
140
+ scrollConstraints: import("../types").ScrollConstraints | null;
141
+ cursorButton: "up" | "down";
142
+ scrolledOutside: boolean;
143
+ isResizing: boolean;
144
+ openMenu: "canvas" | null;
145
+ openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
146
+ openSidebar: {
147
+ name: import("../types").SidebarName;
148
+ tab?: import("../types").SidebarTabName;
149
+ } | null;
150
+ defaultSidebarDockedPreference: boolean;
151
+ lastPointerDownWith: import("@excalidraw/element/types").PointerType;
152
+ previousSelectedElementIds: {
153
+ [id: string]: true;
154
+ };
155
+ selectedElementsAreBeingDragged: boolean;
156
+ toast: {
157
+ message: React.ReactNode;
158
+ closable?: boolean;
159
+ duration?: number;
160
+ } | null;
161
+ gridStep: number;
162
+ fileHandle: FileSystemFileHandle | null;
163
+ stats: {
164
+ open: boolean;
165
+ panels: number;
166
+ };
167
+ showHyperlinkPopup: false | "info" | "editor";
168
+ originSnapOffset: {
169
+ x: number;
170
+ y: number;
171
+ } | null;
172
+ objectsSnapModeEnabled: boolean;
173
+ lockedMultiSelections: {
174
+ [groupId: string]: true;
175
+ };
176
+ };
177
+ files: BinaryFiles;
7
178
  }>;
8
- export declare const loadFromJSON: (localAppState: AppState, localElements: readonly ExcalidrawElement[] | null) => Promise<import("./restore").RestoredDataState>;
9
179
  export declare const isValidExcalidrawData: (data?: {
10
180
  type?: any;
11
181
  elements?: any;