@zsviczian/excalidraw 0.17.6-3 → 0.17.6-30
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/excalidraw.development.js +13100 -1540
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +21 -1
- package/dist/styles.development.css +490 -376
- package/dist/styles.production.css +10 -8
- package/package.json +5 -4
- package/types/excalidraw/actions/actionAddToLibrary.d.ts +0 -605
- package/types/excalidraw/actions/actionAlign.d.ts +0 -108
- package/types/excalidraw/actions/actionBoundText.d.ts +0 -440
- package/types/excalidraw/actions/actionCanvas.d.ts +0 -2958
- package/types/excalidraw/actions/actionClipboard.d.ts +0 -1322
- package/types/excalidraw/actions/actionDeleteSelected.d.ts +0 -640
- package/types/excalidraw/actions/actionDistribute.d.ts +0 -34
- package/types/excalidraw/actions/actionDuplicateSelection.d.ts +0 -21
- package/types/excalidraw/actions/actionElementLock.d.ts +0 -428
- package/types/excalidraw/actions/actionExport.d.ts +0 -1884
- package/types/excalidraw/actions/actionFinalize.d.ts +0 -409
- package/types/excalidraw/actions/actionFlip.d.ts +0 -34
- package/types/excalidraw/actions/actionFrame.d.ts +0 -855
- package/types/excalidraw/actions/actionGroup.d.ts +0 -438
- package/types/excalidraw/actions/actionHistory.d.ts +0 -7
- package/types/excalidraw/actions/actionLinearEditor.d.ts +0 -215
- package/types/excalidraw/actions/actionLink.d.ts +0 -215
- package/types/excalidraw/actions/actionMenu.d.ts +0 -628
- package/types/excalidraw/actions/actionNavigate.d.ts +0 -414
- package/types/excalidraw/actions/actionProperties.d.ts +0 -3156
- package/types/excalidraw/actions/actionSelectAll.d.ts +0 -214
- package/types/excalidraw/actions/actionStyles.d.ts +0 -228
- package/types/excalidraw/actions/actionTextAutoResize.d.ts +0 -17
- package/types/excalidraw/actions/actionToggleGridMode.d.ts +0 -217
- package/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +0 -215
- package/types/excalidraw/actions/actionToggleSearchMenu.d.ts +0 -407
- package/types/excalidraw/actions/actionToggleStats.d.ts +0 -215
- package/types/excalidraw/actions/actionToggleViewMode.d.ts +0 -216
- package/types/excalidraw/actions/actionToggleZenMode.d.ts +0 -216
- package/types/excalidraw/actions/actionZindex.d.ts +0 -74
- package/types/excalidraw/actions/index.d.ts +0 -26
- package/types/excalidraw/actions/manager.d.ts +0 -21
- package/types/excalidraw/actions/register.d.ts +0 -5
- package/types/excalidraw/actions/shortcuts.d.ts +0 -4
- package/types/excalidraw/actions/types.d.ts +0 -46
- package/types/excalidraw/align.d.ts +0 -6
- package/types/excalidraw/analytics.d.ts +0 -1
- package/types/excalidraw/animated-trail.d.ts +0 -33
- package/types/excalidraw/animation-frame-handler.d.ts +0 -16
- package/types/excalidraw/appState.d.ts +0 -89
- package/types/excalidraw/binaryheap.d.ts +0 -12
- package/types/excalidraw/change.d.ts +0 -191
- package/types/excalidraw/charts.d.ts +0 -27
- package/types/excalidraw/clients.d.ts +0 -14
- package/types/excalidraw/clipboard.d.ts +0 -44
- package/types/excalidraw/colors.d.ts +0 -61
- package/types/excalidraw/components/Actions.d.ts +0 -34
- package/types/excalidraw/components/ActiveConfirmDialog.d.ts +0 -4
- package/types/excalidraw/components/App.d.ts +0 -535
- package/types/excalidraw/components/Avatar.d.ts +0 -11
- package/types/excalidraw/components/BraveMeasureTextError.d.ts +0 -2
- package/types/excalidraw/components/Button.d.ts +0 -17
- package/types/excalidraw/components/ButtonIcon.d.ts +0 -14
- package/types/excalidraw/components/ButtonIconCycle.d.ts +0 -10
- package/types/excalidraw/components/ButtonIconSelect.d.ts +0 -19
- package/types/excalidraw/components/ButtonSelect.d.ts +0 -9
- package/types/excalidraw/components/ButtonSeparator.d.ts +0 -1
- package/types/excalidraw/components/Card.d.ts +0 -6
- package/types/excalidraw/components/CheckboxItem.d.ts +0 -8
- package/types/excalidraw/components/ColorPicker/ColorInput.d.ts +0 -9
- package/types/excalidraw/components/ColorPicker/ColorPicker.d.ts +0 -19
- package/types/excalidraw/components/ColorPicker/CustomColorList.d.ts +0 -8
- package/types/excalidraw/components/ColorPicker/HotkeyLabel.d.ts +0 -8
- package/types/excalidraw/components/ColorPicker/Picker.d.ts +0 -18
- package/types/excalidraw/components/ColorPicker/PickerColorList.d.ts +0 -10
- package/types/excalidraw/components/ColorPicker/PickerHeading.d.ts +0 -5
- package/types/excalidraw/components/ColorPicker/ShadeList.d.ts +0 -8
- package/types/excalidraw/components/ColorPicker/TopPicks.d.ts +0 -9
- package/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +0 -21
- package/types/excalidraw/components/ColorPicker/keyboardNavHandlers.d.ts +0 -20
- package/types/excalidraw/components/CommandPalette/CommandPalette.d.ts +0 -18
- package/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +0 -2
- package/types/excalidraw/components/CommandPalette/types.d.ts +0 -25
- package/types/excalidraw/components/ConfirmDialog.d.ts +0 -10
- package/types/excalidraw/components/ContextMenu.d.ts +0 -16
- package/types/excalidraw/components/DarkModeToggle.d.ts +0 -7
- package/types/excalidraw/components/DefaultSidebar.d.ts +0 -30
- package/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
- package/types/excalidraw/components/Dialog.d.ts +0 -13
- package/types/excalidraw/components/DialogActionButton.d.ts +0 -10
- package/types/excalidraw/components/ErrorDialog.d.ts +0 -5
- package/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -15
- package/types/excalidraw/components/EyeDropper.d.ts +0 -27
- package/types/excalidraw/components/FilledButton.d.ts +0 -18
- package/types/excalidraw/components/FixedSideContainer.d.ts +0 -9
- package/types/excalidraw/components/FollowMode/FollowMode.d.ts +0 -10
- package/types/excalidraw/components/FontPicker/FontPicker.d.ts +0 -21
- package/types/excalidraw/components/FontPicker/FontPickerList.d.ts +0 -25
- package/types/excalidraw/components/FontPicker/FontPickerTrigger.d.ts +0 -6
- package/types/excalidraw/components/FontPicker/keyboardNavHandlers.d.ts +0 -13
- package/types/excalidraw/components/HandButton.d.ts +0 -10
- package/types/excalidraw/components/HelpButton.d.ts +0 -7
- package/types/excalidraw/components/HelpDialog.d.ts +0 -4
- package/types/excalidraw/components/HintViewer.d.ts +0 -10
- package/types/excalidraw/components/IconPicker.d.ts +0 -14
- package/types/excalidraw/components/ImageExportDialog.d.ts +0 -14
- package/types/excalidraw/components/InitializeApp.d.ts +0 -10
- package/types/excalidraw/components/InlineIcon.d.ts +0 -3
- package/types/excalidraw/components/Island.d.ts +0 -10
- package/types/excalidraw/components/JSONExportDialog.d.ts +0 -15
- package/types/excalidraw/components/LaserPointerButton.d.ts +0 -10
- package/types/excalidraw/components/LayerUI.d.ts +0 -30
- package/types/excalidraw/components/LibraryMenu.d.ts +0 -24
- package/types/excalidraw/components/LibraryMenuBrowseButton.d.ts +0 -7
- package/types/excalidraw/components/LibraryMenuControlButtons.d.ts +0 -9
- package/types/excalidraw/components/LibraryMenuHeaderContent.d.ts +0 -17
- package/types/excalidraw/components/LibraryMenuItems.d.ts +0 -14
- package/types/excalidraw/components/LibraryMenuSection.d.ts +0 -23
- package/types/excalidraw/components/LibraryUnit.d.ts +0 -14
- package/types/excalidraw/components/LoadingMessage.d.ts +0 -5
- package/types/excalidraw/components/LockButton.d.ts +0 -10
- package/types/excalidraw/components/MagicButton.d.ts +0 -9
- package/types/excalidraw/components/MagicSettings.d.ts +0 -8
- package/types/excalidraw/components/MobileMenu.d.ts +0 -24
- package/types/excalidraw/components/Modal.d.ts +0 -14
- package/types/excalidraw/components/OverwriteConfirm/OverwriteConfirm.d.ts +0 -17
- package/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +0 -17
- package/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +0 -22
- package/types/excalidraw/components/Paragraph.d.ts +0 -4
- package/types/excalidraw/components/PasteChartDialog.d.ts +0 -8
- package/types/excalidraw/components/PenModeButton.d.ts +0 -12
- package/types/excalidraw/components/Popover.d.ts +0 -15
- package/types/excalidraw/components/ProjectName.d.ts +0 -10
- package/types/excalidraw/components/PropertiesPopover.d.ts +0 -15
- package/types/excalidraw/components/PublishLibrary.d.ts +0 -16
- package/types/excalidraw/components/QuickSearch.d.ts +0 -9
- package/types/excalidraw/components/RadioGroup.d.ts +0 -13
- package/types/excalidraw/components/SVGLayer.d.ts +0 -7
- package/types/excalidraw/components/ScrollableList.d.ts +0 -8
- package/types/excalidraw/components/SearchMenu.d.ts +0 -5
- package/types/excalidraw/components/Section.d.ts +0 -6
- package/types/excalidraw/components/ShareableLinkDialog.d.ts +0 -7
- package/types/excalidraw/components/Sidebar/Sidebar.d.ts +0 -76
- package/types/excalidraw/components/Sidebar/SidebarHeader.d.ts +0 -7
- package/types/excalidraw/components/Sidebar/SidebarTab.d.ts +0 -8
- package/types/excalidraw/components/Sidebar/SidebarTabTrigger.d.ts +0 -9
- package/types/excalidraw/components/Sidebar/SidebarTabTriggers.d.ts +0 -6
- package/types/excalidraw/components/Sidebar/SidebarTabs.d.ts +0 -6
- package/types/excalidraw/components/Sidebar/SidebarTrigger.d.ts +0 -6
- package/types/excalidraw/components/Sidebar/common.d.ts +0 -33
- package/types/excalidraw/components/Spinner.d.ts +0 -8
- package/types/excalidraw/components/Stack.d.ts +0 -16
- package/types/excalidraw/components/Stats/Angle.d.ts +0 -11
- package/types/excalidraw/components/Stats/CanvasGrid.d.ts +0 -10
- package/types/excalidraw/components/Stats/CanvasGridSize.d.ts +0 -10
- package/types/excalidraw/components/Stats/Collapsible.d.ts +0 -8
- package/types/excalidraw/components/Stats/Dimension.d.ts +0 -11
- package/types/excalidraw/components/Stats/DragInput.d.ts +0 -34
- package/types/excalidraw/components/Stats/FontSize.d.ts +0 -11
- package/types/excalidraw/components/Stats/MultiAngle.d.ts +0 -11
- package/types/excalidraw/components/Stats/MultiDimension.d.ts +0 -14
- package/types/excalidraw/components/Stats/MultiFontSize.d.ts +0 -12
- package/types/excalidraw/components/Stats/MultiPosition.d.ts +0 -14
- package/types/excalidraw/components/Stats/Position.d.ts +0 -12
- package/types/excalidraw/components/Stats/index.d.ts +0 -35
- package/types/excalidraw/components/Stats/utils.d.ts +0 -26
- package/types/excalidraw/components/Stats.d.ts +0 -11
- package/types/excalidraw/components/Switch.d.ts +0 -9
- package/types/excalidraw/components/TTDDialog/MermaidToExcalidraw.d.ts +0 -14
- package/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +0 -29
- package/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +0 -9
- package/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +0 -7
- package/types/excalidraw/components/TTDDialog/TTDDialogPanel.d.ts +0 -17
- package/types/excalidraw/components/TTDDialog/TTDDialogPanels.d.ts +0 -4
- package/types/excalidraw/components/TTDDialog/TTDDialogSubmitShortcut.d.ts +0 -1
- package/types/excalidraw/components/TTDDialog/TTDDialogTab.d.ts +0 -7
- package/types/excalidraw/components/TTDDialog/TTDDialogTabTrigger.d.ts +0 -8
- package/types/excalidraw/components/TTDDialog/TTDDialogTabTriggers.d.ts +0 -6
- package/types/excalidraw/components/TTDDialog/TTDDialogTabs.d.ts +0 -11
- package/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -8
- package/types/excalidraw/components/TTDDialog/common.d.ts +0 -32
- package/types/excalidraw/components/TextField.d.ts +0 -21
- package/types/excalidraw/components/Toast.d.ts +0 -9
- package/types/excalidraw/components/ToolButton.d.ts +0 -49
- package/types/excalidraw/components/Tooltip.d.ts +0 -18
- package/types/excalidraw/components/Trans.d.ts +0 -9
- package/types/excalidraw/components/UserList.d.ts +0 -18
- package/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +0 -29
- package/types/excalidraw/components/canvases/NewElementCanvas.d.ts +0 -14
- package/types/excalidraw/components/canvases/StaticCanvas.d.ts +0 -19
- package/types/excalidraw/components/canvases/index.d.ts +0 -3
- package/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +0 -86
- package/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +0 -15
- package/types/excalidraw/components/dropdownMenu/DropdownMenuGroup.d.ts +0 -11
- package/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +0 -45
- package/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +0 -7
- package/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +0 -17
- package/types/excalidraw/components/dropdownMenu/DropdownMenuItemCustom.d.ts +0 -7
- package/types/excalidraw/components/dropdownMenu/DropdownMenuItemLink.d.ts +0 -15
- package/types/excalidraw/components/dropdownMenu/DropdownMenuSeparator.d.ts +0 -5
- package/types/excalidraw/components/dropdownMenu/DropdownMenuTrigger.d.ts +0 -10
- package/types/excalidraw/components/dropdownMenu/common.d.ts +0 -6
- package/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +0 -3
- package/types/excalidraw/components/footer/Footer.d.ts +0 -12
- package/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
- package/types/excalidraw/components/hoc/withInternalFallback.d.ts +0 -4
- package/types/excalidraw/components/hyperlink/Hyperlink.d.ts +0 -18
- package/types/excalidraw/components/hyperlink/helpers.d.ts +0 -8
- package/types/excalidraw/components/icons.d.ts +0 -212
- package/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -9
- package/types/excalidraw/components/main-menu/DefaultItems.d.ts +0 -64
- package/types/excalidraw/components/main-menu/MainMenu.d.ts +0 -80
- package/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -59
- package/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
- package/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -86
- package/types/excalidraw/constants.d.ts +0 -322
- package/types/excalidraw/context/tunnels.d.ts +0 -20
- package/types/excalidraw/context/ui-appState.d.ts +0 -4
- package/types/excalidraw/cursor.d.ts +0 -6
- package/types/excalidraw/data/EditorLocalStorage.d.ts +0 -8
- package/types/excalidraw/data/ai/types.d.ts +0 -242
- package/types/excalidraw/data/blob.d.ts +0 -49
- package/types/excalidraw/data/encode.d.ts +0 -54
- package/types/excalidraw/data/encryption.d.ts +0 -9
- package/types/excalidraw/data/filesystem.d.ts +0 -20
- package/types/excalidraw/data/image.d.ts +0 -15
- package/types/excalidraw/data/index.d.ts +0 -22
- package/types/excalidraw/data/json.d.ts +0 -16
- package/types/excalidraw/data/library.d.ts +0 -106
- package/types/excalidraw/data/magic.d.ts +0 -23
- package/types/excalidraw/data/reconcile.d.ts +0 -6
- package/types/excalidraw/data/resave.d.ts +0 -5
- package/types/excalidraw/data/restore.d.ts +0 -21
- package/types/excalidraw/data/transform.d.ts +0 -81
- package/types/excalidraw/data/types.d.ts +0 -45
- package/types/excalidraw/data/url.d.ts +0 -8
- package/types/excalidraw/deburr.d.ts +0 -1
- package/types/excalidraw/dist/excalidraw.development.d.ts +0 -2
- package/types/excalidraw/dist/excalidraw.production.min.d.ts +0 -1
- package/types/excalidraw/distribute.d.ts +0 -6
- package/types/excalidraw/element/ElementCanvasButtons.d.ts +0 -7
- package/types/excalidraw/element/binding.d.ts +0 -99
- package/types/excalidraw/element/bounds.d.ts +0 -76
- package/types/excalidraw/element/collision.d.ts +0 -17
- package/types/excalidraw/element/containerCache.d.ts +0 -11
- package/types/excalidraw/element/dragElements.d.ts +0 -32
- package/types/excalidraw/element/embeddable.d.ts +0 -221
- package/types/excalidraw/element/flowchart.d.ts +0 -25
- package/types/excalidraw/element/heading.d.ts +0 -12
- package/types/excalidraw/element/image.d.ts +0 -32
- package/types/excalidraw/element/index.d.ts +0 -26
- package/types/excalidraw/element/linearElementEditor.d.ts +0 -128
- package/types/excalidraw/element/mutateElement.d.ts +0 -11
- package/types/excalidraw/element/newElement.d.ts +0 -105
- package/types/excalidraw/element/resizeElements.d.ts +0 -16
- package/types/excalidraw/element/resizeTest.d.ts +0 -15
- package/types/excalidraw/element/routing.d.ts +0 -12
- package/types/excalidraw/element/showSelectedShapeActions.d.ts +0 -3
- package/types/excalidraw/element/sizeHelpers.d.ts +0 -35
- package/types/excalidraw/element/sortElements.d.ts +0 -2
- package/types/excalidraw/element/textElement.d.ts +0 -73
- package/types/excalidraw/element/textWysiwyg.d.ts +0 -22
- package/types/excalidraw/element/transformHandles.d.ts +0 -55
- package/types/excalidraw/element/typeChecks.d.ts +0 -39
- package/types/excalidraw/element/types.d.ts +0 -253
- package/types/excalidraw/emitter.d.ts +0 -16
- package/types/excalidraw/entry.d.ts +0 -1
- package/types/excalidraw/env.d.cts +0 -1
- package/types/excalidraw/env.d.ts +0 -1
- package/types/excalidraw/errors.d.ts +0 -25
- package/types/excalidraw/fonts/ExcalidrawFont.d.ts +0 -37
- package/types/excalidraw/fonts/ExcalidrawFontFace.d.ts +0 -35
- package/types/excalidraw/fonts/index.d.ts +0 -87
- package/types/excalidraw/fonts/metadata.d.ts +0 -37
- package/types/excalidraw/fonts/subset/subset-main.d.ts +0 -12
- package/types/excalidraw/fonts/subset/subset-shared.chunk.d.ts +0 -32
- package/types/excalidraw/fonts/subset/subset-worker.chunk.d.ts +0 -15
- package/types/excalidraw/fonts/wasm/hb-subset-bindings.d.ts +0 -45
- package/types/excalidraw/fonts/wasm/hb-subset-loader.d.ts +0 -13
- package/types/excalidraw/fonts/wasm/hb-subset-wasm.d.ts +0 -2
- package/types/excalidraw/fonts/wasm/hb-subset.bindings.d.ts +0 -45
- package/types/excalidraw/fonts/wasm/hb-subset.loader.d.ts +0 -5
- package/types/excalidraw/fonts/wasm/hb-subset.wasm.d.ts +0 -2
- package/types/excalidraw/fonts/wasm/woff2-bindings.d.ts +0 -31
- package/types/excalidraw/fonts/wasm/woff2-loader.d.ts +0 -14
- package/types/excalidraw/fonts/wasm/woff2-wasm.d.ts +0 -2
- package/types/excalidraw/fonts/wasm/woff2.bindings.d.ts +0 -31
- package/types/excalidraw/fonts/wasm/woff2.loader.d.ts +0 -6
- package/types/excalidraw/fonts/wasm/woff2.wasm.d.ts +0 -2
- package/types/excalidraw/fonts/woff2/Cascadia/index.d.ts +0 -2
- package/types/excalidraw/fonts/woff2/Comic/index.d.ts +0 -2
- package/types/excalidraw/fonts/woff2/Emoji/index.d.ts +0 -2
- package/types/excalidraw/fonts/woff2/Excalifont/index.d.ts +0 -2
- package/types/excalidraw/fonts/woff2/Helvetica/index.d.ts +0 -2
- package/types/excalidraw/fonts/woff2/Liberation/index.d.ts +0 -2
- package/types/excalidraw/fonts/woff2/Lilita/index.d.ts +0 -2
- package/types/excalidraw/fonts/woff2/Nunito/index.d.ts +0 -2
- package/types/excalidraw/fonts/woff2/Virgil/index.d.ts +0 -2
- package/types/excalidraw/fonts/woff2/Xiaolai/index.d.ts +0 -8
- package/types/excalidraw/fractionalIndex.d.ts +0 -48
- package/types/excalidraw/frame.d.ts +0 -63
- package/types/excalidraw/ga.d.ts +0 -63
- package/types/excalidraw/gadirections.d.ts +0 -8
- package/types/excalidraw/galines.d.ts +0 -22
- package/types/excalidraw/gapoints.d.ts +0 -7
- package/types/excalidraw/gatransforms.d.ts +0 -10
- package/types/excalidraw/gesture.d.ts +0 -6
- package/types/excalidraw/groups.d.ts +0 -33
- package/types/excalidraw/history.d.ts +0 -40
- package/types/excalidraw/hooks/useCallbackRefState.d.ts +0 -1
- package/types/excalidraw/hooks/useCopiedIndicator.d.ts +0 -5
- package/types/excalidraw/hooks/useCreatePortalContainer.d.ts +0 -7
- package/types/excalidraw/hooks/useEmitter.d.ts +0 -2
- package/types/excalidraw/hooks/useLibraryItemSvg.d.ts +0 -11
- package/types/excalidraw/hooks/useOutsideClick.d.ts +0 -19
- package/types/excalidraw/hooks/useScrollPosition.d.ts +0 -1
- package/types/excalidraw/hooks/useStable.d.ts +0 -1
- package/types/excalidraw/hooks/useStableCallback.d.ts +0 -4
- package/types/excalidraw/hooks/useTransition.d.ts +0 -2
- package/types/excalidraw/i18n.d.ts +0 -24
- package/types/excalidraw/index-node.d.ts +0 -1
- package/types/excalidraw/index.d.ts +0 -63
- package/types/excalidraw/jotai.d.ts +0 -34
- package/types/excalidraw/keys.d.ts +0 -82
- package/types/excalidraw/laser-trails.d.ts +0 -20
- package/types/excalidraw/main.d.ts +0 -2
- package/types/excalidraw/math.d.ts +0 -79
- package/types/excalidraw/mermaid.d.ts +0 -2
- package/types/excalidraw/obsidianUtils.d.ts +0 -21
- package/types/excalidraw/points.d.ts +0 -7
- package/types/excalidraw/polyfill.d.ts +0 -2
- package/types/excalidraw/publicPath.d.ts +0 -1
- package/types/excalidraw/queue.d.ts +0 -9
- package/types/excalidraw/random.d.ts +0 -4
- package/types/excalidraw/reactUtils.d.ts +0 -14
- package/types/excalidraw/renderer/easingFunctions.d.ts +0 -6
- package/types/excalidraw/renderer/helpers.d.ts +0 -13
- package/types/excalidraw/renderer/interactiveScene.d.ts +0 -20
- package/types/excalidraw/renderer/renderElement.d.ts +0 -27
- package/types/excalidraw/renderer/renderNewElementScene.d.ts +0 -7
- package/types/excalidraw/renderer/renderSnaps.d.ts +0 -2
- package/types/excalidraw/renderer/roundRect.d.ts +0 -11
- package/types/excalidraw/renderer/staticScene.d.ts +0 -11
- package/types/excalidraw/renderer/staticSvgScene.d.ts +0 -5
- package/types/excalidraw/scene/Fonts.d.ts +0 -19
- package/types/excalidraw/scene/Renderer.d.ts +0 -28
- package/types/excalidraw/scene/Scene.d.ts +0 -78
- package/types/excalidraw/scene/Shape.d.ts +0 -17
- package/types/excalidraw/scene/ShapeCache.d.ts +0 -25
- package/types/excalidraw/scene/comparisons.d.ts +0 -487
- package/types/excalidraw/scene/export.d.ts +0 -29
- package/types/excalidraw/scene/index.d.ts +0 -4
- package/types/excalidraw/scene/normalize.d.ts +0 -4
- package/types/excalidraw/scene/scroll.d.ts +0 -23
- package/types/excalidraw/scene/scrollbars.d.ts +0 -12
- package/types/excalidraw/scene/selection.d.ts +0 -32
- package/types/excalidraw/scene/types.d.ts +0 -112
- package/types/excalidraw/scene/zoom.d.ts +0 -12
- package/types/excalidraw/shapes.d.ts +0 -85
- package/types/excalidraw/snapping.d.ts +0 -112
- package/types/excalidraw/store.d.ts +0 -129
- package/types/excalidraw/types.d.ts +0 -718
- package/types/excalidraw/utility-types.d.ts +0 -31
- package/types/excalidraw/utils.d.ts +0 -249
- package/types/excalidraw/visualdebug.d.ts +0 -35
- package/types/excalidraw/webpack.dev.config.d.ts +0 -81
- package/types/excalidraw/webpack.prod.config.d.ts +0 -97
- package/types/excalidraw/workers.d.ts +0 -36
- package/types/excalidraw/zindex.d.ts +0 -6
- package/types/math/angle.d.ts +0 -17
- package/types/math/arc.d.ts +0 -6
- package/types/math/curve.d.ts +0 -32
- package/types/math/ga/ga.d.ts +0 -63
- package/types/math/ga/gadirections.d.ts +0 -8
- package/types/math/ga/galines.d.ts +0 -22
- package/types/math/ga/gapoints.d.ts +0 -7
- package/types/math/ga/gatransforms.d.ts +0 -10
- package/types/math/index.d.ts +0 -12
- package/types/math/line.d.ts +0 -26
- package/types/math/point.d.ts +0 -140
- package/types/math/polygon.d.ts +0 -5
- package/types/math/range.d.ts +0 -44
- package/types/math/segment.d.ts +0 -32
- package/types/math/triangle.d.ts +0 -11
- package/types/math/types.d.ts +0 -96
- package/types/math/utils.d.ts +0 -6
- package/types/math/vector.d.ts +0 -88
- package/types/utils/bbox.d.ts +0 -9
- package/types/utils/collision.d.ts +0 -9
- package/types/utils/export.d.ts +0 -44
- package/types/utils/geometry/geometry.d.ts +0 -89
- package/types/utils/geometry/shape.d.ts +0 -71
- package/types/utils/index.d.ts +0 -4
- package/types/utils/withinBounds.d.ts +0 -19
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A line is stored as an array `[0, c, a, b, 0, 0, 0, 0]` representing:
|
|
3
|
-
* c * e0 + a * e1 + b*e2
|
|
4
|
-
*
|
|
5
|
-
* This maps to a standard formula `a * x + b * y + c`.
|
|
6
|
-
*
|
|
7
|
-
* `(-b, a)` corresponds to a 2D vector parallel to the line. The lines
|
|
8
|
-
* have a natural orientation, corresponding to that vector.
|
|
9
|
-
*
|
|
10
|
-
* The magnitude ("norm") of the line is `sqrt(a ^ 2 + b ^ 2)`.
|
|
11
|
-
* `c / norm(line)` is the oriented distance from line to origin.
|
|
12
|
-
*/
|
|
13
|
-
export declare const vector: (x: number, y: number) => readonly [number, number, number, number, number, number, number, number];
|
|
14
|
-
export declare const equation: (a: number, b: number, c: number) => readonly [number, number, number, number, number, number, number, number];
|
|
15
|
-
export declare const through: (from: readonly [number, number, number, number, number, number, number, number], to: readonly [number, number, number, number, number, number, number, number]) => readonly [number, number, number, number, number, number, number, number];
|
|
16
|
-
export declare const orthogonal: (line: readonly [number, number, number, number, number, number, number, number], point: readonly [number, number, number, number, number, number, number, number]) => readonly [number, number, number, number, number, number, number, number];
|
|
17
|
-
export declare const orthogonalThrough: (against: readonly [number, number, number, number, number, number, number, number], intersection: readonly [number, number, number, number, number, number, number, number]) => readonly [number, number, number, number, number, number, number, number];
|
|
18
|
-
export declare const parallel: (line: readonly [number, number, number, number, number, number, number, number], distance: number) => readonly [number, number, number, number, number, number, number, number];
|
|
19
|
-
export declare const parallelThrough: (line: readonly [number, number, number, number, number, number, number, number], point: readonly [number, number, number, number, number, number, number, number]) => readonly [number, number, number, number, number, number, number, number];
|
|
20
|
-
export declare const distance: (line1: readonly [number, number, number, number, number, number, number, number], line2: readonly [number, number, number, number, number, number, number, number]) => number;
|
|
21
|
-
export declare const angle: (line1: readonly [number, number, number, number, number, number, number, number], line2: readonly [number, number, number, number, number, number, number, number]) => number;
|
|
22
|
-
export declare const sign: (line: readonly [number, number, number, number, number, number, number, number]) => number;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const from: ([x, y]: readonly [number, number]) => readonly [number, number, number, number, number, number, number, number];
|
|
2
|
-
export declare const toTuple: (point: readonly [number, number, number, number, number, number, number, number]) => [number, number];
|
|
3
|
-
export declare const abs: (point: readonly [number, number, number, number, number, number, number, number]) => readonly [number, number, number, number, number, number, number, number];
|
|
4
|
-
export declare const intersect: (line1: readonly [number, number, number, number, number, number, number, number], line2: readonly [number, number, number, number, number, number, number, number]) => readonly [number, number, number, number, number, number, number, number];
|
|
5
|
-
export declare const project: (point: readonly [number, number, number, number, number, number, number, number], line: readonly [number, number, number, number, number, number, number, number]) => readonly [number, number, number, number, number, number, number, number];
|
|
6
|
-
export declare const distance: (point1: readonly [number, number, number, number, number, number, number, number], point2: readonly [number, number, number, number, number, number, number, number]) => number;
|
|
7
|
-
export declare const distanceToLine: (point: readonly [number, number, number, number, number, number, number, number], line: readonly [number, number, number, number, number, number, number, number]) => number;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Line, Direction, Point } from "./ga";
|
|
2
|
-
/**
|
|
3
|
-
* TODO: docs
|
|
4
|
-
*/
|
|
5
|
-
export declare const rotation: (pivot: readonly [number, number, number, number, number, number, number, number], angle: number) => readonly [number, number, number, number, number, number, number, number];
|
|
6
|
-
export declare const translation: (direction: readonly [number, number, number, number, number, number, number, number]) => readonly [number, number, number, number, number, number, number, number];
|
|
7
|
-
export declare const translationOrthogonal: (direction: readonly [number, number, number, number, number, number, number, number], distance: number) => readonly [number, number, number, number, number, number, number, number];
|
|
8
|
-
export declare const translationAlong: (line: readonly [number, number, number, number, number, number, number, number], distance: number) => readonly [number, number, number, number, number, number, number, number];
|
|
9
|
-
export declare const compose: (motor1: readonly [number, number, number, number, number, number, number, number], motor2: readonly [number, number, number, number, number, number, number, number]) => readonly [number, number, number, number, number, number, number, number];
|
|
10
|
-
export declare const apply: (motor: readonly [number, number, number, number, number, number, number, number], nvector: Point | Direction | Line) => Point | Direction | Line;
|
package/types/math/index.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export * from "./arc";
|
|
2
|
-
export * from "./angle";
|
|
3
|
-
export * from "./curve";
|
|
4
|
-
export * from "./line";
|
|
5
|
-
export * from "./point";
|
|
6
|
-
export * from "./polygon";
|
|
7
|
-
export * from "./range";
|
|
8
|
-
export * from "./segment";
|
|
9
|
-
export * from "./triangle";
|
|
10
|
-
export * from "./types";
|
|
11
|
-
export * from "./vector";
|
|
12
|
-
export * from "./utils";
|
package/types/math/line.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { GlobalPoint, Line, LocalPoint, Radians } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Create a line from two points.
|
|
4
|
-
*
|
|
5
|
-
* @param points The two points lying on the line
|
|
6
|
-
* @returns The line on which the points lie
|
|
7
|
-
*/
|
|
8
|
-
export declare function line<P extends GlobalPoint | LocalPoint>(a: P, b: P): Line<P>;
|
|
9
|
-
/**
|
|
10
|
-
* Convenient point creation from an array of two points.
|
|
11
|
-
*
|
|
12
|
-
* @param param0 The array with the two points to convert to a line
|
|
13
|
-
* @returns The created line
|
|
14
|
-
*/
|
|
15
|
-
export declare function lineFromPointPair<P extends GlobalPoint | LocalPoint>([a, b]: [
|
|
16
|
-
P,
|
|
17
|
-
P
|
|
18
|
-
]): Line<P>;
|
|
19
|
-
/**
|
|
20
|
-
* TODO
|
|
21
|
-
*
|
|
22
|
-
* @param pointArray
|
|
23
|
-
* @returns
|
|
24
|
-
*/
|
|
25
|
-
export declare function lineFromPointArray<P extends GlobalPoint | LocalPoint>(pointArray: P[]): Line<P> | undefined;
|
|
26
|
-
export declare const lineRotate: <Point extends GlobalPoint | LocalPoint>(l: Line<Point>, angle: Radians, origin?: Point | undefined) => Line<Point>;
|
package/types/math/point.d.ts
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
import type { LocalPoint, GlobalPoint, Radians, Degrees, Vector } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Create a properly typed Point instance from the X and Y coordinates.
|
|
4
|
-
*
|
|
5
|
-
* @param x The X coordinate
|
|
6
|
-
* @param y The Y coordinate
|
|
7
|
-
* @returns The branded and created point
|
|
8
|
-
*/
|
|
9
|
-
export declare function pointFrom<Point extends GlobalPoint | LocalPoint>(x: number, y: number): Point;
|
|
10
|
-
/**
|
|
11
|
-
* Converts and remaps an array containing a pair of numbers to Point.
|
|
12
|
-
*
|
|
13
|
-
* @param numberArray The number array to check and to convert to Point
|
|
14
|
-
* @returns The point instance
|
|
15
|
-
*/
|
|
16
|
-
export declare function pointFromArray<Point extends GlobalPoint | LocalPoint>(numberArray: number[]): Point | undefined;
|
|
17
|
-
/**
|
|
18
|
-
* Converts and remaps a pair of numbers to Point.
|
|
19
|
-
*
|
|
20
|
-
* @param pair A number pair to convert to Point
|
|
21
|
-
* @returns The point instance
|
|
22
|
-
*/
|
|
23
|
-
export declare function pointFromPair<Point extends GlobalPoint | LocalPoint>(pair: [number, number]): Point;
|
|
24
|
-
/**
|
|
25
|
-
* Convert a vector to a point.
|
|
26
|
-
*
|
|
27
|
-
* @param v The vector to convert
|
|
28
|
-
* @returns The point the vector points at with origin 0,0
|
|
29
|
-
*/
|
|
30
|
-
export declare function pointFromVector<P extends GlobalPoint | LocalPoint>(v: Vector): P;
|
|
31
|
-
/**
|
|
32
|
-
* Checks if the provided value has the shape of a Point.
|
|
33
|
-
*
|
|
34
|
-
* @param p The value to attempt verification on
|
|
35
|
-
* @returns TRUE if the provided value has the shape of a local or global point
|
|
36
|
-
*/
|
|
37
|
-
export declare function isPoint(p: unknown): p is LocalPoint | GlobalPoint;
|
|
38
|
-
/**
|
|
39
|
-
* Compare two points coordinate-by-coordinate and if
|
|
40
|
-
* they are closer than INVERSE_PRECISION it returns TRUE.
|
|
41
|
-
*
|
|
42
|
-
* @param a Point The first point to compare
|
|
43
|
-
* @param b Point The second point to compare
|
|
44
|
-
* @returns TRUE if the points are sufficiently close to each other
|
|
45
|
-
*/
|
|
46
|
-
export declare function pointsEqual<Point extends GlobalPoint | LocalPoint>(a: Point, b: Point): boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Roate a point by [angle] radians.
|
|
49
|
-
*
|
|
50
|
-
* @param point The point to rotate
|
|
51
|
-
* @param center The point to rotate around, the center point
|
|
52
|
-
* @param angle The radians to rotate the point by
|
|
53
|
-
* @returns The rotated point
|
|
54
|
-
*/
|
|
55
|
-
export declare function pointRotateRads<Point extends GlobalPoint | LocalPoint>([x, y]: Point, [cx, cy]: Point, angle: Radians): Point;
|
|
56
|
-
/**
|
|
57
|
-
* Roate a point by [angle] degree.
|
|
58
|
-
*
|
|
59
|
-
* @param point The point to rotate
|
|
60
|
-
* @param center The point to rotate around, the center point
|
|
61
|
-
* @param angle The degree to rotate the point by
|
|
62
|
-
* @returns The rotated point
|
|
63
|
-
*/
|
|
64
|
-
export declare function pointRotateDegs<Point extends GlobalPoint | LocalPoint>(point: Point, center: Point, angle: Degrees): Point;
|
|
65
|
-
/**
|
|
66
|
-
* Translate a point by a vector.
|
|
67
|
-
*
|
|
68
|
-
* WARNING: This is not for translating Excalidraw element points!
|
|
69
|
-
* You need to account for rotation on base coordinates
|
|
70
|
-
* on your own.
|
|
71
|
-
* CONSIDER USING AN APPROPRIATE ELEMENT-AWARE TRANSLATE!
|
|
72
|
-
*
|
|
73
|
-
* @param p The point to apply the translation on
|
|
74
|
-
* @param v The vector to translate by
|
|
75
|
-
* @returns
|
|
76
|
-
*/
|
|
77
|
-
export declare function pointTranslate<From extends GlobalPoint | LocalPoint, To extends GlobalPoint | LocalPoint>(p: From, v?: Vector): To;
|
|
78
|
-
/**
|
|
79
|
-
* Find the center point at equal distance from both points.
|
|
80
|
-
*
|
|
81
|
-
* @param a One of the points to create the middle point for
|
|
82
|
-
* @param b The other point to create the middle point for
|
|
83
|
-
* @returns The middle point
|
|
84
|
-
*/
|
|
85
|
-
export declare function pointCenter<P extends LocalPoint | GlobalPoint>(a: P, b: P): P;
|
|
86
|
-
/**
|
|
87
|
-
* Add together two points by their coordinates like you'd apply a translation
|
|
88
|
-
* to a point by a vector.
|
|
89
|
-
*
|
|
90
|
-
* @param a One point to act as a basis
|
|
91
|
-
* @param b The other point to act like the vector to translate by
|
|
92
|
-
* @returns
|
|
93
|
-
*/
|
|
94
|
-
export declare function pointAdd<Point extends LocalPoint | GlobalPoint>(a: Point, b: Point): Point;
|
|
95
|
-
/**
|
|
96
|
-
* Subtract a point from another point like you'd translate a point by an
|
|
97
|
-
* invese vector.
|
|
98
|
-
*
|
|
99
|
-
* @param a The point to translate
|
|
100
|
-
* @param b The point which will act like a vector
|
|
101
|
-
* @returns The resulting point
|
|
102
|
-
*/
|
|
103
|
-
export declare function pointSubtract<Point extends LocalPoint | GlobalPoint>(a: Point, b: Point): Point;
|
|
104
|
-
/**
|
|
105
|
-
* Calculate the distance between two points.
|
|
106
|
-
*
|
|
107
|
-
* @param a First point
|
|
108
|
-
* @param b Second point
|
|
109
|
-
* @returns The euclidean distance between the two points.
|
|
110
|
-
*/
|
|
111
|
-
export declare function pointDistance<P extends LocalPoint | GlobalPoint>(a: P, b: P): number;
|
|
112
|
-
/**
|
|
113
|
-
* Calculate the squared distance between two points.
|
|
114
|
-
*
|
|
115
|
-
* Note: Use this if you only compare distances, it saves a square root.
|
|
116
|
-
*
|
|
117
|
-
* @param a First point
|
|
118
|
-
* @param b Second point
|
|
119
|
-
* @returns The euclidean distance between the two points.
|
|
120
|
-
*/
|
|
121
|
-
export declare function pointDistanceSq<P extends LocalPoint | GlobalPoint>(a: P, b: P): number;
|
|
122
|
-
/**
|
|
123
|
-
* Scale a point from a given origin by the multiplier.
|
|
124
|
-
*
|
|
125
|
-
* @param p The point to scale
|
|
126
|
-
* @param mid The origin to scale from
|
|
127
|
-
* @param multiplier The scaling factor
|
|
128
|
-
* @returns
|
|
129
|
-
*/
|
|
130
|
-
export declare const pointScaleFromOrigin: <P extends GlobalPoint | LocalPoint>(p: P, mid: P, multiplier: number) => GlobalPoint | LocalPoint;
|
|
131
|
-
/**
|
|
132
|
-
* Returns whether `q` lies inside the segment/rectangle defined by `p` and `r`.
|
|
133
|
-
* This is an approximation to "does `q` lie on a segment `pr`" check.
|
|
134
|
-
*
|
|
135
|
-
* @param p The first point to compare against
|
|
136
|
-
* @param q The actual point this function checks whether is in between
|
|
137
|
-
* @param r The other point to compare against
|
|
138
|
-
* @returns TRUE if q is indeed between p and r
|
|
139
|
-
*/
|
|
140
|
-
export declare const isPointWithinBounds: <P extends GlobalPoint | LocalPoint>(p: P, q: P, r: P) => boolean;
|
package/types/math/polygon.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { GlobalPoint, LocalPoint, Polygon } from "./types";
|
|
2
|
-
export declare function polygon<Point extends GlobalPoint | LocalPoint>(...points: Point[]): Polygon<Point>;
|
|
3
|
-
export declare function polygonFromPoints<Point extends GlobalPoint | LocalPoint>(points: Point[]): Polygon<Point>;
|
|
4
|
-
export declare const polygonIncludesPoint: <Point extends GlobalPoint | LocalPoint>(point: Point, polygon: Polygon<Point>) => boolean;
|
|
5
|
-
export declare const pointOnPolygon: <Point extends GlobalPoint | LocalPoint>(p: Point, poly: Polygon<Point>, threshold?: number) => boolean;
|
package/types/math/range.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { InclusiveRange } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Create an inclusive range from the two numbers provided.
|
|
4
|
-
*
|
|
5
|
-
* @param start Start of the range
|
|
6
|
-
* @param end End of the range
|
|
7
|
-
* @returns
|
|
8
|
-
*/
|
|
9
|
-
export declare function rangeInclusive(start: number, end: number): InclusiveRange;
|
|
10
|
-
/**
|
|
11
|
-
* Turn a number pair into an inclusive range.
|
|
12
|
-
*
|
|
13
|
-
* @param pair The number pair to convert to an inclusive range
|
|
14
|
-
* @returns The new inclusive range
|
|
15
|
-
*/
|
|
16
|
-
export declare function rangeInclusiveFromPair(pair: [start: number, end: number]): [number, number] & {
|
|
17
|
-
_brand: "excalimath_degree";
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Given two ranges, return if the two ranges overlap with each other e.g.
|
|
21
|
-
* [1, 3] overlaps with [2, 4] while [1, 3] does not overlap with [4, 5].
|
|
22
|
-
*
|
|
23
|
-
* @param param0 One of the ranges to compare
|
|
24
|
-
* @param param1 The other range to compare against
|
|
25
|
-
* @returns TRUE if the ranges overlap
|
|
26
|
-
*/
|
|
27
|
-
export declare const rangesOverlap: ([a0, a1]: InclusiveRange, [b0, b1]: InclusiveRange) => boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Given two ranges,return ther intersection of the two ranges if any e.g. the
|
|
30
|
-
* intersection of [1, 3] and [2, 4] is [2, 3].
|
|
31
|
-
*
|
|
32
|
-
* @param param0 The first range to compare
|
|
33
|
-
* @param param1 The second range to compare
|
|
34
|
-
* @returns The inclusive range intersection or NULL if no intersection
|
|
35
|
-
*/
|
|
36
|
-
export declare const rangeIntersection: ([a0, a1]: InclusiveRange, [b0, b1]: InclusiveRange) => InclusiveRange | null;
|
|
37
|
-
/**
|
|
38
|
-
* Determine if a value is inside a range.
|
|
39
|
-
*
|
|
40
|
-
* @param value The value to check
|
|
41
|
-
* @param range The range
|
|
42
|
-
* @returns
|
|
43
|
-
*/
|
|
44
|
-
export declare const rangeIncludesValue: (value: number, [min, max]: InclusiveRange) => boolean;
|
package/types/math/segment.d.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { GlobalPoint, LineSegment, LocalPoint, Radians } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Create a line segment from two points.
|
|
4
|
-
*
|
|
5
|
-
* @param points The two points delimiting the line segment on each end
|
|
6
|
-
* @returns The line segment delineated by the points
|
|
7
|
-
*/
|
|
8
|
-
export declare function lineSegment<P extends GlobalPoint | LocalPoint>(a: P, b: P): LineSegment<P>;
|
|
9
|
-
export declare function lineSegmentFromPointArray<P extends GlobalPoint | LocalPoint>(pointArray: P[]): LineSegment<P> | undefined;
|
|
10
|
-
/**
|
|
11
|
-
*
|
|
12
|
-
* @param segment
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
export declare const isLineSegment: <Point extends GlobalPoint | LocalPoint>(segment: unknown) => segment is LineSegment<Point>;
|
|
16
|
-
/**
|
|
17
|
-
* Return the coordinates resulting from rotating the given line about an origin by an angle in radians
|
|
18
|
-
* note that when the origin is not given, the midpoint of the given line is used as the origin.
|
|
19
|
-
*
|
|
20
|
-
* @param l
|
|
21
|
-
* @param angle
|
|
22
|
-
* @param origin
|
|
23
|
-
* @returns
|
|
24
|
-
*/
|
|
25
|
-
export declare const lineSegmentRotate: <Point extends GlobalPoint | LocalPoint>(l: LineSegment<Point>, angle: Radians, origin?: Point | undefined) => LineSegment<Point>;
|
|
26
|
-
/**
|
|
27
|
-
* Calculates the point two line segments with a definite start and end point
|
|
28
|
-
* intersect at.
|
|
29
|
-
*/
|
|
30
|
-
export declare const segmentsIntersectAt: <Point extends GlobalPoint | LocalPoint>(a: Readonly<LineSegment<Point>>, b: Readonly<LineSegment<Point>>) => Point | null;
|
|
31
|
-
export declare const pointOnLineSegment: <Point extends GlobalPoint | LocalPoint>(point: Point, line: LineSegment<Point>, threshold?: number) => boolean;
|
|
32
|
-
export declare const distanceToLineSegment: <Point extends GlobalPoint | LocalPoint>(point: Point, line: LineSegment<Point>) => number;
|
package/types/math/triangle.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { GlobalPoint, LocalPoint, Triangle } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Tests if a point lies inside a triangle. This function
|
|
4
|
-
* will return FALSE if the point lies exactly on the sides
|
|
5
|
-
* of the triangle.
|
|
6
|
-
*
|
|
7
|
-
* @param triangle The triangle to test the point for
|
|
8
|
-
* @param p The point to test whether is in the triangle
|
|
9
|
-
* @returns TRUE if the point is inside of the triangle
|
|
10
|
-
*/
|
|
11
|
-
export declare function triangleIncludesPoint<P extends GlobalPoint | LocalPoint>([a, b, c]: Triangle<P>, p: P): boolean;
|
package/types/math/types.d.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* By definition one radian is the angle subtended at the centre
|
|
3
|
-
* of a circle by an arc that is equal in length to the radius.
|
|
4
|
-
*/
|
|
5
|
-
export type Radians = number & {
|
|
6
|
-
_brand: "excalimath__radian";
|
|
7
|
-
};
|
|
8
|
-
/**
|
|
9
|
-
* An angle measurement of a plane angle in which one full
|
|
10
|
-
* rotation is 360 degrees.
|
|
11
|
-
*/
|
|
12
|
-
export type Degrees = number & {
|
|
13
|
-
_brand: "excalimath_degree";
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* A number range which includes the start and end numbers in the range.
|
|
17
|
-
*/
|
|
18
|
-
export type InclusiveRange = [number, number] & {
|
|
19
|
-
_brand: "excalimath_degree";
|
|
20
|
-
};
|
|
21
|
-
/**
|
|
22
|
-
* Represents a 2D position in world or canvas space. A
|
|
23
|
-
* global coordinate.
|
|
24
|
-
*/
|
|
25
|
-
export type GlobalPoint = [x: number, y: number] & {
|
|
26
|
-
_brand: "excalimath__globalpoint";
|
|
27
|
-
};
|
|
28
|
-
/**
|
|
29
|
-
* Represents a 2D position in whatever local space it's
|
|
30
|
-
* needed. A local coordinate.
|
|
31
|
-
*/
|
|
32
|
-
export type LocalPoint = [x: number, y: number] & {
|
|
33
|
-
_brand: "excalimath__localpoint";
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* A line is an infinitely long object with no width, depth, or curvature.
|
|
37
|
-
*/
|
|
38
|
-
export type Line<P extends GlobalPoint | LocalPoint> = [p: P, q: P] & {
|
|
39
|
-
_brand: "excalimath_line";
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* In geometry, a line segment is a part of a straight
|
|
43
|
-
* line that is bounded by two distinct end points, and
|
|
44
|
-
* contains every point on the line that is between its endpoints.
|
|
45
|
-
*/
|
|
46
|
-
export type LineSegment<P extends GlobalPoint | LocalPoint> = [a: P, b: P] & {
|
|
47
|
-
_brand: "excalimath_linesegment";
|
|
48
|
-
};
|
|
49
|
-
/**
|
|
50
|
-
* Represents a 2D vector
|
|
51
|
-
*/
|
|
52
|
-
export type Vector = [u: number, v: number] & {
|
|
53
|
-
_brand: "excalimath__vector";
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* A triangle represented by 3 points
|
|
57
|
-
*/
|
|
58
|
-
export type Triangle<P extends GlobalPoint | LocalPoint> = [
|
|
59
|
-
a: P,
|
|
60
|
-
b: P,
|
|
61
|
-
c: P
|
|
62
|
-
] & {
|
|
63
|
-
_brand: "excalimath__triangle";
|
|
64
|
-
};
|
|
65
|
-
/**
|
|
66
|
-
* A polygon is a closed shape by connecting the given points
|
|
67
|
-
* rectangles and diamonds are modelled by polygons
|
|
68
|
-
*/
|
|
69
|
-
export type Polygon<Point extends GlobalPoint | LocalPoint> = Point[] & {
|
|
70
|
-
_brand: "excalimath_polygon";
|
|
71
|
-
};
|
|
72
|
-
/**
|
|
73
|
-
* Cubic bezier curve with four control points
|
|
74
|
-
*/
|
|
75
|
-
export type Curve<Point extends GlobalPoint | LocalPoint> = [
|
|
76
|
-
Point,
|
|
77
|
-
Point,
|
|
78
|
-
Point,
|
|
79
|
-
Point
|
|
80
|
-
] & {
|
|
81
|
-
_brand: "excalimath_curve";
|
|
82
|
-
};
|
|
83
|
-
export type PolarCoords = [
|
|
84
|
-
radius: number,
|
|
85
|
-
/** angle in radians */
|
|
86
|
-
angle: number
|
|
87
|
-
];
|
|
88
|
-
/**
|
|
89
|
-
* Angles are in radians and centered on 0, 0. Zero radians on a 1 radius circle
|
|
90
|
-
* corresponds to (1, 0) cartesian coordinates (point), i.e. to the "right".
|
|
91
|
-
*/
|
|
92
|
-
export type SymmetricArc = {
|
|
93
|
-
radius: number;
|
|
94
|
-
startAngle: number;
|
|
95
|
-
endAngle: number;
|
|
96
|
-
};
|
package/types/math/utils.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export declare const PRECISION = 0.0001;
|
|
2
|
-
export declare const clamp: (value: number, min: number, max: number) => number;
|
|
3
|
-
export declare const round: (value: number, precision: number, func?: "round" | "floor" | "ceil") => number;
|
|
4
|
-
export declare const roundToStep: (value: number, step: number, func?: "round" | "floor" | "ceil") => number;
|
|
5
|
-
export declare const average: (a: number, b: number) => number;
|
|
6
|
-
export declare const isFiniteNumber: (value: any) => value is number;
|
package/types/math/vector.d.ts
DELETED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import type { GlobalPoint, LocalPoint, Vector } from "./types";
|
|
2
|
-
/**
|
|
3
|
-
* Create a vector from the x and y coordiante elements.
|
|
4
|
-
*
|
|
5
|
-
* @param x The X aspect of the vector
|
|
6
|
-
* @param y T Y aspect of the vector
|
|
7
|
-
* @returns The constructed vector with X and Y as the coordinates
|
|
8
|
-
*/
|
|
9
|
-
export declare function vector(x: number, y: number, originX?: number, originY?: number): Vector;
|
|
10
|
-
/**
|
|
11
|
-
* Turn a point into a vector with the origin point.
|
|
12
|
-
*
|
|
13
|
-
* @param p The point to turn into a vector
|
|
14
|
-
* @param origin The origin point in a given coordiante system
|
|
15
|
-
* @returns The created vector from the point and the origin
|
|
16
|
-
*/
|
|
17
|
-
export declare function vectorFromPoint<Point extends GlobalPoint | LocalPoint>(p: Point, origin?: Point): Vector;
|
|
18
|
-
/**
|
|
19
|
-
* Cross product is a binary operation on two vectors in 2D space.
|
|
20
|
-
* It results in a vector that is perpendicular to both vectors.
|
|
21
|
-
*
|
|
22
|
-
* @param a One of the vectors to use for the directed area calculation
|
|
23
|
-
* @param b The other vector to use for the directed area calculation
|
|
24
|
-
* @returns The directed area value for the two vectos
|
|
25
|
-
*/
|
|
26
|
-
export declare function vectorCross(a: Vector, b: Vector): number;
|
|
27
|
-
/**
|
|
28
|
-
* Dot product is defined as the sum of the products of the
|
|
29
|
-
* two vectors.
|
|
30
|
-
*
|
|
31
|
-
* @param a One of the vectors for which the sum of products is calculated
|
|
32
|
-
* @param b The other vector for which the sum of products is calculated
|
|
33
|
-
* @returns The sum of products of the two vectors
|
|
34
|
-
*/
|
|
35
|
-
export declare function vectorDot(a: Vector, b: Vector): number;
|
|
36
|
-
/**
|
|
37
|
-
* Determines if the value has the shape of a Vector.
|
|
38
|
-
*
|
|
39
|
-
* @param v The value to test
|
|
40
|
-
* @returns TRUE if the value has the shape and components of a Vectors
|
|
41
|
-
*/
|
|
42
|
-
export declare function isVector(v: unknown): v is Vector;
|
|
43
|
-
/**
|
|
44
|
-
* Add two vectors by adding their coordinates.
|
|
45
|
-
*
|
|
46
|
-
* @param a One of the vectors to add
|
|
47
|
-
* @param b The other vector to add
|
|
48
|
-
* @returns The sum vector of the two provided vectors
|
|
49
|
-
*/
|
|
50
|
-
export declare function vectorAdd(a: Readonly<Vector>, b: Readonly<Vector>): Vector;
|
|
51
|
-
/**
|
|
52
|
-
* Add two vectors by adding their coordinates.
|
|
53
|
-
*
|
|
54
|
-
* @param start One of the vectors to add
|
|
55
|
-
* @param end The other vector to add
|
|
56
|
-
* @returns The sum vector of the two provided vectors
|
|
57
|
-
*/
|
|
58
|
-
export declare function vectorSubtract(start: Readonly<Vector>, end: Readonly<Vector>): Vector;
|
|
59
|
-
/**
|
|
60
|
-
* Scale vector by a scalar.
|
|
61
|
-
*
|
|
62
|
-
* @param v The vector to scale
|
|
63
|
-
* @param scalar The scalar to multiply the vector components with
|
|
64
|
-
* @returns The new scaled vector
|
|
65
|
-
*/
|
|
66
|
-
export declare function vectorScale(v: Vector, scalar: number): Vector;
|
|
67
|
-
/**
|
|
68
|
-
* Calculates the sqare magnitude of a vector. Use this if you compare
|
|
69
|
-
* magnitudes as it saves you an SQRT.
|
|
70
|
-
*
|
|
71
|
-
* @param v The vector to measure
|
|
72
|
-
* @returns The scalar squared magnitude of the vector
|
|
73
|
-
*/
|
|
74
|
-
export declare function vectorMagnitudeSq(v: Vector): number;
|
|
75
|
-
/**
|
|
76
|
-
* Calculates the magnitude of a vector.
|
|
77
|
-
*
|
|
78
|
-
* @param v The vector to measure
|
|
79
|
-
* @returns The scalar magnitude of the vector
|
|
80
|
-
*/
|
|
81
|
-
export declare function vectorMagnitude(v: Vector): number;
|
|
82
|
-
/**
|
|
83
|
-
* Normalize the vector (i.e. make the vector magnitue equal 1).
|
|
84
|
-
*
|
|
85
|
-
* @param v The vector to normalize
|
|
86
|
-
* @returns The new normalized vector
|
|
87
|
-
*/
|
|
88
|
-
export declare const vectorNormalize: (v: Vector) => Vector;
|
package/types/utils/bbox.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { type GlobalPoint, type LocalPoint } from "../math";
|
|
2
|
-
import type { Bounds } from "../excalidraw/element/bounds";
|
|
3
|
-
export type LineSegment<P extends LocalPoint | GlobalPoint> = [P, P];
|
|
4
|
-
export declare function getBBox<P extends LocalPoint | GlobalPoint>(line: LineSegment<P>): Bounds;
|
|
5
|
-
export declare function doBBoxesIntersect(a: Bounds, b: Bounds): boolean;
|
|
6
|
-
export declare function isPointOnLine<P extends GlobalPoint | LocalPoint>(l: LineSegment<P>, p: P): boolean;
|
|
7
|
-
export declare function isPointRightOfLine<P extends GlobalPoint | LocalPoint>(l: LineSegment<P>, p: P): boolean;
|
|
8
|
-
export declare function isLineSegmentTouchingOrCrossingLine<P extends GlobalPoint | LocalPoint>(a: LineSegment<P>, b: LineSegment<P>): boolean;
|
|
9
|
-
export declare function doLineSegmentsIntersect<P extends GlobalPoint | LocalPoint>(a: LineSegment<P>, b: LineSegment<P>): boolean;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { Polyline } from "./geometry/shape";
|
|
2
|
-
import { type GeometricShape } from "./geometry/shape";
|
|
3
|
-
import type { Curve } from "../math";
|
|
4
|
-
import { type GlobalPoint, type LocalPoint, type Polygon } from "../math";
|
|
5
|
-
export declare const isPointOnShape: <Point extends GlobalPoint | LocalPoint>(point: Point, shape: GeometricShape<Point>, tolerance?: number) => boolean;
|
|
6
|
-
export declare const isPointInShape: <Point extends GlobalPoint | LocalPoint>(point: Point, shape: GeometricShape<Point>) => boolean;
|
|
7
|
-
export declare const isPointInBounds: <Point extends GlobalPoint | LocalPoint>(point: Point, bounds: Polygon<Point>) => boolean;
|
|
8
|
-
export declare const pointOnCurve: <Point extends GlobalPoint | LocalPoint>(point: Point, curve: Curve<Point>, threshold: number) => boolean;
|
|
9
|
-
export declare const pointOnPolyline: <Point extends GlobalPoint | LocalPoint>(point: Point, polyline: Polyline<Point>, threshold?: number) => boolean;
|
package/types/utils/export.d.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { AppState, BinaryFiles } from "../excalidraw/types";
|
|
2
|
-
import type { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeleted } from "../excalidraw/element/types";
|
|
3
|
-
import { MIME_TYPES } from "../excalidraw/constants";
|
|
4
|
-
export { MIME_TYPES };
|
|
5
|
-
type ExportOpts = {
|
|
6
|
-
elements: readonly NonDeleted<ExcalidrawElement>[];
|
|
7
|
-
appState?: Partial<Omit<AppState, "offsetTop" | "offsetLeft">>;
|
|
8
|
-
files: BinaryFiles | null;
|
|
9
|
-
maxWidthOrHeight?: number;
|
|
10
|
-
exportingFrame?: ExcalidrawFrameLikeElement | null;
|
|
11
|
-
getDimensions?: (width: number, height: number) => {
|
|
12
|
-
width: number;
|
|
13
|
-
height: number;
|
|
14
|
-
scale?: number;
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export declare const exportToCanvas: ({ elements, appState, files, maxWidthOrHeight, getDimensions, exportPadding, exportingFrame, }: ExportOpts & {
|
|
18
|
-
exportPadding?: number | undefined;
|
|
19
|
-
}) => Promise<HTMLCanvasElement>;
|
|
20
|
-
export declare const exportToBlob: (opts: ExportOpts & {
|
|
21
|
-
mimeType?: string;
|
|
22
|
-
quality?: number;
|
|
23
|
-
exportPadding?: number;
|
|
24
|
-
}) => Promise<Blob>;
|
|
25
|
-
export declare const exportToSvg: ({ elements, appState, files, exportPadding, renderEmbeddables, exportingFrame, skipInliningFonts, }: Omit<ExportOpts, "getDimensions"> & {
|
|
26
|
-
exportPadding?: number | undefined;
|
|
27
|
-
renderEmbeddables?: boolean | undefined;
|
|
28
|
-
skipInliningFonts?: true | undefined;
|
|
29
|
-
}) => Promise<SVGSVGElement>;
|
|
30
|
-
export declare const exportToClipboard: (opts: ExportOpts & {
|
|
31
|
-
mimeType?: string;
|
|
32
|
-
quality?: number;
|
|
33
|
-
type: "png" | "svg" | "json";
|
|
34
|
-
}) => Promise<void>;
|
|
35
|
-
export { getCommonBoundingBox } from "../excalidraw/element/bounds";
|
|
36
|
-
export { getMaximumGroups } from "../excalidraw/groups";
|
|
37
|
-
export { intersectElementWithLine } from "../excalidraw/element/binding";
|
|
38
|
-
export { determineFocusDistance } from "../excalidraw/element/binding";
|
|
39
|
-
export { measureText, wrapText } from "../excalidraw/element/textElement";
|
|
40
|
-
export { getLineHeight } from "../excalidraw/fonts/index";
|
|
41
|
-
export { getFontString, getFontFamilyString } from "../excalidraw/utils";
|
|
42
|
-
export { getBoundTextMaxWidth } from "../excalidraw/element/textElement";
|
|
43
|
-
export { mermaidToExcalidraw } from "../excalidraw/components/TTDDialog/MermaidToExcalidraw";
|
|
44
|
-
export { destroyObsidianUtils, initializeObsidianUtils, registerLocalFont, getFontFamilies, registerFontsInCSS, getCSSFontDefinition, loadSceneFonts, } from "../excalidraw/obsidianUtils";
|