@excalidraw/math 0.18.0-9ba0f5d → 0.18.0-9fbeaed

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 (307) hide show
  1. package/dist/dev/index.js +349 -160
  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/colors.d.ts +24 -2
  7. package/dist/types/common/src/constants.d.ts +72 -7
  8. package/dist/types/common/src/index.d.ts +3 -0
  9. package/dist/types/common/src/keys.d.ts +6 -0
  10. package/dist/types/common/src/points.d.ts +1 -1
  11. package/dist/types/common/src/random.d.ts +7 -0
  12. package/dist/types/common/src/utils.d.ts +16 -50
  13. package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
  14. package/dist/types/element/src/Scene.d.ts +9 -5
  15. package/dist/types/element/src/align.d.ts +5 -2
  16. package/dist/types/element/src/arrowEndpointText.d.ts +49 -0
  17. package/dist/types/element/src/arrowheads.d.ts +3 -0
  18. package/dist/types/element/src/arrows/focus.d.ts +30 -0
  19. package/dist/types/element/src/arrows/helpers.d.ts +5 -0
  20. package/dist/types/element/src/binding.d.ts +99 -17
  21. package/dist/types/element/src/bounds.d.ts +32 -9
  22. package/dist/types/element/src/bucketFill.d.ts +110 -0
  23. package/dist/types/element/src/collision.d.ts +20 -3
  24. package/dist/types/element/src/comparisons.d.ts +8 -5
  25. package/dist/types/element/src/convertToShape.d.ts +23 -0
  26. package/dist/types/element/src/cropElement.d.ts +36 -4
  27. package/dist/types/element/src/delta.d.ts +30 -2
  28. package/dist/types/element/src/distribute.d.ts +6 -2
  29. package/dist/types/element/src/dragElements.d.ts +34 -2
  30. package/dist/types/element/src/duplicate.d.ts +64 -3
  31. package/dist/types/element/src/elbowArrow.d.ts +7 -0
  32. package/dist/types/element/src/embeddable.d.ts +3 -2
  33. package/dist/types/element/src/flowchart.d.ts +9 -11
  34. package/dist/types/element/src/fractionalIndex.d.ts +2 -2
  35. package/dist/types/element/src/frame.d.ts +30 -11
  36. package/dist/types/element/src/groups.d.ts +10 -15
  37. package/dist/types/element/src/image.d.ts +5 -2
  38. package/dist/types/element/src/index.d.ts +10 -1
  39. package/dist/types/element/src/linearElementEditor.d.ts +36 -11
  40. package/dist/types/element/src/listMarker.d.ts +39 -0
  41. package/dist/types/element/src/mutateElement.d.ts +3 -1
  42. package/dist/types/element/src/newElement.d.ts +55 -3
  43. package/dist/types/element/src/renderElement.d.ts +31 -7
  44. package/dist/types/element/src/renderEnvironment.d.ts +66 -0
  45. package/dist/types/element/src/resizeElements.d.ts +14 -4
  46. package/dist/types/element/src/selection.d.ts +11 -13
  47. package/dist/types/element/src/shape.d.ts +30 -2
  48. package/dist/types/element/src/sizeHelpers.d.ts +6 -0
  49. package/dist/types/element/src/sortElements.d.ts +10 -0
  50. package/dist/types/element/src/stickyNote.d.ts +191 -0
  51. package/dist/types/element/src/textElement.d.ts +23 -11
  52. package/dist/types/element/src/textMeasurements.d.ts +15 -11
  53. package/dist/types/element/src/textWrapping.d.ts +28 -1
  54. package/dist/types/element/src/transform.d.ts +31 -8
  55. package/dist/types/element/src/typeChecks.d.ts +29 -27
  56. package/dist/types/element/src/types.d.ts +48 -9
  57. package/dist/types/element/src/utils.d.ts +19 -6
  58. package/dist/types/element/src/zindex.d.ts +2 -2
  59. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +128 -53
  60. package/dist/types/excalidraw/actions/actionAlign.d.ts +6 -6
  61. package/dist/types/excalidraw/actions/actionBoundText.d.ts +87 -213
  62. package/dist/types/excalidraw/actions/actionCanvas.d.ts +371 -1027
  63. package/dist/types/excalidraw/actions/actionClipboard.d.ts +86 -36
  64. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +43 -18
  65. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +4 -513
  66. package/dist/types/excalidraw/actions/actionDeselect.d.ts +183 -0
  67. package/dist/types/excalidraw/actions/actionDistribute.d.ts +2 -3
  68. package/dist/types/excalidraw/actions/actionElementLink.d.ts +39 -18
  69. package/dist/types/excalidraw/actions/actionElementLock.d.ts +87 -37
  70. package/dist/types/excalidraw/actions/actionExport.d.ts +140 -364
  71. package/dist/types/excalidraw/actions/actionFinalize.d.ts +1 -0
  72. package/dist/types/excalidraw/actions/actionFrame.d.ts +157 -684
  73. package/dist/types/excalidraw/actions/actionGroup.d.ts +102 -52
  74. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +100 -21
  75. package/dist/types/excalidraw/actions/actionLink.d.ts +44 -19
  76. package/dist/types/excalidraw/actions/actionMenu.d.ts +39 -18
  77. package/dist/types/excalidraw/actions/actionProperties.d.ts +122 -56
  78. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +48 -23
  79. package/dist/types/excalidraw/actions/actionStyles.d.ts +44 -18
  80. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +452 -6
  81. package/dist/types/excalidraw/actions/{actionEmbeddable.d.ts → actionToggleArrowBinding.d.ts} +58 -32
  82. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +47 -23
  83. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +196 -0
  84. package/dist/types/excalidraw/actions/actionToggleMinimap.d.ts +201 -0
  85. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +44 -19
  86. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +43 -23
  87. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +1 -1
  88. package/dist/types/excalidraw/actions/actionToggleShowHints.d.ts +198 -0
  89. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +44 -19
  90. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +45 -20
  91. package/dist/types/excalidraw/actions/actionToggleWrap.d.ts +12 -0
  92. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +44 -19
  93. package/dist/types/excalidraw/actions/colorTargets.d.ts +39 -0
  94. package/dist/types/excalidraw/actions/index.d.ts +7 -2
  95. package/dist/types/excalidraw/actions/manager.d.ts +1 -0
  96. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  97. package/dist/types/excalidraw/actions/types.d.ts +8 -4
  98. package/dist/types/excalidraw/{animated-trail.d.ts → animatedTrail.d.ts} +4 -3
  99. package/dist/types/excalidraw/appState.d.ts +44 -17
  100. package/dist/types/excalidraw/charts/charts.bar.d.ts +3 -0
  101. package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
  102. package/dist/types/excalidraw/charts/charts.helpers.d.ts +33 -0
  103. package/dist/types/excalidraw/charts/charts.line.d.ts +3 -0
  104. package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
  105. package/dist/types/excalidraw/charts/charts.radar.d.ts +3 -0
  106. package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
  107. package/dist/types/excalidraw/charts/index.d.ts +8 -0
  108. package/dist/types/excalidraw/clipboard.d.ts +6 -7
  109. package/dist/types/excalidraw/components/Actions.d.ts +26 -13
  110. package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -1
  111. package/dist/types/excalidraw/components/App.arrowText.d.ts +70 -0
  112. package/dist/types/excalidraw/components/App.bucketFill.d.ts +48 -0
  113. package/dist/types/excalidraw/components/App.clipboard.d.ts +31 -0
  114. package/dist/types/excalidraw/components/App.cursor.d.ts +38 -0
  115. package/dist/types/excalidraw/components/App.d.ts +376 -112
  116. package/dist/types/excalidraw/components/App.drawshape.d.ts +55 -0
  117. package/dist/types/excalidraw/components/App.duplicate.d.ts +101 -0
  118. package/dist/types/excalidraw/components/App.flowchart.d.ts +21 -0
  119. package/dist/types/excalidraw/components/App.host.d.ts +102 -0
  120. package/dist/types/excalidraw/components/App.modifiers.d.ts +38 -0
  121. package/dist/types/excalidraw/components/App.pan.d.ts +62 -0
  122. package/dist/types/excalidraw/components/App.selection.d.ts +265 -0
  123. package/dist/types/excalidraw/components/App.selectionTool.d.ts +94 -0
  124. package/dist/types/excalidraw/components/App.text.d.ts +197 -0
  125. package/dist/types/excalidraw/components/App.textTool.d.ts +140 -0
  126. package/dist/types/excalidraw/components/App.toolDrag.d.ts +63 -0
  127. package/dist/types/excalidraw/components/App.viewport.d.ts +133 -0
  128. package/dist/types/excalidraw/components/App.wheel.d.ts +30 -0
  129. package/dist/types/excalidraw/components/App.wrap.d.ts +39 -0
  130. package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
  131. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +9 -3
  132. package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +3 -1
  133. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +5 -1
  134. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +9 -2
  135. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +4 -2
  136. package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +8 -1
  137. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
  138. package/dist/types/excalidraw/components/ColorPicker/colorTopPicksDnD.d.ts +11 -0
  139. package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -1
  140. package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -2
  141. package/dist/types/excalidraw/components/CommandPalette/types.d.ts +1 -1
  142. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +4 -3
  143. package/dist/types/excalidraw/components/CursorHint.d.ts +46 -0
  144. package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -1
  145. package/dist/types/excalidraw/components/FileDropOverlay.d.ts +2 -0
  146. package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +4 -1
  147. package/dist/types/excalidraw/components/FontPicker/FontPickerList.d.ts +6 -1
  148. package/dist/types/excalidraw/components/FontPicker/fontTopPicksDnD.d.ts +12 -0
  149. package/dist/types/excalidraw/components/IconButton.d.ts +48 -0
  150. package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
  151. package/dist/types/excalidraw/components/Island.d.ts +7 -0
  152. package/dist/types/excalidraw/components/LaserPointerButton.d.ts +2 -4
  153. package/dist/types/excalidraw/components/LayerUI.d.ts +5 -2
  154. package/dist/types/excalidraw/components/LibraryMenu.d.ts +1 -1
  155. package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +6 -2
  156. package/dist/types/excalidraw/components/LibraryUnit.d.ts +7 -2
  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/Minimap/Minimap.d.ts +15 -0
  160. package/dist/types/excalidraw/components/Minimap/MinimapAnnouncementDot.d.ts +10 -0
  161. package/dist/types/excalidraw/components/Minimap/minimap-controller.chunk.d.ts +90 -0
  162. package/dist/types/excalidraw/components/Minimap/minimap-shared.chunk.d.ts +122 -0
  163. package/dist/types/excalidraw/components/Minimap/minimap-worker.chunk.d.ts +12 -0
  164. package/dist/types/excalidraw/components/MobileMenu.d.ts +4 -4
  165. package/dist/types/excalidraw/components/MobileToolbar.d.ts +9 -0
  166. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
  167. package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
  168. package/dist/types/excalidraw/components/PenModeButton.d.ts +2 -5
  169. package/dist/types/excalidraw/components/Popover.d.ts +1 -3
  170. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -1
  171. package/dist/types/excalidraw/components/{ButtonIcon.d.ts → RadioButton.d.ts} +2 -5
  172. package/dist/types/excalidraw/components/Range.d.ts +10 -4
  173. package/dist/types/excalidraw/components/SVGLayer.d.ts +1 -1
  174. package/dist/types/excalidraw/components/SearchMenu.d.ts +1 -1
  175. package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +1 -1
  176. package/dist/types/excalidraw/components/Stats/Angle.d.ts +2 -2
  177. package/dist/types/excalidraw/components/Stats/Dimension.d.ts +2 -2
  178. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +2 -2
  179. package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +2 -2
  180. package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +2 -2
  181. package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +2 -2
  182. package/dist/types/excalidraw/components/Stats/Position.d.ts +3 -3
  183. package/dist/types/excalidraw/components/Stats/utils.d.ts +4 -2
  184. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatInterface.d.ts +2 -6
  185. package/dist/types/excalidraw/components/TTDDialog/Chat/TTDChatPanel.d.ts +2 -1
  186. package/dist/types/excalidraw/components/TTDDialog/CodeMirrorEditor.d.ts +11 -0
  187. package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +2 -1
  188. package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +4 -4
  189. package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +11 -7
  190. package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +3 -3
  191. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +8 -2
  192. package/dist/types/excalidraw/components/TTDDialog/TTDPreviewPanel.d.ts +5 -2
  193. package/dist/types/excalidraw/components/TTDDialog/TTDWelcomeMessage.d.ts +1 -0
  194. package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +3 -1
  195. package/dist/types/excalidraw/components/TTDDialog/common.d.ts +4 -1
  196. package/dist/types/excalidraw/components/TTDDialog/hooks/useTextGeneration.d.ts +3 -2
  197. package/dist/types/excalidraw/components/TTDDialog/mermaid-lang-lite.d.ts +2 -0
  198. package/dist/types/excalidraw/components/TTDDialog/types.d.ts +18 -1
  199. package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +3 -3
  200. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidAutoFix.d.ts +1 -0
  201. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +26 -0
  202. package/dist/types/excalidraw/components/Toast.d.ts +8 -4
  203. package/dist/types/excalidraw/components/ToolPopover.d.ts +3 -6
  204. package/dist/types/excalidraw/components/Toolbar.d.ts +11 -0
  205. package/dist/types/excalidraw/components/Tools.d.ts +151 -0
  206. package/dist/types/excalidraw/components/Tooltip.d.ts +26 -2
  207. package/dist/types/excalidraw/components/TopPicksDnD/TopPicksContextMenu.d.ts +14 -0
  208. package/dist/types/excalidraw/components/TopPicksDnD/TopPicksTip.d.ts +11 -0
  209. package/dist/types/excalidraw/components/TopPicksDnD/topPicksDnD.d.ts +58 -0
  210. package/dist/types/excalidraw/components/UserList.d.ts +3 -2
  211. package/dist/types/excalidraw/components/ViewportStatusFrame/ViewportStatusFrame.d.ts +11 -0
  212. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +6 -2
  213. package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +3 -0
  214. package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
  215. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +30 -16
  216. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +3 -2
  217. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +11 -12
  218. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCheckbox.d.ts +5 -0
  219. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +2 -1
  220. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -1
  221. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSub.d.ts +23 -0
  222. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubContent.d.ts +8 -0
  223. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubTrigger.d.ts +12 -0
  224. package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +1 -1
  225. package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -0
  226. package/dist/types/excalidraw/components/footer/Footer.d.ts +5 -1
  227. package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +3 -2
  228. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +15 -4
  229. package/dist/types/excalidraw/components/icons.d.ts +31 -10
  230. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +27 -3
  231. package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +23 -14
  232. package/dist/types/excalidraw/components/positionElementBesideCursor.d.ts +26 -0
  233. package/dist/types/excalidraw/components/shapeActionPredicates.d.ts +39 -0
  234. package/dist/types/excalidraw/data/blob.d.ts +119 -70
  235. package/dist/types/excalidraw/data/filesystem.d.ts +3 -5
  236. package/dist/types/excalidraw/data/index.d.ts +9 -10
  237. package/dist/types/excalidraw/data/json.d.ts +68 -35
  238. package/dist/types/excalidraw/data/library.d.ts +1 -1
  239. package/dist/types/excalidraw/data/resave.d.ts +7 -2
  240. package/dist/types/excalidraw/drawShapeTrail.d.ts +16 -0
  241. package/dist/types/excalidraw/eraser/index.d.ts +2 -3
  242. package/dist/types/excalidraw/fonts/Fonts.d.ts +12 -8
  243. package/dist/types/excalidraw/history.d.ts +10 -4
  244. package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +29 -0
  245. package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
  246. package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +5 -5
  247. package/dist/types/excalidraw/{laser-trails.d.ts → laserTrails.d.ts} +5 -7
  248. package/dist/types/excalidraw/lasso/index.d.ts +2 -3
  249. package/dist/types/excalidraw/lasso/utils.d.ts +2 -0
  250. package/dist/types/excalidraw/mermaid.d.ts +7 -0
  251. package/dist/types/excalidraw/reactUtils.d.ts +1 -1
  252. package/dist/types/excalidraw/renderOverrides.d.ts +9 -0
  253. package/dist/types/excalidraw/renderer/animation.d.ts +15 -4
  254. package/dist/types/excalidraw/renderer/helpers.d.ts +25 -0
  255. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +2 -4
  256. package/dist/types/excalidraw/renderer/staticScene.d.ts +11 -6
  257. package/dist/types/excalidraw/scene/Renderer.d.ts +490 -21
  258. package/dist/types/excalidraw/scene/export.d.ts +344 -21
  259. package/dist/types/excalidraw/scene/index.d.ts +2 -2
  260. package/dist/types/excalidraw/scene/types.d.ts +30 -5
  261. package/dist/types/excalidraw/snapping.d.ts +7 -7
  262. package/dist/types/excalidraw/textAutoResizeHandle.d.ts +15 -0
  263. package/dist/types/excalidraw/types.d.ts +702 -44
  264. package/dist/types/excalidraw/viewport.d.ts +303 -0
  265. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +17 -3
  266. package/dist/types/fractional-indexing/src/index.d.ts +29 -0
  267. package/dist/types/laser-pointer/src/index.d.ts +2 -0
  268. package/dist/types/laser-pointer/src/math.d.ts +16 -0
  269. package/dist/types/laser-pointer/src/simplify.d.ts +2 -0
  270. package/dist/types/laser-pointer/src/state.d.ts +36 -0
  271. package/dist/types/math/src/constants.d.ts +0 -1
  272. package/dist/types/math/src/curve.d.ts +23 -13
  273. package/dist/types/math/src/index.d.ts +1 -0
  274. package/dist/types/math/src/pca.d.ts +79 -0
  275. package/dist/types/math/src/point.d.ts +8 -2
  276. package/dist/types/math/src/polygon.d.ts +25 -1
  277. package/dist/types/math/src/segment.d.ts +6 -0
  278. package/dist/types/math/src/types.d.ts +25 -1
  279. package/dist/types/utils/src/index.d.ts +4 -3
  280. package/dist/types/utils/src/shape.d.ts +2 -2
  281. package/package.json +2 -2
  282. package/dist/types/excalidraw/animation-frame-handler.d.ts +0 -16
  283. package/dist/types/excalidraw/charts.d.ts +0 -27
  284. package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
  285. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -15
  286. package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +0 -10
  287. package/dist/types/excalidraw/components/HandButton.d.ts +0 -10
  288. package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
  289. package/dist/types/excalidraw/components/MobileToolBar.d.ts +0 -10
  290. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -8
  291. package/dist/types/excalidraw/components/TTDDialog/utils/TTDStreamFetch.d.ts +0 -24
  292. package/dist/types/excalidraw/components/ToolButton.d.ts +0 -49
  293. package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
  294. package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -11
  295. package/dist/types/excalidraw/components/shapes.d.ts +0 -190
  296. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
  297. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
  298. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -84
  299. package/dist/types/excalidraw/cursor.d.ts +0 -5
  300. package/dist/types/excalidraw/data/reconcile.d.ts +0 -7
  301. package/dist/types/excalidraw/index.d.ts +0 -46
  302. package/dist/types/excalidraw/polyfill.d.ts +0 -2
  303. package/dist/types/excalidraw/scene/scroll.d.ts +0 -18
  304. package/dist/types/excalidraw/scene/zoom.d.ts +0 -12
  305. package/dist/types/utils/src/bbox.d.ts +0 -9
  306. package/dist/types/utils/src/export.d.ts +0 -35
  307. package/dist/types/utils/src/withinBounds.d.ts +0 -19
