@wildmio/excalidraw-common 0.18.0-custom.1

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 (379) hide show
  1. package/README.md +19 -0
  2. package/dist/dev/index.js +2695 -0
  3. package/dist/dev/index.js.map +7 -0
  4. package/dist/prod/index.js +4 -0
  5. package/dist/types/common/src/binary-heap.d.ts +12 -0
  6. package/dist/types/common/src/bounds.d.ts +10 -0
  7. package/dist/types/common/src/colors.d.ts +62 -0
  8. package/dist/types/common/src/constants.d.ts +352 -0
  9. package/dist/types/common/src/editorInterface.d.ts +34 -0
  10. package/dist/types/common/src/emitter.d.ts +16 -0
  11. package/dist/types/common/src/font-metadata.d.ts +46 -0
  12. package/dist/types/common/src/index.d.ts +15 -0
  13. package/dist/types/common/src/keys.d.ts +189 -0
  14. package/dist/types/common/src/points.d.ts +9 -0
  15. package/dist/types/common/src/promise-pool.d.ts +6 -0
  16. package/dist/types/common/src/queue.d.ts +9 -0
  17. package/dist/types/common/src/random.d.ts +3 -0
  18. package/dist/types/common/src/url.d.ts +7 -0
  19. package/dist/types/common/src/utility-types.d.ts +37 -0
  20. package/dist/types/common/src/utils.d.ts +279 -0
  21. package/dist/types/common/src/visualdebug.d.ts +41 -0
  22. package/dist/types/element/src/Scene.d.ts +80 -0
  23. package/dist/types/element/src/align.d.ts +8 -0
  24. package/dist/types/element/src/binding.d.ts +124 -0
  25. package/dist/types/element/src/bounds.d.ts +81 -0
  26. package/dist/types/element/src/collision.d.ts +36 -0
  27. package/dist/types/element/src/comparisons.d.ts +8 -0
  28. package/dist/types/element/src/containerCache.d.ts +11 -0
  29. package/dist/types/element/src/cropElement.d.ts +19 -0
  30. package/dist/types/element/src/delta.d.ts +228 -0
  31. package/dist/types/element/src/distance.d.ts +3 -0
  32. package/dist/types/element/src/distribute.d.ts +7 -0
  33. package/dist/types/element/src/dragElements.d.ts +33 -0
  34. package/dist/types/element/src/duplicate.d.ts +63 -0
  35. package/dist/types/element/src/elbowArrow.d.ts +17 -0
  36. package/dist/types/element/src/elementLink.d.ts +13 -0
  37. package/dist/types/element/src/embeddable.d.ts +10 -0
  38. package/dist/types/element/src/flowchart.d.ts +26 -0
  39. package/dist/types/element/src/fractionalIndex.d.ts +57 -0
  40. package/dist/types/element/src/frame.d.ts +74 -0
  41. package/dist/types/element/src/groups.d.ts +34 -0
  42. package/dist/types/element/src/heading.d.ts +16 -0
  43. package/dist/types/element/src/image.d.ts +22 -0
  44. package/dist/types/element/src/index.d.ts +56 -0
  45. package/dist/types/element/src/linearElementEditor.d.ts +113 -0
  46. package/dist/types/element/src/mutateElement.d.ts +23 -0
  47. package/dist/types/element/src/newElement.d.ts +62 -0
  48. package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
  49. package/dist/types/element/src/renderElement.d.ts +31 -0
  50. package/dist/types/element/src/resizeElements.d.ts +32 -0
  51. package/dist/types/element/src/resizeTest.d.ts +16 -0
  52. package/dist/types/element/src/selection.d.ts +34 -0
  53. package/dist/types/element/src/shape.d.ts +42 -0
  54. package/dist/types/element/src/showSelectedShapeActions.d.ts +3 -0
  55. package/dist/types/element/src/sizeHelpers.d.ts +35 -0
  56. package/dist/types/element/src/sortElements.d.ts +2 -0
  57. package/dist/types/element/src/store.d.ts +237 -0
  58. package/dist/types/element/src/textElement.d.ts +40 -0
  59. package/dist/types/element/src/textMeasurements.d.ts +39 -0
  60. package/dist/types/element/src/textWrapping.d.ts +13 -0
  61. package/dist/types/element/src/transform.d.ts +81 -0
  62. package/dist/types/element/src/transformHandles.d.ts +36 -0
  63. package/dist/types/element/src/typeChecks.d.ts +54 -0
  64. package/dist/types/element/src/types.d.ts +291 -0
  65. package/dist/types/element/src/utils.d.ts +34 -0
  66. package/dist/types/element/src/zindex.d.ts +13 -0
  67. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +485 -0
  68. package/dist/types/excalidraw/actions/actionAlign.d.ts +109 -0
  69. package/dist/types/excalidraw/actions/actionBoundText.d.ts +360 -0
  70. package/dist/types/excalidraw/actions/actionCanvas.d.ts +2059 -0
  71. package/dist/types/excalidraw/actions/actionClipboard.d.ts +399 -0
  72. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +174 -0
  73. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +519 -0
  74. package/dist/types/excalidraw/actions/actionDistribute.d.ts +34 -0
  75. package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +17 -0
  76. package/dist/types/excalidraw/actions/actionElementLink.d.ts +194 -0
  77. package/dist/types/excalidraw/actions/actionElementLock.d.ts +346 -0
  78. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +171 -0
  79. package/dist/types/excalidraw/actions/actionExport.d.ts +683 -0
  80. package/dist/types/excalidraw/actions/actionFinalize.d.ts +13 -0
  81. package/dist/types/excalidraw/actions/actionFlip.d.ts +34 -0
  82. package/dist/types/excalidraw/actions/actionFrame.d.ts +1150 -0
  83. package/dist/types/excalidraw/actions/actionGroup.d.ts +350 -0
  84. package/dist/types/excalidraw/actions/actionHistory.d.ts +6 -0
  85. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +659 -0
  86. package/dist/types/excalidraw/actions/actionLink.d.ts +175 -0
  87. package/dist/types/excalidraw/actions/actionMenu.d.ts +163 -0
  88. package/dist/types/excalidraw/actions/actionNavigate.d.ts +20 -0
  89. package/dist/types/excalidraw/actions/actionProperties.d.ts +402 -0
  90. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +170 -0
  91. package/dist/types/excalidraw/actions/actionStyles.d.ts +188 -0
  92. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +17 -0
  93. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +177 -0
  94. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +175 -0
  95. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +166 -0
  96. package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
  97. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +174 -0
  98. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +175 -0
  99. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +175 -0
  100. package/dist/types/excalidraw/actions/actionZindex.d.ts +74 -0
  101. package/dist/types/excalidraw/actions/index.d.ts +28 -0
  102. package/dist/types/excalidraw/actions/manager.d.ts +21 -0
  103. package/dist/types/excalidraw/actions/register.d.ts +5 -0
  104. package/dist/types/excalidraw/actions/shortcuts.d.ts +4 -0
  105. package/dist/types/excalidraw/actions/types.d.ts +47 -0
  106. package/dist/types/excalidraw/analytics.d.ts +1 -0
  107. package/dist/types/excalidraw/animated-trail.d.ts +39 -0
  108. package/dist/types/excalidraw/animation-frame-handler.d.ts +16 -0
  109. package/dist/types/excalidraw/appState.d.ts +102 -0
  110. package/dist/types/excalidraw/charts.d.ts +27 -0
  111. package/dist/types/excalidraw/clients.d.ts +14 -0
  112. package/dist/types/excalidraw/clipboard.d.ts +105 -0
  113. package/dist/types/excalidraw/components/Actions.d.ts +47 -0
  114. package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +4 -0
  115. package/dist/types/excalidraw/components/App.d.ts +563 -0
  116. package/dist/types/excalidraw/components/Avatar.d.ts +11 -0
  117. package/dist/types/excalidraw/components/BraveMeasureTextError.d.ts +2 -0
  118. package/dist/types/excalidraw/components/Button.d.ts +17 -0
  119. package/dist/types/excalidraw/components/ButtonIcon.d.ts +16 -0
  120. package/dist/types/excalidraw/components/ButtonSeparator.d.ts +1 -0
  121. package/dist/types/excalidraw/components/Card.d.ts +6 -0
  122. package/dist/types/excalidraw/components/CheckboxItem.d.ts +8 -0
  123. package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +10 -0
  124. package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +23 -0
  125. package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +8 -0
  126. package/dist/types/excalidraw/components/ColorPicker/HotkeyLabel.d.ts +7 -0
  127. package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +19 -0
  128. package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +10 -0
  129. package/dist/types/excalidraw/components/ColorPicker/PickerHeading.d.ts +5 -0
  130. package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +9 -0
  131. package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +9 -0
  132. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +21 -0
  133. package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +20 -0
  134. package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +19 -0
  135. package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +2 -0
  136. package/dist/types/excalidraw/components/CommandPalette/types.d.ts +24 -0
  137. package/dist/types/excalidraw/components/ConfirmDialog.d.ts +10 -0
  138. package/dist/types/excalidraw/components/ContextMenu.d.ts +16 -0
  139. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +23 -0
  140. package/dist/types/excalidraw/components/DarkModeToggle.d.ts +7 -0
  141. package/dist/types/excalidraw/components/DefaultSidebar.d.ts +27 -0
  142. package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +4 -0
  143. package/dist/types/excalidraw/components/Dialog.d.ts +13 -0
  144. package/dist/types/excalidraw/components/DialogActionButton.d.ts +10 -0
  145. package/dist/types/excalidraw/components/ElementCanvasButtons.d.ts +7 -0
  146. package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +12 -0
  147. package/dist/types/excalidraw/components/Ellipsify.d.ts +3 -0
  148. package/dist/types/excalidraw/components/ErrorDialog.d.ts +5 -0
  149. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +15 -0
  150. package/dist/types/excalidraw/components/EyeButton.d.ts +8 -0
  151. package/dist/types/excalidraw/components/EyeDropper.d.ts +27 -0
  152. package/dist/types/excalidraw/components/FilledButton.d.ts +18 -0
  153. package/dist/types/excalidraw/components/FixedSideContainer.d.ts +9 -0
  154. package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +10 -0
  155. package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +22 -0
  156. package/dist/types/excalidraw/components/FontPicker/FontPickerList.d.ts +26 -0
  157. package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +8 -0
  158. package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +13 -0
  159. package/dist/types/excalidraw/components/HandButton.d.ts +10 -0
  160. package/dist/types/excalidraw/components/HelpButton.d.ts +7 -0
  161. package/dist/types/excalidraw/components/HelpDialog.d.ts +4 -0
  162. package/dist/types/excalidraw/components/HintViewer.d.ts +11 -0
  163. package/dist/types/excalidraw/components/IconPicker.d.ts +15 -0
  164. package/dist/types/excalidraw/components/ImageExportDialog.d.ts +14 -0
  165. package/dist/types/excalidraw/components/InitializeApp.d.ts +10 -0
  166. package/dist/types/excalidraw/components/InlineIcon.d.ts +5 -0
  167. package/dist/types/excalidraw/components/Island.d.ts +10 -0
  168. package/dist/types/excalidraw/components/JSONExportDialog.d.ts +15 -0
  169. package/dist/types/excalidraw/components/LaserPointerButton.d.ts +10 -0
  170. package/dist/types/excalidraw/components/LayerUI.d.ts +32 -0
  171. package/dist/types/excalidraw/components/LibraryMenu.d.ts +10 -0
  172. package/dist/types/excalidraw/components/LibraryMenuBrowseButton.d.ts +7 -0
  173. package/dist/types/excalidraw/components/LibraryMenuControlButtons.d.ts +9 -0
  174. package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +17 -0
  175. package/dist/types/excalidraw/components/LibraryMenuItems.d.ts +14 -0
  176. package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +23 -0
  177. package/dist/types/excalidraw/components/LibraryUnit.d.ts +14 -0
  178. package/dist/types/excalidraw/components/LoadingMessage.d.ts +5 -0
  179. package/dist/types/excalidraw/components/LockButton.d.ts +10 -0
  180. package/dist/types/excalidraw/components/MagicButton.d.ts +10 -0
  181. package/dist/types/excalidraw/components/MobileMenu.d.ts +24 -0
  182. package/dist/types/excalidraw/components/MobileToolBar.d.ts +10 -0
  183. package/dist/types/excalidraw/components/Modal.d.ts +11 -0
  184. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +17 -0
  185. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +17 -0
  186. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +22 -0
  187. package/dist/types/excalidraw/components/PasteChartDialog.d.ts +8 -0
  188. package/dist/types/excalidraw/components/PenModeButton.d.ts +12 -0
  189. package/dist/types/excalidraw/components/Popover.d.ts +16 -0
  190. package/dist/types/excalidraw/components/ProjectName.d.ts +10 -0
  191. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +16 -0
  192. package/dist/types/excalidraw/components/PublishLibrary.d.ts +16 -0
  193. package/dist/types/excalidraw/components/QuickSearch.d.ts +9 -0
  194. package/dist/types/excalidraw/components/RadioGroup.d.ts +13 -0
  195. package/dist/types/excalidraw/components/RadioSelection.d.ts +20 -0
  196. package/dist/types/excalidraw/components/Range.d.ts +8 -0
  197. package/dist/types/excalidraw/components/SVGLayer.d.ts +7 -0
  198. package/dist/types/excalidraw/components/ScrollableList.d.ts +8 -0
  199. package/dist/types/excalidraw/components/SearchMenu.d.ts +5 -0
  200. package/dist/types/excalidraw/components/Section.d.ts +6 -0
  201. package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +70 -0
  202. package/dist/types/excalidraw/components/Sidebar/SidebarHeader.d.ts +7 -0
  203. package/dist/types/excalidraw/components/Sidebar/SidebarTab.d.ts +8 -0
  204. package/dist/types/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +9 -0
  205. package/dist/types/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +6 -0
  206. package/dist/types/excalidraw/components/Sidebar/SidebarTabs.d.ts +6 -0
  207. package/dist/types/excalidraw/components/Sidebar/SidebarTrigger.d.ts +6 -0
  208. package/dist/types/excalidraw/components/Sidebar/common.d.ts +34 -0
  209. package/dist/types/excalidraw/components/Spinner.d.ts +8 -0
  210. package/dist/types/excalidraw/components/Stack.d.ts +15 -0
  211. package/dist/types/excalidraw/components/Stats/Angle.d.ts +11 -0
  212. package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +10 -0
  213. package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +10 -0
  214. package/dist/types/excalidraw/components/Stats/Dimension.d.ts +11 -0
  215. package/dist/types/excalidraw/components/Stats/DragInput.d.ts +44 -0
  216. package/dist/types/excalidraw/components/Stats/FontSize.d.ts +11 -0
  217. package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +11 -0
  218. package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +14 -0
  219. package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +12 -0
  220. package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +14 -0
  221. package/dist/types/excalidraw/components/Stats/Position.d.ts +12 -0
  222. package/dist/types/excalidraw/components/Stats/index.d.ts +35 -0
  223. package/dist/types/excalidraw/components/Stats/utils.d.ts +19 -0
  224. package/dist/types/excalidraw/components/Switch.d.ts +9 -0
  225. package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +6 -0
  226. package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +29 -0
  227. package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +9 -0
  228. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +7 -0
  229. package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +17 -0
  230. package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanels.d.ts +4 -0
  231. package/dist/types/excalidraw/components/TTDDialog/TTDDialogSubmitShortcut.d.ts +1 -0
  232. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +7 -0
  233. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +8 -0
  234. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +6 -0
  235. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabs.d.ts +11 -0
  236. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +8 -0
  237. package/dist/types/excalidraw/components/TTDDialog/common.d.ts +32 -0
  238. package/dist/types/excalidraw/components/TextField.d.ts +22 -0
  239. package/dist/types/excalidraw/components/Toast.d.ts +9 -0
  240. package/dist/types/excalidraw/components/ToolButton.d.ts +49 -0
  241. package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
  242. package/dist/types/excalidraw/components/Tooltip.d.ts +18 -0
  243. package/dist/types/excalidraw/components/Trans.d.ts +9 -0
  244. package/dist/types/excalidraw/components/UnlockPopup.d.ts +8 -0
  245. package/dist/types/excalidraw/components/UserList.d.ts +18 -0
  246. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +33 -0
  247. package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +14 -0
  248. package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +19 -0
  249. package/dist/types/excalidraw/components/canvases/index.d.ts +3 -0
  250. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +84 -0
  251. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +16 -0
  252. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +11 -0
  253. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +38 -0
  254. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +8 -0
  255. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +17 -0
  256. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +7 -0
  257. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +16 -0
  258. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSeparator.d.ts +5 -0
  259. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +10 -0
  260. package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +6 -0
  261. package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +3 -0
  262. package/dist/types/excalidraw/components/footer/Footer.d.ts +17 -0
  263. package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +8 -0
  264. package/dist/types/excalidraw/components/hoc/withInternalFallback.d.ts +4 -0
  265. package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +19 -0
  266. package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +10 -0
  267. package/dist/types/excalidraw/components/icons.d.ts +237 -0
  268. package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +11 -0
  269. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +64 -0
  270. package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +76 -0
  271. package/dist/types/excalidraw/components/shapes.d.ts +190 -0
  272. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +58 -0
  273. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +19 -0
  274. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +84 -0
  275. package/dist/types/excalidraw/context/tunnels.d.ts +21 -0
  276. package/dist/types/excalidraw/context/ui-appState.d.ts +4 -0
  277. package/dist/types/excalidraw/cursor.d.ts +5 -0
  278. package/dist/types/excalidraw/data/EditorLocalStorage.d.ts +8 -0
  279. package/dist/types/excalidraw/data/blob.d.ts +57 -0
  280. package/dist/types/excalidraw/data/encode.d.ts +55 -0
  281. package/dist/types/excalidraw/data/encryption.d.ts +9 -0
  282. package/dist/types/excalidraw/data/filesystem.d.ts +21 -0
  283. package/dist/types/excalidraw/data/image.d.ts +9 -0
  284. package/dist/types/excalidraw/data/index.d.ts +22 -0
  285. package/dist/types/excalidraw/data/json.d.ts +18 -0
  286. package/dist/types/excalidraw/data/library.d.ts +127 -0
  287. package/dist/types/excalidraw/data/reconcile.d.ts +7 -0
  288. package/dist/types/excalidraw/data/resave.d.ts +5 -0
  289. package/dist/types/excalidraw/data/restore.d.ts +35 -0
  290. package/dist/types/excalidraw/data/types.d.ts +48 -0
  291. package/dist/types/excalidraw/deburr.d.ts +1 -0
  292. package/dist/types/excalidraw/editor-jotai.d.ts +56 -0
  293. package/dist/types/excalidraw/eraser/index.d.ts +12 -0
  294. package/dist/types/excalidraw/errors.d.ts +29 -0
  295. package/dist/types/excalidraw/fonts/Cascadia/index.d.ts +2 -0
  296. package/dist/types/excalidraw/fonts/ComicShanns/index.d.ts +2 -0
  297. package/dist/types/excalidraw/fonts/Emoji/index.d.ts +2 -0
  298. package/dist/types/excalidraw/fonts/ExcalidrawFontFace.d.ts +25 -0
  299. package/dist/types/excalidraw/fonts/Excalifont/index.d.ts +2 -0
  300. package/dist/types/excalidraw/fonts/Fonts.d.ts +79 -0
  301. package/dist/types/excalidraw/fonts/Helvetica/index.d.ts +2 -0
  302. package/dist/types/excalidraw/fonts/Liberation/index.d.ts +2 -0
  303. package/dist/types/excalidraw/fonts/Lilita/index.d.ts +2 -0
  304. package/dist/types/excalidraw/fonts/Nunito/index.d.ts +2 -0
  305. package/dist/types/excalidraw/fonts/Virgil/index.d.ts +2 -0
  306. package/dist/types/excalidraw/fonts/Xiaolai/index.d.ts +8 -0
  307. package/dist/types/excalidraw/fonts/index.d.ts +1 -0
  308. package/dist/types/excalidraw/gesture.d.ts +6 -0
  309. package/dist/types/excalidraw/history.d.ts +48 -0
  310. package/dist/types/excalidraw/hooks/useCallbackRefState.d.ts +1 -0
  311. package/dist/types/excalidraw/hooks/useCopiedIndicator.d.ts +5 -0
  312. package/dist/types/excalidraw/hooks/useCreatePortalContainer.d.ts +4 -0
  313. package/dist/types/excalidraw/hooks/useEmitter.d.ts +2 -0
  314. package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +11 -0
  315. package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +21 -0
  316. package/dist/types/excalidraw/hooks/useScrollPosition.d.ts +1 -0
  317. package/dist/types/excalidraw/hooks/useStable.d.ts +1 -0
  318. package/dist/types/excalidraw/hooks/useStableCallback.d.ts +4 -0
  319. package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
  320. package/dist/types/excalidraw/hooks/useTransition.d.ts +2 -0
  321. package/dist/types/excalidraw/i18n.d.ts +24 -0
  322. package/dist/types/excalidraw/index.d.ts +45 -0
  323. package/dist/types/excalidraw/laser-trails.d.ts +20 -0
  324. package/dist/types/excalidraw/lasso/index.d.ts +16 -0
  325. package/dist/types/excalidraw/lasso/utils.d.ts +13 -0
  326. package/dist/types/excalidraw/mermaid.d.ts +2 -0
  327. package/dist/types/excalidraw/polyfill.d.ts +2 -0
  328. package/dist/types/excalidraw/reactUtils.d.ts +14 -0
  329. package/dist/types/excalidraw/renderer/animation.d.ts +12 -0
  330. package/dist/types/excalidraw/renderer/helpers.d.ts +16 -0
  331. package/dist/types/excalidraw/renderer/interactiveScene.d.ts +14 -0
  332. package/dist/types/excalidraw/renderer/renderNewElementScene.d.ts +7 -0
  333. package/dist/types/excalidraw/renderer/renderSnaps.d.ts +2 -0
  334. package/dist/types/excalidraw/renderer/roundRect.d.ts +11 -0
  335. package/dist/types/excalidraw/renderer/staticScene.d.ts +14 -0
  336. package/dist/types/excalidraw/renderer/staticSvgScene.d.ts +5 -0
  337. package/dist/types/excalidraw/scene/Renderer.d.ts +30 -0
  338. package/dist/types/excalidraw/scene/export.d.ts +36 -0
  339. package/dist/types/excalidraw/scene/index.d.ts +4 -0
  340. package/dist/types/excalidraw/scene/normalize.d.ts +4 -0
  341. package/dist/types/excalidraw/scene/scroll.d.ts +18 -0
  342. package/dist/types/excalidraw/scene/scrollbars.d.ts +11 -0
  343. package/dist/types/excalidraw/scene/types.d.ts +132 -0
  344. package/dist/types/excalidraw/scene/zoom.d.ts +12 -0
  345. package/dist/types/excalidraw/shortcut.d.ts +1 -0
  346. package/dist/types/excalidraw/snapping.d.ts +111 -0
  347. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-bindings.d.ts +45 -0
  348. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-loader.d.ts +13 -0
  349. package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-wasm.d.ts +2 -0
  350. package/dist/types/excalidraw/subset/subset-main.d.ts +12 -0
  351. package/dist/types/excalidraw/subset/subset-shared.chunk.d.ts +32 -0
  352. package/dist/types/excalidraw/subset/subset-worker.chunk.d.ts +15 -0
  353. package/dist/types/excalidraw/subset/woff2/woff2-bindings.d.ts +31 -0
  354. package/dist/types/excalidraw/subset/woff2/woff2-loader.d.ts +14 -0
  355. package/dist/types/excalidraw/subset/woff2/woff2-wasm.d.ts +2 -0
  356. package/dist/types/excalidraw/types.d.ts +744 -0
  357. package/dist/types/excalidraw/workers.d.ts +36 -0
  358. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +24 -0
  359. package/dist/types/math/src/angle.d.ts +19 -0
  360. package/dist/types/math/src/constants.d.ts +3 -0
  361. package/dist/types/math/src/curve.d.ts +74 -0
  362. package/dist/types/math/src/ellipse.d.ts +44 -0
  363. package/dist/types/math/src/index.d.ts +13 -0
  364. package/dist/types/math/src/line.d.ts +17 -0
  365. package/dist/types/math/src/point.d.ts +122 -0
  366. package/dist/types/math/src/polygon.d.ts +6 -0
  367. package/dist/types/math/src/range.d.ts +44 -0
  368. package/dist/types/math/src/rectangle.d.ts +5 -0
  369. package/dist/types/math/src/segment.d.ts +40 -0
  370. package/dist/types/math/src/triangle.d.ts +11 -0
  371. package/dist/types/math/src/types.d.ts +106 -0
  372. package/dist/types/math/src/utils.d.ts +7 -0
  373. package/dist/types/math/src/vector.d.ts +94 -0
  374. package/dist/types/utils/src/bbox.d.ts +9 -0
  375. package/dist/types/utils/src/export.d.ts +35 -0
  376. package/dist/types/utils/src/index.d.ts +4 -0
  377. package/dist/types/utils/src/shape.d.ts +58 -0
  378. package/dist/types/utils/src/withinBounds.d.ts +19 -0
  379. package/package.json +59 -0
