@dwelle/excalidraw 0.4.0-d8d86cf → 0.4.0-da7ef3e
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/CHANGELOG.md +706 -0
- package/README.md +18 -1422
- package/dist/excalidraw-assets/{vendor-2002fe1b8862917b36c1.js → vendor-d415b28e9024dee4bb1b.js} +2 -2
- package/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.js → vendor-a14cd58fa2db417e42b2.js} +6 -6
- package/dist/excalidraw.development.js +3035 -1464
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +20 -0
- package/main.js +1 -8
- package/package.json +9 -4
- package/types/actions/actionAddToLibrary.d.ts +130 -52
- package/types/actions/actionAlign.d.ts +25 -32
- package/types/actions/actionBoundText.d.ts +191 -22
- package/types/actions/actionCanvas.d.ts +774 -174
- package/types/actions/actionClipboard.d.ts +232 -88
- package/types/actions/actionDeleteSelected.d.ts +129 -57
- package/types/actions/actionDistribute.d.ts +7 -12
- package/types/actions/actionDuplicateSelection.d.ts +2 -5
- package/types/actions/actionElementLock.d.ts +283 -0
- package/types/actions/actionExport.d.ts +448 -229
- package/types/actions/actionFinalize.d.ts +87 -41
- package/types/actions/actionFlip.d.ts +4 -7
- package/types/actions/actionFrame.d.ts +441 -0
- package/types/actions/actionGroup.d.ts +260 -15
- package/types/actions/actionHistory.d.ts +1 -1
- package/types/actions/actionLinearEditor.d.ts +46 -20
- package/types/actions/actionMenu.d.ts +136 -65
- package/types/actions/actionNavigate.d.ts +2 -3
- package/types/actions/actionProperties.d.ts +590 -277
- package/types/actions/actionSelectAll.d.ts +127 -2
- package/types/actions/actionStyles.d.ts +44 -19
- package/types/actions/actionToggleGridMode.d.ts +46 -19
- package/types/actions/{actionToggleLock.d.ts → actionToggleObjectsSnapMode.d.ts} +58 -31
- package/types/actions/actionToggleStats.d.ts +45 -19
- package/types/actions/actionToggleViewMode.d.ts +46 -19
- package/types/actions/actionToggleZenMode.d.ts +46 -19
- package/types/actions/actionZindex.d.ts +8 -16
- package/types/actions/index.d.ts +2 -1
- package/types/actions/manager.d.ts +3 -2
- package/types/actions/shortcuts.d.ts +2 -1
- package/types/actions/types.d.ts +16 -13
- package/types/appState.d.ts +23 -18
- package/types/charts.d.ts +2 -2
- package/types/clients.d.ts +5 -6
- package/types/clipboard.d.ts +3 -2
- package/types/colors.d.ts +60 -5
- package/types/components/Actions.d.ts +7 -7
- package/types/components/ActiveConfirmDialog.d.ts +4 -0
- package/types/components/App.d.ts +88 -74
- package/types/components/Avatar.d.ts +1 -2
- package/types/components/BraveMeasureTextError.d.ts +2 -0
- package/types/components/Button.d.ts +16 -0
- package/types/components/ButtonIconSelect.d.ts +11 -3
- package/types/components/Card.d.ts +6 -0
- package/types/components/ColorPicker/ColorInput.d.ts +9 -0
- package/types/components/ColorPicker/ColorPicker.d.ts +19 -0
- package/types/components/ColorPicker/CustomColorList.d.ts +8 -0
- package/types/components/ColorPicker/HotkeyLabel.d.ts +8 -0
- package/types/components/ColorPicker/Picker.d.ts +18 -0
- package/types/components/ColorPicker/PickerColorList.d.ts +10 -0
- package/types/components/ColorPicker/PickerHeading.d.ts +5 -0
- package/types/components/ColorPicker/ShadeList.d.ts +8 -0
- package/types/components/ColorPicker/TopPicks.d.ts +9 -0
- package/types/components/ColorPicker/colorPickerUtils.d.ts +21 -0
- package/types/components/ColorPicker/keyboardNavHandlers.d.ts +20 -0
- package/types/components/ContextMenu.d.ts +9 -22
- package/types/components/DefaultSidebar.d.ts +29 -0
- package/types/components/Dialog.d.ts +3 -4
- package/types/components/ErrorDialog.d.ts +3 -2
- package/types/components/ExcalidrawLogo.d.ts +15 -0
- package/types/components/EyeDropper.d.ts +28 -0
- package/types/components/FilledButton.d.ts +17 -0
- package/types/components/FixedSideContainer.d.ts +1 -1
- package/types/components/HandButton.d.ts +10 -0
- package/types/components/HelpButton.d.ts +1 -2
- package/types/components/HintViewer.d.ts +4 -5
- package/types/components/HomeButton.d.ts +1 -1
- package/types/components/ImageExportDialog.d.ts +8 -13
- package/types/components/Island.d.ts +1 -1
- package/types/components/JSONExportDialog.d.ts +7 -5
- package/types/components/LayerUI.d.ts +10 -16
- package/types/components/LibraryMenu.d.ts +13 -14
- package/types/components/LibraryMenuBrowseButton.d.ts +2 -2
- package/types/components/LibraryMenuControlButtons.d.ts +9 -0
- package/types/components/LibraryMenuHeaderContent.d.ts +10 -5
- package/types/components/LibraryMenuItems.d.ts +6 -7
- package/types/components/LibraryMenuSection.d.ts +22 -0
- package/types/components/LibraryUnit.d.ts +6 -3
- package/types/components/LoadingMessage.d.ts +0 -1
- package/types/components/LockButton.d.ts +1 -2
- package/types/components/MobileMenu.d.ts +10 -12
- package/types/components/OverwriteConfirm/OverwriteConfirm.d.ts +17 -0
- package/types/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +17 -0
- package/types/components/OverwriteConfirm/OverwriteConfirmState.d.ts +22 -0
- package/types/components/PasteChartDialog.d.ts +4 -5
- package/types/components/PenModeButton.d.ts +1 -1
- package/types/components/Popover.d.ts +1 -1
- package/types/components/ProjectName.d.ts +2 -1
- package/types/components/PublishLibrary.d.ts +2 -2
- package/types/components/RadioGroup.d.ts +12 -0
- package/types/components/Section.d.ts +1 -1
- package/types/components/Sidebar/Sidebar.d.ts +66 -63
- package/types/components/Sidebar/SidebarHeader.d.ts +6 -19
- package/types/components/Sidebar/SidebarTab.d.ts +8 -0
- package/types/components/Sidebar/SidebarTabTrigger.d.ts +9 -0
- package/types/components/Sidebar/SidebarTabTriggers.d.ts +6 -0
- package/types/components/Sidebar/SidebarTabs.d.ts +6 -0
- package/types/components/Sidebar/SidebarTrigger.d.ts +6 -0
- package/types/components/Sidebar/common.d.ts +24 -7
- package/types/components/Spinner.d.ts +2 -1
- package/types/components/Stack.d.ts +4 -3
- package/types/components/Stats.d.ts +3 -3
- package/types/components/Switch.d.ts +9 -0
- package/types/components/ToolButton.d.ts +6 -5
- package/types/components/Tooltip.d.ts +1 -1
- package/types/components/Trans.d.ts +9 -0
- package/types/components/UserList.d.ts +0 -2
- package/types/components/canvases/InteractiveCanvas.d.ts +27 -0
- package/types/components/canvases/StaticCanvas.d.ts +18 -0
- package/types/components/canvases/index.d.ts +3 -0
- package/types/components/dropdownMenu/DropdownMenu.d.ts +67 -0
- package/types/components/dropdownMenu/DropdownMenuContent.d.ts +15 -0
- package/types/components/dropdownMenu/DropdownMenuGroup.d.ts +11 -0
- package/types/components/dropdownMenu/DropdownMenuItem.d.ts +12 -0
- package/types/components/dropdownMenu/DropdownMenuItemContent.d.ts +6 -0
- package/types/components/dropdownMenu/DropdownMenuItemCustom.d.ts +6 -0
- package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +13 -0
- package/types/components/dropdownMenu/DropdownMenuSeparator.d.ts +5 -0
- package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +10 -0
- package/types/components/dropdownMenu/common.d.ts +6 -0
- package/types/components/dropdownMenu/dropdownMenuUtils.d.ts +3 -0
- package/types/components/footer/Footer.d.ts +12 -0
- package/types/components/footer/FooterCenter.d.ts +8 -0
- package/types/components/hoc/withInternalFallback.d.ts +4 -0
- package/types/components/icons.d.ts +15 -2
- package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +9 -0
- package/types/components/main-menu/DefaultItems.d.ts +47 -0
- package/types/components/main-menu/MainMenu.d.ts +61 -0
- package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +57 -0
- package/types/components/welcome-screen/WelcomeScreen.Hints.d.ts +19 -0
- package/types/components/welcome-screen/WelcomeScreen.d.ts +84 -0
- package/types/constants.d.ts +94 -18
- package/types/context/tunnels.d.ts +19 -0
- package/types/context/ui-appState.d.ts +4 -0
- package/types/data/blob.d.ts +3 -2
- package/types/data/encode.d.ts +1 -1
- package/types/data/filesystem.d.ts +2 -1
- package/types/data/index.d.ts +1 -1
- package/types/data/library.d.ts +3 -45
- package/types/data/restore.d.ts +10 -4
- package/types/data/transform.d.ts +71 -0
- package/types/data/types.d.ts +3 -5
- package/types/data/url.d.ts +7 -0
- package/types/element/Hyperlink.d.ts +57 -30
- package/types/element/binding.d.ts +4 -3
- package/types/element/bounds.d.ts +31 -7
- package/types/element/collision.d.ts +7 -7
- package/types/element/dragElements.d.ts +12 -2
- package/types/element/embeddable.d.ts +159 -0
- package/types/element/image.d.ts +11 -1
- package/types/element/index.d.ts +3 -2
- package/types/element/linearElementEditor.d.ts +49 -24
- package/types/element/mutateElement.d.ts +2 -1
- package/types/element/newElement.d.ts +48 -15
- package/types/element/resizeElements.d.ts +3 -2
- package/types/element/showSelectedShapeActions.d.ts +2 -2
- package/types/element/sizeHelpers.d.ts +8 -1
- package/types/element/sortElements.d.ts +2 -0
- package/types/element/textElement.d.ts +44 -11
- package/types/element/textWysiwyg.d.ts +7 -2
- package/types/element/transformHandles.d.ts +15 -8
- package/types/element/typeChecks.d.ts +13 -2
- package/types/element/types.d.ts +64 -36
- package/types/emitter.d.ts +1 -1
- package/types/errors.d.ts +1 -1
- package/types/frame.d.ts +40 -0
- package/types/ga.d.ts +5 -5
- package/types/groups.d.ts +15 -11
- package/types/history.d.ts +3 -3
- package/types/hooks/useCreatePortalContainer.d.ts +4 -0
- package/types/hooks/useLibraryItemSvg.d.ts +11 -0
- package/types/hooks/useOutsideClick.d.ts +19 -2
- package/types/hooks/useScrollPosition.d.ts +1 -0
- package/types/hooks/useStable.d.ts +1 -0
- package/types/hooks/useTransition.d.ts +2 -0
- package/types/i18n.d.ts +11 -2
- package/types/jotai.d.ts +20 -108
- package/types/keys.d.ts +7 -4
- package/types/math.d.ts +6 -1
- package/types/packages/excalidraw/example/App.d.ts +7 -1
- package/types/packages/excalidraw/example/CustomFooter.d.ts +5 -0
- package/types/packages/excalidraw/example/MobileFooter.d.ts +5 -0
- package/types/packages/excalidraw/example/initialData.d.ts +182 -64
- package/types/packages/excalidraw/index.d.ts +19 -3
- package/types/packages/excalidraw/main.d.ts +3 -1
- package/types/packages/excalidraw/webpack.dev.config.d.ts +5 -2
- package/types/packages/excalidraw/webpack.prod.config.d.ts +3 -0
- package/types/packages/utils.d.ts +28 -24
- package/types/renderer/renderElement.d.ts +12 -22
- package/types/renderer/renderScene.d.ts +19 -29
- package/types/renderer/renderSnaps.d.ts +2 -0
- package/types/renderer/roundRect.d.ts +1 -1
- package/types/scene/Renderer.d.ts +25 -0
- package/types/scene/Scene.d.ts +27 -5
- package/types/scene/Shape.d.ts +12 -0
- package/types/scene/ShapeCache.d.ts +20 -0
- package/types/scene/comparisons.d.ts +1 -1
- package/types/scene/export.d.ts +182 -10
- package/types/scene/index.d.ts +1 -1
- package/types/scene/scroll.d.ts +1 -1
- package/types/scene/scrollbars.d.ts +2 -6
- package/types/scene/selection.d.ts +27 -6
- package/types/scene/types.d.ts +69 -26
- package/types/snapping.d.ts +108 -0
- package/types/types.d.ts +196 -81
- package/types/utility-types.d.ts +24 -0
- package/types/utils.d.ts +78 -12
- package/types/zindex.d.ts +4 -4
- package/types/components/ActiveFile.d.ts +0 -7
- package/types/components/ClearCanvas.d.ts +0 -4
- package/types/components/CollabButton.d.ts +0 -6
- package/types/components/ColorPicker.d.ts +0 -14
- package/types/components/Footer.d.ts +0 -10
- package/types/components/LibraryButton.d.ts +0 -8
- package/types/components/MenuItem.d.ts +0 -11
- package/types/components/MenuUtils.d.ts +0 -1
- package/types/components/SingleLibraryItem.d.ts +0 -10
- package/types/components/WelcomeScreen.d.ts +0 -10
- package/types/components/WelcomeScreenDecor.d.ts +0 -6
- package/types/components/hoc/withUpstreamOverride.d.ts +0 -10
- /package/dist/excalidraw-assets/{vendor-2002fe1b8862917b36c1.js.LICENSE.txt → vendor-d415b28e9024dee4bb1b.js.LICENSE.txt} +0 -0
- /package/types/packages/excalidraw/dist/excalidraw-assets/{vendor-2002fe1b8862917b36c1.d.ts → vendor-d415b28e9024dee4bb1b.d.ts} +0 -0
- /package/types/packages/excalidraw/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.d.ts → vendor-a14cd58fa2db417e42b2.d.ts} +0 -0
package/types/scene/types.d.ts
CHANGED
|
@@ -1,49 +1,79 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { RoughCanvas } from "roughjs/bin/canvas";
|
|
2
|
+
import { Drawable } from "roughjs/bin/core";
|
|
3
|
+
import { ExcalidrawTextElement, NonDeletedExcalidrawElement } from "../element/types";
|
|
4
|
+
import { AppClassProperties, InteractiveCanvasAppState, StaticCanvasAppState } from "../types";
|
|
5
|
+
export type RenderConfig = {};
|
|
6
|
+
export type StaticCanvasRenderConfig = {
|
|
7
|
+
imageCache: AppClassProperties["imageCache"];
|
|
8
|
+
renderGrid: boolean;
|
|
9
|
+
/** when exporting the behavior is slightly different (e.g. we can't use
|
|
10
|
+
CSS filters), and we disable render optimizations for best output */
|
|
11
|
+
isExporting: boolean;
|
|
6
12
|
/** null indicates transparent bg */
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
13
|
+
canvasBackgroundColor: string | null;
|
|
14
|
+
};
|
|
15
|
+
export type InteractiveCanvasRenderConfig = {
|
|
16
|
+
remoteSelectedElementIds: {
|
|
17
|
+
[elementId: string]: string[];
|
|
18
|
+
};
|
|
11
19
|
remotePointerViewportCoords: {
|
|
12
20
|
[id: string]: {
|
|
13
21
|
x: number;
|
|
14
22
|
y: number;
|
|
15
23
|
};
|
|
16
24
|
};
|
|
17
|
-
|
|
18
|
-
[id: string]: string
|
|
19
|
-
};
|
|
20
|
-
remoteSelectedElementIds: {
|
|
21
|
-
[elementId: string]: string[];
|
|
25
|
+
remotePointerUserStates: {
|
|
26
|
+
[id: string]: string;
|
|
22
27
|
};
|
|
23
28
|
remotePointerUsernames: {
|
|
24
29
|
[id: string]: string;
|
|
25
30
|
};
|
|
26
|
-
|
|
27
|
-
[id: string]: string;
|
|
31
|
+
remotePointerButton?: {
|
|
32
|
+
[id: string]: string | undefined;
|
|
28
33
|
};
|
|
29
|
-
imageCache: AppClassProperties["imageCache"];
|
|
30
|
-
renderScrollbars?: boolean;
|
|
31
|
-
renderSelection?: boolean;
|
|
32
|
-
renderGrid?: boolean;
|
|
33
|
-
/** when exporting the behavior is slightly different (e.g. we can't use
|
|
34
|
-
CSS filters), and we disable render optimizations for best output */
|
|
35
|
-
isExporting: boolean;
|
|
36
34
|
selectionColor?: string;
|
|
35
|
+
renderScrollbars?: boolean;
|
|
36
|
+
};
|
|
37
|
+
export type RenderInteractiveSceneCallback = {
|
|
38
|
+
atLeastOneVisibleElement: boolean;
|
|
39
|
+
elements: readonly NonDeletedExcalidrawElement[];
|
|
40
|
+
scrollBars?: ScrollBars;
|
|
37
41
|
};
|
|
38
|
-
export
|
|
42
|
+
export type StaticSceneRenderConfig = {
|
|
43
|
+
canvas: HTMLCanvasElement;
|
|
44
|
+
rc: RoughCanvas;
|
|
45
|
+
elements: readonly NonDeletedExcalidrawElement[];
|
|
46
|
+
visibleElements: readonly NonDeletedExcalidrawElement[];
|
|
47
|
+
/**
|
|
48
|
+
* canvas scale factor. Not related to zoom. In browsers, it's the
|
|
49
|
+
* devicePixelRatio. For export, it's the `appState.exportScale`
|
|
50
|
+
* (user setting) or whatever scale you want to use when exporting elsewhere.
|
|
51
|
+
*
|
|
52
|
+
* Bigger the scale, the more pixels (=quality).
|
|
53
|
+
*/
|
|
54
|
+
scale: number;
|
|
55
|
+
appState: StaticCanvasAppState;
|
|
56
|
+
renderConfig: StaticCanvasRenderConfig;
|
|
57
|
+
};
|
|
58
|
+
export type InteractiveSceneRenderConfig = {
|
|
59
|
+
canvas: HTMLCanvasElement | null;
|
|
60
|
+
elements: readonly NonDeletedExcalidrawElement[];
|
|
61
|
+
visibleElements: readonly NonDeletedExcalidrawElement[];
|
|
62
|
+
selectedElements: readonly NonDeletedExcalidrawElement[];
|
|
63
|
+
scale: number;
|
|
64
|
+
appState: InteractiveCanvasAppState;
|
|
65
|
+
renderConfig: InteractiveCanvasRenderConfig;
|
|
66
|
+
callback: (data: RenderInteractiveSceneCallback) => void;
|
|
67
|
+
};
|
|
68
|
+
export type SceneScroll = {
|
|
39
69
|
scrollX: number;
|
|
40
70
|
scrollY: number;
|
|
41
71
|
};
|
|
42
72
|
export interface Scene {
|
|
43
73
|
elements: ExcalidrawTextElement[];
|
|
44
74
|
}
|
|
45
|
-
export
|
|
46
|
-
export
|
|
75
|
+
export type ExportType = "png" | "clipboard" | "clipboard-svg" | "backend" | "svg";
|
|
76
|
+
export type ScrollBars = {
|
|
47
77
|
horizontal: {
|
|
48
78
|
x: number;
|
|
49
79
|
y: number;
|
|
@@ -57,3 +87,16 @@ export declare type ScrollBars = {
|
|
|
57
87
|
height: number;
|
|
58
88
|
} | null;
|
|
59
89
|
};
|
|
90
|
+
export type ElementShape = Drawable | Drawable[] | null;
|
|
91
|
+
export type ElementShapes = {
|
|
92
|
+
rectangle: Drawable;
|
|
93
|
+
ellipse: Drawable;
|
|
94
|
+
diamond: Drawable;
|
|
95
|
+
embeddable: Drawable;
|
|
96
|
+
freedraw: Drawable | null;
|
|
97
|
+
arrow: Drawable[];
|
|
98
|
+
line: Drawable[];
|
|
99
|
+
text: null;
|
|
100
|
+
image: null;
|
|
101
|
+
frame: null;
|
|
102
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { Bounds } from "./element/bounds";
|
|
2
|
+
import { MaybeTransformHandleType } from "./element/transformHandles";
|
|
3
|
+
import { ExcalidrawElement, NonDeletedExcalidrawElement } from "./element/types";
|
|
4
|
+
import { AppState, KeyboardModifiersObject, Point } from "./types";
|
|
5
|
+
export declare const getSnapDistance: (zoomValue: number) => number;
|
|
6
|
+
type Vector2D = {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
};
|
|
10
|
+
type PointPair = [Point, Point];
|
|
11
|
+
export type PointSnap = {
|
|
12
|
+
type: "point";
|
|
13
|
+
points: PointPair;
|
|
14
|
+
offset: number;
|
|
15
|
+
};
|
|
16
|
+
export type Gap = {
|
|
17
|
+
startBounds: Bounds;
|
|
18
|
+
endBounds: Bounds;
|
|
19
|
+
startSide: [Point, Point];
|
|
20
|
+
endSide: [Point, Point];
|
|
21
|
+
overlap: [number, number];
|
|
22
|
+
length: number;
|
|
23
|
+
};
|
|
24
|
+
export type GapSnap = {
|
|
25
|
+
type: "gap";
|
|
26
|
+
direction: "center_horizontal" | "center_vertical" | "side_left" | "side_right" | "side_top" | "side_bottom";
|
|
27
|
+
gap: Gap;
|
|
28
|
+
offset: number;
|
|
29
|
+
};
|
|
30
|
+
export type GapSnaps = GapSnap[];
|
|
31
|
+
export type Snap = GapSnap | PointSnap;
|
|
32
|
+
export type Snaps = Snap[];
|
|
33
|
+
export type PointSnapLine = {
|
|
34
|
+
type: "points";
|
|
35
|
+
points: Point[];
|
|
36
|
+
};
|
|
37
|
+
export type PointerSnapLine = {
|
|
38
|
+
type: "pointer";
|
|
39
|
+
points: PointPair;
|
|
40
|
+
direction: "horizontal" | "vertical";
|
|
41
|
+
};
|
|
42
|
+
export type GapSnapLine = {
|
|
43
|
+
type: "gap";
|
|
44
|
+
direction: "horizontal" | "vertical";
|
|
45
|
+
points: PointPair;
|
|
46
|
+
};
|
|
47
|
+
export type SnapLine = PointSnapLine | GapSnapLine | PointerSnapLine;
|
|
48
|
+
export declare class SnapCache {
|
|
49
|
+
private static referenceSnapPoints;
|
|
50
|
+
private static visibleGaps;
|
|
51
|
+
static setReferenceSnapPoints: (snapPoints: Point[] | null) => void;
|
|
52
|
+
static getReferenceSnapPoints: () => (readonly [number, number])[] | null;
|
|
53
|
+
static setVisibleGaps: (gaps: {
|
|
54
|
+
verticalGaps: Gap[];
|
|
55
|
+
horizontalGaps: Gap[];
|
|
56
|
+
} | null) => void;
|
|
57
|
+
static getVisibleGaps: () => {
|
|
58
|
+
verticalGaps: Gap[];
|
|
59
|
+
horizontalGaps: Gap[];
|
|
60
|
+
} | null;
|
|
61
|
+
static destroy: () => void;
|
|
62
|
+
}
|
|
63
|
+
export declare const isSnappingEnabled: ({ event, appState, selectedElements, }: {
|
|
64
|
+
appState: AppState;
|
|
65
|
+
event: KeyboardModifiersObject;
|
|
66
|
+
selectedElements: NonDeletedExcalidrawElement[];
|
|
67
|
+
}) => boolean;
|
|
68
|
+
export declare const areRoughlyEqual: (a: number, b: number, precision?: number) => boolean;
|
|
69
|
+
export declare const getElementsCorners: (elements: ExcalidrawElement[], { omitCenter, boundingBoxCorners, dragOffset, }?: {
|
|
70
|
+
omitCenter?: boolean | undefined;
|
|
71
|
+
boundingBoxCorners?: boolean | undefined;
|
|
72
|
+
dragOffset?: Vector2D | undefined;
|
|
73
|
+
}) => Point[];
|
|
74
|
+
export declare const getVisibleGaps: (elements: readonly NonDeletedExcalidrawElement[], selectedElements: ExcalidrawElement[], appState: AppState) => {
|
|
75
|
+
horizontalGaps: Gap[];
|
|
76
|
+
verticalGaps: Gap[];
|
|
77
|
+
};
|
|
78
|
+
export declare const getReferenceSnapPoints: (elements: readonly NonDeletedExcalidrawElement[], selectedElements: ExcalidrawElement[], appState: AppState) => (readonly [number, number])[];
|
|
79
|
+
export declare const snapDraggedElements: (selectedElements: ExcalidrawElement[], dragOffset: Vector2D, appState: AppState, event: KeyboardModifiersObject) => {
|
|
80
|
+
snapOffset: {
|
|
81
|
+
x: number;
|
|
82
|
+
y: number;
|
|
83
|
+
};
|
|
84
|
+
snapLines: (PointSnapLine | GapSnapLine)[];
|
|
85
|
+
};
|
|
86
|
+
export declare const snapResizingElements: (selectedElements: ExcalidrawElement[], selectedOriginalElements: ExcalidrawElement[], appState: AppState, event: KeyboardModifiersObject, dragOffset: Vector2D, transformHandle: MaybeTransformHandleType) => {
|
|
87
|
+
snapOffset: {
|
|
88
|
+
x: number;
|
|
89
|
+
y: number;
|
|
90
|
+
};
|
|
91
|
+
snapLines: PointSnapLine[];
|
|
92
|
+
};
|
|
93
|
+
export declare const snapNewElement: (draggingElement: ExcalidrawElement, appState: AppState, event: KeyboardModifiersObject, origin: Vector2D, dragOffset: Vector2D) => {
|
|
94
|
+
snapOffset: {
|
|
95
|
+
x: number;
|
|
96
|
+
y: number;
|
|
97
|
+
};
|
|
98
|
+
snapLines: PointSnapLine[];
|
|
99
|
+
};
|
|
100
|
+
export declare const getSnapLinesAtPointer: (elements: readonly ExcalidrawElement[], appState: AppState, pointer: Vector2D, event: KeyboardModifiersObject) => {
|
|
101
|
+
originOffset: {
|
|
102
|
+
x: number;
|
|
103
|
+
y: number;
|
|
104
|
+
};
|
|
105
|
+
snapLines: PointerSnapLine[];
|
|
106
|
+
};
|
|
107
|
+
export declare const isActiveToolNonLinearSnappable: (activeToolType: AppState["activeTool"]["type"]) => boolean;
|
|
108
|
+
export {};
|