@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.
- package/README.md +19 -0
- package/dist/dev/index.js +2695 -0
- package/dist/dev/index.js.map +7 -0
- package/dist/prod/index.js +4 -0
- package/dist/types/common/src/binary-heap.d.ts +12 -0
- package/dist/types/common/src/bounds.d.ts +10 -0
- package/dist/types/common/src/colors.d.ts +62 -0
- package/dist/types/common/src/constants.d.ts +352 -0
- package/dist/types/common/src/editorInterface.d.ts +34 -0
- package/dist/types/common/src/emitter.d.ts +16 -0
- package/dist/types/common/src/font-metadata.d.ts +46 -0
- package/dist/types/common/src/index.d.ts +15 -0
- package/dist/types/common/src/keys.d.ts +189 -0
- package/dist/types/common/src/points.d.ts +9 -0
- package/dist/types/common/src/promise-pool.d.ts +6 -0
- package/dist/types/common/src/queue.d.ts +9 -0
- package/dist/types/common/src/random.d.ts +3 -0
- package/dist/types/common/src/url.d.ts +7 -0
- package/dist/types/common/src/utility-types.d.ts +37 -0
- package/dist/types/common/src/utils.d.ts +279 -0
- package/dist/types/common/src/visualdebug.d.ts +41 -0
- package/dist/types/element/src/Scene.d.ts +80 -0
- package/dist/types/element/src/align.d.ts +8 -0
- package/dist/types/element/src/binding.d.ts +124 -0
- package/dist/types/element/src/bounds.d.ts +81 -0
- package/dist/types/element/src/collision.d.ts +36 -0
- package/dist/types/element/src/comparisons.d.ts +8 -0
- package/dist/types/element/src/containerCache.d.ts +11 -0
- package/dist/types/element/src/cropElement.d.ts +19 -0
- package/dist/types/element/src/delta.d.ts +228 -0
- package/dist/types/element/src/distance.d.ts +3 -0
- package/dist/types/element/src/distribute.d.ts +7 -0
- package/dist/types/element/src/dragElements.d.ts +33 -0
- package/dist/types/element/src/duplicate.d.ts +63 -0
- package/dist/types/element/src/elbowArrow.d.ts +17 -0
- package/dist/types/element/src/elementLink.d.ts +13 -0
- package/dist/types/element/src/embeddable.d.ts +10 -0
- package/dist/types/element/src/flowchart.d.ts +26 -0
- package/dist/types/element/src/fractionalIndex.d.ts +57 -0
- package/dist/types/element/src/frame.d.ts +74 -0
- package/dist/types/element/src/groups.d.ts +34 -0
- package/dist/types/element/src/heading.d.ts +16 -0
- package/dist/types/element/src/image.d.ts +22 -0
- package/dist/types/element/src/index.d.ts +56 -0
- package/dist/types/element/src/linearElementEditor.d.ts +113 -0
- package/dist/types/element/src/mutateElement.d.ts +23 -0
- package/dist/types/element/src/newElement.d.ts +62 -0
- package/dist/types/element/src/positionElementsOnGrid.d.ts +2 -0
- package/dist/types/element/src/renderElement.d.ts +31 -0
- package/dist/types/element/src/resizeElements.d.ts +32 -0
- package/dist/types/element/src/resizeTest.d.ts +16 -0
- package/dist/types/element/src/selection.d.ts +34 -0
- package/dist/types/element/src/shape.d.ts +42 -0
- package/dist/types/element/src/showSelectedShapeActions.d.ts +3 -0
- package/dist/types/element/src/sizeHelpers.d.ts +35 -0
- package/dist/types/element/src/sortElements.d.ts +2 -0
- package/dist/types/element/src/store.d.ts +237 -0
- package/dist/types/element/src/textElement.d.ts +40 -0
- package/dist/types/element/src/textMeasurements.d.ts +39 -0
- package/dist/types/element/src/textWrapping.d.ts +13 -0
- package/dist/types/element/src/transform.d.ts +81 -0
- package/dist/types/element/src/transformHandles.d.ts +36 -0
- package/dist/types/element/src/typeChecks.d.ts +54 -0
- package/dist/types/element/src/types.d.ts +291 -0
- package/dist/types/element/src/utils.d.ts +34 -0
- package/dist/types/element/src/zindex.d.ts +13 -0
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +485 -0
- package/dist/types/excalidraw/actions/actionAlign.d.ts +109 -0
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +360 -0
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +2059 -0
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +399 -0
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +174 -0
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +519 -0
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +34 -0
- package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +17 -0
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +194 -0
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +346 -0
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +171 -0
- package/dist/types/excalidraw/actions/actionExport.d.ts +683 -0
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +13 -0
- package/dist/types/excalidraw/actions/actionFlip.d.ts +34 -0
- package/dist/types/excalidraw/actions/actionFrame.d.ts +1150 -0
- package/dist/types/excalidraw/actions/actionGroup.d.ts +350 -0
- package/dist/types/excalidraw/actions/actionHistory.d.ts +6 -0
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +659 -0
- package/dist/types/excalidraw/actions/actionLink.d.ts +175 -0
- package/dist/types/excalidraw/actions/actionMenu.d.ts +163 -0
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +20 -0
- package/dist/types/excalidraw/actions/actionProperties.d.ts +402 -0
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +170 -0
- package/dist/types/excalidraw/actions/actionStyles.d.ts +188 -0
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +17 -0
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +177 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +175 -0
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +166 -0
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +19 -0
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +174 -0
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +175 -0
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +175 -0
- package/dist/types/excalidraw/actions/actionZindex.d.ts +74 -0
- package/dist/types/excalidraw/actions/index.d.ts +28 -0
- package/dist/types/excalidraw/actions/manager.d.ts +21 -0
- package/dist/types/excalidraw/actions/register.d.ts +5 -0
- package/dist/types/excalidraw/actions/shortcuts.d.ts +4 -0
- package/dist/types/excalidraw/actions/types.d.ts +47 -0
- package/dist/types/excalidraw/analytics.d.ts +1 -0
- package/dist/types/excalidraw/animated-trail.d.ts +39 -0
- package/dist/types/excalidraw/animation-frame-handler.d.ts +16 -0
- package/dist/types/excalidraw/appState.d.ts +102 -0
- package/dist/types/excalidraw/charts.d.ts +27 -0
- package/dist/types/excalidraw/clients.d.ts +14 -0
- package/dist/types/excalidraw/clipboard.d.ts +105 -0
- package/dist/types/excalidraw/components/Actions.d.ts +47 -0
- package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +4 -0
- package/dist/types/excalidraw/components/App.d.ts +563 -0
- package/dist/types/excalidraw/components/Avatar.d.ts +11 -0
- package/dist/types/excalidraw/components/BraveMeasureTextError.d.ts +2 -0
- package/dist/types/excalidraw/components/Button.d.ts +17 -0
- package/dist/types/excalidraw/components/ButtonIcon.d.ts +16 -0
- package/dist/types/excalidraw/components/ButtonSeparator.d.ts +1 -0
- package/dist/types/excalidraw/components/Card.d.ts +6 -0
- package/dist/types/excalidraw/components/CheckboxItem.d.ts +8 -0
- package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +10 -0
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +23 -0
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +8 -0
- package/dist/types/excalidraw/components/ColorPicker/HotkeyLabel.d.ts +7 -0
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +19 -0
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +10 -0
- package/dist/types/excalidraw/components/ColorPicker/PickerHeading.d.ts +5 -0
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +9 -0
- package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +9 -0
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +21 -0
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +20 -0
- package/dist/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +19 -0
- package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +2 -0
- package/dist/types/excalidraw/components/CommandPalette/types.d.ts +24 -0
- package/dist/types/excalidraw/components/ConfirmDialog.d.ts +10 -0
- package/dist/types/excalidraw/components/ContextMenu.d.ts +16 -0
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +23 -0
- package/dist/types/excalidraw/components/DarkModeToggle.d.ts +7 -0
- package/dist/types/excalidraw/components/DefaultSidebar.d.ts +27 -0
- package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +4 -0
- package/dist/types/excalidraw/components/Dialog.d.ts +13 -0
- package/dist/types/excalidraw/components/DialogActionButton.d.ts +10 -0
- package/dist/types/excalidraw/components/ElementCanvasButtons.d.ts +7 -0
- package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +12 -0
- package/dist/types/excalidraw/components/Ellipsify.d.ts +3 -0
- package/dist/types/excalidraw/components/ErrorDialog.d.ts +5 -0
- package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +15 -0
- package/dist/types/excalidraw/components/EyeButton.d.ts +8 -0
- package/dist/types/excalidraw/components/EyeDropper.d.ts +27 -0
- package/dist/types/excalidraw/components/FilledButton.d.ts +18 -0
- package/dist/types/excalidraw/components/FixedSideContainer.d.ts +9 -0
- package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +10 -0
- package/dist/types/excalidraw/components/FontPicker/FontPicker.d.ts +22 -0
- package/dist/types/excalidraw/components/FontPicker/FontPickerList.d.ts +26 -0
- package/dist/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +8 -0
- package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +13 -0
- package/dist/types/excalidraw/components/HandButton.d.ts +10 -0
- package/dist/types/excalidraw/components/HelpButton.d.ts +7 -0
- package/dist/types/excalidraw/components/HelpDialog.d.ts +4 -0
- package/dist/types/excalidraw/components/HintViewer.d.ts +11 -0
- package/dist/types/excalidraw/components/IconPicker.d.ts +15 -0
- package/dist/types/excalidraw/components/ImageExportDialog.d.ts +14 -0
- package/dist/types/excalidraw/components/InitializeApp.d.ts +10 -0
- package/dist/types/excalidraw/components/InlineIcon.d.ts +5 -0
- package/dist/types/excalidraw/components/Island.d.ts +10 -0
- package/dist/types/excalidraw/components/JSONExportDialog.d.ts +15 -0
- package/dist/types/excalidraw/components/LaserPointerButton.d.ts +10 -0
- package/dist/types/excalidraw/components/LayerUI.d.ts +32 -0
- package/dist/types/excalidraw/components/LibraryMenu.d.ts +10 -0
- package/dist/types/excalidraw/components/LibraryMenuBrowseButton.d.ts +7 -0
- package/dist/types/excalidraw/components/LibraryMenuControlButtons.d.ts +9 -0
- package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +17 -0
- package/dist/types/excalidraw/components/LibraryMenuItems.d.ts +14 -0
- package/dist/types/excalidraw/components/LibraryMenuSection.d.ts +23 -0
- package/dist/types/excalidraw/components/LibraryUnit.d.ts +14 -0
- package/dist/types/excalidraw/components/LoadingMessage.d.ts +5 -0
- package/dist/types/excalidraw/components/LockButton.d.ts +10 -0
- package/dist/types/excalidraw/components/MagicButton.d.ts +10 -0
- package/dist/types/excalidraw/components/MobileMenu.d.ts +24 -0
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +10 -0
- package/dist/types/excalidraw/components/Modal.d.ts +11 -0
- package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +17 -0
- package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +17 -0
- package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +22 -0
- package/dist/types/excalidraw/components/PasteChartDialog.d.ts +8 -0
- package/dist/types/excalidraw/components/PenModeButton.d.ts +12 -0
- package/dist/types/excalidraw/components/Popover.d.ts +16 -0
- package/dist/types/excalidraw/components/ProjectName.d.ts +10 -0
- package/dist/types/excalidraw/components/PropertiesPopover.d.ts +16 -0
- package/dist/types/excalidraw/components/PublishLibrary.d.ts +16 -0
- package/dist/types/excalidraw/components/QuickSearch.d.ts +9 -0
- package/dist/types/excalidraw/components/RadioGroup.d.ts +13 -0
- package/dist/types/excalidraw/components/RadioSelection.d.ts +20 -0
- package/dist/types/excalidraw/components/Range.d.ts +8 -0
- package/dist/types/excalidraw/components/SVGLayer.d.ts +7 -0
- package/dist/types/excalidraw/components/ScrollableList.d.ts +8 -0
- package/dist/types/excalidraw/components/SearchMenu.d.ts +5 -0
- package/dist/types/excalidraw/components/Section.d.ts +6 -0
- package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +70 -0
- package/dist/types/excalidraw/components/Sidebar/SidebarHeader.d.ts +7 -0
- package/dist/types/excalidraw/components/Sidebar/SidebarTab.d.ts +8 -0
- package/dist/types/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +9 -0
- package/dist/types/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +6 -0
- package/dist/types/excalidraw/components/Sidebar/SidebarTabs.d.ts +6 -0
- package/dist/types/excalidraw/components/Sidebar/SidebarTrigger.d.ts +6 -0
- package/dist/types/excalidraw/components/Sidebar/common.d.ts +34 -0
- package/dist/types/excalidraw/components/Spinner.d.ts +8 -0
- package/dist/types/excalidraw/components/Stack.d.ts +15 -0
- package/dist/types/excalidraw/components/Stats/Angle.d.ts +11 -0
- package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +10 -0
- package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +10 -0
- package/dist/types/excalidraw/components/Stats/Dimension.d.ts +11 -0
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +44 -0
- package/dist/types/excalidraw/components/Stats/FontSize.d.ts +11 -0
- package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +11 -0
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +14 -0
- package/dist/types/excalidraw/components/Stats/MultiFontSize.d.ts +12 -0
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +14 -0
- package/dist/types/excalidraw/components/Stats/Position.d.ts +12 -0
- package/dist/types/excalidraw/components/Stats/index.d.ts +35 -0
- package/dist/types/excalidraw/components/Stats/utils.d.ts +19 -0
- package/dist/types/excalidraw/components/Switch.d.ts +9 -0
- package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +6 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +29 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +9 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +7 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +17 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanels.d.ts +4 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogSubmitShortcut.d.ts +1 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +7 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +8 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +6 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabs.d.ts +11 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +8 -0
- package/dist/types/excalidraw/components/TTDDialog/common.d.ts +32 -0
- package/dist/types/excalidraw/components/TextField.d.ts +22 -0
- package/dist/types/excalidraw/components/Toast.d.ts +9 -0
- package/dist/types/excalidraw/components/ToolButton.d.ts +49 -0
- package/dist/types/excalidraw/components/ToolPopover.d.ts +25 -0
- package/dist/types/excalidraw/components/Tooltip.d.ts +18 -0
- package/dist/types/excalidraw/components/Trans.d.ts +9 -0
- package/dist/types/excalidraw/components/UnlockPopup.d.ts +8 -0
- package/dist/types/excalidraw/components/UserList.d.ts +18 -0
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +33 -0
- package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +14 -0
- package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +19 -0
- package/dist/types/excalidraw/components/canvases/index.d.ts +3 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +84 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +16 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +11 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +38 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +8 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +17 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +7 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +16 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSeparator.d.ts +5 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +10 -0
- package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +6 -0
- package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +3 -0
- package/dist/types/excalidraw/components/footer/Footer.d.ts +17 -0
- package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +8 -0
- package/dist/types/excalidraw/components/hoc/withInternalFallback.d.ts +4 -0
- package/dist/types/excalidraw/components/hyperlink/Hyperlink.d.ts +19 -0
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +10 -0
- package/dist/types/excalidraw/components/icons.d.ts +237 -0
- package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +11 -0
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +64 -0
- package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +76 -0
- package/dist/types/excalidraw/components/shapes.d.ts +190 -0
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +58 -0
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +19 -0
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +84 -0
- package/dist/types/excalidraw/context/tunnels.d.ts +21 -0
- package/dist/types/excalidraw/context/ui-appState.d.ts +4 -0
- package/dist/types/excalidraw/cursor.d.ts +5 -0
- package/dist/types/excalidraw/data/EditorLocalStorage.d.ts +8 -0
- package/dist/types/excalidraw/data/blob.d.ts +57 -0
- package/dist/types/excalidraw/data/encode.d.ts +55 -0
- package/dist/types/excalidraw/data/encryption.d.ts +9 -0
- package/dist/types/excalidraw/data/filesystem.d.ts +21 -0
- package/dist/types/excalidraw/data/image.d.ts +9 -0
- package/dist/types/excalidraw/data/index.d.ts +22 -0
- package/dist/types/excalidraw/data/json.d.ts +18 -0
- package/dist/types/excalidraw/data/library.d.ts +127 -0
- package/dist/types/excalidraw/data/reconcile.d.ts +7 -0
- package/dist/types/excalidraw/data/resave.d.ts +5 -0
- package/dist/types/excalidraw/data/restore.d.ts +35 -0
- package/dist/types/excalidraw/data/types.d.ts +48 -0
- package/dist/types/excalidraw/deburr.d.ts +1 -0
- package/dist/types/excalidraw/editor-jotai.d.ts +56 -0
- package/dist/types/excalidraw/eraser/index.d.ts +12 -0
- package/dist/types/excalidraw/errors.d.ts +29 -0
- package/dist/types/excalidraw/fonts/Cascadia/index.d.ts +2 -0
- package/dist/types/excalidraw/fonts/ComicShanns/index.d.ts +2 -0
- package/dist/types/excalidraw/fonts/Emoji/index.d.ts +2 -0
- package/dist/types/excalidraw/fonts/ExcalidrawFontFace.d.ts +25 -0
- package/dist/types/excalidraw/fonts/Excalifont/index.d.ts +2 -0
- package/dist/types/excalidraw/fonts/Fonts.d.ts +79 -0
- package/dist/types/excalidraw/fonts/Helvetica/index.d.ts +2 -0
- package/dist/types/excalidraw/fonts/Liberation/index.d.ts +2 -0
- package/dist/types/excalidraw/fonts/Lilita/index.d.ts +2 -0
- package/dist/types/excalidraw/fonts/Nunito/index.d.ts +2 -0
- package/dist/types/excalidraw/fonts/Virgil/index.d.ts +2 -0
- package/dist/types/excalidraw/fonts/Xiaolai/index.d.ts +8 -0
- package/dist/types/excalidraw/fonts/index.d.ts +1 -0
- package/dist/types/excalidraw/gesture.d.ts +6 -0
- package/dist/types/excalidraw/history.d.ts +48 -0
- package/dist/types/excalidraw/hooks/useCallbackRefState.d.ts +1 -0
- package/dist/types/excalidraw/hooks/useCopiedIndicator.d.ts +5 -0
- package/dist/types/excalidraw/hooks/useCreatePortalContainer.d.ts +4 -0
- package/dist/types/excalidraw/hooks/useEmitter.d.ts +2 -0
- package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +11 -0
- package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +21 -0
- package/dist/types/excalidraw/hooks/useScrollPosition.d.ts +1 -0
- package/dist/types/excalidraw/hooks/useStable.d.ts +1 -0
- package/dist/types/excalidraw/hooks/useStableCallback.d.ts +4 -0
- package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +14 -0
- package/dist/types/excalidraw/hooks/useTransition.d.ts +2 -0
- package/dist/types/excalidraw/i18n.d.ts +24 -0
- package/dist/types/excalidraw/index.d.ts +45 -0
- package/dist/types/excalidraw/laser-trails.d.ts +20 -0
- package/dist/types/excalidraw/lasso/index.d.ts +16 -0
- package/dist/types/excalidraw/lasso/utils.d.ts +13 -0
- package/dist/types/excalidraw/mermaid.d.ts +2 -0
- package/dist/types/excalidraw/polyfill.d.ts +2 -0
- package/dist/types/excalidraw/reactUtils.d.ts +14 -0
- package/dist/types/excalidraw/renderer/animation.d.ts +12 -0
- package/dist/types/excalidraw/renderer/helpers.d.ts +16 -0
- package/dist/types/excalidraw/renderer/interactiveScene.d.ts +14 -0
- package/dist/types/excalidraw/renderer/renderNewElementScene.d.ts +7 -0
- package/dist/types/excalidraw/renderer/renderSnaps.d.ts +2 -0
- package/dist/types/excalidraw/renderer/roundRect.d.ts +11 -0
- package/dist/types/excalidraw/renderer/staticScene.d.ts +14 -0
- package/dist/types/excalidraw/renderer/staticSvgScene.d.ts +5 -0
- package/dist/types/excalidraw/scene/Renderer.d.ts +30 -0
- package/dist/types/excalidraw/scene/export.d.ts +36 -0
- package/dist/types/excalidraw/scene/index.d.ts +4 -0
- package/dist/types/excalidraw/scene/normalize.d.ts +4 -0
- package/dist/types/excalidraw/scene/scroll.d.ts +18 -0
- package/dist/types/excalidraw/scene/scrollbars.d.ts +11 -0
- package/dist/types/excalidraw/scene/types.d.ts +132 -0
- package/dist/types/excalidraw/scene/zoom.d.ts +12 -0
- package/dist/types/excalidraw/shortcut.d.ts +1 -0
- package/dist/types/excalidraw/snapping.d.ts +111 -0
- package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-bindings.d.ts +45 -0
- package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-loader.d.ts +13 -0
- package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-wasm.d.ts +2 -0
- package/dist/types/excalidraw/subset/subset-main.d.ts +12 -0
- package/dist/types/excalidraw/subset/subset-shared.chunk.d.ts +32 -0
- package/dist/types/excalidraw/subset/subset-worker.chunk.d.ts +15 -0
- package/dist/types/excalidraw/subset/woff2/woff2-bindings.d.ts +31 -0
- package/dist/types/excalidraw/subset/woff2/woff2-loader.d.ts +14 -0
- package/dist/types/excalidraw/subset/woff2/woff2-wasm.d.ts +2 -0
- package/dist/types/excalidraw/types.d.ts +744 -0
- package/dist/types/excalidraw/workers.d.ts +36 -0
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +24 -0
- package/dist/types/math/src/angle.d.ts +19 -0
- package/dist/types/math/src/constants.d.ts +3 -0
- package/dist/types/math/src/curve.d.ts +74 -0
- package/dist/types/math/src/ellipse.d.ts +44 -0
- package/dist/types/math/src/index.d.ts +13 -0
- package/dist/types/math/src/line.d.ts +17 -0
- package/dist/types/math/src/point.d.ts +122 -0
- package/dist/types/math/src/polygon.d.ts +6 -0
- package/dist/types/math/src/range.d.ts +44 -0
- package/dist/types/math/src/rectangle.d.ts +5 -0
- package/dist/types/math/src/segment.d.ts +40 -0
- package/dist/types/math/src/triangle.d.ts +11 -0
- package/dist/types/math/src/types.d.ts +106 -0
- package/dist/types/math/src/utils.d.ts +7 -0
- package/dist/types/math/src/vector.d.ts +94 -0
- package/dist/types/utils/src/bbox.d.ts +9 -0
- package/dist/types/utils/src/export.d.ts +35 -0
- package/dist/types/utils/src/index.d.ts +4 -0
- package/dist/types/utils/src/shape.d.ts +58 -0
- package/dist/types/utils/src/withinBounds.d.ts +19 -0
- package/package.json +59 -0
|
@@ -0,0 +1,744 @@
|
|
|
1
|
+
import type { IMAGE_MIME_TYPES, UserIdleState, throttleRAF, MIME_TYPES, EditorInterface } from "@excalidraw/common";
|
|
2
|
+
import type { LinearElementEditor } from "@excalidraw/element";
|
|
3
|
+
import type { MaybeTransformHandleType } from "@excalidraw/element";
|
|
4
|
+
import type { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, ChartType, FontFamilyValues, FileId, Theme, StrokeRoundness, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawFrameLikeElement, ExcalidrawElementType, ExcalidrawIframeLikeElement, OrderedExcalidrawElement, ExcalidrawNonSelectionElement, BindMode } from "@excalidraw/element/types";
|
|
5
|
+
import type { Merge, MaybePromise, ValueOf, MakeBrand } from "@excalidraw/common/utility-types";
|
|
6
|
+
import type { CaptureUpdateActionType, DurableIncrement, EphemeralIncrement } from "@excalidraw/element";
|
|
7
|
+
import type { Action } from "./actions/types";
|
|
8
|
+
import type { Spreadsheet } from "./charts";
|
|
9
|
+
import type { ClipboardData } from "./clipboard";
|
|
10
|
+
import type App from "./components/App";
|
|
11
|
+
import type Library from "./data/library";
|
|
12
|
+
import type { FileSystemHandle } from "./data/filesystem";
|
|
13
|
+
import type { ContextMenuItems } from "./components/ContextMenu";
|
|
14
|
+
import type { SnapLine } from "./snapping";
|
|
15
|
+
import type { ImportedDataState } from "./data/types";
|
|
16
|
+
import type { Language } from "./i18n";
|
|
17
|
+
import type { isOverScrollBars } from "./scene/scrollbars";
|
|
18
|
+
import type React from "react";
|
|
19
|
+
import type { JSX } from "react";
|
|
20
|
+
export type SocketId = string & {
|
|
21
|
+
_brand: "SocketId";
|
|
22
|
+
};
|
|
23
|
+
export type Collaborator = Readonly<{
|
|
24
|
+
pointer?: CollaboratorPointer;
|
|
25
|
+
button?: "up" | "down";
|
|
26
|
+
selectedElementIds?: AppState["selectedElementIds"];
|
|
27
|
+
username?: string | null;
|
|
28
|
+
userState?: UserIdleState;
|
|
29
|
+
color?: {
|
|
30
|
+
background: string;
|
|
31
|
+
stroke: string;
|
|
32
|
+
};
|
|
33
|
+
avatarUrl?: string;
|
|
34
|
+
id?: string;
|
|
35
|
+
socketId?: SocketId;
|
|
36
|
+
isCurrentUser?: boolean;
|
|
37
|
+
isInCall?: boolean;
|
|
38
|
+
isSpeaking?: boolean;
|
|
39
|
+
isMuted?: boolean;
|
|
40
|
+
}>;
|
|
41
|
+
export type CollaboratorPointer = {
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
tool: "pointer" | "laser";
|
|
45
|
+
/**
|
|
46
|
+
* Whether to render cursor + username. Useful when you only want to render
|
|
47
|
+
* laser trail.
|
|
48
|
+
*
|
|
49
|
+
* @default true
|
|
50
|
+
*/
|
|
51
|
+
renderCursor?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Explicit laser color.
|
|
54
|
+
*
|
|
55
|
+
* @default string collaborator's cursor color
|
|
56
|
+
*/
|
|
57
|
+
laserColor?: string;
|
|
58
|
+
};
|
|
59
|
+
export type DataURL = string & {
|
|
60
|
+
_brand: "DataURL";
|
|
61
|
+
};
|
|
62
|
+
export type BinaryFileData = {
|
|
63
|
+
mimeType: ValueOf<typeof IMAGE_MIME_TYPES> | typeof MIME_TYPES.binary;
|
|
64
|
+
id: FileId;
|
|
65
|
+
dataURL: DataURL;
|
|
66
|
+
/**
|
|
67
|
+
* Epoch timestamp in milliseconds
|
|
68
|
+
*/
|
|
69
|
+
created: number;
|
|
70
|
+
/**
|
|
71
|
+
* Indicates when the file was last retrieved from storage to be loaded
|
|
72
|
+
* onto the scene. We use this flag to determine whether to delete unused
|
|
73
|
+
* files from storage.
|
|
74
|
+
*
|
|
75
|
+
* Epoch timestamp in milliseconds.
|
|
76
|
+
*/
|
|
77
|
+
lastRetrieved?: number;
|
|
78
|
+
/**
|
|
79
|
+
* indicates the version of the file. This can be used to determine whether
|
|
80
|
+
* the file dataURL has changed e.g. as part of restore due to schema update.
|
|
81
|
+
*/
|
|
82
|
+
version?: number;
|
|
83
|
+
};
|
|
84
|
+
export type BinaryFileMetadata = Omit<BinaryFileData, "dataURL">;
|
|
85
|
+
export type BinaryFiles = Record<ExcalidrawElement["id"], BinaryFileData>;
|
|
86
|
+
export type ToolType = "selection" | "lasso" | "rectangle" | "diamond" | "ellipse" | "arrow" | "line" | "freedraw" | "text" | "image" | "eraser" | "hand" | "frame" | "magicframe" | "embeddable" | "laser";
|
|
87
|
+
export type ElementOrToolType = ExcalidrawElementType | ToolType | "custom";
|
|
88
|
+
export type ActiveTool = {
|
|
89
|
+
type: ToolType;
|
|
90
|
+
customType: null;
|
|
91
|
+
} | {
|
|
92
|
+
type: "custom";
|
|
93
|
+
customType: string;
|
|
94
|
+
};
|
|
95
|
+
export type SidebarName = string;
|
|
96
|
+
export type SidebarTabName = string;
|
|
97
|
+
export type UserToFollow = {
|
|
98
|
+
socketId: SocketId;
|
|
99
|
+
username: string;
|
|
100
|
+
};
|
|
101
|
+
type _CommonCanvasAppState = {
|
|
102
|
+
zoom: AppState["zoom"];
|
|
103
|
+
scrollX: AppState["scrollX"];
|
|
104
|
+
scrollY: AppState["scrollY"];
|
|
105
|
+
width: AppState["width"];
|
|
106
|
+
height: AppState["height"];
|
|
107
|
+
hideAnnotations: AppState["hideAnnotations"];
|
|
108
|
+
viewModeEnabled: AppState["viewModeEnabled"];
|
|
109
|
+
openDialog: AppState["openDialog"];
|
|
110
|
+
editingGroupId: AppState["editingGroupId"];
|
|
111
|
+
selectedElementIds: AppState["selectedElementIds"];
|
|
112
|
+
frameToHighlight: AppState["frameToHighlight"];
|
|
113
|
+
offsetLeft: AppState["offsetLeft"];
|
|
114
|
+
offsetTop: AppState["offsetTop"];
|
|
115
|
+
theme: AppState["theme"];
|
|
116
|
+
};
|
|
117
|
+
export type StaticCanvasAppState = Readonly<_CommonCanvasAppState & {
|
|
118
|
+
shouldCacheIgnoreZoom: AppState["shouldCacheIgnoreZoom"];
|
|
119
|
+
/** null indicates transparent bg */
|
|
120
|
+
viewBackgroundColor: AppState["viewBackgroundColor"] | null;
|
|
121
|
+
exportScale: AppState["exportScale"];
|
|
122
|
+
selectedElementsAreBeingDragged: AppState["selectedElementsAreBeingDragged"];
|
|
123
|
+
gridSize: AppState["gridSize"];
|
|
124
|
+
gridStep: AppState["gridStep"];
|
|
125
|
+
frameRendering: AppState["frameRendering"];
|
|
126
|
+
currentHoveredFontFamily: AppState["currentHoveredFontFamily"];
|
|
127
|
+
hoveredElementIds: AppState["hoveredElementIds"];
|
|
128
|
+
suggestedBinding: AppState["suggestedBinding"];
|
|
129
|
+
croppingElementId: AppState["croppingElementId"];
|
|
130
|
+
}>;
|
|
131
|
+
export type InteractiveCanvasAppState = Readonly<_CommonCanvasAppState & {
|
|
132
|
+
activeEmbeddable: AppState["activeEmbeddable"];
|
|
133
|
+
selectionElement: AppState["selectionElement"];
|
|
134
|
+
selectedGroupIds: AppState["selectedGroupIds"];
|
|
135
|
+
selectedLinearElement: AppState["selectedLinearElement"];
|
|
136
|
+
multiElement: AppState["multiElement"];
|
|
137
|
+
newElement: AppState["newElement"];
|
|
138
|
+
isBindingEnabled: AppState["isBindingEnabled"];
|
|
139
|
+
suggestedBinding: AppState["suggestedBinding"];
|
|
140
|
+
isRotating: AppState["isRotating"];
|
|
141
|
+
elementsToHighlight: AppState["elementsToHighlight"];
|
|
142
|
+
collaborators: AppState["collaborators"];
|
|
143
|
+
snapLines: AppState["snapLines"];
|
|
144
|
+
zenModeEnabled: AppState["zenModeEnabled"];
|
|
145
|
+
editingTextElement: AppState["editingTextElement"];
|
|
146
|
+
isCropping: AppState["isCropping"];
|
|
147
|
+
croppingElementId: AppState["croppingElementId"];
|
|
148
|
+
searchMatches: AppState["searchMatches"];
|
|
149
|
+
activeLockedId: AppState["activeLockedId"];
|
|
150
|
+
hoveredElementIds: AppState["hoveredElementIds"];
|
|
151
|
+
frameRendering: AppState["frameRendering"];
|
|
152
|
+
shouldCacheIgnoreZoom: AppState["shouldCacheIgnoreZoom"];
|
|
153
|
+
exportScale: AppState["exportScale"];
|
|
154
|
+
}>;
|
|
155
|
+
export type ObservedAppState = ObservedStandaloneAppState & ObservedElementsAppState;
|
|
156
|
+
export type ObservedStandaloneAppState = {
|
|
157
|
+
name: AppState["name"];
|
|
158
|
+
viewBackgroundColor: AppState["viewBackgroundColor"];
|
|
159
|
+
};
|
|
160
|
+
export type ObservedElementsAppState = {
|
|
161
|
+
editingGroupId: AppState["editingGroupId"];
|
|
162
|
+
selectedElementIds: AppState["selectedElementIds"];
|
|
163
|
+
selectedGroupIds: AppState["selectedGroupIds"];
|
|
164
|
+
selectedLinearElement: {
|
|
165
|
+
elementId: LinearElementEditor["elementId"];
|
|
166
|
+
isEditing: boolean;
|
|
167
|
+
} | null;
|
|
168
|
+
croppingElementId: AppState["croppingElementId"];
|
|
169
|
+
lockedMultiSelections: AppState["lockedMultiSelections"];
|
|
170
|
+
activeLockedId: AppState["activeLockedId"];
|
|
171
|
+
};
|
|
172
|
+
export interface AppState {
|
|
173
|
+
contextMenu: {
|
|
174
|
+
items: ContextMenuItems;
|
|
175
|
+
top: number;
|
|
176
|
+
left: number;
|
|
177
|
+
} | null;
|
|
178
|
+
showWelcomeScreen: boolean;
|
|
179
|
+
isLoading: boolean;
|
|
180
|
+
errorMessage: React.ReactNode;
|
|
181
|
+
activeEmbeddable: {
|
|
182
|
+
element: NonDeletedExcalidrawElement;
|
|
183
|
+
state: "hover" | "active";
|
|
184
|
+
} | null;
|
|
185
|
+
/**
|
|
186
|
+
* for a newly created element
|
|
187
|
+
* - set on pointer down, updated during pointer move, used on pointer up
|
|
188
|
+
*/
|
|
189
|
+
newElement: NonDeleted<ExcalidrawNonSelectionElement> | null;
|
|
190
|
+
/**
|
|
191
|
+
* for a single element that's being resized
|
|
192
|
+
* - set on pointer down when it's selected and the active tool is selection
|
|
193
|
+
*/
|
|
194
|
+
resizingElement: NonDeletedExcalidrawElement | null;
|
|
195
|
+
/**
|
|
196
|
+
* multiElement is for multi-point linear element that's created by clicking as opposed to dragging
|
|
197
|
+
* - when set and present, the editor will handle linear element creation logic accordingly
|
|
198
|
+
*/
|
|
199
|
+
multiElement: NonDeleted<ExcalidrawLinearElement> | null;
|
|
200
|
+
/**
|
|
201
|
+
* decoupled from newElement, dragging selection only creates selectionElement
|
|
202
|
+
* - set on pointer down, updated during pointer move
|
|
203
|
+
*/
|
|
204
|
+
selectionElement: NonDeletedExcalidrawElement | null;
|
|
205
|
+
isBindingEnabled: boolean;
|
|
206
|
+
startBoundElement: NonDeleted<ExcalidrawBindableElement> | null;
|
|
207
|
+
suggestedBinding: NonDeleted<ExcalidrawBindableElement> | null;
|
|
208
|
+
frameToHighlight: NonDeleted<ExcalidrawFrameLikeElement> | null;
|
|
209
|
+
frameRendering: {
|
|
210
|
+
enabled: boolean;
|
|
211
|
+
name: boolean;
|
|
212
|
+
outline: boolean;
|
|
213
|
+
clip: boolean;
|
|
214
|
+
};
|
|
215
|
+
editingFrame: string | null;
|
|
216
|
+
elementsToHighlight: NonDeleted<ExcalidrawElement>[] | null;
|
|
217
|
+
/**
|
|
218
|
+
* set when a new text is created or when an existing text is being edited
|
|
219
|
+
*/
|
|
220
|
+
editingTextElement: NonDeletedExcalidrawElement | null;
|
|
221
|
+
activeTool: {
|
|
222
|
+
/**
|
|
223
|
+
* indicates a previous tool we should revert back to if we deselect the
|
|
224
|
+
* currently active tool. At the moment applies to `eraser` and `hand` tool.
|
|
225
|
+
*/
|
|
226
|
+
lastActiveTool: ActiveTool | null;
|
|
227
|
+
locked: boolean;
|
|
228
|
+
fromSelection: boolean;
|
|
229
|
+
} & ActiveTool;
|
|
230
|
+
preferredSelectionTool: {
|
|
231
|
+
type: "selection" | "lasso";
|
|
232
|
+
initialized: boolean;
|
|
233
|
+
};
|
|
234
|
+
penMode: boolean;
|
|
235
|
+
penDetected: boolean;
|
|
236
|
+
exportBackground: boolean;
|
|
237
|
+
exportEmbedScene: boolean;
|
|
238
|
+
exportWithDarkMode: boolean;
|
|
239
|
+
exportScale: number;
|
|
240
|
+
currentItemStrokeColor: string;
|
|
241
|
+
currentItemBackgroundColor: string;
|
|
242
|
+
currentItemFillStyle: ExcalidrawElement["fillStyle"];
|
|
243
|
+
currentItemStrokeWidth: number;
|
|
244
|
+
currentItemStrokeStyle: ExcalidrawElement["strokeStyle"];
|
|
245
|
+
currentItemRoughness: number;
|
|
246
|
+
currentItemOpacity: number;
|
|
247
|
+
currentItemFontFamily: FontFamilyValues;
|
|
248
|
+
currentItemFontSize: number;
|
|
249
|
+
currentItemTextAlign: TextAlign;
|
|
250
|
+
currentItemStartArrowhead: Arrowhead | null;
|
|
251
|
+
currentItemEndArrowhead: Arrowhead | null;
|
|
252
|
+
currentHoveredFontFamily: FontFamilyValues | null;
|
|
253
|
+
currentItemRoundness: StrokeRoundness;
|
|
254
|
+
currentItemArrowType: "sharp" | "round" | "elbow";
|
|
255
|
+
viewBackgroundColor: string;
|
|
256
|
+
scrollX: number;
|
|
257
|
+
scrollY: number;
|
|
258
|
+
cursorButton: "up" | "down";
|
|
259
|
+
scrolledOutside: boolean;
|
|
260
|
+
name: string | null;
|
|
261
|
+
isResizing: boolean;
|
|
262
|
+
isRotating: boolean;
|
|
263
|
+
zoom: Zoom;
|
|
264
|
+
openMenu: "canvas" | null;
|
|
265
|
+
openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
|
|
266
|
+
openSidebar: {
|
|
267
|
+
name: SidebarName;
|
|
268
|
+
tab?: SidebarTabName;
|
|
269
|
+
} | null;
|
|
270
|
+
openDialog: null | {
|
|
271
|
+
name: "imageExport" | "help" | "jsonExport";
|
|
272
|
+
} | {
|
|
273
|
+
name: "ttd";
|
|
274
|
+
tab: "text-to-diagram" | "mermaid";
|
|
275
|
+
} | {
|
|
276
|
+
name: "commandPalette";
|
|
277
|
+
} | {
|
|
278
|
+
name: "settings";
|
|
279
|
+
} | {
|
|
280
|
+
name: "elementLinkSelector";
|
|
281
|
+
sourceElementId: ExcalidrawElement["id"];
|
|
282
|
+
};
|
|
283
|
+
/**
|
|
284
|
+
* Reflects user preference for whether the default sidebar should be docked.
|
|
285
|
+
*
|
|
286
|
+
* NOTE this is only a user preference and does not reflect the actual docked
|
|
287
|
+
* state of the sidebar, because the host apps can override this through
|
|
288
|
+
* a DefaultSidebar prop, which is not reflected back to the appState.
|
|
289
|
+
*/
|
|
290
|
+
defaultSidebarDockedPreference: boolean;
|
|
291
|
+
lastPointerDownWith: PointerType;
|
|
292
|
+
selectedElementIds: Readonly<{
|
|
293
|
+
[id: string]: true;
|
|
294
|
+
}>;
|
|
295
|
+
hoveredElementIds: Readonly<{
|
|
296
|
+
[id: string]: true;
|
|
297
|
+
}>;
|
|
298
|
+
previousSelectedElementIds: {
|
|
299
|
+
[id: string]: true;
|
|
300
|
+
};
|
|
301
|
+
selectedElementsAreBeingDragged: boolean;
|
|
302
|
+
shouldCacheIgnoreZoom: boolean;
|
|
303
|
+
toast: {
|
|
304
|
+
message: string;
|
|
305
|
+
closable?: boolean;
|
|
306
|
+
duration?: number;
|
|
307
|
+
} | null;
|
|
308
|
+
zenModeEnabled: boolean;
|
|
309
|
+
theme: Theme;
|
|
310
|
+
/** grid cell px size */
|
|
311
|
+
gridSize: number;
|
|
312
|
+
gridStep: number;
|
|
313
|
+
gridModeEnabled: boolean;
|
|
314
|
+
viewModeEnabled: boolean;
|
|
315
|
+
hideAnnotations: boolean;
|
|
316
|
+
/** top-most selected groups (i.e. does not include nested groups) */
|
|
317
|
+
selectedGroupIds: {
|
|
318
|
+
[groupId: string]: boolean;
|
|
319
|
+
};
|
|
320
|
+
/** group being edited when you drill down to its constituent element
|
|
321
|
+
(e.g. when you double-click on a group's element) */
|
|
322
|
+
editingGroupId: GroupId | null;
|
|
323
|
+
width: number;
|
|
324
|
+
height: number;
|
|
325
|
+
offsetTop: number;
|
|
326
|
+
offsetLeft: number;
|
|
327
|
+
fileHandle: FileSystemHandle | null;
|
|
328
|
+
collaborators: Map<SocketId, Collaborator>;
|
|
329
|
+
stats: {
|
|
330
|
+
open: boolean;
|
|
331
|
+
/** bitmap. Use `STATS_PANELS` bit values */
|
|
332
|
+
panels: number;
|
|
333
|
+
};
|
|
334
|
+
currentChartType: ChartType;
|
|
335
|
+
pasteDialog: {
|
|
336
|
+
shown: false;
|
|
337
|
+
data: null;
|
|
338
|
+
} | {
|
|
339
|
+
shown: true;
|
|
340
|
+
data: Spreadsheet;
|
|
341
|
+
};
|
|
342
|
+
showHyperlinkPopup: false | "info" | "editor";
|
|
343
|
+
selectedLinearElement: LinearElementEditor | null;
|
|
344
|
+
snapLines: readonly SnapLine[];
|
|
345
|
+
originSnapOffset: {
|
|
346
|
+
x: number;
|
|
347
|
+
y: number;
|
|
348
|
+
} | null;
|
|
349
|
+
objectsSnapModeEnabled: boolean;
|
|
350
|
+
/** the user's socket id & username who is being followed on the canvas */
|
|
351
|
+
userToFollow: UserToFollow | null;
|
|
352
|
+
/** the socket ids of the users following the current user */
|
|
353
|
+
followedBy: Set<SocketId>;
|
|
354
|
+
/** image cropping */
|
|
355
|
+
isCropping: boolean;
|
|
356
|
+
croppingElementId: ExcalidrawElement["id"] | null;
|
|
357
|
+
/** null if no search matches found / search closed */
|
|
358
|
+
searchMatches: Readonly<{
|
|
359
|
+
focusedId: ExcalidrawElement["id"] | null;
|
|
360
|
+
matches: readonly SearchMatch[];
|
|
361
|
+
}> | null;
|
|
362
|
+
/** the locked element/group that's active and shows unlock popup */
|
|
363
|
+
activeLockedId: string | null;
|
|
364
|
+
lockedMultiSelections: {
|
|
365
|
+
[groupId: string]: true;
|
|
366
|
+
};
|
|
367
|
+
bindMode: BindMode;
|
|
368
|
+
}
|
|
369
|
+
export type SearchMatch = {
|
|
370
|
+
id: string;
|
|
371
|
+
focus: boolean;
|
|
372
|
+
matchedLines: {
|
|
373
|
+
offsetX: number;
|
|
374
|
+
offsetY: number;
|
|
375
|
+
width: number;
|
|
376
|
+
height: number;
|
|
377
|
+
showOnCanvas: boolean;
|
|
378
|
+
}[];
|
|
379
|
+
};
|
|
380
|
+
export type UIAppState = Omit<AppState, "startBoundElement" | "cursorButton" | "scrollX" | "scrollY">;
|
|
381
|
+
export type NormalizedZoomValue = number & {
|
|
382
|
+
_brand: "normalizedZoom";
|
|
383
|
+
};
|
|
384
|
+
export type Zoom = Readonly<{
|
|
385
|
+
value: NormalizedZoomValue;
|
|
386
|
+
}>;
|
|
387
|
+
export type PointerCoords = Readonly<{
|
|
388
|
+
x: number;
|
|
389
|
+
y: number;
|
|
390
|
+
}>;
|
|
391
|
+
export type Gesture = {
|
|
392
|
+
pointers: Map<number, PointerCoords>;
|
|
393
|
+
lastCenter: {
|
|
394
|
+
x: number;
|
|
395
|
+
y: number;
|
|
396
|
+
} | null;
|
|
397
|
+
initialDistance: number | null;
|
|
398
|
+
initialScale: number | null;
|
|
399
|
+
};
|
|
400
|
+
export declare class GestureEvent extends UIEvent {
|
|
401
|
+
readonly rotation: number;
|
|
402
|
+
readonly scale: number;
|
|
403
|
+
}
|
|
404
|
+
/** @deprecated legacy: do not use outside of migration paths */
|
|
405
|
+
export type LibraryItem_v1 = readonly NonDeleted<ExcalidrawElement>[];
|
|
406
|
+
/** @deprecated legacy: do not use outside of migration paths */
|
|
407
|
+
type LibraryItems_v1 = readonly LibraryItem_v1[];
|
|
408
|
+
/** v2 library item */
|
|
409
|
+
export type LibraryItem = {
|
|
410
|
+
id: string;
|
|
411
|
+
status: "published" | "unpublished";
|
|
412
|
+
elements: readonly NonDeleted<ExcalidrawElement>[];
|
|
413
|
+
/** timestamp in epoch (ms) */
|
|
414
|
+
created: number;
|
|
415
|
+
name?: string;
|
|
416
|
+
error?: string;
|
|
417
|
+
};
|
|
418
|
+
export type LibraryItems = readonly LibraryItem[];
|
|
419
|
+
export type LibraryItems_anyVersion = LibraryItems | LibraryItems_v1;
|
|
420
|
+
export type LibraryItemsSource = ((currentLibraryItems: LibraryItems) => MaybePromise<LibraryItems_anyVersion | Blob>) | MaybePromise<LibraryItems_anyVersion | Blob>;
|
|
421
|
+
export type ExcalidrawInitialDataState = Merge<ImportedDataState, {
|
|
422
|
+
libraryItems?: MaybePromise<Required<ImportedDataState>["libraryItems"]>;
|
|
423
|
+
}>;
|
|
424
|
+
export type OnUserFollowedPayload = {
|
|
425
|
+
userToFollow: UserToFollow;
|
|
426
|
+
action: "FOLLOW" | "UNFOLLOW";
|
|
427
|
+
};
|
|
428
|
+
export interface ExcalidrawProps {
|
|
429
|
+
onChange?: (elements: readonly OrderedExcalidrawElement[], appState: AppState, files: BinaryFiles) => void;
|
|
430
|
+
onIncrement?: (event: DurableIncrement | EphemeralIncrement) => void;
|
|
431
|
+
initialData?: (() => MaybePromise<ExcalidrawInitialDataState | null>) | MaybePromise<ExcalidrawInitialDataState | null>;
|
|
432
|
+
excalidrawAPI?: (api: ExcalidrawImperativeAPI) => void;
|
|
433
|
+
isCollaborating?: boolean;
|
|
434
|
+
onPointerUpdate?: (payload: {
|
|
435
|
+
pointer: {
|
|
436
|
+
x: number;
|
|
437
|
+
y: number;
|
|
438
|
+
tool: "pointer" | "laser";
|
|
439
|
+
};
|
|
440
|
+
button: "down" | "up";
|
|
441
|
+
pointersMap: Gesture["pointers"];
|
|
442
|
+
}) => void;
|
|
443
|
+
onPaste?: (data: ClipboardData, event: ClipboardEvent | null) => Promise<boolean> | boolean;
|
|
444
|
+
/**
|
|
445
|
+
* Called when element(s) are duplicated so you can listen or modify as
|
|
446
|
+
* needed.
|
|
447
|
+
*
|
|
448
|
+
* Called when duplicating via mouse-drag, keyboard, paste, library insert
|
|
449
|
+
* etc.
|
|
450
|
+
*
|
|
451
|
+
* Returned elements will be used in place of the next elements
|
|
452
|
+
* (you should return all elements, including deleted, and not mutate
|
|
453
|
+
* the element if changes are made)
|
|
454
|
+
*/
|
|
455
|
+
onDuplicate?: (nextElements: readonly ExcalidrawElement[],
|
|
456
|
+
/** excludes the duplicated elements */
|
|
457
|
+
prevElements: readonly ExcalidrawElement[]) => ExcalidrawElement[] | void;
|
|
458
|
+
renderTopLeftUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
|
|
459
|
+
renderTopRightUI?: (isMobile: boolean, appState: UIAppState) => JSX.Element | null;
|
|
460
|
+
langCode?: Language["code"];
|
|
461
|
+
hideAnnotations?: boolean;
|
|
462
|
+
viewModeEnabled?: boolean;
|
|
463
|
+
zenModeEnabled?: boolean;
|
|
464
|
+
gridModeEnabled?: boolean;
|
|
465
|
+
objectsSnapModeEnabled?: boolean;
|
|
466
|
+
libraryReturnUrl?: string;
|
|
467
|
+
theme?: Theme;
|
|
468
|
+
name?: string;
|
|
469
|
+
renderCustomStats?: (elements: readonly NonDeletedExcalidrawElement[], appState: UIAppState) => JSX.Element;
|
|
470
|
+
UIOptions?: Partial<UIOptions>;
|
|
471
|
+
detectScroll?: boolean;
|
|
472
|
+
handleKeyboardGlobally?: boolean;
|
|
473
|
+
onLibraryChange?: (libraryItems: LibraryItems) => void | Promise<any>;
|
|
474
|
+
autoFocus?: boolean;
|
|
475
|
+
generateIdForFile?: (file: File) => string | Promise<string>;
|
|
476
|
+
generateLinkForSelection?: (id: string, type: "element" | "group") => string;
|
|
477
|
+
onLinkOpen?: (element: NonDeletedExcalidrawElement, event: CustomEvent<{
|
|
478
|
+
nativeEvent: MouseEvent | React.PointerEvent<HTMLCanvasElement>;
|
|
479
|
+
}>) => void;
|
|
480
|
+
onPointerDown?: (activeTool: AppState["activeTool"], pointerDownState: PointerDownState) => void;
|
|
481
|
+
onPointerUp?: (activeTool: AppState["activeTool"], pointerDownState: PointerDownState) => void;
|
|
482
|
+
onScrollChange?: (scrollX: number, scrollY: number, zoom: Zoom) => void;
|
|
483
|
+
onUserFollow?: (payload: OnUserFollowedPayload) => void;
|
|
484
|
+
children?: React.ReactNode;
|
|
485
|
+
validateEmbeddable?: boolean | string[] | RegExp | RegExp[] | ((link: string) => boolean | undefined);
|
|
486
|
+
onHideAnnotationsChange?: (hideAnnotations: boolean) => void;
|
|
487
|
+
renderEmbeddable?: (element: NonDeleted<ExcalidrawEmbeddableElement>, appState: AppState) => JSX.Element | null;
|
|
488
|
+
aiEnabled?: boolean;
|
|
489
|
+
showDeprecatedFonts?: boolean;
|
|
490
|
+
renderScrollbars?: boolean;
|
|
491
|
+
}
|
|
492
|
+
export type SceneData = {
|
|
493
|
+
elements?: ImportedDataState["elements"];
|
|
494
|
+
appState?: ImportedDataState["appState"];
|
|
495
|
+
collaborators?: Map<SocketId, Collaborator>;
|
|
496
|
+
captureUpdate?: CaptureUpdateActionType;
|
|
497
|
+
};
|
|
498
|
+
export type ExportOpts = {
|
|
499
|
+
saveFileToDisk?: boolean;
|
|
500
|
+
onExportToBackend?: (exportedElements: readonly NonDeletedExcalidrawElement[], appState: UIAppState, files: BinaryFiles) => void;
|
|
501
|
+
renderCustomUI?: (exportedElements: readonly NonDeletedExcalidrawElement[], appState: UIAppState, files: BinaryFiles, canvas: HTMLCanvasElement) => JSX.Element;
|
|
502
|
+
};
|
|
503
|
+
export type CanvasActions = Partial<{
|
|
504
|
+
changeViewBackgroundColor: boolean;
|
|
505
|
+
clearCanvas: boolean;
|
|
506
|
+
export: false | ExportOpts;
|
|
507
|
+
loadScene: boolean;
|
|
508
|
+
saveToActiveFile: boolean;
|
|
509
|
+
toggleTheme: boolean | null;
|
|
510
|
+
saveAsImage: boolean;
|
|
511
|
+
}>;
|
|
512
|
+
export type UIOptions = Partial<{
|
|
513
|
+
dockedSidebarBreakpoint: number;
|
|
514
|
+
canvasActions: CanvasActions;
|
|
515
|
+
tools: {
|
|
516
|
+
image: boolean;
|
|
517
|
+
};
|
|
518
|
+
/**
|
|
519
|
+
* Optionally control the editor form factor and desktop UI mode from the host app.
|
|
520
|
+
* If not provided, we will take care of it internally.
|
|
521
|
+
*/
|
|
522
|
+
formFactor?: EditorInterface["formFactor"];
|
|
523
|
+
desktopUIMode?: EditorInterface["desktopUIMode"];
|
|
524
|
+
toolBar?: {
|
|
525
|
+
lockEnabled?: boolean;
|
|
526
|
+
moreToolsEnabled?: boolean;
|
|
527
|
+
hintViewerEnabled?: boolean;
|
|
528
|
+
};
|
|
529
|
+
topLeftMenuEnabled?: boolean;
|
|
530
|
+
libraryEnabled?: boolean;
|
|
531
|
+
footer?: {
|
|
532
|
+
helpEnabled?: boolean;
|
|
533
|
+
};
|
|
534
|
+
fontPicker?: {
|
|
535
|
+
familyChangeEnabled?: boolean;
|
|
536
|
+
};
|
|
537
|
+
shapeControl?: {
|
|
538
|
+
sloppinessChangeEnabled?: boolean;
|
|
539
|
+
};
|
|
540
|
+
viewModeControlEnabled?: boolean;
|
|
541
|
+
hideAnnotationsControlEnabled?: boolean;
|
|
542
|
+
undoRedoPosition: "footer" | "toolbar";
|
|
543
|
+
swapTopMenuAndFooter?: boolean;
|
|
544
|
+
/** @deprecated does nothing. Will be removed in 0.15 */
|
|
545
|
+
welcomeScreen?: boolean;
|
|
546
|
+
}>;
|
|
547
|
+
export type AppProps = Merge<ExcalidrawProps, {
|
|
548
|
+
UIOptions: Merge<UIOptions, {
|
|
549
|
+
canvasActions: Required<CanvasActions> & {
|
|
550
|
+
export: ExportOpts;
|
|
551
|
+
};
|
|
552
|
+
}>;
|
|
553
|
+
detectScroll: boolean;
|
|
554
|
+
handleKeyboardGlobally: boolean;
|
|
555
|
+
isCollaborating: boolean;
|
|
556
|
+
children?: React.ReactNode;
|
|
557
|
+
aiEnabled: boolean;
|
|
558
|
+
}>;
|
|
559
|
+
/** A subset of App class properties that we need to use elsewhere
|
|
560
|
+
* in the app, eg Manager. Factored out into a separate type to keep DRY. */
|
|
561
|
+
export type AppClassProperties = {
|
|
562
|
+
props: AppProps;
|
|
563
|
+
state: AppState;
|
|
564
|
+
interactiveCanvas: HTMLCanvasElement | null;
|
|
565
|
+
/** static canvas */
|
|
566
|
+
canvas: HTMLCanvasElement;
|
|
567
|
+
focusContainer(): void;
|
|
568
|
+
library: Library;
|
|
569
|
+
imageCache: Map<FileId, {
|
|
570
|
+
image: HTMLImageElement | Promise<HTMLImageElement>;
|
|
571
|
+
mimeType: ValueOf<typeof IMAGE_MIME_TYPES>;
|
|
572
|
+
}>;
|
|
573
|
+
files: BinaryFiles;
|
|
574
|
+
editorInterface: App["editorInterface"];
|
|
575
|
+
scene: App["scene"];
|
|
576
|
+
syncActionResult: App["syncActionResult"];
|
|
577
|
+
fonts: App["fonts"];
|
|
578
|
+
pasteFromClipboard: App["pasteFromClipboard"];
|
|
579
|
+
id: App["id"];
|
|
580
|
+
onInsertElements: App["onInsertElements"];
|
|
581
|
+
onExportImage: App["onExportImage"];
|
|
582
|
+
lastViewportPosition: App["lastViewportPosition"];
|
|
583
|
+
scrollToContent: App["scrollToContent"];
|
|
584
|
+
addFiles: App["addFiles"];
|
|
585
|
+
addElementsFromPasteOrLibrary: App["addElementsFromPasteOrLibrary"];
|
|
586
|
+
togglePenMode: App["togglePenMode"];
|
|
587
|
+
toggleLock: App["toggleLock"];
|
|
588
|
+
setActiveTool: App["setActiveTool"];
|
|
589
|
+
setOpenDialog: App["setOpenDialog"];
|
|
590
|
+
insertEmbeddableElement: App["insertEmbeddableElement"];
|
|
591
|
+
onMagicframeToolSelect: App["onMagicframeToolSelect"];
|
|
592
|
+
getName: App["getName"];
|
|
593
|
+
dismissLinearEditor: App["dismissLinearEditor"];
|
|
594
|
+
flowChartCreator: App["flowChartCreator"];
|
|
595
|
+
getEffectiveGridSize: App["getEffectiveGridSize"];
|
|
596
|
+
setPlugins: App["setPlugins"];
|
|
597
|
+
plugins: App["plugins"];
|
|
598
|
+
getEditorUIOffsets: App["getEditorUIOffsets"];
|
|
599
|
+
visibleElements: App["visibleElements"];
|
|
600
|
+
excalidrawContainerValue: App["excalidrawContainerValue"];
|
|
601
|
+
onPointerUpEmitter: App["onPointerUpEmitter"];
|
|
602
|
+
updateEditorAtom: App["updateEditorAtom"];
|
|
603
|
+
onPointerDownEmitter: App["onPointerDownEmitter"];
|
|
604
|
+
bindModeHandler: App["bindModeHandler"];
|
|
605
|
+
};
|
|
606
|
+
export type PointerDownState = Readonly<{
|
|
607
|
+
origin: Readonly<{
|
|
608
|
+
x: number;
|
|
609
|
+
y: number;
|
|
610
|
+
}>;
|
|
611
|
+
originInGrid: Readonly<{
|
|
612
|
+
x: number;
|
|
613
|
+
y: number;
|
|
614
|
+
}>;
|
|
615
|
+
scrollbars: ReturnType<typeof isOverScrollBars>;
|
|
616
|
+
lastCoords: {
|
|
617
|
+
x: number;
|
|
618
|
+
y: number;
|
|
619
|
+
};
|
|
620
|
+
originalElements: Map<string, NonDeleted<ExcalidrawElement>>;
|
|
621
|
+
resize: {
|
|
622
|
+
handleType: MaybeTransformHandleType;
|
|
623
|
+
isResizing: boolean;
|
|
624
|
+
offset: {
|
|
625
|
+
x: number;
|
|
626
|
+
y: number;
|
|
627
|
+
};
|
|
628
|
+
arrowDirection: "origin" | "end";
|
|
629
|
+
center: {
|
|
630
|
+
x: number;
|
|
631
|
+
y: number;
|
|
632
|
+
};
|
|
633
|
+
};
|
|
634
|
+
hit: {
|
|
635
|
+
element: NonDeleted<ExcalidrawElement> | null;
|
|
636
|
+
allHitElements: NonDeleted<ExcalidrawElement>[];
|
|
637
|
+
wasAddedToSelection: boolean;
|
|
638
|
+
hasBeenDuplicated: boolean;
|
|
639
|
+
hasHitCommonBoundingBoxOfSelectedElements: boolean;
|
|
640
|
+
};
|
|
641
|
+
withCmdOrCtrl: boolean;
|
|
642
|
+
drag: {
|
|
643
|
+
hasOccurred: boolean;
|
|
644
|
+
offset: {
|
|
645
|
+
x: number;
|
|
646
|
+
y: number;
|
|
647
|
+
} | null;
|
|
648
|
+
origin: {
|
|
649
|
+
x: number;
|
|
650
|
+
y: number;
|
|
651
|
+
};
|
|
652
|
+
blockDragging: boolean;
|
|
653
|
+
};
|
|
654
|
+
eventListeners: {
|
|
655
|
+
onMove: null | ReturnType<typeof throttleRAF>;
|
|
656
|
+
onUp: null | ((event: PointerEvent) => void);
|
|
657
|
+
onKeyDown: null | ((event: KeyboardEvent) => void);
|
|
658
|
+
onKeyUp: null | ((event: KeyboardEvent) => void);
|
|
659
|
+
};
|
|
660
|
+
boxSelection: {
|
|
661
|
+
hasOccurred: boolean;
|
|
662
|
+
};
|
|
663
|
+
}>;
|
|
664
|
+
export type UnsubscribeCallback = () => void;
|
|
665
|
+
export interface ExcalidrawImperativeAPI {
|
|
666
|
+
updateScene: InstanceType<typeof App>["updateScene"];
|
|
667
|
+
applyDeltas: InstanceType<typeof App>["applyDeltas"];
|
|
668
|
+
mutateElement: InstanceType<typeof App>["mutateElement"];
|
|
669
|
+
updateLibrary: InstanceType<typeof Library>["updateLibrary"];
|
|
670
|
+
resetScene: InstanceType<typeof App>["resetScene"];
|
|
671
|
+
getSceneElementsIncludingDeleted: InstanceType<typeof App>["getSceneElementsIncludingDeleted"];
|
|
672
|
+
getSceneElementsMapIncludingDeleted: InstanceType<typeof App>["getSceneElementsMapIncludingDeleted"];
|
|
673
|
+
history: {
|
|
674
|
+
clear: InstanceType<typeof App>["resetHistory"];
|
|
675
|
+
};
|
|
676
|
+
getSceneElements: InstanceType<typeof App>["getSceneElements"];
|
|
677
|
+
getAppState: () => InstanceType<typeof App>["state"];
|
|
678
|
+
getFiles: () => InstanceType<typeof App>["files"];
|
|
679
|
+
getName: InstanceType<typeof App>["getName"];
|
|
680
|
+
scrollToContent: InstanceType<typeof App>["scrollToContent"];
|
|
681
|
+
registerAction: (action: Action) => void;
|
|
682
|
+
refresh: InstanceType<typeof App>["refresh"];
|
|
683
|
+
setToast: InstanceType<typeof App>["setToast"];
|
|
684
|
+
addFiles: (data: BinaryFileData[]) => void;
|
|
685
|
+
id: string;
|
|
686
|
+
setActiveTool: InstanceType<typeof App>["setActiveTool"];
|
|
687
|
+
setCursor: InstanceType<typeof App>["setCursor"];
|
|
688
|
+
resetCursor: InstanceType<typeof App>["resetCursor"];
|
|
689
|
+
toggleSidebar: InstanceType<typeof App>["toggleSidebar"];
|
|
690
|
+
getEditorInterface: () => EditorInterface;
|
|
691
|
+
/**
|
|
692
|
+
* Disables rendering of frames (including element clipping), but currently
|
|
693
|
+
* the frames are still interactive in edit mode. As such, this API should be
|
|
694
|
+
* used in conjunction with view mode (props.viewModeEnabled).
|
|
695
|
+
*/
|
|
696
|
+
updateFrameRendering: InstanceType<typeof App>["updateFrameRendering"];
|
|
697
|
+
onChange: (callback: (elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles) => void) => UnsubscribeCallback;
|
|
698
|
+
onIncrement: (callback: (event: DurableIncrement | EphemeralIncrement) => void) => UnsubscribeCallback;
|
|
699
|
+
onPointerDown: (callback: (activeTool: AppState["activeTool"], pointerDownState: PointerDownState, event: React.PointerEvent<HTMLElement>) => void) => UnsubscribeCallback;
|
|
700
|
+
onPointerUp: (callback: (activeTool: AppState["activeTool"], pointerDownState: PointerDownState, event: PointerEvent) => void) => UnsubscribeCallback;
|
|
701
|
+
onScrollChange: (callback: (scrollX: number, scrollY: number, zoom: Zoom) => void) => UnsubscribeCallback;
|
|
702
|
+
onUserFollow: (callback: (payload: OnUserFollowedPayload) => void) => UnsubscribeCallback;
|
|
703
|
+
onHideAnnotationsChange: (callback: (hideAnnotations: boolean) => void) => UnsubscribeCallback;
|
|
704
|
+
}
|
|
705
|
+
export type FrameNameBounds = {
|
|
706
|
+
x: number;
|
|
707
|
+
y: number;
|
|
708
|
+
width: number;
|
|
709
|
+
height: number;
|
|
710
|
+
angle: number;
|
|
711
|
+
};
|
|
712
|
+
export type FrameNameBoundsCache = {
|
|
713
|
+
get: (frameElement: ExcalidrawFrameLikeElement | ExcalidrawMagicFrameElement) => FrameNameBounds | null;
|
|
714
|
+
_cache: Map<string, FrameNameBounds & {
|
|
715
|
+
zoom: AppState["zoom"]["value"];
|
|
716
|
+
versionNonce: ExcalidrawFrameLikeElement["versionNonce"];
|
|
717
|
+
}>;
|
|
718
|
+
};
|
|
719
|
+
export type KeyboardModifiersObject = {
|
|
720
|
+
ctrlKey: boolean;
|
|
721
|
+
shiftKey: boolean;
|
|
722
|
+
altKey: boolean;
|
|
723
|
+
metaKey: boolean;
|
|
724
|
+
};
|
|
725
|
+
export type Primitive = number | string | boolean | bigint | symbol | null | undefined;
|
|
726
|
+
export type JSONValue = string | number | boolean | null | object;
|
|
727
|
+
export type EmbedsValidationStatus = Map<ExcalidrawIframeLikeElement["id"], boolean>;
|
|
728
|
+
export type ElementsPendingErasure = Set<ExcalidrawElement["id"]>;
|
|
729
|
+
export type PendingExcalidrawElements = ExcalidrawElement[];
|
|
730
|
+
/** Runtime gridSize value. Null indicates disabled grid. */
|
|
731
|
+
export type NullableGridSize = (AppState["gridSize"] & MakeBrand<"NullableGridSize">) | null;
|
|
732
|
+
export type GenerateDiagramToCode = (props: {
|
|
733
|
+
frame: ExcalidrawMagicFrameElement;
|
|
734
|
+
children: readonly ExcalidrawElement[];
|
|
735
|
+
}) => MaybePromise<{
|
|
736
|
+
html: string;
|
|
737
|
+
}>;
|
|
738
|
+
export type Offsets = Partial<{
|
|
739
|
+
top: number;
|
|
740
|
+
right: number;
|
|
741
|
+
bottom: number;
|
|
742
|
+
left: number;
|
|
743
|
+
}>;
|
|
744
|
+
export {};
|