@@ -2,12 +2,11 @@ import { IMAGE_MIME_TYPES, MIME_TYPES } from "@excalidraw/common";
2
2
  import type { ValueOf } from "@excalidraw/common/utility-types";
3
3
  import type { ExcalidrawElement, FileId } from "@excalidraw/element/types";
4
4
  import type { AppState, DataURL, LibraryItem } from "../types";
5
- import type { FileSystemHandle } from "browser-fs-access";
6
5
  import type { ImportedLibraryData } from "./types";
7
6
  export declare const getMimeType: (blob: Blob | string) => string;
8
- export declare const getFileHandleType: (handle: FileSystemHandle | null) => string | null;
7
+ export declare const getFileHandleType: (handle: FileSystemFileHandle | null) => string | null;
9
8
  export declare const isImageFileHandleType: (type: string | null) => type is "png" | "svg";
10
- export declare const isImageFileHandle: (handle: FileSystemHandle | null) => boolean;
9
+ export declare const isImageFileHandle: (handle: FileSystemFileHandle | null) => handle is FileSystemFileHandle;
11
10
  export declare const isSupportedImageFileType: (type: string | null | undefined) => boolean;
12
11
  export declare const isSupportedImageFile: (blob: Blob | null | undefined) => blob is Blob & {
13
12
  type: ValueOf<typeof IMAGE_MIME_TYPES>;
@@ -15,8 +14,8 @@ export declare const isSupportedImageFile: (blob: Blob | null | undefined) => bl
15
14
  export declare const loadSceneOrLibraryFromBlob: (blob: Blob | File,
16
15
  /** @see restore.localAppState */
17
16
  localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null,
18
- /** FileSystemHandle. Defaults to `blob.handle` if defined, otherwise null. */
19
- fileHandle?: FileSystemHandle | null) => Promise<{
17
+ /** FileSystemFileHandle. Defaults to `blob.handle` if defined, otherwise null. */
18
+ fileHandle?: FileSystemFileHandle | null) => Promise<{
20
19
  type: "application/vnd.excalidraw+json";
21
20
  data: {
22
21
  elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
@@ -31,6 +30,11 @@ fileHandle?: FileSystemHandle | null) => Promise<{
31
30
  };
32
31
  name: string | null;
33
32
  zoom: import("../types").Zoom;
33
+ isBindingEnabled: boolean;
34
+ isMidpointSnappingEnabled: boolean;
35
+ selectedElementIds: Readonly<{
36
+ [id: string]: true;
37
+ }>;
34
38
  scrollX: number;
35
39
  scrollY: number;
36
40
  viewModeEnabled: boolean;
@@ -46,12 +50,18 @@ fileHandle?: FileSystemHandle | null) => Promise<{
46
50
  } | {
47
51
  name: "elementLinkSelector";
48
52
  sourceElementId: ExcalidrawElement["id"];
53
+ } | {
54
+ name: "charts";
55
+ data: import("../charts").Spreadsheet;
56
+ rawText: string;
49
57
  };
50
58
  editingGroupId: import("@excalidraw/element/types").GroupId | null;
51
- selectedElementIds: Readonly<{
52
- [id: string]: true;
53
- }>;
54
59
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
60
+ activeTool: {
61
+ lastActiveTool: import("../types").ActiveTool | null;
62
+ locked: boolean;
63
+ fromSelection: boolean;
64
+ } & import("../types").ActiveTool;
55
65
  activeEmbeddable: {
56
66
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
57
67
  state: "hover" | "active";
@@ -63,14 +73,28 @@ fileHandle?: FileSystemHandle | null) => Promise<{
63
73
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
64
74
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
65
75
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
66
- isBindingEnabled: boolean;
67
- suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
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;
68
92
  isRotating: boolean;
69
- elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
93
+ elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
70
94
  collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
71
95
  snapLines: readonly import("../snapping").SnapLine[];
72
96
  zenModeEnabled: boolean;
73
- editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
97
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
74
98
  isCropping: boolean;
75
99
  croppingElementId: ExcalidrawElement["id"] | null;
76
100
  searchMatches: Readonly<{
@@ -83,8 +107,7 @@ fileHandle?: FileSystemHandle | null) => Promise<{
83
107
  }>;
84
108
  shouldCacheIgnoreZoom: boolean;
85
109
  exportScale: number;
86
- bindMode: import("@excalidraw/element/types").BindMode;
87
- gridSize: number;
110
+ currentItemArrowType: "sharp" | "round" | "elbow";
88
111
  contextMenu: {
89
112
  items: import("../components/ContextMenu").ContextMenuItems;
90
113
  top: number;
@@ -94,13 +117,11 @@ fileHandle?: FileSystemHandle | null) => Promise<{
94
117
  isLoading: boolean;
95
118
  errorMessage: React.ReactNode;
96
119
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
97
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
98
- editingFrame: string | null;
99
- activeTool: {
100
- lastActiveTool: import("../types").ActiveTool | null;
101
- locked: boolean;
102
- fromSelection: boolean;
103
- } & import("../types").ActiveTool;
120
+ boxSelectionMode: import("../types").BoxSelectionMode;
121
+ bindingPreference: "enabled" | "disabled";
122
+ showHints: boolean;
123
+ inputDevice: import("../types").InputDevice;
124
+ editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
104
125
  preferredSelectionTool: {
105
126
  type: "selection" | "lasso";
106
127
  initialized: boolean;
@@ -111,11 +132,14 @@ fileHandle?: FileSystemHandle | null) => Promise<{
111
132
  exportEmbedScene: boolean;
112
133
  exportWithDarkMode: boolean;
113
134
  currentItemStrokeColor: string;
135
+ currentItemStickynoteStrokeColor: string;
136
+ currentItemStickynoteBackgroundColor: string;
114
137
  currentItemBackgroundColor: string;
115
138
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
116
- currentItemStrokeWidth: number;
139
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
117
140
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
118
141
  currentItemRoughness: number;
142
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
119
143
  currentItemOpacity: number;
120
144
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
121
145
  currentItemFontSize: number;
@@ -124,7 +148,7 @@ fileHandle?: FileSystemHandle | null) => Promise<{
124
148
  currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
125
149
  currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
126
150
  currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
127
- currentItemArrowType: "sharp" | "round" | "elbow";
151
+ scrollConstraints: import("../types").ScrollConstraints | null;
128
152
  cursorButton: "up" | "down";
129
153
  scrolledOutside: boolean;
130
154
  isResizing: boolean;
@@ -141,36 +165,36 @@ fileHandle?: FileSystemHandle | null) => Promise<{
141
165
  };
142
166
  selectedElementsAreBeingDragged: boolean;
143
167
  toast: {
144
- message: string;
168
+ message: React.ReactNode;
145
169
  closable?: boolean;
146
170
  duration?: number;
147
171
  } | null;
172
+ minimapEnabled: boolean;
173
+ gridSize: number;
148
174
  gridStep: number;
149
- gridModeEnabled: boolean;
150
- fileHandle: FileSystemHandle | null;
175
+ fileHandle: FileSystemFileHandle | null;
151
176
  stats: {
152
177
  open: boolean;
153
178
  panels: number;
154
179
  };
155
- currentChartType: import("@excalidraw/element/types").ChartType;
156
- pasteDialog: {
157
- shown: false;
158
- data: null;
159
- } | {
160
- shown: true;
161
- data: import("../charts").Spreadsheet;
162
- };
163
180
  showHyperlinkPopup: false | "info" | "editor";
164
181
  originSnapOffset: {
165
182
  x: number;
166
183
  y: number;
167
184
  } | null;
168
185
  objectsSnapModeEnabled: boolean;
169
- userToFollow: import("../types").UserToFollow | null;
170
- followedBy: Set<import("../types").SocketId>;
171
186
  lockedMultiSelections: {
172
187
  [groupId: string]: true;
173
188
  };
189
+ bindMode: import("@excalidraw/element/types").BindMode;
190
+ colorTopPicks: {
191
+ elementStroke: readonly string[] | null;
192
+ elementBackground: readonly string[] | null;
193
+ bucketFill: readonly string[] | null;
194
+ stickyNoteStroke: readonly string[] | null;
195
+ stickyNoteBackground: readonly string[] | null;
196
+ };
197
+ fontTopPicks: readonly import("@excalidraw/element/types").FontFamilyValues[] | null;
174
198
  };
175
199
  files: import("../types").BinaryFiles;
176
200
  };
@@ -181,8 +205,8 @@ fileHandle?: FileSystemHandle | null) => Promise<{
181
205
  export declare const loadFromBlob: (blob: Blob,
182
206
  /** @see restore.localAppState */
183
207
  localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null,
184
- /** FileSystemHandle. Defaults to `blob.handle` if defined, otherwise null. */
185
- fileHandle?: FileSystemHandle | null) => Promise<{
208
+ /** FileSystemFileHandle. Defaults to `blob.handle` if defined, otherwise null. */
209
+ fileHandle?: FileSystemFileHandle | null) => Promise<{
186
210
  elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
187
211
  appState: {
188
212
  viewBackgroundColor: string;
@@ -195,6 +219,11 @@ fileHandle?: FileSystemHandle | null) => Promise<{
195
219
  };
196
220
  name: string | null;
197
221
  zoom: import("../types").Zoom;
222
+ isBindingEnabled: boolean;
223
+ isMidpointSnappingEnabled: boolean;
224
+ selectedElementIds: Readonly<{
225
+ [id: string]: true;
226
+ }>;
198
227
  scrollX: number;
199
228
  scrollY: number;
200
229
  viewModeEnabled: boolean;
@@ -210,12 +239,18 @@ fileHandle?: FileSystemHandle | null) => Promise<{
210
239
  } | {
211
240
  name: "elementLinkSelector";
212
241
  sourceElementId: ExcalidrawElement["id"];
242
+ } | {
243
+ name: "charts";
244
+ data: import("../charts").Spreadsheet;
245
+ rawText: string;
213
246
  };
214
247
  editingGroupId: import("@excalidraw/element/types").GroupId | null;
215
- selectedElementIds: Readonly<{
216
- [id: string]: true;
217
- }>;
218
248
  frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
249
+ activeTool: {
250
+ lastActiveTool: import("../types").ActiveTool | null;
251
+ locked: boolean;
252
+ fromSelection: boolean;
253
+ } & import("../types").ActiveTool;
219
254
  activeEmbeddable: {
220
255
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
221
256
  state: "hover" | "active";
@@ -227,14 +262,28 @@ fileHandle?: FileSystemHandle | null) => Promise<{
227
262
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
228
263
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
229
264
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
230
- isBindingEnabled: boolean;
231
- suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
265
+ gridModeEnabled: boolean;
266
+ suggestedBinding: {
267
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
268
+ midPoint?: import("@excalidraw/math").GlobalPoint;
269
+ } | null;
270
+ textToolHover: {
271
+ type: "text";
272
+ elementId: ExcalidrawElement["id"];
273
+ } | {
274
+ type: "container";
275
+ elementId: ExcalidrawElement["id"];
276
+ } | {
277
+ type: "arrow";
278
+ elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
279
+ anchor: "start" | "end" | "label";
280
+ } | null;
232
281
  isRotating: boolean;
233
- elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
282
+ elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
234
283
  collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
235
284
  snapLines: readonly import("../snapping").SnapLine[];
236
285
  zenModeEnabled: boolean;
237
- editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
286
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
238
287
  isCropping: boolean;
239
288
  croppingElementId: ExcalidrawElement["id"] | null;
240
289
  searchMatches: Readonly<{
@@ -247,8 +296,7 @@ fileHandle?: FileSystemHandle | null) => Promise<{
247
296
  }>;
248
297
  shouldCacheIgnoreZoom: boolean;
249
298
  exportScale: number;
250
- bindMode: import("@excalidraw/element/types").BindMode;
251
- gridSize: number;
299
+ currentItemArrowType: "sharp" | "round" | "elbow";
252
300
  contextMenu: {
253
301
  items: import("../components/ContextMenu").ContextMenuItems;
254
302
  top: number;
@@ -258,13 +306,11 @@ fileHandle?: FileSystemHandle | null) => Promise<{
258
306
  isLoading: boolean;
259
307
  errorMessage: React.ReactNode;
260
308
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
261
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
262
- editingFrame: string | null;
263
- activeTool: {
264
- lastActiveTool: import("../types").ActiveTool | null;
265
- locked: boolean;
266
- fromSelection: boolean;
267
- } & import("../types").ActiveTool;
309
+ boxSelectionMode: import("../types").BoxSelectionMode;
310
+ bindingPreference: "enabled" | "disabled";
311
+ showHints: boolean;
312
+ inputDevice: import("../types").InputDevice;
313
+ editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
268
314
  preferredSelectionTool: {
269
315
  type: "selection" | "lasso";
270
316
  initialized: boolean;
@@ -275,11 +321,14 @@ fileHandle?: FileSystemHandle | null) => Promise<{
275
321
  exportEmbedScene: boolean;
276
322
  exportWithDarkMode: boolean;
277
323
  currentItemStrokeColor: string;
324
+ currentItemStickynoteStrokeColor: string;
325
+ currentItemStickynoteBackgroundColor: string;
278
326
  currentItemBackgroundColor: string;
279
327
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
280
- currentItemStrokeWidth: number;
328
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
281
329
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
282
330
  currentItemRoughness: number;
331
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
283
332
  currentItemOpacity: number;
284
333
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
285
334
  currentItemFontSize: number;
@@ -288,7 +337,7 @@ fileHandle?: FileSystemHandle | null) => Promise<{
288
337
  currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
289
338
  currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
290
339
  currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
291
- currentItemArrowType: "sharp" | "round" | "elbow";
340
+ scrollConstraints: import("../types").ScrollConstraints | null;
292
341
  cursorButton: "up" | "down";
293
342
  scrolledOutside: boolean;
294
343
  isResizing: boolean;
@@ -305,36 +354,36 @@ fileHandle?: FileSystemHandle | null) => Promise<{
305
354
  };
306
355
  selectedElementsAreBeingDragged: boolean;
307
356
  toast: {
308
- message: string;
357
+ message: React.ReactNode;
309
358
  closable?: boolean;
310
359
  duration?: number;
311
360
  } | null;
361
+ minimapEnabled: boolean;
362
+ gridSize: number;
312
363
  gridStep: number;
313
- gridModeEnabled: boolean;
314
- fileHandle: FileSystemHandle | null;
364
+ fileHandle: FileSystemFileHandle | null;
315
365
  stats: {
316
366
  open: boolean;
317
367
  panels: number;
318
368
  };
319
- currentChartType: import("@excalidraw/element/types").ChartType;
320
- pasteDialog: {
321
- shown: false;
322
- data: null;
323
- } | {
324
- shown: true;
325
- data: import("../charts").Spreadsheet;
326
- };
327
369
  showHyperlinkPopup: false | "info" | "editor";
328
370
  originSnapOffset: {
329
371
  x: number;
330
372
  y: number;
331
373
  } | null;
332
374
  objectsSnapModeEnabled: boolean;
333
- userToFollow: import("../types").UserToFollow | null;
334
- followedBy: Set<import("../types").SocketId>;
335
375
  lockedMultiSelections: {
336
376
  [groupId: string]: true;
337
377
  };
378
+ bindMode: import("@excalidraw/element/types").BindMode;
379
+ colorTopPicks: {
380
+ elementStroke: readonly string[] | null;
381
+ elementBackground: readonly string[] | null;
382
+ bucketFill: readonly string[] | null;
383
+ stickyNoteStroke: readonly string[] | null;
384
+ stickyNoteBackground: readonly string[] | null;
385
+ };
386
+ fontTopPicks: readonly import("@excalidraw/element/types").FontFamilyValues[] | null;
338
387
  };
339
388
  files: import("../types").BinaryFiles;
340
389
  }>;
@@ -358,7 +407,7 @@ export declare const SVGStringToFile: (SVGString: string, filename?: string) =>
358
407
  type: typeof MIME_TYPES.svg;
359
408
  };
