@excalidraw/math 0.18.0-4e0441e → 0.18.0-4e758db
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/dist/dev/index.js +313 -116
- package/dist/dev/index.js.map +4 -4
- package/dist/prod/index.js +1 -1
- package/dist/types/common/debug.d.ts +21 -0
- package/dist/types/common/src/appEventBus.d.ts +27 -0
- package/dist/types/common/src/bounds.d.ts +10 -0
- package/dist/types/common/src/colors.d.ts +81 -39
- package/dist/types/common/src/constants.d.ts +75 -34
- package/dist/types/common/src/editorInterface.d.ts +34 -0
- package/dist/types/common/src/font-metadata.d.ts +1 -3
- package/dist/types/common/src/index.d.ts +5 -0
- package/dist/types/common/src/keys.d.ts +5 -1
- package/dist/types/common/src/points.d.ts +1 -1
- package/dist/types/common/src/random.d.ts +7 -0
- package/dist/types/common/src/utility-types.d.ts +0 -1
- package/dist/types/common/src/utils.d.ts +45 -77
- package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
- package/dist/types/element/src/Scene.d.ts +12 -8
- package/dist/types/element/src/align.d.ts +2 -2
- package/dist/types/element/src/arrowEndpointText.d.ts +49 -0
- package/dist/types/element/src/arrowheads.d.ts +3 -0
- package/dist/types/element/src/arrows/focus.d.ts +30 -0
- package/dist/types/element/src/arrows/helpers.d.ts +5 -0
- package/dist/types/element/src/binding.d.ts +79 -51
- package/dist/types/element/src/bounds.d.ts +25 -18
- package/dist/types/element/src/bucketFill.d.ts +110 -0
- package/dist/types/element/src/collision.d.ts +7 -2
- package/dist/types/element/src/comparisons.d.ts +10 -7
- package/dist/types/element/src/convertToShape.d.ts +23 -0
- package/dist/types/element/src/delta.d.ts +23 -1
- package/dist/types/element/src/distribute.d.ts +3 -2
- package/dist/types/element/src/dragElements.d.ts +30 -3
- package/dist/types/element/src/duplicate.d.ts +7 -6
- package/dist/types/element/src/elbowArrow.d.ts +2 -0
- package/dist/types/element/src/embeddable.d.ts +2 -2
- package/dist/types/element/src/flowchart.d.ts +11 -7
- package/dist/types/element/src/fractionalIndex.d.ts +4 -4
- package/dist/types/element/src/frame.d.ts +16 -11
- package/dist/types/element/src/groups.d.ts +9 -9
- package/dist/types/element/src/heading.d.ts +2 -1
- package/dist/types/element/src/image.d.ts +1 -11
- package/dist/types/element/src/index.d.ts +9 -4
- package/dist/types/element/src/linearElementEditor.d.ts +48 -30
- package/dist/types/element/src/mutateElement.d.ts +6 -2
- package/dist/types/element/src/newElement.d.ts +44 -8
- package/dist/types/element/src/renderElement.d.ts +1 -10
- package/dist/types/element/src/resizeElements.d.ts +12 -12
- package/dist/types/element/src/resizeTest.d.ts +6 -5
- package/dist/types/element/src/selection.d.ts +14 -14
- package/dist/types/element/src/shape.d.ts +21 -8
- package/dist/types/element/src/sizeHelpers.d.ts +6 -0
- package/dist/types/element/src/sortElements.d.ts +10 -0
- package/dist/types/element/src/stickyNote.d.ts +183 -0
- package/dist/types/element/src/textElement.d.ts +14 -10
- package/dist/types/element/src/textMeasurements.d.ts +1 -3
- package/dist/types/element/src/textWrapping.d.ts +26 -0
- package/dist/types/{excalidraw/data → element/src}/transform.d.ts +27 -8
- package/dist/types/element/src/transformHandles.d.ts +8 -27
- package/dist/types/element/src/typeChecks.d.ts +30 -31
- package/dist/types/element/src/types.d.ts +55 -20
- package/dist/types/element/src/utils.d.ts +15 -6
- package/dist/types/element/src/zindex.d.ts +7 -1
- package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +206 -219
- package/dist/types/excalidraw/actions/actionAlign.d.ts +12 -13
- package/dist/types/excalidraw/actions/actionBoundText.d.ts +122 -131
- package/dist/types/excalidraw/actions/actionCanvas.d.ts +446 -1594
- package/dist/types/excalidraw/actions/actionClipboard.d.ts +149 -919
- package/dist/types/excalidraw/actions/actionCropEditor.d.ts +59 -64
- package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +192 -208
- package/dist/types/excalidraw/actions/actionDeselect.d.ts +170 -0
- package/dist/types/excalidraw/actions/actionDistribute.d.ts +4 -6
- package/dist/types/excalidraw/actions/actionDuplicateSelection.d.ts +3 -4
- package/dist/types/excalidraw/actions/actionElementLink.d.ts +66 -77
- package/dist/types/excalidraw/actions/actionElementLock.d.ts +121 -130
- package/dist/types/excalidraw/actions/actionExport.d.ts +200 -1449
- package/dist/types/excalidraw/actions/actionFinalize.d.ts +11 -404
- package/dist/types/excalidraw/actions/actionFlip.d.ts +2 -3
- package/dist/types/excalidraw/actions/actionFrame.d.ts +318 -509
- package/dist/types/excalidraw/actions/actionGroup.d.ts +132 -149
- package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +205 -196
- package/dist/types/excalidraw/actions/actionLink.d.ts +73 -78
- package/dist/types/excalidraw/actions/actionMenu.d.ts +60 -71
- package/dist/types/excalidraw/actions/actionNavigate.d.ts +18 -369
- package/dist/types/excalidraw/actions/actionProperties.d.ts +213 -2610
- package/dist/types/excalidraw/actions/actionSelectAll.d.ts +66 -75
- package/dist/types/excalidraw/actions/actionStyles.d.ts +60 -64
- package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +4 -4
- package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +186 -0
- package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +74 -80
- package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +186 -0
- package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +73 -78
- package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +62 -74
- package/dist/types/excalidraw/actions/actionToggleShapeSwitch.d.ts +2 -2
- package/dist/types/excalidraw/actions/actionToggleStats.d.ts +72 -77
- package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +73 -78
- package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +73 -78
- package/dist/types/excalidraw/actions/actionZindex.d.ts +8 -9
- package/dist/types/excalidraw/actions/colorTargets.d.ts +39 -0
- package/dist/types/excalidraw/actions/index.d.ts +4 -2
- package/dist/types/excalidraw/actions/manager.d.ts +1 -0
- package/dist/types/excalidraw/actions/register.d.ts +2 -2
- package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
- package/dist/types/excalidraw/actions/types.d.ts +11 -7
- package/dist/types/excalidraw/{animated-trail.d.ts → animatedTrail.d.ts} +4 -3
- package/dist/types/excalidraw/appState.d.ts +50 -25
- package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -0
- package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
- package/dist/types/excalidraw/charts/charts.helpers.d.ts +32 -0
- package/dist/types/excalidraw/charts/charts.line.d.ts +2 -0
- package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
- package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -0
- package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
- package/dist/types/excalidraw/charts/index.d.ts +7 -0
- package/dist/types/excalidraw/clipboard.d.ts +13 -38
- package/dist/types/excalidraw/components/Actions.d.ts +22 -14
- package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/App.arrowText.d.ts +104 -0
- package/dist/types/excalidraw/components/App.bucketFill.d.ts +48 -0
- package/dist/types/excalidraw/components/App.cursor.d.ts +38 -0
- package/dist/types/excalidraw/components/App.d.ts +552 -125
- package/dist/types/excalidraw/components/App.drawshape.d.ts +55 -0
- package/dist/types/excalidraw/components/App.flowchart.d.ts +21 -0
- package/dist/types/excalidraw/components/App.toolDrag.d.ts +63 -0
- package/dist/types/excalidraw/components/App.viewport.d.ts +73 -0
- package/dist/types/excalidraw/components/App.wheel.d.ts +33 -0
- package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
- package/dist/types/excalidraw/components/Card.d.ts +1 -3
- package/dist/types/excalidraw/components/ColorPicker/ColorInput.d.ts +2 -4
- package/dist/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +9 -5
- package/dist/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +3 -1
- package/dist/types/excalidraw/components/ColorPicker/Picker.d.ts +3 -1
- package/dist/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +9 -2
- package/dist/types/excalidraw/components/ColorPicker/ShadeList.d.ts +4 -2
- package/dist/types/excalidraw/components/ColorPicker/TopPicks.d.ts +8 -1
- package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -2
- package/dist/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +2 -2
- package/dist/types/excalidraw/components/ColorPicker/topPicksDnD.d.ts +31 -0
- package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -2
- package/dist/types/excalidraw/components/CommandPalette/types.d.ts +2 -4
- package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +4 -4
- package/dist/types/excalidraw/components/CursorHint.d.ts +46 -0
- package/dist/types/excalidraw/components/DarkModeToggle.d.ts +1 -1
- package/dist/types/excalidraw/components/DefaultSidebar.d.ts +9 -13
- package/dist/types/excalidraw/components/ElementLinkDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/Ellipsify.d.ts +1 -2
- package/dist/types/excalidraw/components/ErrorDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -2
- package/dist/types/excalidraw/components/FilledButton.d.ts +2 -1
- package/dist/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +0 -1
- package/dist/types/excalidraw/components/HelpDialog.d.ts +1 -1
- package/dist/types/excalidraw/components/HintViewer.d.ts +4 -3
- package/dist/types/excalidraw/components/IconButton.d.ts +48 -0
- package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
- package/dist/types/excalidraw/components/InlineIcon.d.ts +2 -2
- package/dist/types/excalidraw/components/Island.d.ts +7 -0
- package/dist/types/excalidraw/components/LaserPointerButton.d.ts +2 -4
- package/dist/types/excalidraw/components/LayerUI.d.ts +5 -2
- package/dist/types/excalidraw/components/LibraryMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryMenuControlButtons.d.ts +1 -1
- package/dist/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +1 -2
- package/dist/types/excalidraw/components/LibraryUnit.d.ts +2 -3
- package/dist/types/excalidraw/components/LoadingMessage.d.ts +0 -1
- package/dist/types/excalidraw/components/LockButton.d.ts +3 -4
- package/dist/types/excalidraw/components/MagicButton.d.ts +0 -2
- package/dist/types/excalidraw/components/MobileMenu.d.ts +4 -4
- package/dist/types/excalidraw/components/MobileToolbar.d.ts +9 -0
- package/dist/types/excalidraw/components/Modal.d.ts +0 -1
- package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +1 -1
- package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
- package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
- package/dist/types/excalidraw/components/PenModeButton.d.ts +2 -5
- package/dist/types/excalidraw/components/Popover.d.ts +1 -3
- package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -1
- package/dist/types/excalidraw/components/{ButtonIcon.d.ts → RadioButton.d.ts} +2 -5
- package/dist/types/excalidraw/components/RadioGroup.d.ts +0 -1
- package/dist/types/excalidraw/components/RadioSelection.d.ts +4 -4
- package/dist/types/excalidraw/components/Range.d.ts +10 -4
- package/dist/types/excalidraw/components/SVGLayer.d.ts +1 -1
- package/dist/types/excalidraw/components/ScrollableList.d.ts +0 -1
- package/dist/types/excalidraw/components/SearchMenu.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +16 -22
- package/dist/types/excalidraw/components/Sidebar/SidebarHeader.d.ts +1 -1
- package/dist/types/excalidraw/components/Sidebar/SidebarTab.d.ts +1 -2
- package/dist/types/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +1 -2
- package/dist/types/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +1 -2
- package/dist/types/excalidraw/components/Sidebar/SidebarTabs.d.ts +1 -2
- package/dist/types/excalidraw/components/Spinner.d.ts +4 -4
- package/dist/types/excalidraw/components/Stats/Angle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/CanvasGrid.d.ts +0 -1
- package/dist/types/excalidraw/components/Stats/Collapsible.d.ts +0 -1
- package/dist/types/excalidraw/components/Stats/Dimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/DragInput.d.ts +2 -3
- package/dist/types/excalidraw/components/Stats/MultiAngle.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiDimension.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/MultiPosition.d.ts +2 -2
- package/dist/types/excalidraw/components/Stats/Position.d.ts +3 -3
- package/dist/types/excalidraw/components/Stats/index.d.ts +7 -8
- package/dist/types/excalidraw/components/Stats/utils.d.ts +1 -1
- package/dist/types/excalidraw/components/TTDDialog/Chat/ChatHistoryMenu.d.ts +15 -0
- package/dist/types/excalidraw/components/TTDDialog/Chat/ChatInterface.d.ts +23 -0
- package/dist/types/excalidraw/components/TTDDialog/Chat/ChatMessage.d.ts +14 -0
- package/dist/types/excalidraw/components/TTDDialog/Chat/TTDChatPanel.d.ts +27 -0
- package/dist/types/excalidraw/components/TTDDialog/Chat/index.d.ts +3 -0
- package/dist/types/excalidraw/components/TTDDialog/Chat/useChatAgent.d.ts +8 -0
- package/dist/types/excalidraw/components/TTDDialog/CodeMirrorEditor.d.ts +11 -0
- package/dist/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +3 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +13 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +12 -29
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +3 -3
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +5 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +13 -9
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +1 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +1 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +1 -2
- package/dist/types/excalidraw/components/TTDDialog/TTDPreviewPanel.d.ts +9 -0
- package/dist/types/excalidraw/components/TTDDialog/TTDWelcomeMessage.d.ts +1 -0
- package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +9 -0
- package/dist/types/excalidraw/components/TTDDialog/common.d.ts +16 -16
- package/dist/types/excalidraw/components/TTDDialog/hooks/useChatManagement.d.ts +13 -0
- package/dist/types/excalidraw/components/TTDDialog/hooks/useMermaidRenderer.d.ts +14 -0
- package/dist/types/excalidraw/components/TTDDialog/hooks/useTextGeneration.d.ts +7 -0
- package/dist/types/excalidraw/components/TTDDialog/mermaid-lang-lite.d.ts +2 -0
- package/dist/types/excalidraw/components/TTDDialog/types.d.ts +95 -0
- package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +22 -0
- package/dist/types/excalidraw/components/TTDDialog/utils/chat.d.ts +10 -0
- package/dist/types/excalidraw/components/TTDDialog/utils/mermaidAutoFix.d.ts +1 -0
- package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +10 -0
- package/dist/types/excalidraw/components/TTDDialog/utils/mermaidValidation.d.ts +1 -0
- package/dist/types/excalidraw/components/Toast.d.ts +11 -7
- package/dist/types/excalidraw/components/ToolPopover.d.ts +3 -6
- package/dist/types/excalidraw/components/Toolbar.d.ts +11 -0
- package/dist/types/excalidraw/components/Tools.d.ts +151 -0
- package/dist/types/excalidraw/components/Trans.d.ts +2 -2
- package/dist/types/excalidraw/components/UserList.d.ts +3 -2
- package/dist/types/excalidraw/components/ViewportStatusFrame/ViewportStatusFrame.d.ts +11 -0
- package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +10 -4
- package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +3 -0
- package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +48 -38
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +7 -6
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +3 -3
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +13 -22
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCheckbox.d.ts +5 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +5 -4
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +2 -2
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +6 -6
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSub.d.ts +23 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubContent.d.ts +8 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubTrigger.d.ts +12 -0
- package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +3 -4
- package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +2 -2
- package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -0
- package/dist/types/excalidraw/components/footer/Footer.d.ts +3 -1
- package/dist/types/excalidraw/components/hoc/withInternalFallback.d.ts +1 -1
- package/dist/types/excalidraw/components/hyperlink/helpers.d.ts +3 -3
- package/dist/types/excalidraw/components/icons.d.ts +51 -22
- package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +25 -3
- package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +39 -35
- package/dist/types/excalidraw/components/positionElementBesideCursor.d.ts +26 -0
- package/dist/types/excalidraw/components/shapeActionPredicates.d.ts +39 -0
- package/dist/types/excalidraw/data/blob.d.ts +354 -7
- package/dist/types/excalidraw/data/encode.d.ts +4 -4
- package/dist/types/excalidraw/data/encryption.d.ts +5 -5
- package/dist/types/excalidraw/data/filesystem.d.ts +5 -7
- package/dist/types/excalidraw/data/index.d.ts +8 -9
- package/dist/types/excalidraw/data/json.d.ts +183 -3
- package/dist/types/excalidraw/data/library.d.ts +25 -10
- package/dist/types/excalidraw/data/resave.d.ts +7 -2
- package/dist/types/excalidraw/data/restore.d.ts +25 -10
- package/dist/types/excalidraw/drawShapeTrail.d.ts +16 -0
- package/dist/types/excalidraw/editor-jotai.d.ts +11 -11
- package/dist/types/excalidraw/eraser/index.d.ts +2 -3
- package/dist/types/excalidraw/errors.d.ts +14 -0
- package/dist/types/excalidraw/fonts/Fonts.d.ts +3 -2
- package/dist/types/excalidraw/hooks/useAppStateValue.d.ts +29 -0
- package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
- package/dist/types/excalidraw/hooks/useOutsideClick.d.ts +4 -3
- package/dist/types/excalidraw/hooks/useScrollPosition.d.ts +1 -2
- package/dist/types/excalidraw/hooks/useTextEditorFocus.d.ts +5 -5
- package/dist/types/excalidraw/i18n.d.ts +2 -2
- package/dist/types/excalidraw/{laser-trails.d.ts → laserTrails.d.ts} +5 -7
- package/dist/types/excalidraw/lasso/index.d.ts +2 -3
- package/dist/types/excalidraw/lasso/utils.d.ts +2 -0
- package/dist/types/excalidraw/renderer/animation.d.ts +16 -0
- package/dist/types/excalidraw/renderer/helpers.d.ts +31 -8
- package/dist/types/excalidraw/renderer/interactiveScene.d.ts +7 -15
- package/dist/types/excalidraw/scene/Renderer.d.ts +477 -18
- package/dist/types/excalidraw/scene/export.d.ts +4 -4
- package/dist/types/excalidraw/scene/index.d.ts +2 -2
- package/dist/types/excalidraw/scene/types.d.ts +27 -8
- package/dist/types/excalidraw/snapping.d.ts +12 -12
- package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-bindings.d.ts +1 -1
- package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-loader.d.ts +1 -1
- package/dist/types/excalidraw/subset/harfbuzz/harfbuzz-wasm.d.ts +1 -1
- package/dist/types/excalidraw/subset/woff2/woff2-loader.d.ts +2 -2
- package/dist/types/excalidraw/subset/woff2/woff2-wasm.d.ts +1 -1
- package/dist/types/excalidraw/textAutoResizeHandle.d.ts +15 -0
- package/dist/types/excalidraw/types.d.ts +566 -55
- package/dist/types/excalidraw/viewport.d.ts +280 -0
- package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +8 -5
- package/dist/types/fractional-indexing/src/index.d.ts +29 -0
- package/dist/types/laser-pointer/src/index.d.ts +2 -0
- package/dist/types/laser-pointer/src/math.d.ts +16 -0
- package/dist/types/laser-pointer/src/simplify.d.ts +2 -0
- package/dist/types/laser-pointer/src/state.d.ts +36 -0
- package/dist/types/math/src/constants.d.ts +0 -1
- package/dist/types/math/src/curve.d.ts +23 -13
- package/dist/types/math/src/index.d.ts +1 -0
- package/dist/types/math/src/pca.d.ts +79 -0
- package/dist/types/math/src/point.d.ts +8 -2
- package/dist/types/math/src/polygon.d.ts +26 -2
- package/dist/types/math/src/range.d.ts +1 -3
- package/dist/types/math/src/segment.d.ts +9 -3
- package/dist/types/math/src/types.d.ts +25 -1
- package/dist/types/utils/src/export.d.ts +9 -8
- package/dist/types/utils/src/index.d.ts +1 -2
- package/dist/types/utils/src/shape.d.ts +8 -8
- package/package.json +2 -2
- package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +0 -190
- package/dist/types/excalidraw/animation-frame-handler.d.ts +0 -16
- package/dist/types/excalidraw/charts.d.ts +0 -27
- package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
- package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -16
- package/dist/types/excalidraw/components/FollowMode/FollowMode.d.ts +0 -10
- package/dist/types/excalidraw/components/HandButton.d.ts +0 -10
- package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
- package/dist/types/excalidraw/components/MobileToolBar.d.ts +0 -11
- package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -8
- package/dist/types/excalidraw/components/ToolButton.d.ts +0 -49
- package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
- package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -10
- package/dist/types/excalidraw/components/shapes.d.ts +0 -190
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
- package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -85
- package/dist/types/excalidraw/cursor.d.ts +0 -5
- package/dist/types/excalidraw/data/reconcile.d.ts +0 -7
- package/dist/types/excalidraw/index.d.ts +0 -47
- package/dist/types/excalidraw/polyfill.d.ts +0 -2
- package/dist/types/excalidraw/scene/scroll.d.ts +0 -23
- package/dist/types/excalidraw/scene/zoom.d.ts +0 -12
- package/dist/types/utils/src/bbox.d.ts +0 -9
- package/dist/types/utils/src/withinBounds.d.ts +0 -19
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GlobalCoord } from "@excalidraw/math";
|
|
2
|
+
import type { FontFamilyValues, FontString } from "@excalidraw/element/types";
|
|
2
3
|
import type { ActiveTool, AppState, ToolType, UnsubscribeCallback, Zoom } from "@excalidraw/excalidraw/types";
|
|
3
|
-
import type { MaybePromise } from "./utility-types";
|
|
4
|
+
import type { MaybePromise, ResolutionType } from "./utility-types";
|
|
4
5
|
import type { EVENT } from "./constants";
|
|
5
6
|
export declare const setDateTimeForTests: (dateTime: string) => void;
|
|
6
7
|
export declare const getDateTime: () => string;
|
|
7
8
|
export declare const capitalizeString: (str: string) => string;
|
|
8
9
|
export declare const isToolIcon: (target: Element | EventTarget | null) => target is HTMLElement;
|
|
9
|
-
export declare const isInputLike: (target: Element | EventTarget | null) => target is
|
|
10
|
+
export declare const isInputLike: (target: Element | EventTarget | null) => target is HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | HTMLBRElement | HTMLDivElement;
|
|
10
11
|
export declare const isInteractive: (target: Element | EventTarget | null) => boolean;
|
|
11
|
-
export declare const isWritableElement: (target: Element | EventTarget | null) => target is
|
|
12
|
+
export declare const isWritableElement: (target: Element | EventTarget | null) => target is HTMLInputElement | HTMLTextAreaElement | HTMLBRElement | HTMLDivElement;
|
|
12
13
|
export declare const getFontFamilyString: ({ fontFamily, }: {
|
|
13
14
|
fontFamily: FontFamilyValues;
|
|
14
15
|
}) => string;
|
|
@@ -24,9 +25,7 @@ export declare const debounce: <T extends any[]>(fn: (...args: T) => void, timeo
|
|
|
24
25
|
flush(): void;
|
|
25
26
|
cancel(): void;
|
|
26
27
|
};
|
|
27
|
-
export declare const throttleRAF: <T extends any[]>(fn: (...args: T) => void
|
|
28
|
-
trailing?: boolean;
|
|
29
|
-
}) => {
|
|
28
|
+
export declare const throttleRAF: <T extends any[]>(fn: (...args: T) => void) => {
|
|
30
29
|
(...args: T): void;
|
|
31
30
|
flush(): void;
|
|
32
31
|
cancel(): void;
|
|
@@ -38,50 +37,11 @@ export declare const throttleRAF: <T extends any[]>(fn: (...args: T) => void, op
|
|
|
38
37
|
* @returns {number} The tweened value.
|
|
39
38
|
*/
|
|
40
39
|
export declare const easeOut: (k: number) => number;
|
|
41
|
-
|
|
42
|
-
* Animates values from `fromValues` to `toValues` using the requestAnimationFrame API.
|
|
43
|
-
* Executes the `onStep` callback on each step with the interpolated values.
|
|
44
|
-
* Returns a function that can be called to cancel the animation.
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* // Example usage:
|
|
48
|
-
* const fromValues = { x: 0, y: 0 };
|
|
49
|
-
* const toValues = { x: 100, y: 200 };
|
|
50
|
-
* const onStep = ({x, y}) => {
|
|
51
|
-
* setState(x, y)
|
|
52
|
-
* };
|
|
53
|
-
* const onCancel = () => {
|
|
54
|
-
* console.log("Animation canceled");
|
|
55
|
-
* };
|
|
56
|
-
*
|
|
57
|
-
* const cancelAnimation = easeToValuesRAF({
|
|
58
|
-
* fromValues,
|
|
59
|
-
* toValues,
|
|
60
|
-
* onStep,
|
|
61
|
-
* onCancel,
|
|
62
|
-
* });
|
|
63
|
-
*
|
|
64
|
-
* // To cancel the animation:
|
|
65
|
-
* cancelAnimation();
|
|
66
|
-
*/
|
|
67
|
-
export declare const easeToValuesRAF: <T extends Record<keyof T, number>, K extends keyof T>({ fromValues, toValues, onStep, duration, interpolateValue, onStart, onEnd, onCancel, }: {
|
|
68
|
-
fromValues: T;
|
|
69
|
-
toValues: T;
|
|
70
|
-
/**
|
|
71
|
-
* Interpolate a single value.
|
|
72
|
-
* Return undefined to be handled by the default interpolator.
|
|
73
|
-
*/
|
|
74
|
-
interpolateValue?: ((fromValue: number, toValue: number, progress: number, key: K) => number | undefined) | undefined;
|
|
75
|
-
onStep: (values: T) => void;
|
|
76
|
-
duration?: number | undefined;
|
|
77
|
-
onStart?: (() => void) | undefined;
|
|
78
|
-
onEnd?: (() => void) | undefined;
|
|
79
|
-
onCancel?: (() => void) | undefined;
|
|
80
|
-
}) => () => void;
|
|
81
|
-
export declare const chunk: <T extends unknown>(array: readonly T[], size: number) => T[][];
|
|
40
|
+
export declare const chunk: <T extends any>(array: readonly T[], size: number) => T[][];
|
|
82
41
|
export declare const selectNode: (node: Element) => void;
|
|
83
42
|
export declare const removeSelection: () => void;
|
|
84
43
|
export declare const distance: (x: number, y: number) => number;
|
|
44
|
+
export declare const isSelectionLikeTool: (type: ToolType | "custom") => type is "selection" | "lasso";
|
|
85
45
|
export declare const updateActiveTool: (appState: Pick<AppState, "activeTool">, data: (({
|
|
86
46
|
type: ToolType;
|
|
87
47
|
} | {
|
|
@@ -91,7 +51,7 @@ export declare const updateActiveTool: (appState: Pick<AppState, "activeTool">,
|
|
|
91
51
|
locked?: boolean;
|
|
92
52
|
fromSelection?: boolean;
|
|
93
53
|
}) & {
|
|
94
|
-
|
|
54
|
+
lastActiveTool?: ActiveTool | null;
|
|
95
55
|
}) => AppState["activeTool"];
|
|
96
56
|
export declare const isFullScreen: () => boolean;
|
|
97
57
|
export declare const allowFullScreen: () => Promise<void>;
|
|
@@ -105,10 +65,7 @@ export declare const viewportCoordsToSceneCoords: ({ clientX, clientY }: {
|
|
|
105
65
|
offsetTop: number;
|
|
106
66
|
scrollX: number;
|
|
107
67
|
scrollY: number;
|
|
108
|
-
}) =>
|
|
109
|
-
x: number;
|
|
110
|
-
y: number;
|
|
111
|
-
};
|
|
68
|
+
}) => GlobalCoord;
|
|
112
69
|
export declare const sceneCoordsToViewportCoords: ({ sceneX, sceneY }: {
|
|
113
70
|
sceneX: number;
|
|
114
71
|
sceneY: number;
|
|
@@ -139,9 +96,7 @@ export declare const muteFSAbortError: (error?: Error) => void;
|
|
|
139
96
|
export declare const findIndex: <T>(array: readonly T[], cb: (element: T, index: number, array: readonly T[]) => boolean, fromIndex?: number) => number;
|
|
140
97
|
export declare const findLastIndex: <T>(array: readonly T[], cb: (element: T, index: number, array: readonly T[]) => boolean, fromIndex?: number) => number;
|
|
141
98
|
/** returns the first non-null mapped value */
|
|
142
|
-
export declare const mapFind: <T, K>(collection: readonly T[], iteratee: (value: T, index: number) => K |
|
|
143
|
-
export declare const isTransparent: (color: string) => boolean;
|
|
144
|
-
export declare const isBindingFallthroughEnabled: (el: ExcalidrawBindableElement) => boolean;
|
|
99
|
+
export declare const mapFind: <T, K>(collection: readonly T[], iteratee: (value: T, index: number) => K | undefined | null) => K | undefined;
|
|
145
100
|
export type ResolvablePromise<T> = Promise<T> & {
|
|
146
101
|
resolve: [T] extends [undefined] ? (value?: MaybePromise<Awaited<T>>) => void : (value: MaybePromise<Awaited<T>>) => void;
|
|
147
102
|
reject: (error: Error) => void;
|
|
@@ -159,16 +114,16 @@ export declare const getUpdatedTimestamp: () => number;
|
|
|
159
114
|
* Transforms array of objects containing `id` attribute,
|
|
160
115
|
* or array of ids (strings), into a Map, keyd by `id`.
|
|
161
116
|
*/
|
|
162
|
-
export declare const arrayToMap: <T extends
|
|
117
|
+
export declare const arrayToMap: <T extends {
|
|
163
118
|
id: string;
|
|
164
|
-
}>(items: Map<string, T>
|
|
119
|
+
} | string>(items: readonly T[] | Map<string, T>) => Map<string, T>;
|
|
165
120
|
export declare const arrayToMapWithIndex: <T extends {
|
|
166
121
|
id: string;
|
|
167
122
|
}>(elements: readonly T[]) => Map<string, [element: T, index: number]>;
|
|
168
123
|
/**
|
|
169
124
|
* Transform array into an object, use only when array order is irrelevant.
|
|
170
125
|
*/
|
|
171
|
-
export declare const arrayToObject: <T>(array: readonly T[], groupBy?: (
|
|
126
|
+
export declare const arrayToObject: <T>(array: readonly T[], groupBy?: (value: T) => string | number) => {
|
|
172
127
|
[key: string]: T;
|
|
173
128
|
};
|
|
174
129
|
/** Doubly linked node */
|
|
@@ -184,11 +139,11 @@ export declare const arrayToList: <T>(array: readonly T[]) => Node<T>[];
|
|
|
184
139
|
* Converts a readonly array or map into an iterable.
|
|
185
140
|
* Useful for avoiding entry allocations when iterating object / map on each iteration.
|
|
186
141
|
*/
|
|
187
|
-
export declare const toIterable: <T>(values: ReadonlyMap<string, T>
|
|
142
|
+
export declare const toIterable: <T>(values: readonly T[] | ReadonlyMap<string, T>) => Iterable<T>;
|
|
188
143
|
/**
|
|
189
144
|
* Converts a readonly array or map into an array.
|
|
190
145
|
*/
|
|
191
|
-
export declare const toArray: <T>(values: ReadonlyMap<string, T>
|
|
146
|
+
export declare const toArray: <T>(values: readonly T[] | ReadonlyMap<string, T>) => T[];
|
|
192
147
|
export declare const isTestEnv: () => boolean;
|
|
193
148
|
export declare const isDevEnv: () => boolean;
|
|
194
149
|
export declare const isProdEnv: () => boolean;
|
|
@@ -200,18 +155,18 @@ export declare const updateObject: <T extends Record<string, any>>(obj: T, updat
|
|
|
200
155
|
export declare const isPrimitive: (val: any) => boolean;
|
|
201
156
|
export declare const getFrame: () => "top" | "iframe";
|
|
202
157
|
export declare const isRunningInIframe: () => boolean;
|
|
203
|
-
export declare const isPromiseLike: (value: any) => value is Promise<
|
|
158
|
+
export declare const isPromiseLike: (value: any) => value is Promise<ResolutionType<typeof value>>;
|
|
204
159
|
export declare const queryFocusableElements: (container: HTMLElement | null) => HTMLElement[];
|
|
205
160
|
/**
|
|
206
161
|
* Returns whether object/array is shallow equal.
|
|
207
162
|
* Considers empty object/arrays as equal (whether top-level or second-level).
|
|
208
163
|
*/
|
|
209
|
-
export declare const isShallowEqual: <T extends Record<string, any>, K extends readonly unknown[]>(objA: T, objB: T, comparators?: { [key in keyof T]?: (
|
|
164
|
+
export declare const isShallowEqual: <T extends Record<string, any>, K extends readonly unknown[]>(objA: T, objB: T, comparators?: { [key in keyof T]?: (a: T[key], b: T[key]) => boolean; } | (keyof T extends K[number] ? K extends readonly (keyof T)[] ? K : {
|
|
210
165
|
_error: "keys are either missing or include keys not in compared obj";
|
|
211
166
|
} : {
|
|
212
167
|
_error: "keys are either missing or include keys not in compared obj";
|
|
213
|
-
})
|
|
214
|
-
export declare const composeEventHandlers: <E>(originalEventHandler?: (
|
|
168
|
+
}), debug?: boolean) => boolean;
|
|
169
|
+
export declare const composeEventHandlers: <E>(originalEventHandler?: (event: E) => void, ourEventHandler?: (event: E) => void, { checkForDefaultPrevented }?: {
|
|
215
170
|
checkForDefaultPrevented?: boolean | undefined;
|
|
216
171
|
}) => (event: E) => void;
|
|
217
172
|
/**
|
|
@@ -223,11 +178,15 @@ export declare function invariant(condition: any, message: string): asserts cond
|
|
|
223
178
|
/**
|
|
224
179
|
* Memoizes on values of `opts` object (strict equality).
|
|
225
180
|
*/
|
|
226
|
-
export declare const memoize: <T extends Record<string, any>, R extends
|
|
181
|
+
export declare const memoize: <T extends Record<string, any>, R extends any>(func: (opts: T) => R) => typeof func & {
|
|
227
182
|
clear: () => void;
|
|
228
183
|
};
|
|
229
184
|
/** Checks if value is inside given collection. Useful for type-safety. */
|
|
230
|
-
export declare const isMemberOf: <T extends string>(
|
|
185
|
+
export declare const isMemberOf: <T extends string>(
|
|
186
|
+
/** Set/Map/Array/Object */
|
|
187
|
+
collection: Set<T> | readonly T[] | Record<T, any> | Map<T, any>,
|
|
188
|
+
/** value to look for */
|
|
189
|
+
value: string) => value is T;
|
|
231
190
|
export declare const cloneJSON: <T>(obj: T) => T;
|
|
232
191
|
export declare const updateStable: <T extends any[] | Record<string, any>>(prevValue: T, nextValue: T) => T;
|
|
233
192
|
export declare function addEventListener<K extends keyof WindowEventMap>(target: Window & typeof globalThis, type: K, listener: (this: Window, ev: WindowEventMap[K]) => any, options?: boolean | AddEventListenerOptions): UnsubscribeCallback;
|
|
@@ -238,21 +197,25 @@ export declare function addEventListener<K extends keyof FontFaceSetEventMap>(ta
|
|
|
238
197
|
export declare function addEventListener<K extends keyof HTMLElementEventMap>(target: Document | (Window & typeof globalThis) | HTMLElement | undefined | null | false, type: K, listener: (this: HTMLDivElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): UnsubscribeCallback;
|
|
239
198
|
export declare function getSvgPathFromStroke(points: number[][], closed?: boolean): string;
|
|
240
199
|
export declare const normalizeEOL: (str: string) => string;
|
|
241
|
-
type HasBrand<T> = {
|
|
242
|
-
[K in keyof T]: K extends `~brand${infer _}` ? true : never;
|
|
200
|
+
export type HasBrand<T> = {
|
|
201
|
+
[K in keyof T]: K extends `~brand${infer _}` | "_brand" ? true : never;
|
|
243
202
|
}[keyof T];
|
|
244
203
|
type RemoveAllBrands<T> = HasBrand<T> extends true ? {
|
|
245
|
-
[K in keyof T as K extends `~brand~${infer _}` ? never : K]: T[K];
|
|
246
|
-
} :
|
|
247
|
-
type
|
|
204
|
+
[K in keyof T as K extends `~brand~${infer _}` | "_brand" ? never : K]: T[K];
|
|
205
|
+
} : T;
|
|
206
|
+
type UnbrandForValue<T> = T extends Map<infer E, infer F> ? Map<UnbrandForValue<E>, UnbrandForValue<F>> : T extends Set<infer E> ? Set<UnbrandForValue<E>> : T extends readonly any[] ? T extends any[] ? unknown[] : readonly unknown[] : RemoveAllBrands<T>;
|
|
207
|
+
export type Unbrand<T> = T extends Map<infer E, infer F> ? Map<Unbrand<E>, Unbrand<F>> : T extends Set<infer E> ? Set<Unbrand<E>> : T extends readonly (infer E)[] ? Array<Unbrand<E>> : RemoveAllBrands<T>;
|
|
208
|
+
export type CombineBrands<BrandedType, CurrentType> = BrandedType extends readonly (infer BE)[] ? CurrentType extends readonly (infer CE)[] ? Array<CE & BE> : CurrentType & BrandedType : CurrentType & BrandedType;
|
|
209
|
+
export type CombineBrandsIfNeeded<T, Required> = [T] extends [Required] ? T[] : HasBrand<T> extends true ? CombineBrands<T, Required>[] : Required[];
|
|
248
210
|
/**
|
|
249
211
|
* Makes type into a branded type, ensuring that value is assignable to
|
|
250
|
-
* the base
|
|
212
|
+
* the base unbranded type. Optionally you can explicitly supply current value
|
|
251
213
|
* type to combine both (useful for composite branded types. Make sure you
|
|
252
214
|
* compose branded types which are not composite themselves.)
|
|
253
215
|
*/
|
|
254
|
-
export declare
|
|
255
|
-
export declare
|
|
216
|
+
export declare function toBrandedType<BrandedType>(value: UnbrandForValue<BrandedType>): BrandedType;
|
|
217
|
+
export declare function toBrandedType<BrandedType, CurrentType>(value: CurrentType): CombineBrands<BrandedType, CurrentType>;
|
|
218
|
+
export declare const promiseTry: <TValue, TArgs extends unknown[]>(fn: (...args: TArgs) => PromiseLike<TValue> | TValue, ...args: TArgs) => Promise<TValue>;
|
|
256
219
|
export declare const isAnyTrue: (...args: boolean[]) => boolean;
|
|
257
220
|
export declare const safelyParseJSON: (json: string) => Record<string, any> | null;
|
|
258
221
|
/**
|
|
@@ -264,6 +227,11 @@ export declare const castArray: <T>(value: T | T[]) => T[];
|
|
|
264
227
|
/** hack for Array.isArray type guard not working with readonly value[] */
|
|
265
228
|
export declare const isReadonlyArray: (value?: any) => value is readonly any[];
|
|
266
229
|
export declare const sizeOf: (value: readonly unknown[] | Readonly<Map<string, unknown>> | Readonly<Record<string, unknown>> | ReadonlySet<unknown>) => number;
|
|
267
|
-
export declare const reduceToCommonValue: <T, R = T>(collection:
|
|
268
|
-
|
|
230
|
+
export declare const reduceToCommonValue: <T, R = T>(collection: readonly T[] | ReadonlySet<T>, getValue?: (item: T) => R) => R | null;
|
|
231
|
+
type FEATURE_FLAGS = {
|
|
232
|
+
COMPLEX_BINDINGS: boolean;
|
|
233
|
+
};
|
|
234
|
+
export declare const getFeatureFlag: <F extends keyof FEATURE_FLAGS>(flag: F) => FEATURE_FLAGS[F];
|
|
235
|
+
export declare const setFeatureFlag: <F extends keyof FEATURE_FLAGS>(flag: F, value: FEATURE_FLAGS[F]) => void;
|
|
236
|
+
export declare const oneOf: <N extends string | number | symbol | null, H extends N>(needle: N, haystack: readonly H[]) => needle is H;
|
|
269
237
|
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type VersionedSnapshot<T> = Readonly<{
|
|
2
|
+
version: number;
|
|
3
|
+
value: T;
|
|
4
|
+
}>;
|
|
5
|
+
export declare class VersionedSnapshotStore<T> {
|
|
6
|
+
private readonly isEqual;
|
|
7
|
+
private version;
|
|
8
|
+
private value;
|
|
9
|
+
private readonly waiters;
|
|
10
|
+
private readonly subscribers;
|
|
11
|
+
constructor(initialValue: T, isEqual?: (prev: T, next: T) => boolean);
|
|
12
|
+
getSnapshot(): VersionedSnapshot<T>;
|
|
13
|
+
set(nextValue: T): boolean;
|
|
14
|
+
update(updater: (prev: T) => T): boolean;
|
|
15
|
+
subscribe(subscriber: (snapshot: VersionedSnapshot<T>) => void): () => void;
|
|
16
|
+
pull(sinceVersion?: number): Promise<VersionedSnapshot<T>>;
|
|
17
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ElementUpdate } from "@excalidraw/element";
|
|
2
|
-
import type { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawFrameLikeElement, ElementsMapOrArray, OrderedExcalidrawElement, Ordered } from "@excalidraw/element/types";
|
|
2
|
+
import type { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawFrameLikeElement, ElementsMapOrArray, SceneElementsMap, NonDeletedSceneElementsMap, OrderedExcalidrawElement, Ordered } from "@excalidraw/element/types";
|
|
3
3
|
import type { Mutable } from "@excalidraw/common/utility-types";
|
|
4
4
|
import type { AppState } from "../../excalidraw/types";
|
|
5
5
|
type SceneStateCallback = () => void;
|
|
@@ -22,9 +22,9 @@ export declare class Scene {
|
|
|
22
22
|
*/
|
|
23
23
|
private sceneNonce;
|
|
24
24
|
getSceneNonce(): number | undefined;
|
|
25
|
-
getNonDeletedElementsMap():
|
|
25
|
+
getNonDeletedElementsMap(): NonDeletedSceneElementsMap;
|
|
26
26
|
getElementsIncludingDeleted(): readonly OrderedExcalidrawElement[];
|
|
27
|
-
getElementsMapIncludingDeleted():
|
|
27
|
+
getElementsMapIncludingDeleted(): SceneElementsMap;
|
|
28
28
|
getNonDeletedElements(): readonly Ordered<NonDeletedExcalidrawElement>[];
|
|
29
29
|
getFramesIncludingDeleted(): readonly ExcalidrawFrameLikeElement[];
|
|
30
30
|
constructor(elements?: ElementsMapOrArray | null, options?: {
|
|
@@ -40,7 +40,7 @@ export declare class Scene {
|
|
|
40
40
|
elements?: ElementsMapOrArray;
|
|
41
41
|
includeBoundTextElement?: boolean;
|
|
42
42
|
includeElementsInFrames?: boolean;
|
|
43
|
-
}):
|
|
43
|
+
}): NonDeletedExcalidrawElement[];
|
|
44
44
|
getNonDeletedFramesLikes(): readonly NonDeleted<ExcalidrawFrameLikeElement>[];
|
|
45
45
|
getElement<T extends ExcalidrawElement>(id: T["id"]): T | null;
|
|
46
46
|
getNonDeletedElement(id: ExcalidrawElement["id"]): NonDeleted<ExcalidrawElement> | null;
|
|
@@ -63,18 +63,22 @@ export declare class Scene {
|
|
|
63
63
|
triggerUpdate(): void;
|
|
64
64
|
onUpdate(cb: SceneStateCallback): SceneStateCallbackRemover;
|
|
65
65
|
destroy(): void;
|
|
66
|
-
|
|
67
|
-
insertElementsAtIndex(elements: ExcalidrawElement[],
|
|
66
|
+
/** low-level - generally use app.insertNewElements() */
|
|
67
|
+
insertElementsAtIndex(elements: ExcalidrawElement[],
|
|
68
|
+
/** null indicates end of the array */
|
|
69
|
+
index: number | null): void;
|
|
70
|
+
/** low-level - generally use app.insertNewElement() */
|
|
68
71
|
insertElement: (element: ExcalidrawElement) => void;
|
|
69
|
-
insertElements: (elements: ExcalidrawElement[]) => void;
|
|
70
72
|
getElementIndex(elementId: string): number;
|
|
71
73
|
getContainerElement: (element: (ExcalidrawElement & {
|
|
72
74
|
containerId: ExcalidrawElement["id"] | null;
|
|
73
|
-
}) | null) => import("@excalidraw/element/types").ExcalidrawLinearElement | import("@excalidraw/element/types").ExcalidrawSelectionElement | import("@excalidraw/element/types").ExcalidrawRectangleElement | import("@excalidraw/element/types").ExcalidrawDiamondElement | import("@excalidraw/element/types").ExcalidrawEllipseElement | import("@excalidraw/element/types").ExcalidrawEmbeddableElement | import("@excalidraw/element/types").ExcalidrawIframeElement | import("@excalidraw/element/types").ExcalidrawImageElement | import("@excalidraw/element/types").ExcalidrawFrameElement | import("@excalidraw/element/types").ExcalidrawMagicFrameElement | import("@excalidraw/element/types").ExcalidrawTextElement | import("@excalidraw/element/types").ExcalidrawFreeDrawElement | null;
|
|
75
|
+
}) | null) => import("@excalidraw/element/types").ExcalidrawLinearElement | import("@excalidraw/element/types").ExcalidrawSelectionElement | import("@excalidraw/element/types").ExcalidrawRectangleElement | import("@excalidraw/element/types").ExcalidrawStickyNoteElement | import("@excalidraw/element/types").ExcalidrawDiamondElement | import("@excalidraw/element/types").ExcalidrawEllipseElement | import("@excalidraw/element/types").ExcalidrawEmbeddableElement | import("@excalidraw/element/types").ExcalidrawIframeElement | import("@excalidraw/element/types").ExcalidrawImageElement | import("@excalidraw/element/types").ExcalidrawFrameElement | import("@excalidraw/element/types").ExcalidrawMagicFrameElement | import("@excalidraw/element/types").ExcalidrawTextElement | import("@excalidraw/element/types").ExcalidrawFreeDrawElement | null;
|
|
74
76
|
getElementsFromId: (id: string) => ExcalidrawElement[];
|
|
75
77
|
mutateElement<TElement extends Mutable<ExcalidrawElement>>(element: TElement, updates: ElementUpdate<TElement>, options?: {
|
|
76
78
|
informMutation: boolean;
|
|
77
79
|
isDragging: boolean;
|
|
80
|
+
isBindingEnabled?: boolean;
|
|
81
|
+
isMidpointSnappingEnabled?: boolean;
|
|
78
82
|
}): TElement;
|
|
79
83
|
}
|
|
80
84
|
export {};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
2
2
|
import type { Scene } from "./Scene";
|
|
3
|
-
import type {
|
|
3
|
+
import type { NonDeletedExcalidrawElement } from "./types";
|
|
4
4
|
export interface Alignment {
|
|
5
5
|
position: "start" | "center" | "end";
|
|
6
6
|
axis: "x" | "y";
|
|
7
7
|
}
|
|
8
|
-
export declare const alignElements: (selectedElements:
|
|
8
|
+
export declare const alignElements: (selectedElements: NonDeletedExcalidrawElement[], alignment: Alignment, scene: Scene, appState: Readonly<AppState>) => NonDeletedExcalidrawElement[];
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { GlobalPoint } from "@excalidraw/math";
|
|
2
|
+
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
3
|
+
import type { ElementsMap, ExcalidrawArrowElement, ExcalidrawTextElement, FixedPoint, NonDeleted, NonDeletedExcalidrawElement, TextAlign, VerticalAlign } from "./types";
|
|
4
|
+
export type ArrowEndpoint = {
|
|
5
|
+
arrow: NonDeleted<ExcalidrawArrowElement>;
|
|
6
|
+
startOrEnd: "start" | "end";
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Finds a free (unbound) arrow endpoint under the cursor, front-most first.
|
|
10
|
+
* Used by the text tool to offer creating a text label anchored to the tip of
|
|
11
|
+
* an arrow.
|
|
12
|
+
*/
|
|
13
|
+
export declare const getUnboundArrowEndpointAtPoint: (scenePointer: GlobalPoint, elements: readonly NonDeletedExcalidrawElement[], elementsMap: ElementsMap, zoom: AppState["zoom"]) => ArrowEndpoint | null;
|
|
14
|
+
/**
|
|
15
|
+
* Describes how a text element should be created so that it reads as a label
|
|
16
|
+
* for the given arrow endpoint.
|
|
17
|
+
*
|
|
18
|
+
* The arrow is treated as fixed: rather than routing the arrow to the text, we
|
|
19
|
+
* pick the side of the text the arrow should attach to (the one it already
|
|
20
|
+
* points at), and place the text so that side's midpoint lands on the existing
|
|
21
|
+
* endpoint. The alignment returned pins that same midpoint while the text is
|
|
22
|
+
* typed, so the arrow doesn't swing around during editing.
|
|
23
|
+
*/
|
|
24
|
+
export declare const getTextBindingForArrowEndpoint: (arrow: NonDeleted<ExcalidrawArrowElement>, startOrEnd: "start" | "end", elementsMap: ElementsMap,
|
|
25
|
+
/**
|
|
26
|
+
* stroke width the text will be created with — the binding gap is derived
|
|
27
|
+
* from the *bind target*, so using the arrow's would offset the anchor by
|
|
28
|
+
* half the difference between the two
|
|
29
|
+
*/
|
|
30
|
+
targetStrokeWidth: number) => {
|
|
31
|
+
/** the text-local ratio the arrow binds to (a side midpoint) */
|
|
32
|
+
fixedPoint: FixedPoint;
|
|
33
|
+
textAlign: TextAlign;
|
|
34
|
+
verticalAlign: VerticalAlign;
|
|
35
|
+
/** scene position the text's bound side midpoint should sit at */
|
|
36
|
+
anchor: GlobalPoint;
|
|
37
|
+
} | null;
|
|
38
|
+
/**
|
|
39
|
+
* Whether an arrow endpoint is bound to this text — i.e. the text serves as an
|
|
40
|
+
* arrow-endpoint label. Checked on the arrows' own bindings: the text's
|
|
41
|
+
* `boundElements` only says an arrow relates to it, while the binding on the
|
|
42
|
+
* arrow is the authoritative side of the relationship.
|
|
43
|
+
*/
|
|
44
|
+
export declare const isEndpointBoundText: (text: ExcalidrawTextElement, elementsMap: ElementsMap) => boolean;
|
|
45
|
+
/** the anchor a text bound to an arrow endpoint grows away from */
|
|
46
|
+
export declare const getEndpointBoundTextDragAnchor: (newElement: ExcalidrawTextElement) => {
|
|
47
|
+
anchorRatio: number;
|
|
48
|
+
anchorX: number;
|
|
49
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { Arrowhead, AnyArrowhead } from "./types";
|
|
2
|
+
export declare const normalizeArrowhead: (arrowhead: AnyArrowhead | null | undefined) => Arrowhead | null;
|
|
3
|
+
export declare const getArrowheadForPicker: (arrowhead: AnyArrowhead | null | undefined) => Arrowhead | null;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type GlobalPoint } from "@excalidraw/math";
|
|
2
|
+
import type { AppState, NullableGridSize } from "@excalidraw/excalidraw/types";
|
|
3
|
+
import { LinearElementEditor } from "../linearElementEditor";
|
|
4
|
+
import type { ElementsMap, ExcalidrawArrowElement, ExcalidrawBindableElement, FixedPointBinding, NonDeletedSceneElementsMap } from "../types";
|
|
5
|
+
import type { Scene } from "../Scene";
|
|
6
|
+
export declare const isFocusPointVisible: (focusPoint: GlobalPoint, arrow: ExcalidrawArrowElement, bindableElement: ExcalidrawBindableElement, elementsMap: ElementsMap, appState: {
|
|
7
|
+
isBindingEnabled: AppState["isBindingEnabled"];
|
|
8
|
+
zoom: AppState["zoom"];
|
|
9
|
+
}, startOrEnd: "start" | "end", ignoreOverlap?: boolean) => boolean;
|
|
10
|
+
export declare const handleFocusPointDrag: (linearElementEditor: LinearElementEditor, elementsMap: NonDeletedSceneElementsMap, pointerCoords: {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
}, scene: Scene, appState: AppState, gridSize: NullableGridSize, switchToInsideBinding: boolean) => void;
|
|
14
|
+
export declare const handleFocusPointPointerDown: (arrow: ExcalidrawArrowElement, pointerDownState: {
|
|
15
|
+
origin: {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
};
|
|
19
|
+
}, elementsMap: NonDeletedSceneElementsMap, appState: AppState) => {
|
|
20
|
+
hitFocusPoint: "start" | "end" | null;
|
|
21
|
+
pointerOffset: {
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
};
|
|
25
|
+
arrowOtherEndpointInitialBinding: FixedPointBinding | null;
|
|
26
|
+
};
|
|
27
|
+
export declare const handleFocusPointPointerUp: (linearElementEditor: LinearElementEditor, scene: Scene) => {
|
|
28
|
+
arrowOtherEndpointInitialBinding: null;
|
|
29
|
+
};
|
|
30
|
+
export declare const handleFocusPointHover: (arrow: ExcalidrawArrowElement, scenePointerX: number, scenePointerY: number, scene: Scene, appState: AppState) => "start" | "end" | null;
|
|
@@ -1,68 +1,87 @@
|
|
|
1
1
|
import { type GlobalPoint } from "@excalidraw/math";
|
|
2
|
-
import type { LocalPoint } from "@excalidraw/math";
|
|
3
|
-
import type { AppState } from "@excalidraw/excalidraw/types";
|
|
2
|
+
import type { LineSegment, LocalPoint } from "@excalidraw/math";
|
|
3
|
+
import type { AppState, NullableGridSize } from "@excalidraw/excalidraw/types";
|
|
4
|
+
import type { Bounds } from "@excalidraw/common";
|
|
4
5
|
import { type Heading } from "./heading";
|
|
5
6
|
import type { Scene } from "./Scene";
|
|
6
|
-
import type { Bounds } from "./bounds";
|
|
7
7
|
import type { ElementUpdate } from "./mutateElement";
|
|
8
|
-
import type { ExcalidrawBindableElement, ExcalidrawElement,
|
|
9
|
-
export type
|
|
10
|
-
|
|
11
|
-
NonDeleted<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export declare const
|
|
31
|
-
export declare const
|
|
32
|
-
export declare const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
8
|
+
import type { BindMode, ElementsMap, ExcalidrawArrowElement, ExcalidrawBindableElement, ExcalidrawElbowArrowElement, ExcalidrawElement, FixedPoint, FixedPointBinding, NonDeleted, NonDeletedExcalidrawElement, NonDeletedSceneElementsMap, Ordered, PointsPositionUpdates } from "./types";
|
|
9
|
+
export type BindingStrategy = {
|
|
10
|
+
mode: BindMode;
|
|
11
|
+
element: NonDeleted<ExcalidrawBindableElement>;
|
|
12
|
+
focusPoint: GlobalPoint;
|
|
13
|
+
} | {
|
|
14
|
+
mode: null;
|
|
15
|
+
element?: undefined;
|
|
16
|
+
focusPoint?: undefined;
|
|
17
|
+
} | {
|
|
18
|
+
mode: undefined;
|
|
19
|
+
element?: undefined;
|
|
20
|
+
focusPoint?: undefined;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* gaps exclude element strokeWidth
|
|
24
|
+
*
|
|
25
|
+
* IMPORTANT: currently must be > 0 (this also applies to the computed gap)
|
|
26
|
+
*/
|
|
27
|
+
export declare const BASE_BINDING_GAP = 5;
|
|
28
|
+
export declare const BASE_BINDING_GAP_ELBOW = 5;
|
|
29
|
+
export declare const BASE_ARROW_MIN_LENGTH = 10;
|
|
30
|
+
export declare const FOCUS_POINT_SIZE: number;
|
|
31
|
+
export declare const getBindingGap: (bindTarget: Pick<ExcalidrawBindableElement, "strokeWidth">, opts: Pick<ExcalidrawArrowElement, "elbowed">) => number;
|
|
32
|
+
export declare const maxBindingDistance_simple: (zoom?: AppState["zoom"]) => number;
|
|
33
|
+
export declare const isBindingEnabled: (appState: {
|
|
34
|
+
isBindingEnabled: AppState["isBindingEnabled"];
|
|
35
|
+
}) => boolean;
|
|
36
|
+
export declare const bindOrUnbindBindingElement: (arrow: NonDeleted<ExcalidrawArrowElement>, draggingPoints: PointsPositionUpdates, scenePointerX: number, scenePointerY: number, scene: Scene, appState: AppState, opts?: {
|
|
37
|
+
newArrow?: boolean;
|
|
38
|
+
altKey?: boolean;
|
|
39
|
+
angleLocked?: boolean;
|
|
40
|
+
initialBinding?: boolean;
|
|
41
|
+
gridSize?: NullableGridSize;
|
|
42
|
+
}) => {
|
|
43
|
+
start: BindingStrategy;
|
|
44
|
+
end: BindingStrategy;
|
|
45
|
+
};
|
|
46
|
+
export declare const getBindingStrategyForDraggingBindingElementEndpoints: (arrow: NonDeleted<ExcalidrawArrowElement>, draggingPoints: PointsPositionUpdates, screenPointerX: number, screenPointerY: number, elementsMap: NonDeletedSceneElementsMap, elements: readonly Ordered<NonDeletedExcalidrawElement>[], appState: AppState, opts?: {
|
|
47
|
+
newArrow?: boolean;
|
|
48
|
+
angleLocked?: boolean;
|
|
49
|
+
altKey?: boolean;
|
|
50
|
+
finalize?: boolean;
|
|
51
|
+
initialBinding?: boolean;
|
|
52
|
+
zoom?: AppState["zoom"];
|
|
53
|
+
gridSize?: NullableGridSize;
|
|
54
|
+
}) => {
|
|
55
|
+
start: BindingStrategy;
|
|
56
|
+
end: BindingStrategy;
|
|
57
|
+
};
|
|
58
|
+
export declare const bindOrUnbindBindingElements: (selectedArrows: NonDeleted<ExcalidrawArrowElement>[], scene: Scene, appState: AppState) => void;
|
|
59
|
+
export declare const bindBindingElement: (arrow: NonDeleted<ExcalidrawArrowElement>, hoveredElement: NonDeleted<ExcalidrawBindableElement>, mode: BindMode, startOrEnd: "start" | "end", scene: Scene, focusPoint?: GlobalPoint, shouldSnapToOutline?: boolean, isMidpointSnappingEnabled?: boolean) => void;
|
|
60
|
+
export declare const unbindBindingElement: (arrow: ExcalidrawArrowElement, startOrEnd: "start" | "end", scene: Scene) => ExcalidrawBindableElement["id"] | null;
|
|
36
61
|
export declare const updateBoundElements: (changedElement: NonDeletedExcalidrawElement, scene: Scene, options?: {
|
|
37
|
-
simultaneouslyUpdated?: readonly
|
|
38
|
-
newSize?: {
|
|
39
|
-
width: number;
|
|
40
|
-
height: number;
|
|
41
|
-
};
|
|
62
|
+
simultaneouslyUpdated?: readonly NonDeletedExcalidrawElement[];
|
|
42
63
|
changedElements?: Map<string, ExcalidrawElement>;
|
|
43
64
|
}) => void;
|
|
44
|
-
export declare const updateBindings: (latestElement:
|
|
45
|
-
simultaneouslyUpdated?: readonly
|
|
65
|
+
export declare const updateBindings: (latestElement: NonDeletedExcalidrawElement, scene: Scene, appState: AppState, options?: {
|
|
66
|
+
simultaneouslyUpdated?: readonly NonDeletedExcalidrawElement[];
|
|
46
67
|
newSize?: {
|
|
47
68
|
width: number;
|
|
48
69
|
height: number;
|
|
49
70
|
};
|
|
50
|
-
zoom?: AppState["zoom"];
|
|
51
71
|
}) => void;
|
|
52
72
|
export declare const getHeadingForElbowArrowSnap: (p: Readonly<GlobalPoint>, otherPoint: Readonly<GlobalPoint>, bindableElement: ExcalidrawBindableElement | undefined | null, aabb: Bounds | undefined | null, origPoint: GlobalPoint, elementsMap: ElementsMap, zoom?: AppState["zoom"]) => Heading;
|
|
53
|
-
export declare const bindPointToSnapToElementOutline: (
|
|
54
|
-
export declare const avoidRectangularCorner: (
|
|
55
|
-
export declare const snapToMid: (
|
|
56
|
-
export declare const
|
|
73
|
+
export declare const bindPointToSnapToElementOutline: (arrowElement: ExcalidrawArrowElement, bindableElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap, customIntersector?: LineSegment<GlobalPoint>, isMidpointSnappingEnabled?: boolean) => GlobalPoint;
|
|
74
|
+
export declare const avoidRectangularCorner: (arrowElement: ExcalidrawArrowElement, bindTarget: ExcalidrawBindableElement, elementsMap: ElementsMap, p: GlobalPoint) => GlobalPoint;
|
|
75
|
+
export declare const snapToMid: (bindTarget: ExcalidrawBindableElement, elementsMap: ElementsMap, p: GlobalPoint, tolerance?: number, arrowElement?: ExcalidrawArrowElement) => GlobalPoint | undefined;
|
|
76
|
+
export declare const updateBoundPoint: (arrow: NonDeleted<ExcalidrawArrowElement>, startOrEnd: "startBinding" | "endBinding", binding: FixedPointBinding | null | undefined, bindableElement: ExcalidrawBindableElement, elementsMap: ElementsMap, dragging?: boolean) => LocalPoint | null;
|
|
77
|
+
export declare const calculateFixedPointForElbowArrowBinding: (linearElement: NonDeleted<ExcalidrawElbowArrowElement>, hoveredElement: ExcalidrawBindableElement, startOrEnd: "start" | "end", elementsMap: ElementsMap, shouldSnapToOutline?: boolean, isMidpointSnappingEnabled?: boolean) => {
|
|
78
|
+
fixedPoint: FixedPoint;
|
|
79
|
+
};
|
|
80
|
+
export declare const calculateFixedPointForNonElbowArrowBinding: (linearElement: NonDeleted<ExcalidrawArrowElement>, hoveredElement: NonDeleted<ExcalidrawBindableElement>, startOrEnd: "start" | "end", elementsMap: ElementsMap, focusPoint?: GlobalPoint) => {
|
|
57
81
|
fixedPoint: FixedPoint;
|
|
58
82
|
};
|
|
59
83
|
export declare const fixDuplicatedBindingsAfterDuplication: (duplicatedElements: ExcalidrawElement[], origIdToDuplicateId: Map<ExcalidrawElement["id"], ExcalidrawElement["id"]>, duplicateElementsMap: NonDeletedSceneElementsMap) => void;
|
|
60
84
|
export declare const fixBindingsAfterDeletion: (sceneElements: readonly ExcalidrawElement[], deletedElements: readonly ExcalidrawElement[]) => void;
|
|
61
|
-
export declare const bindingBorderTest: (element: NonDeleted<ExcalidrawBindableElement>, { x, y }: {
|
|
62
|
-
x: number;
|
|
63
|
-
y: number;
|
|
64
|
-
}, elementsMap: NonDeletedSceneElementsMap, zoom?: AppState["zoom"], fullShape?: boolean) => boolean;
|
|
65
|
-
export declare const maxBindingGap: (element: ExcalidrawElement, elementWidth: number, elementHeight: number, zoom?: AppState["zoom"]) => number;
|
|
66
85
|
export declare const bindingProperties: Set<BindableProp | BindingProp>;
|
|
67
86
|
export type BindableProp = "boundElements";
|
|
68
87
|
export type BindingProp = "frameId" | "containerId" | "startBinding" | "endBinding";
|
|
@@ -104,7 +123,16 @@ export declare class BindableElement {
|
|
|
104
123
|
*/
|
|
105
124
|
static rebindAffected: (elements: ElementsMap, bindableElement: ExcalidrawElement | undefined, updateElementWith: (affected: ExcalidrawElement, updates: ElementUpdate<ExcalidrawElement>) => void) => void;
|
|
106
125
|
}
|
|
107
|
-
export declare const getGlobalFixedPointForBindableElement: (fixedPointRatio:
|
|
108
|
-
export declare const getGlobalFixedPoints: (arrow:
|
|
126
|
+
export declare const getGlobalFixedPointForBindableElement: (fixedPointRatio: FixedPoint, element: ExcalidrawBindableElement, elementsMap: ElementsMap) => GlobalPoint;
|
|
127
|
+
export declare const getGlobalFixedPoints: (arrow: ExcalidrawArrowElement, elementsMap: ElementsMap) => [GlobalPoint, GlobalPoint];
|
|
109
128
|
export declare const getArrowLocalFixedPoints: (arrow: ExcalidrawElbowArrowElement, elementsMap: ElementsMap) => LocalPoint[];
|
|
110
|
-
export declare const
|
|
129
|
+
export declare const isFixedPoint: (fixedPoint: any) => fixedPoint is FixedPointBinding["fixedPoint"];
|
|
130
|
+
export declare const normalizeFixedPoint: <T extends FixedPoint>(fixedPoint: T) => FixedPoint;
|
|
131
|
+
export declare const getBindingSideMidPoint: (binding: FixedPointBinding, elementsMap: ElementsMap) => GlobalPoint | LocalPoint | null;
|
|
132
|
+
/**
|
|
133
|
+
* Binds an arrow endpoint to an explicit fixed point on a bindable element,
|
|
134
|
+
* bypassing the "derive the ratio from where the endpoint currently is"
|
|
135
|
+
* strategy used when dragging. Needed when the binding target is placed to fit
|
|
136
|
+
* the arrow rather than the other way round.
|
|
137
|
+
*/
|
|
138
|
+
export declare const bindBindingElementToFixedPoint: (arrow: NonDeleted<ExcalidrawArrowElement>, bindableElement: NonDeleted<ExcalidrawBindableElement>, startOrEnd: "start" | "end", fixedPoint: FixedPoint, scene: Scene) => void;
|