@@ -0,0 +1,352 @@
1
+ import type { ExcalidrawElement, FontFamilyValues } from "@excalidraw/element/types";
2
+ import type { AppProps, AppState } from "@excalidraw/excalidraw/types";
3
+ export declare const supportsResizeObserver: boolean;
4
+ export declare const APP_NAME = "Excalidraw";
5
+ export declare const TEXT_AUTOWRAP_THRESHOLD = 36;
6
+ export declare const DRAGGING_THRESHOLD = 10;
7
+ export declare const MINIMUM_ARROW_SIZE = 20;
8
+ export declare const LINE_CONFIRM_THRESHOLD = 8;
9
+ export declare const ELEMENT_SHIFT_TRANSLATE_AMOUNT = 5;
10
+ export declare const ELEMENT_TRANSLATE_AMOUNT = 1;
11
+ export declare const TEXT_TO_CENTER_SNAP_THRESHOLD = 30;
12
+ export declare const SHIFT_LOCKING_ANGLE: number;
13
+ export declare const DEFAULT_LASER_COLOR = "red";
14
+ export declare const CURSOR_TYPE: {
15
+ TEXT: string;
16
+ CROSSHAIR: string;
17
+ GRABBING: string;
18
+ GRAB: string;
19
+ POINTER: string;
20
+ MOVE: string;
21
+ AUTO: string;
22
+ };
23
+ export declare const POINTER_BUTTON: {
24
+ readonly MAIN: 0;
25
+ readonly WHEEL: 1;
26
+ readonly SECONDARY: 2;
27
+ readonly TOUCH: -1;
28
+ readonly ERASER: 5;
29
+ };
30
+ export declare const POINTER_EVENTS: {
31
+ readonly enabled: "all";
32
+ readonly disabled: "none";
33
+ readonly inheritFromUI: any;
34
+ };
35
+ export declare enum EVENT {
36
+ COPY = "copy",
37
+ PASTE = "paste",
38
+ CUT = "cut",
39
+ KEYDOWN = "keydown",
40
+ KEYUP = "keyup",
41
+ MOUSE_MOVE = "mousemove",
42
+ RESIZE = "resize",
43
+ UNLOAD = "unload",
44
+ FOCUS = "focus",
45
+ BLUR = "blur",
46
+ DRAG_OVER = "dragover",
47
+ DROP = "drop",
48
+ GESTURE_END = "gestureend",
49
+ BEFORE_UNLOAD = "beforeunload",
50
+ GESTURE_START = "gesturestart",
51
+ GESTURE_CHANGE = "gesturechange",
52
+ POINTER_MOVE = "pointermove",
53
+ POINTER_DOWN = "pointerdown",
54
+ POINTER_UP = "pointerup",
55
+ STATE_CHANGE = "statechange",
56
+ WHEEL = "wheel",
57
+ TOUCH_START = "touchstart",
58
+ TOUCH_END = "touchend",
59
+ HASHCHANGE = "hashchange",
60
+ VISIBILITY_CHANGE = "visibilitychange",
61
+ SCROLL = "scroll",
62
+ EXCALIDRAW_LINK = "excalidraw-link",
63
+ MENU_ITEM_SELECT = "menu.itemSelect",
64
+ MESSAGE = "message",
65
+ FULLSCREENCHANGE = "fullscreenchange"
66
+ }
67
+ export declare const YOUTUBE_STATES: {
68
+ readonly UNSTARTED: -1;
69
+ readonly ENDED: 0;
70
+ readonly PLAYING: 1;
71
+ readonly PAUSED: 2;
72
+ readonly BUFFERING: 3;
73
+ readonly CUED: 5;
74
+ };
75
+ export declare const ENV: {
76
+ TEST: string;
77
+ DEVELOPMENT: string;
78
+ PRODUCTION: string;
79
+ };
80
+ export declare const CLASSES: {
81
+ SIDEBAR: string;
82
+ SHAPE_ACTIONS_MENU: string;
83
+ ZOOM_ACTIONS: string;
84
+ SEARCH_MENU_INPUT_WRAPPER: string;
85
+ CONVERT_ELEMENT_TYPE_POPUP: string;
86
+ SHAPE_ACTIONS_THEME_SCOPE: string;
87
+ FRAME_NAME: string;
88
+ };
89
+ export declare const FONT_SIZES: {
90
+ readonly sm: 16;
91
+ readonly md: 20;
92
+ readonly lg: 28;
93
+ readonly xl: 36;
94
+ };
95
+ export declare const CJK_HAND_DRAWN_FALLBACK_FONT = "Xiaolai";
96
+ export declare const WINDOWS_EMOJI_FALLBACK_FONT = "Segoe UI Emoji";
97
+ /**
98
+ * // TODO: shouldn't be really `const`, likely neither have integers as values, due to value for the custom fonts, which should likely be some hash.
99
+ *
100
+ * Let's think this through and consider:
101
+ * - https://developer.mozilla.org/en-US/docs/Web/CSS/generic-family
102
+ * - https://drafts.csswg.org/css-fonts-4/#font-family-prop
103
+ * - https://learn.microsoft.com/en-us/typography/opentype/spec/ibmfc
104
+ */
105
+ export declare const FONT_FAMILY: {
106
+ Virgil: number;
107
+ Helvetica: number;
108
+ Cascadia: number;
109
+ Excalifont: number;
110
+ Nunito: number;
111
+ "Lilita One": number;
112
+ "Comic Shanns": number;
113
+ "Liberation Sans": number;
114
+ Assistant: number;
115
+ };
116
+ export declare const SANS_SERIF_GENERIC_FONT = "sans-serif";
117
+ export declare const MONOSPACE_GENERIC_FONT = "monospace";
118
+ export declare const FONT_FAMILY_GENERIC_FALLBACKS: {
119
+ "sans-serif": number;
120
+ monospace: number;
121
+ };
122
+ export declare const FONT_FAMILY_FALLBACKS: {
123
+ "Segoe UI Emoji": number;
124
+ "sans-serif": number;
125
+ monospace: number;
126
+ Xiaolai: number;
127
+ };
128
+ export declare function getGenericFontFamilyFallback(fontFamily: number): keyof typeof FONT_FAMILY_GENERIC_FALLBACKS;
129
+ export declare const getFontFamilyFallbacks: (fontFamily: number) => Array<keyof typeof FONT_FAMILY_FALLBACKS>;
130
+ export declare const THEME: {
131
+ readonly LIGHT: "light";
132
+ readonly DARK: "dark";
133
+ };
134
+ export declare const FRAME_STYLE: {
135
+ strokeColor: ExcalidrawElement["strokeColor"];
136
+ strokeWidth: ExcalidrawElement["strokeWidth"];
137
+ strokeStyle: ExcalidrawElement["strokeStyle"];
138
+ fillStyle: ExcalidrawElement["fillStyle"];
139
+ roughness: ExcalidrawElement["roughness"];
140
+ roundness: ExcalidrawElement["roundness"];
141
+ backgroundColor: ExcalidrawElement["backgroundColor"];
142
+ radius: number;
143
+ nameOffsetY: number;
144
+ nameColorLightTheme: string;
145
+ nameColorDarkTheme: string;
146
+ nameFontSize: number;
147
+ nameLineHeight: number;
148
+ };
149
+ export declare const MIN_FONT_SIZE = 1;
150
+ export declare const DEFAULT_FONT_SIZE = 20;
151
+ export declare const DEFAULT_FONT_FAMILY: FontFamilyValues;
152
+ export declare const DEFAULT_TEXT_ALIGN = "left";
153
+ export declare const DEFAULT_VERTICAL_ALIGN = "top";
154
+ export declare const DEFAULT_VERSION = "{version}";
155
+ export declare const DEFAULT_TRANSFORM_HANDLE_SPACING = 2;
156
+ export declare const SIDE_RESIZING_THRESHOLD: number;
157
+ export declare const EPSILON = 0.00001;
158
+ export declare const DEFAULT_COLLISION_THRESHOLD: number;
159
+ export declare const COLOR_WHITE = "#ffffff";
160
+ export declare const COLOR_CHARCOAL_BLACK = "#1e1e1e";
161
+ export declare const COLOR_VOICE_CALL = "#a2f1a6";
162
+ export declare const CANVAS_ONLY_ACTIONS: string[];
163
+ export declare const DEFAULT_GRID_SIZE = 20;
164
+ export declare const DEFAULT_GRID_STEP = 5;
165
+ export declare const IMAGE_MIME_TYPES: {
166
+ readonly svg: "image/svg+xml";
167
+ readonly png: "image/png";
168
+ readonly jpg: "image/jpeg";
169
+ readonly gif: "image/gif";
170
+ readonly webp: "image/webp";
171
+ readonly bmp: "image/bmp";
172
+ readonly ico: "image/x-icon";
173
+ readonly avif: "image/avif";
174
+ readonly jfif: "image/jfif";
175
+ };
176
+ export declare const STRING_MIME_TYPES: {
177
+ readonly text: "text/plain";
178
+ readonly html: "text/html";
179
+ readonly json: "application/json";
180
+ readonly excalidraw: "application/vnd.excalidraw+json";
181
+ readonly excalidrawlib: "application/vnd.excalidrawlib+json";
182
+ readonly excalidrawlibIds: "application/vnd.excalidrawlib.ids+json";
183
+ };
184
+ export declare const MIME_TYPES: {
185
+ readonly svg: "image/svg+xml";
186
+ readonly png: "image/png";
187
+ readonly jpg: "image/jpeg";
188
+ readonly gif: "image/gif";
189
+ readonly webp: "image/webp";
190
+ readonly bmp: "image/bmp";
191
+ readonly ico: "image/x-icon";
192
+ readonly avif: "image/avif";
193
+ readonly jfif: "image/jfif";
194
+ readonly "excalidraw.svg": "image/svg+xml";
195
+ readonly "excalidraw.png": "image/png";
196
+ readonly binary: "application/octet-stream";
197
+ readonly text: "text/plain";
198
+ readonly html: "text/html";
199
+ readonly json: "application/json";
200
+ readonly excalidraw: "application/vnd.excalidraw+json";
201
+ readonly excalidrawlib: "application/vnd.excalidrawlib+json";
202
+ readonly excalidrawlibIds: "application/vnd.excalidrawlib.ids+json";
203
+ };
204
+ export declare const ALLOWED_PASTE_MIME_TYPES: readonly ["text/plain", "text/html", ...("image/svg+xml" | "image/png" | "image/jpeg" | "image/gif" | "image/webp" | "image/bmp" | "image/x-icon" | "image/avif" | "image/jfif")[]];
205
+ export declare const EXPORT_IMAGE_TYPES: {
206
+ readonly png: "png";
207
+ readonly svg: "svg";
208
+ readonly clipboard: "clipboard";
209
+ };
210
+ export declare const EXPORT_DATA_TYPES: {
211
+ readonly excalidraw: "excalidraw";
212
+ readonly excalidrawClipboard: "excalidraw/clipboard";
213
+ readonly excalidrawLibrary: "excalidrawlib";
214
+ readonly excalidrawClipboardWithAPI: "excalidraw-api/clipboard";
215
+ };
216
+ export declare const getExportSource: () => string;
217
+ export declare const IMAGE_RENDER_TIMEOUT = 500;
218
+ export declare const TAP_TWICE_TIMEOUT = 300;
219
+ export declare const TOUCH_CTX_MENU_TIMEOUT = 500;
220
+ export declare const TITLE_TIMEOUT = 10000;
221
+ export declare const VERSION_TIMEOUT = 30000;
222
+ export declare const SCROLL_TIMEOUT = 100;
223
+ export declare const ZOOM_STEP = 0.1;
224
+ export declare const MIN_ZOOM = 0.1;
225
+ export declare const MAX_ZOOM = 30;
226
+ export declare const HYPERLINK_TOOLTIP_DELAY = 300;
227
+ export declare const IDLE_THRESHOLD = 60000;
228
+ export declare const ACTIVE_THRESHOLD = 3000;
229
+ export declare const THEME_FILTER = "invert(93%) hue-rotate(180deg)";
230
+ export declare const URL_QUERY_KEYS: {
231
+ readonly addLibrary: "addLibrary";
232
+ };
233
+ export declare const URL_HASH_KEYS: {
234
+ readonly addLibrary: "addLibrary";
235
+ };
236
+ export declare const DEFAULT_UI_OPTIONS: AppProps["UIOptions"];
237
+ export declare const MAX_DECIMALS_FOR_SVG_EXPORT = 2;
238
+ export declare const EXPORT_SCALES: number[];
239
+ export declare const DEFAULT_EXPORT_PADDING = 10;
240
+ export declare const DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT = 1440;
241
+ export declare const MAX_ALLOWED_FILE_BYTES: number;
242
+ export declare const SVG_NS = "http://www.w3.org/2000/svg";
243
+ export declare const SVG_DOCUMENT_PREAMBLE = "<?xml version=\"1.0\" standalone=\"no\"?>\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n";
244
+ export declare const ENCRYPTION_KEY_BITS = 128;
245
+ export declare const VERSIONS: {
246
+ readonly excalidraw: 2;
247
+ readonly excalidrawLibrary: 2;
248
+ };
249
+ export declare const BOUND_TEXT_PADDING = 5;
250
+ export declare const ARROW_LABEL_WIDTH_FRACTION = 0.7;
251
+ export declare const ARROW_LABEL_FONT_SIZE_TO_MIN_WIDTH_RATIO = 11;
252
+ export declare const VERTICAL_ALIGN: {
253
+ TOP: string;
254
+ MIDDLE: string;
255
+ BOTTOM: string;
256
+ };
257
+ export declare const TEXT_ALIGN: {
258
+ LEFT: string;
259
+ CENTER: string;
260
+ RIGHT: string;
261
+ };
262
+ export declare const ELEMENT_READY_TO_ERASE_OPACITY = 20;
263
+ export declare const DEFAULT_PROPORTIONAL_RADIUS = 0.25;
264
+ export declare const DEFAULT_ADAPTIVE_RADIUS = 32;
265
+ export declare const ROUNDNESS: {
266
+ readonly LEGACY: 1;
267
+ readonly PROPORTIONAL_RADIUS: 2;
268
+ readonly ADAPTIVE_RADIUS: 3;
269
+ };
270
+ export declare const ROUGHNESS: {
271
+ readonly architect: 0;
272
+ readonly artist: 1;
273
+ readonly cartoonist: 2;
274
+ };
275
+ export declare const STROKE_WIDTH: {
276
+ readonly thin: 1;
277
+ readonly bold: 2;
278
+ readonly extraBold: 4;
279
+ };
280
+ export declare const DEFAULT_ELEMENT_PROPS: {
281
+ strokeColor: ExcalidrawElement["strokeColor"];
282
+ backgroundColor: ExcalidrawElement["backgroundColor"];
283
+ fillStyle: ExcalidrawElement["fillStyle"];
284
+ strokeWidth: ExcalidrawElement["strokeWidth"];
285
+ strokeStyle: ExcalidrawElement["strokeStyle"];
286
+ roughness: ExcalidrawElement["roughness"];
287
+ opacity: ExcalidrawElement["opacity"];
288
+ locked: ExcalidrawElement["locked"];
289
+ };
290
+ export declare const LIBRARY_SIDEBAR_TAB = "library";
291
+ export declare const CANVAS_SEARCH_TAB = "search";
292
+ export declare const DEFAULT_SIDEBAR: {
293
+ readonly name: "default";
294
+ readonly defaultTab: "library";
295
+ };
296
+ export declare const LIBRARY_DISABLED_TYPES: Set<"embeddable" | "image" | "iframe">;
297
+ export declare const TOOL_TYPE: {
298
+ readonly selection: "selection";
299
+ readonly lasso: "lasso";
300
+ readonly rectangle: "rectangle";
301
+ readonly diamond: "diamond";
302
+ readonly ellipse: "ellipse";
303
+ readonly arrow: "arrow";
304
+ readonly line: "line";
305
+ readonly freedraw: "freedraw";
306
+ readonly text: "text";
307
+ readonly image: "image";
308
+ readonly eraser: "eraser";
309
+ readonly hand: "hand";
310
+ readonly frame: "frame";
311
+ readonly magicframe: "magicframe";
312
+ readonly embeddable: "embeddable";
313
+ readonly laser: "laser";
314
+ };
315
+ export declare const EDITOR_LS_KEYS: {
316
+ readonly OAI_API_KEY: "excalidraw-oai-api-key";
317
+ readonly MERMAID_TO_EXCALIDRAW: "mermaid-to-excalidraw";
318
+ readonly PUBLISH_LIBRARY: "publish-library-data";
319
+ };
320
+ /**
321
+ * not translated as this is used only in public, stateless API as default value
322
+ * where filename is optional and we can't retrieve name from app state
323
+ */
324
+ export declare const DEFAULT_FILENAME = "Untitled";
325
+ export declare const STATS_PANELS: {
326
+ readonly generalStats: 1;
327
+ readonly elementProperties: 2;
328
+ };
329
+ export declare const MIN_WIDTH_OR_HEIGHT = 1;
330
+ export declare const ARROW_TYPE: {
331
+ [T in AppState["currentItemArrowType"]]: T;
332
+ };
333
+ export declare const DEFAULT_REDUCED_GLOBAL_ALPHA = 0.3;
334
+ export declare const ELEMENT_LINK_KEY = "element";
335
+ /** used in tests */
336
+ export declare const ORIG_ID: unique symbol;
337
+ export declare enum UserIdleState {
338
+ ACTIVE = "active",
339
+ AWAY = "away",
340
+ IDLE = "idle"
341
+ }
342
+ /**
343
+ * distance at which we merge points instead of adding a new merge-point
344
+ * when converting a line to a polygon (merge currently means overlaping
345
+ * the start and end points)
346
+ */
347
+ export declare const LINE_POLYGON_POINT_MERGE_DISTANCE = 20;
348
+ export declare const DOUBLE_TAP_POSITION_THRESHOLD = 35;
349
+ export declare const BIND_MODE_TIMEOUT = 700;
350
+ export declare const MOBILE_ACTION_BUTTON_BG: {
351
+ readonly background: "var(--mobile-action-button-bg)";
352
+ };
@@ -0,0 +1,34 @@
1
+ export type StylesPanelMode = "compact" | "full" | "mobile";
2
+ export type EditorInterface = Readonly<{
3
+ formFactor: "phone" | "tablet" | "desktop";
4
+ desktopUIMode: "compact" | "full";
5
+ userAgent: Readonly<{
6
+ isMobileDevice: boolean;
7
+ platform: "ios" | "android" | "other" | "unknown";
8
+ }>;
9
+ isTouchScreen: boolean;
10
+ canFitSidebar: boolean;
11
+ isLandscape: boolean;
12
+ }>;
13
+ export declare const MQ_MAX_MOBILE = 599;
14
+ export declare const MQ_MAX_WIDTH_LANDSCAPE = 1000;
15
+ export declare const MQ_MAX_HEIGHT_LANDSCAPE = 500;
16
+ export declare const MQ_MIN_TABLET: number;
17
+ export declare const MQ_MAX_TABLET = 1400;
18
+ export declare const MQ_MIN_WIDTH_DESKTOP = 1440;
19
+ export declare const MQ_RIGHT_SIDEBAR_MIN_WIDTH = 1229;
20
+ export declare const isDarwin: boolean;
21
+ export declare const isWindows: boolean;
22
+ export declare const isAndroid: boolean;
23
+ export declare const isFirefox: boolean;
24
+ export declare const isChrome: boolean;
25
+ export declare const isSafari: boolean;
26
+ export declare const isIOS: boolean;
27
+ export declare const isBrave: () => boolean;
28
+ export declare const isMobileBreakpoint: (width: number, height: number) => boolean;
29
+ export declare const isTabletBreakpoint: (editorWidth: number, editorHeight: number) => boolean;
30
+ export declare const getFormFactor: (editorWidth: number, editorHeight: number) => EditorInterface["formFactor"];
31
+ export declare const deriveStylesPanelMode: (editorInterface: EditorInterface) => StylesPanelMode;
32
+ export declare const createUserAgentDescriptor: (userAgentString: string) => EditorInterface["userAgent"];
33
+ export declare const loadDesktopUIModePreference: () => "compact" | "full" | null;
34
+ export declare const setDesktopUIMode: (mode: EditorInterface["desktopUIMode"]) => "compact" | "full" | undefined;
@@ -0,0 +1,16 @@
1
+ import type { UnsubscribeCallback } from "@excalidraw/excalidraw/types";
2
+ type Subscriber<T extends any[]> = (...payload: T) => void;
3
+ export declare class Emitter<T extends any[] = []> {
4
+ subscribers: Subscriber<T>[];
5
+ /**
6
+ * Attaches subscriber
7
+ *
8
+ * @returns unsubscribe function
9
+ */
10
+ on(...handlers: Subscriber<T>[] | Subscriber<T>[][]): UnsubscribeCallback;
11
+ once(...handlers: Subscriber<T>[] | Subscriber<T>[][]): UnsubscribeCallback;
12
+ off(...handlers: Subscriber<T>[] | Subscriber<T>[][]): void;
13
+ trigger(...payload: T): this;
14
+ clear(): void;
15
+ }
16
+ export {};
@@ -0,0 +1,46 @@
1
+ import type { ExcalidrawTextElement, FontFamilyValues } from "@excalidraw/element/types";
2
+ /**
3
+ * Encapsulates font metrics with additional font metadata.
4
+ * */
5
+ export interface FontMetadata {
6
+ /** for head & hhea metrics read the woff2 with https://fontdrop.info/ */
7
+ metrics: {
8
+ /** head.unitsPerEm metric */
9
+ unitsPerEm: 1000 | 1024 | 2048;
10
+ /** hhea.ascender metric */
11
+ ascender: number;
12
+ /** hhea.descender metric */
13
+ descender: number;
14
+ /** harcoded unitless line-height, https://github.com/excalidraw/excalidraw/pull/6360#issuecomment-1477635971 */
15
+ lineHeight: number;
16
+ };
17
+ /** flag to indicate a deprecated font */
18
+ deprecated?: true;
19
+ /**
20
+ * whether this is a font that users can use (= shown in font picker)
21
+ */
22
+ private?: true;
23
+ /** flag to indiccate a local-only font */
24
+ local?: true;
25
+ /** flag to indicate a fallback font */
26
+ fallback?: true;
27
+ }
28
+ export declare const FONT_METADATA: Record<number, FontMetadata>;
29
+ /** Unicode ranges defined by google fonts */
30
+ export declare const GOOGLE_FONTS_RANGES: {
31
+ LATIN: string;
32
+ LATIN_EXT: string;
33
+ CYRILIC_EXT: string;
34
+ CYRILIC: string;
35
+ VIETNAMESE: string;
36
+ };
37
+ /** local protocol to skip the local font from registering or inlining */
38
+ export declare const LOCAL_FONT_PROTOCOL = "local:";
39
+ /**
40
+ * Calculates vertical offset for a text with alphabetic baseline.
41
+ */
42
+ export declare const getVerticalOffset: (fontFamily: ExcalidrawTextElement["fontFamily"], fontSize: ExcalidrawTextElement["fontSize"], lineHeightPx: number) => number;
43
+ /**
44
+ * Gets line height for a selected family.
45
+ */
46
+ export declare const getLineHeight: (fontFamily: FontFamilyValues) => ExcalidrawTextElement["lineHeight"];
@@ -0,0 +1,15 @@
1
+ export * from "./binary-heap";
2
+ export * from "./bounds";
3
+ export * from "./colors";
4
+ export * from "./constants";
5
+ export * from "./font-metadata";
6
+ export * from "./queue";
7
+ export * from "./keys";
8
+ export * from "./points";
9
+ export * from "./promise-pool";
10
+ export * from "./random";
11
+ export * from "./url";
12
+ export * from "./utils";
13
+ export * from "./emitter";
14
+ export * from "./visualdebug";
15
+ export * from "./editorInterface";
@@ -0,0 +1,189 @@
1
+ import type { ValueOf } from "./utility-types";
2
+ export declare const CODES: {
3
+ readonly EQUAL: "Equal";
4
+ readonly MINUS: "Minus";
5
+ readonly NUM_ADD: "NumpadAdd";
6
+ readonly NUM_SUBTRACT: "NumpadSubtract";
7
+ readonly NUM_ZERO: "Numpad0";
8
+ readonly BRACKET_RIGHT: "BracketRight";
9
+ readonly BRACKET_LEFT: "BracketLeft";
10
+ readonly ONE: "Digit1";
11
+ readonly TWO: "Digit2";
12
+ readonly THREE: "Digit3";
13
+ readonly NINE: "Digit9";
14
+ readonly QUOTE: "Quote";
15
+ readonly ZERO: "Digit0";
16
+ readonly SLASH: "Slash";
17
+ readonly C: "KeyC";
18
+ readonly D: "KeyD";
19
+ readonly H: "KeyH";
20
+ readonly V: "KeyV";
21
+ readonly Z: "KeyZ";
22
+ readonly Y: "KeyY";
23
+ readonly R: "KeyR";
24
+ readonly S: "KeyS";
25
+ };
26
+ export declare const KEYS: {
27
+ readonly ARROW_DOWN: "ArrowDown";
28
+ readonly ARROW_LEFT: "ArrowLeft";
29
+ readonly ARROW_RIGHT: "ArrowRight";
30
+ readonly ARROW_UP: "ArrowUp";
31
+ readonly PAGE_UP: "PageUp";
32
+ readonly PAGE_DOWN: "PageDown";
33
+ readonly BACKSPACE: "Backspace";
34
+ readonly ALT: "Alt";
35
+ readonly CTRL_OR_CMD: "metaKey" | "ctrlKey";
36
+ readonly DELETE: "Delete";
37
+ readonly ENTER: "Enter";
38
+ readonly ESCAPE: "Escape";
39
+ readonly QUESTION_MARK: "?";
40
+ readonly SPACE: " ";
41
+ readonly TAB: "Tab";
42
+ readonly CHEVRON_LEFT: "<";
43
+ readonly CHEVRON_RIGHT: ">";
44
+ readonly PERIOD: ".";
45
+ readonly COMMA: ",";
46
+ readonly SUBTRACT: "-";
47
+ readonly SLASH: "/";
48
+ readonly A: "a";
49
+ readonly C: "c";
50
+ readonly D: "d";
51
+ readonly E: "e";
52
+ readonly F: "f";
53
+ readonly G: "g";
54
+ readonly H: "h";
55
+ readonly I: "i";
56
+ readonly L: "l";
57
+ readonly O: "o";
58
+ readonly P: "p";
59
+ readonly Q: "q";
60
+ readonly R: "r";
61
+ readonly S: "s";
62
+ readonly T: "t";
63
+ readonly V: "v";
64
+ readonly X: "x";
65
+ readonly Y: "y";
66
+ readonly Z: "z";
67
+ readonly K: "k";
68
+ readonly W: "w";
69
+ readonly 0: "0";
70
+ readonly 1: "1";
71
+ readonly 2: "2";
72
+ readonly 3: "3";
73
+ readonly 4: "4";
74
+ readonly 5: "5";
75
+ readonly 6: "6";
76
+ readonly 7: "7";
77
+ readonly 8: "8";
78
+ readonly 9: "9";
79
+ };
80
+ export type Key = keyof typeof KEYS;
81
+ export declare const KeyCodeMap: Map<ValueOf<{
82
+ readonly ARROW_DOWN: "ArrowDown";
83
+ readonly ARROW_LEFT: "ArrowLeft";
84
+ readonly ARROW_RIGHT: "ArrowRight";
85
+ readonly ARROW_UP: "ArrowUp";
86
+ readonly PAGE_UP: "PageUp";
87
+ readonly PAGE_DOWN: "PageDown";
88
+ readonly BACKSPACE: "Backspace";
89
+ readonly ALT: "Alt";
90
+ readonly CTRL_OR_CMD: "metaKey" | "ctrlKey";
91
+ readonly DELETE: "Delete";
92
+ readonly ENTER: "Enter";
93
+ readonly ESCAPE: "Escape";
94
+ readonly QUESTION_MARK: "?";
95
+ readonly SPACE: " ";
96
+ readonly TAB: "Tab";
97
+ readonly CHEVRON_LEFT: "<";
98
+ readonly CHEVRON_RIGHT: ">";
99
+ readonly PERIOD: ".";
100
+ readonly COMMA: ",";
101
+ readonly SUBTRACT: "-";
102
+ readonly SLASH: "/";
103
+ readonly A: "a";
104
+ readonly C: "c";
105
+ readonly D: "d";
106
+ readonly E: "e";
107
+ readonly F: "f";
108
+ readonly G: "g";
109
+ readonly H: "h";
110
+ readonly I: "i";
111
+ readonly L: "l";
112
+ readonly O: "o";
113
+ readonly P: "p";
114
+ readonly Q: "q";
115
+ readonly R: "r";
116
+ readonly S: "s";
117
+ readonly T: "t";
118
+ readonly V: "v";
119
+ readonly X: "x";
120
+ readonly Y: "y";
121
+ readonly Z: "z";
122
+ readonly K: "k";
123
+ readonly W: "w";
124
+ readonly 0: "0";
125
+ readonly 1: "1";
126
+ readonly 2: "2";
127
+ readonly 3: "3";
128
+ readonly 4: "4";
129
+ readonly 5: "5";
130
+ readonly 6: "6";
131
+ readonly 7: "7";
132
+ readonly 8: "8";
133
+ readonly 9: "9";
134
+ }>, ValueOf<{
135
+ readonly EQUAL: "Equal";
136
+ readonly MINUS: "Minus";
137
+ readonly NUM_ADD: "NumpadAdd";
138
+ readonly NUM_SUBTRACT: "NumpadSubtract";
139
+ readonly NUM_ZERO: "Numpad0";
140
+ readonly BRACKET_RIGHT: "BracketRight";
141
+ readonly BRACKET_LEFT: "BracketLeft";
142
+ readonly ONE: "Digit1";
143
+ readonly TWO: "Digit2";
144
+ readonly THREE: "Digit3";
145
+ readonly NINE: "Digit9";
146
+ readonly QUOTE: "Quote";
147
+ readonly ZERO: "Digit0";
148
+ readonly SLASH: "Slash";
149
+ readonly C: "KeyC";
150
+ readonly D: "KeyD";
151
+ readonly H: "KeyH";
152
+ readonly V: "KeyV";
153
+ readonly Z: "KeyZ";
154
+ readonly Y: "KeyY";
155
+ readonly R: "KeyR";
156
+ readonly S: "KeyS";
157
+ }>>;
158
+ export declare const isLatinChar: (key: string) => boolean;
159
+ /**
160
+ * Used to match key events for any keyboard layout, especially on Windows and Linux,
161
+ * where non-latin character with modified (CMD) is not substituted with latin-based alternative.
162
+ *
163
+ * Uses `event.key` when it's latin, otherwise fallbacks to `event.code` (if mapping exists).
164
+ *
165
+ * Example of pressing "z" on different layouts, with the chosen key or code highlighted in []:
166
+ *
167
+ * Layout | Code | Key | Comment
168
+ * --------------------- | ----- | --- | -------
169
+ * U.S. | KeyZ | [z] |
170
+ * Czech | KeyY | [z] |
171
+ * Turkish | KeyN | [z] |
172
+ * French | KeyW | [z] |
173
+ * Macedonian | [KeyZ] | з | z with cmd; з is Cyrillic equivalent of z
174
+ * Russian | [KeyZ] | я | z with cmd
175
+ * Serbian | [KeyZ] | ѕ | z with cmd
176
+ * Greek | [KeyZ] | ζ | z with cmd; also ζ is Greek equivalent of z
177
+ * Hebrew | [KeyZ] | ז | z with cmd; also ז is Hebrew equivalent of z
178
+ * Pinyin - Simplified | KeyZ | [z] | due to IME
179
+ * Cangije - Traditional | [KeyZ] | 重 | z with cmd
180
+ * Japanese | [KeyZ] | つ | z with cmd
181
+ * 2-Set Korean | [KeyZ] | ㅋ | z with cmd
182
+ *
183
+ * More details in https://github.com/excalidraw/excalidraw/pull/5944
184
+ */
185
+ export declare const matchKey: (event: KeyboardEvent | React.KeyboardEvent<Element>, key: ValueOf<typeof KEYS>) => boolean;
186
+ export declare const isArrowKey: (key: string) => key is "ArrowDown" | "ArrowLeft" | "ArrowRight" | "ArrowUp";
187
+ export declare const shouldResizeFromCenter: (event: MouseEvent | KeyboardEvent) => boolean;
188
+ export declare const shouldMaintainAspectRatio: (event: MouseEvent | KeyboardEvent) => boolean;
189
+ export declare const shouldRotateWithDiscreteAngle: (event: MouseEvent | KeyboardEvent | React.PointerEvent<HTMLCanvasElement>) => boolean;
@@ -0,0 +1,9 @@
1
+ import { type GlobalPoint, type LocalPoint } from "@excalidraw/math";
2
+ import type { NullableGridSize } from "@excalidraw/excalidraw/types";
3
+ export declare const getSizeFromPoints: (points: readonly (GlobalPoint | LocalPoint)[]) => {
4
+ width: number;
5
+ height: number;
6
+ };
7
+ /** @arg dimension, 0 for rescaling only x, 1 for y */
8
+ export declare const rescalePoints: <Point extends GlobalPoint | LocalPoint>(dimension: 0 | 1, newSize: number, points: readonly Point[], normalize: boolean) => Point[];
9
+ export declare const getGridPoint: (x: number, y: number, gridSize: NullableGridSize) => [number, number];
@@ -0,0 +1,6 @@
1
+ export declare class PromisePool<T> {
2
+ private readonly pool;
3
+ private readonly entries;
4
+ constructor(source: IterableIterator<Promise<void | readonly [number, T]>>, concurrency: number);
5
+ all(): PromiseLike<T[]>;
6
+ }
@@ -0,0 +1,9 @@
1
+ import type { MaybePromise } from "./utility-types";
2
+ type Job<T, TArgs extends unknown[]> = (...args: TArgs) => MaybePromise<T>;
3
+ export declare class Queue {
4
+ private jobs;
5
+ private running;
6
+ private tick;
7
+ push<TValue, TArgs extends unknown[]>(jobFactory: Job<TValue, TArgs>, ...args: TArgs): Promise<TValue>;
8
+ }
9
+ export {};