360
409
  export declare const ImageURLToFile: (imageUrl: string, filename?: string) => Promise<File | undefined>;
361
- export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTransferItem) => Promise<FileSystemHandle | null>;
410
+ export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTransferItem) => Promise<FileSystemFileHandle | null>;
362
411
  export declare const createFile: (blob: File | Blob | ArrayBuffer, mimeType: string, name: string | undefined) => File;
363
412
  /** attempts to detect correct mimeType if none is set, or if an image
364
413
  * has an incorrect extension.
@@ -1,6 +1,5 @@
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
5
  extensions?: FILE_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,5 @@
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";
2
+ import type { RenderEnvironment } from "@excalidraw/element";
3
3
  import type { ExportType } from "../scene/types";
4
4
  import type { AppState, BinaryFiles } from "../types";
5
5
  export { loadFromBlob } from "./blob";
@@ -7,16 +7,15 @@ export { loadFromJSON, saveAsJSON } from "./json";
7
7
  export type ExportedElements = readonly NonDeletedExcalidrawElement[] & {
8
8
  _brand: "exportedElements";
9
9
  };
10
- export declare const prepareElementsForExport: (elements: readonly ExcalidrawElement[], { selectedElementIds }: Pick<AppState, "selectedElementIds">, exportSelectionOnly: boolean) => {
11
- exportingFrame: ExcalidrawFrameLikeElement | null;
10
+ export declare const prepareElementsForExport: (allElements: readonly ExcalidrawElement[], { selectedElementIds }: Pick<AppState, "selectedElementIds">, exportSelectionOnly: boolean) => {
11
+ exportingFrame: NonDeleted<ExcalidrawFrameLikeElement> | null;
12
12
  exportedElements: ExportedElements;
13
13
  };
14
- export declare const exportCanvas: (type: Omit<ExportType, "backend">, elements: ExportedElements, appState: AppState, files: BinaryFiles, { exportBackground, exportPadding, viewBackgroundColor, name, fileHandle, exportingFrame, }: {
15
- exportBackground: boolean;
14
+ export declare const exportCanvas: (type: Omit<ExportType, "backend">, elements: ExportedElements, appState: AppState, files: BinaryFiles, { exportPadding, name, fileHandle, exportingFrame, renderEnvironment, }: {
16
15
  exportPadding?: number;
17
- viewBackgroundColor: string;
18
16
  /** filename, if applicable */
