@excalidraw/math 0.18.0-3a5ef40 → 0.18.0-3c916c5

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