19
17
  name?: string;
20
- fileHandle?: FileSystemHandle | null;
21
- exportingFrame: ExcalidrawFrameLikeElement | null;
22
- }) => Promise<FileSystemHandle | null | undefined>;
18
+ fileHandle?: FileSystemFileHandle | null;
19
+ exportingFrame: NonDeleted<ExcalidrawFrameLikeElement> | null;
20
+ renderEnvironment?: RenderEnvironment;
21
+ }) => Promise<FileSystemFileHandle | null | undefined>;
@@ -1,11 +1,19 @@
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,
6
- /** filename */
7
- name?: string) => Promise<{
8
- 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;
9
17
  }>;
10
18
  export declare const loadFromJSON: (localAppState: AppState, localElements: readonly ExcalidrawElement[] | null) => Promise<{
11
19
  elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
@@ -20,6 +28,11 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
20
28
  };
21
29
  name: string | null;
22
30
  zoom: import("../types").Zoom;
31
+ isBindingEnabled: boolean;
32
+ isMidpointSnappingEnabled: boolean;
33
+ selectedElementIds: Readonly<{
34
+ [id: string]: true;
35
+ }>;
23
36
  scrollX: number;
24
37
  scrollY: number;
25
38
  viewModeEnabled: boolean;
@@ -35,12 +48,18 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
35
48
  } | {
36
49
  name: "elementLinkSelector";
37
50
  sourceElementId: ExcalidrawElement["id"];
51
+ } | {
52
+ name: "charts";
53
+ data: import("../charts").Spreadsheet;
54
+ rawText: string;
38
55
  };
39
56
  editingGroupId: import("@excalidraw/element/types").GroupId | null;
40
- selectedElementIds: Readonly<{
41
- [id: string]: true;
42
- }>;
43
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;
44
63
  activeEmbeddable: {
45
64
  element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
46
65
  state: "hover" | "active";
@@ -52,14 +71,28 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
52
71
  selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
53
72
  multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
54
73
  newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
55
- isBindingEnabled: boolean;
56
- suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
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
+ textToolHover: {
80
+ type: "text";
81
+ elementId: ExcalidrawElement["id"];
82
+ } | {
83
+ type: "container";
84
+ elementId: ExcalidrawElement["id"];
85
+ } | {
86
+ type: "arrow";
87
+ elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"];
88
+ anchor: "start" | "end" | "label";
89
+ } | null;
57
90
  isRotating: boolean;
58
- elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
91
+ elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null;
59
92
  collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
60
93
  snapLines: readonly import("../snapping").SnapLine[];
61
94
  zenModeEnabled: boolean;
62
- editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
95
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
63
96
  isCropping: boolean;
64
97
  croppingElementId: ExcalidrawElement["id"] | null;
65
98
  searchMatches: Readonly<{
@@ -72,8 +105,7 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
72
105
  }>;
73
106
  shouldCacheIgnoreZoom: boolean;
74
107
  exportScale: number;
75
- bindMode: import("@excalidraw/element/types").BindMode;
76
- gridSize: number;
108
+ currentItemArrowType: "sharp" | "round" | "elbow";
77
109
  contextMenu: {
78
110
  items: import("../components/ContextMenu").ContextMenuItems;
79
111
  top: number;
@@ -83,13 +115,11 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
83
115
  isLoading: boolean;
84
116
  errorMessage: React.ReactNode;
85
117
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
86
- startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
87
- editingFrame: string | null;
88
- activeTool: {
89
- lastActiveTool: import("../types").ActiveTool | null;
90
- locked: boolean;
91
- fromSelection: boolean;
92
- } & import("../types").ActiveTool;
118
+ boxSelectionMode: import("../types").BoxSelectionMode;
119
+ bindingPreference: "enabled" | "disabled";
120
+ showHints: boolean;
121
+ inputDevice: import("../types").InputDevice;
122
+ editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null;
93
123
  preferredSelectionTool: {
94
124
  type: "selection" | "lasso";
95
125
  initialized: boolean;
@@ -100,11 +130,14 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
100
130
  exportEmbedScene: boolean;
101
131
  exportWithDarkMode: boolean;
102
132
  currentItemStrokeColor: string;
133
+ currentItemStickynoteStrokeColor: string;
134
+ currentItemStickynoteBackgroundColor: string;
103
135
  currentItemBackgroundColor: string;
104
136
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
105
- currentItemStrokeWidth: number;
137
+ currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey;
106
138
  currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
107
139
  currentItemRoughness: number;
140
+ currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability;
108
141
  currentItemOpacity: number;
109
142
  currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues;
110
143
  currentItemFontSize: number;
@@ -113,7 +146,7 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
113
146
  currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
114
147
  currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
115
148
  currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
116
- currentItemArrowType: "sharp" | "round" | "elbow";
149
+ scrollConstraints: import("../types").ScrollConstraints | null;
117
150
  cursorButton: "up" | "down";
118
151
  scrolledOutside: boolean;
119
152
  isResizing: boolean;
@@ -130,36 +163,36 @@ export declare const loadFromJSON: (localAppState: AppState, localElements: read
130
163
  };
131
164
  selectedElementsAreBeingDragged: boolean;
132
165
  toast: {
133
- message: string;
166
+ message: React.ReactNode;
134
167
  closable?: boolean;
135
168
  duration?: number;
136
169
  } | null;
170
+ minimapEnabled: boolean;
171
+ gridSize: number;
137
172
  gridStep: number;
138
- gridModeEnabled: boolean;
139
- fileHandle: import("browser-fs-access").FileSystemHandle | null;
173
+ fileHandle: FileSystemFileHandle | null;
140
174
  stats: {
141
175
  open: boolean;
142
176
  panels: number;
143
177
  };
144
- currentChartType: import("@excalidraw/element/types").ChartType;
145
- pasteDialog: {
146
- shown: false;
147
- data: null;
148
- } | {
149
- shown: true;
150
- data: import("../charts").Spreadsheet;
151
- };
152
178
  showHyperlinkPopup: false | "info" | "editor";
153
179
  originSnapOffset: {
154
180
  x: number;
155
181
  y: number;
156
182
  } | null;
157
183
  objectsSnapModeEnabled: boolean;
158
- userToFollow: import("../types").UserToFollow | null;
159
- followedBy: Set<import("../types").SocketId>;
160
184
  lockedMultiSelections: {
161
185
  [groupId: string]: true;
162
186
  };
187
+ bindMode: import("@excalidraw/element/types").BindMode;
188
+ colorTopPicks: {
189
+ elementStroke: readonly string[] | null;
190
+ elementBackground: readonly string[] | null;
191
+ bucketFill: readonly string[] | null;
192
+ stickyNoteStroke: readonly string[] | null;
193
+ stickyNoteBackground: readonly string[] | null;
194
+ };
195
+ fontTopPicks: readonly import("@excalidraw/element/types").FontFamilyValues[] | null;
163
196
  };
164
197
  files: BinaryFiles;
165
198
  }>;
@@ -37,7 +37,7 @@ export interface LibraryMigrationAdapter {
37
37
  /** clears entire storage afterwards */
38
38
  clear(): MaybePromise<void>;
39
39
  }
40
- export declare const libraryItemsAtom: import("jotai/vanilla/atom").PrimitiveAtom<{
40
+ export declare const libraryItemsAtom: import("jotai").PrimitiveAtom<{
41
41
  status: "loading" | "loaded";
42
42
  /** indicates whether library is initialized with library items (has gone
43
43
  * through at least one update). Used in UI. Specific to this atom only. */
@@ -1,5 +1,10 @@
1
+ import type { MaybePromise } from "@excalidraw/common/utility-types";
1
2
  import type { ExcalidrawElement } from "@excalidraw/element/types";
2
3
  import type { AppState, BinaryFiles } from "../types";
3
- export declare const resaveAsImageWithScene: (elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles, name: string) => Promise<{
4
- fileHandle: import("browser-fs-access").FileSystemHandle;
4
+ export declare const resaveAsImageWithScene: (data: MaybePromise<{
5
+ elements: readonly ExcalidrawElement[];
6
+ appState: AppState;
7
+ files: BinaryFiles;
8
+ }>, fileHandle: FileSystemFileHandle, filename: string) => Promise<{
9
+ fileHandle: FileSystemFileHandle;
5
10
  }>;