@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.
Files changed (232) hide show
  1. package/CHANGELOG.md +706 -0
  2. package/README.md +18 -1422
  3. package/dist/excalidraw-assets/{vendor-2002fe1b8862917b36c1.js → vendor-d415b28e9024dee4bb1b.js} +2 -2
  4. package/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.js → vendor-a14cd58fa2db417e42b2.js} +6 -6
  5. package/dist/excalidraw.development.js +3035 -1464
  6. package/dist/excalidraw.production.min.js +1 -1
  7. package/dist/excalidraw.production.min.js.LICENSE.txt +20 -0
  8. package/main.js +1 -8
  9. package/package.json +9 -4
  10. package/types/actions/actionAddToLibrary.d.ts +130 -52
  11. package/types/actions/actionAlign.d.ts +25 -32
  12. package/types/actions/actionBoundText.d.ts +191 -22
  13. package/types/actions/actionCanvas.d.ts +774 -174
  14. package/types/actions/actionClipboard.d.ts +232 -88
  15. package/types/actions/actionDeleteSelected.d.ts +129 -57
  16. package/types/actions/actionDistribute.d.ts +7 -12
  17. package/types/actions/actionDuplicateSelection.d.ts +2 -5
  18. package/types/actions/actionElementLock.d.ts +283 -0
  19. package/types/actions/actionExport.d.ts +448 -229
  20. package/types/actions/actionFinalize.d.ts +87 -41
  21. package/types/actions/actionFlip.d.ts +4 -7
  22. package/types/actions/actionFrame.d.ts +441 -0
  23. package/types/actions/actionGroup.d.ts +260 -15
  24. package/types/actions/actionHistory.d.ts +1 -1
  25. package/types/actions/actionLinearEditor.d.ts +46 -20
  26. package/types/actions/actionMenu.d.ts +136 -65
  27. package/types/actions/actionNavigate.d.ts +2 -3
  28. package/types/actions/actionProperties.d.ts +590 -277
  29. package/types/actions/actionSelectAll.d.ts +127 -2
  30. package/types/actions/actionStyles.d.ts +44 -19
  31. package/types/actions/actionToggleGridMode.d.ts +46 -19
  32. package/types/actions/{actionToggleLock.d.ts → actionToggleObjectsSnapMode.d.ts} +58 -31
  33. package/types/actions/actionToggleStats.d.ts +45 -19
  34. package/types/actions/actionToggleViewMode.d.ts +46 -19
  35. package/types/actions/actionToggleZenMode.d.ts +46 -19
  36. package/types/actions/actionZindex.d.ts +8 -16
  37. package/types/actions/index.d.ts +2 -1
  38. package/types/actions/manager.d.ts +3 -2
  39. package/types/actions/shortcuts.d.ts +2 -1
  40. package/types/actions/types.d.ts +16 -13
  41. package/types/appState.d.ts +23 -18
  42. package/types/charts.d.ts +2 -2
  43. package/types/clients.d.ts +5 -6
  44. package/types/clipboard.d.ts +3 -2
  45. package/types/colors.d.ts +60 -5
  46. package/types/components/Actions.d.ts +7 -7
  47. package/types/components/ActiveConfirmDialog.d.ts +4 -0
  48. package/types/components/App.d.ts +88 -74
  49. package/types/components/Avatar.d.ts +1 -2
  50. package/types/components/BraveMeasureTextError.d.ts +2 -0
  51. package/types/components/Button.d.ts +16 -0
  52. package/types/components/ButtonIconSelect.d.ts +11 -3
  53. package/types/components/Card.d.ts +6 -0
  54. package/types/components/ColorPicker/ColorInput.d.ts +9 -0
  55. package/types/components/ColorPicker/ColorPicker.d.ts +19 -0
  56. package/types/components/ColorPicker/CustomColorList.d.ts +8 -0
  57. package/types/components/ColorPicker/HotkeyLabel.d.ts +8 -0
  58. package/types/components/ColorPicker/Picker.d.ts +18 -0
  59. package/types/components/ColorPicker/PickerColorList.d.ts +10 -0
  60. package/types/components/ColorPicker/PickerHeading.d.ts +5 -0
  61. package/types/components/ColorPicker/ShadeList.d.ts +8 -0
  62. package/types/components/ColorPicker/TopPicks.d.ts +9 -0
  63. package/types/components/ColorPicker/colorPickerUtils.d.ts +21 -0
  64. package/types/components/ColorPicker/keyboardNavHandlers.d.ts +20 -0
  65. package/types/components/ContextMenu.d.ts +9 -22
  66. package/types/components/DefaultSidebar.d.ts +29 -0
  67. package/types/components/Dialog.d.ts +3 -4
  68. package/types/components/ErrorDialog.d.ts +3 -2
  69. package/types/components/ExcalidrawLogo.d.ts +15 -0
  70. package/types/components/EyeDropper.d.ts +28 -0
  71. package/types/components/FilledButton.d.ts +17 -0
  72. package/types/components/FixedSideContainer.d.ts +1 -1
  73. package/types/components/HandButton.d.ts +10 -0
  74. package/types/components/HelpButton.d.ts +1 -2
  75. package/types/components/HintViewer.d.ts +4 -5
  76. package/types/components/HomeButton.d.ts +1 -1
  77. package/types/components/ImageExportDialog.d.ts +8 -13
  78. package/types/components/Island.d.ts +1 -1
  79. package/types/components/JSONExportDialog.d.ts +7 -5
  80. package/types/components/LayerUI.d.ts +10 -16
  81. package/types/components/LibraryMenu.d.ts +13 -14
  82. package/types/components/LibraryMenuBrowseButton.d.ts +2 -2
  83. package/types/components/LibraryMenuControlButtons.d.ts +9 -0
  84. package/types/components/LibraryMenuHeaderContent.d.ts +10 -5
  85. package/types/components/LibraryMenuItems.d.ts +6 -7
  86. package/types/components/LibraryMenuSection.d.ts +22 -0
  87. package/types/components/LibraryUnit.d.ts +6 -3
  88. package/types/components/LoadingMessage.d.ts +0 -1
  89. package/types/components/LockButton.d.ts +1 -2
  90. package/types/components/MobileMenu.d.ts +10 -12
  91. package/types/components/OverwriteConfirm/OverwriteConfirm.d.ts +17 -0
  92. package/types/components/OverwriteConfirm/OverwriteConfirmActions.d.ts +17 -0
  93. package/types/components/OverwriteConfirm/OverwriteConfirmState.d.ts +22 -0
  94. package/types/components/PasteChartDialog.d.ts +4 -5
  95. package/types/components/PenModeButton.d.ts +1 -1
  96. package/types/components/Popover.d.ts +1 -1
  97. package/types/components/ProjectName.d.ts +2 -1
  98. package/types/components/PublishLibrary.d.ts +2 -2
  99. package/types/components/RadioGroup.d.ts +12 -0
  100. package/types/components/Section.d.ts +1 -1
  101. package/types/components/Sidebar/Sidebar.d.ts +66 -63
  102. package/types/components/Sidebar/SidebarHeader.d.ts +6 -19
  103. package/types/components/Sidebar/SidebarTab.d.ts +8 -0
  104. package/types/components/Sidebar/SidebarTabTrigger.d.ts +9 -0
  105. package/types/components/Sidebar/SidebarTabTriggers.d.ts +6 -0
  106. package/types/components/Sidebar/SidebarTabs.d.ts +6 -0
  107. package/types/components/Sidebar/SidebarTrigger.d.ts +6 -0
  108. package/types/components/Sidebar/common.d.ts +24 -7
  109. package/types/components/Spinner.d.ts +2 -1
  110. package/types/components/Stack.d.ts +4 -3
  111. package/types/components/Stats.d.ts +3 -3
  112. package/types/components/Switch.d.ts +9 -0
  113. package/types/components/ToolButton.d.ts +6 -5
  114. package/types/components/Tooltip.d.ts +1 -1
  115. package/types/components/Trans.d.ts +9 -0
  116. package/types/components/UserList.d.ts +0 -2
  117. package/types/components/canvases/InteractiveCanvas.d.ts +27 -0
  118. package/types/components/canvases/StaticCanvas.d.ts +18 -0
  119. package/types/components/canvases/index.d.ts +3 -0
  120. package/types/components/dropdownMenu/DropdownMenu.d.ts +67 -0
  121. package/types/components/dropdownMenu/DropdownMenuContent.d.ts +15 -0
  122. package/types/components/dropdownMenu/DropdownMenuGroup.d.ts +11 -0
  123. package/types/components/dropdownMenu/DropdownMenuItem.d.ts +12 -0
  124. package/types/components/dropdownMenu/DropdownMenuItemContent.d.ts +6 -0
  125. package/types/components/dropdownMenu/DropdownMenuItemCustom.d.ts +6 -0
  126. package/types/components/dropdownMenu/DropdownMenuItemLink.d.ts +13 -0
  127. package/types/components/dropdownMenu/DropdownMenuSeparator.d.ts +5 -0
  128. package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +10 -0
  129. package/types/components/dropdownMenu/common.d.ts +6 -0
  130. package/types/components/dropdownMenu/dropdownMenuUtils.d.ts +3 -0
  131. package/types/components/footer/Footer.d.ts +12 -0
  132. package/types/components/footer/FooterCenter.d.ts +8 -0
  133. package/types/components/hoc/withInternalFallback.d.ts +4 -0
  134. package/types/components/icons.d.ts +15 -2
  135. package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +9 -0
  136. package/types/components/main-menu/DefaultItems.d.ts +47 -0
  137. package/types/components/main-menu/MainMenu.d.ts +61 -0
  138. package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +57 -0
  139. package/types/components/welcome-screen/WelcomeScreen.Hints.d.ts +19 -0
  140. package/types/components/welcome-screen/WelcomeScreen.d.ts +84 -0
  141. package/types/constants.d.ts +94 -18
  142. package/types/context/tunnels.d.ts +19 -0
  143. package/types/context/ui-appState.d.ts +4 -0
  144. package/types/data/blob.d.ts +3 -2
  145. package/types/data/encode.d.ts +1 -1
  146. package/types/data/filesystem.d.ts +2 -1
  147. package/types/data/index.d.ts +1 -1
  148. package/types/data/library.d.ts +3 -45
  149. package/types/data/restore.d.ts +10 -4
  150. package/types/data/transform.d.ts +71 -0
  151. package/types/data/types.d.ts +3 -5
  152. package/types/data/url.d.ts +7 -0
  153. package/types/element/Hyperlink.d.ts +57 -30
  154. package/types/element/binding.d.ts +4 -3
  155. package/types/element/bounds.d.ts +31 -7
  156. package/types/element/collision.d.ts +7 -7
  157. package/types/element/dragElements.d.ts +12 -2
  158. package/types/element/embeddable.d.ts +159 -0
  159. package/types/element/image.d.ts +11 -1
  160. package/types/element/index.d.ts +3 -2
  161. package/types/element/linearElementEditor.d.ts +49 -24
  162. package/types/element/mutateElement.d.ts +2 -1
  163. package/types/element/newElement.d.ts +48 -15
  164. package/types/element/resizeElements.d.ts +3 -2
  165. package/types/element/showSelectedShapeActions.d.ts +2 -2
  166. package/types/element/sizeHelpers.d.ts +8 -1
  167. package/types/element/sortElements.d.ts +2 -0
  168. package/types/element/textElement.d.ts +44 -11
  169. package/types/element/textWysiwyg.d.ts +7 -2
  170. package/types/element/transformHandles.d.ts +15 -8
  171. package/types/element/typeChecks.d.ts +13 -2
  172. package/types/element/types.d.ts +64 -36
  173. package/types/emitter.d.ts +1 -1
  174. package/types/errors.d.ts +1 -1
  175. package/types/frame.d.ts +40 -0
  176. package/types/ga.d.ts +5 -5
  177. package/types/groups.d.ts +15 -11
  178. package/types/history.d.ts +3 -3
  179. package/types/hooks/useCreatePortalContainer.d.ts +4 -0
  180. package/types/hooks/useLibraryItemSvg.d.ts +11 -0
  181. package/types/hooks/useOutsideClick.d.ts +19 -2
  182. package/types/hooks/useScrollPosition.d.ts +1 -0
  183. package/types/hooks/useStable.d.ts +1 -0
  184. package/types/hooks/useTransition.d.ts +2 -0
  185. package/types/i18n.d.ts +11 -2
  186. package/types/jotai.d.ts +20 -108
  187. package/types/keys.d.ts +7 -4
  188. package/types/math.d.ts +6 -1
  189. package/types/packages/excalidraw/example/App.d.ts +7 -1
  190. package/types/packages/excalidraw/example/CustomFooter.d.ts +5 -0
  191. package/types/packages/excalidraw/example/MobileFooter.d.ts +5 -0
  192. package/types/packages/excalidraw/example/initialData.d.ts +182 -64
  193. package/types/packages/excalidraw/index.d.ts +19 -3
  194. package/types/packages/excalidraw/main.d.ts +3 -1
  195. package/types/packages/excalidraw/webpack.dev.config.d.ts +5 -2
  196. package/types/packages/excalidraw/webpack.prod.config.d.ts +3 -0
  197. package/types/packages/utils.d.ts +28 -24
  198. package/types/renderer/renderElement.d.ts +12 -22
  199. package/types/renderer/renderScene.d.ts +19 -29
  200. package/types/renderer/renderSnaps.d.ts +2 -0
  201. package/types/renderer/roundRect.d.ts +1 -1
  202. package/types/scene/Renderer.d.ts +25 -0
  203. package/types/scene/Scene.d.ts +27 -5
  204. package/types/scene/Shape.d.ts +12 -0
  205. package/types/scene/ShapeCache.d.ts +20 -0
  206. package/types/scene/comparisons.d.ts +1 -1
  207. package/types/scene/export.d.ts +182 -10
  208. package/types/scene/index.d.ts +1 -1
  209. package/types/scene/scroll.d.ts +1 -1
  210. package/types/scene/scrollbars.d.ts +2 -6
  211. package/types/scene/selection.d.ts +27 -6
  212. package/types/scene/types.d.ts +69 -26
  213. package/types/snapping.d.ts +108 -0
  214. package/types/types.d.ts +196 -81
  215. package/types/utility-types.d.ts +24 -0
  216. package/types/utils.d.ts +78 -12
  217. package/types/zindex.d.ts +4 -4
  218. package/types/components/ActiveFile.d.ts +0 -7
  219. package/types/components/ClearCanvas.d.ts +0 -4
  220. package/types/components/CollabButton.d.ts +0 -6
  221. package/types/components/ColorPicker.d.ts +0 -14
  222. package/types/components/Footer.d.ts +0 -10
  223. package/types/components/LibraryButton.d.ts +0 -8
  224. package/types/components/MenuItem.d.ts +0 -11
  225. package/types/components/MenuUtils.d.ts +0 -1
  226. package/types/components/SingleLibraryItem.d.ts +0 -10
  227. package/types/components/WelcomeScreen.d.ts +0 -10
  228. package/types/components/WelcomeScreenDecor.d.ts +0 -6
  229. package/types/components/hoc/withUpstreamOverride.d.ts +0 -10
  230. /package/dist/excalidraw-assets/{vendor-2002fe1b8862917b36c1.js.LICENSE.txt → vendor-d415b28e9024dee4bb1b.js.LICENSE.txt} +0 -0
  231. /package/types/packages/excalidraw/dist/excalidraw-assets/{vendor-2002fe1b8862917b36c1.d.ts → vendor-d415b28e9024dee4bb1b.d.ts} +0 -0
  232. /package/types/packages/excalidraw/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.d.ts → vendor-a14cd58fa2db417e42b2.d.ts} +0 -0
@@ -1,34 +1,38 @@
1
- import { AppState, BinaryFiles } from "../types";
2
- import { ExcalidrawElement, NonDeleted } from "../element/types";
1
+ import { ExportToCanvasConfig, ExportToCanvasData } from "../scene/export";
3
2
  import { MIME_TYPES } from "../constants";
4
3
  export { MIME_TYPES };
5
- declare type ExportOpts = {
6
- elements: readonly NonDeleted<ExcalidrawElement>[];
7
- appState?: Partial<Omit<AppState, "offsetTop" | "offsetLeft">>;
8
- files: BinaryFiles | null;
9
- maxWidthOrHeight?: number;
10
- getDimensions?: (width: number, height: number) => {
11
- width: number;
12
- height: number;
13
- scale?: number;
14
- };
15
- };
16
- export declare const exportToCanvas: ({ elements, appState, files, maxWidthOrHeight, getDimensions, exportPadding, }: ExportOpts & {
17
- exportPadding?: number | undefined;
18
- }) => Promise<HTMLCanvasElement>;
19
- export declare const exportToBlob: (opts: ExportOpts & {
4
+ type ExportToBlobConfig = ExportToCanvasConfig & {
20
5
  mimeType?: string;
21
6
  quality?: number;
7
+ };
8
+ type ExportToSvgConfig = Pick<ExportToCanvasConfig, "canvasBackgroundColor" | "padding" | "theme"> & {
22
9
  exportPadding?: number;
10
+ renderEmbeddables?: boolean;
11
+ };
12
+ export declare const exportToBlob: ({ data, config, }: {
13
+ data: ExportToCanvasData;
14
+ config?: ExportToBlobConfig | undefined;
23
15
  }) => Promise<Blob>;
24
- export declare const exportToSvg: ({ elements, appState, files, exportPadding, }: Omit<ExportOpts, "getDimensions"> & {
25
- exportPadding?: number | undefined;
16
+ export declare const exportToSvg: ({ data, config, }: {
17
+ data: ExportToCanvasData;
18
+ config?: ExportToSvgConfig | undefined;
26
19
  }) => Promise<SVGSVGElement>;
27
- export declare const exportToClipboard: (opts: ExportOpts & {
28
- mimeType?: string;
29
- quality?: number;
30
- type: "png" | "svg" | "json";
31
- }) => Promise<void>;
20
+ export declare const exportToCanvas: ({ data, config, }: {
21
+ data: ExportToCanvasData;
22
+ config?: ExportToCanvasConfig | undefined;
23
+ }) => Promise<HTMLCanvasElement>;
24
+ export declare const exportToClipboard: ({ type, data, config, }: {
25
+ data: ExportToCanvasData;
26
+ } & ({
27
+ type: "png";
28
+ config?: ExportToBlobConfig | undefined;
29
+ } | {
30
+ type: "svg";
31
+ config?: ExportToSvgConfig | undefined;
32
+ } | {
33
+ type: "json";
34
+ config?: undefined;
35
+ })) => Promise<void>;
32
36
  export { serializeAsJSON, serializeLibraryAsJSON } from "../data/json";
33
37
  export { loadFromBlob, loadSceneOrLibraryFromBlob, loadLibraryFromBlob, } from "../data/blob";
34
38
  export { getFreeDrawSvgPath } from "../renderer/renderElement";
@@ -1,36 +1,26 @@
1
1
  import { ExcalidrawElement, ExcalidrawTextElement, NonDeletedExcalidrawElement, ExcalidrawFreeDrawElement } from "../element/types";
2
- import { RoughCanvas } from "roughjs/bin/canvas";
3
- import { Drawable, Options } from "roughjs/bin/core";
4
- import { RoughSVG } from "roughjs/bin/svg";
5
- import { RenderConfig } from "../scene/types";
6
- import { AppState, BinaryFiles, Zoom } from "../types";
2
+ import type { RoughCanvas } from "roughjs/bin/canvas";
3
+ import type { RoughSVG } from "roughjs/bin/svg";
4
+ import { StaticCanvasRenderConfig } from "../scene/types";
5
+ import { AppState, StaticCanvasAppState, BinaryFiles, InteractiveCanvasAppState } from "../types";
7
6
  export interface ExcalidrawElementWithCanvas {
8
7
  element: ExcalidrawElement | ExcalidrawTextElement;
9
8
  canvas: HTMLCanvasElement;
10
- theme: RenderConfig["theme"];
11
- canvasZoom: Zoom["value"];
9
+ theme: AppState["theme"];
10
+ scale: number;
11
+ zoomValue: AppState["zoom"]["value"];
12
12
  canvasOffsetX: number;
13
13
  canvasOffsetY: number;
14
14
  boundTextElementVersion: number | null;
15
+ containingFrameOpacity: number;
15
16
  }
16
17
  export declare const DEFAULT_LINK_SIZE = 14;
17
- declare type ElementShape = Drawable | Drawable[] | null;
18
- declare type ElementShapes = {
19
- freedraw: Drawable | null;
20
- arrow: Drawable[];
21
- line: Drawable[];
22
- text: null;
23
- image: null;
24
- };
25
- export declare const getShapeForElement: <T extends ExcalidrawElement>(element: T) => T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] | undefined : Drawable | null | undefined;
26
- export declare const setShapeForElement: <T extends ExcalidrawElement>(element: T, shape: T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] : Drawable) => WeakMap<ExcalidrawElement, ElementShape>;
27
- export declare const invalidateShapeForElement: (element: ExcalidrawElement) => boolean;
18
+ export declare let elementWithCanvasCache: WeakMap<ExcalidrawElement, ExcalidrawElementWithCanvas>;
28
19
  export declare const clearRenderCache: () => void;
29
- export declare const generateRoughOptions: (element: ExcalidrawElement, continuousPath?: boolean) => Options;
30
- export declare const renderElement: (element: NonDeletedExcalidrawElement, rc: RoughCanvas, context: CanvasRenderingContext2D, renderConfig: RenderConfig, appState: AppState) => void;
31
- export declare const renderElementToSvg: (element: NonDeletedExcalidrawElement, rsvg: RoughSVG, svgRoot: SVGElement, files: BinaryFiles, offsetX: number, offsetY: number, exportWithDarkMode?: boolean) => void;
20
+ export declare const renderSelectionElement: (element: NonDeletedExcalidrawElement, context: CanvasRenderingContext2D, appState: InteractiveCanvasAppState) => void;
21
+ export declare const renderElement: (element: NonDeletedExcalidrawElement, rc: RoughCanvas, context: CanvasRenderingContext2D, renderConfig: StaticCanvasRenderConfig, appState: StaticCanvasAppState) => void;
22
+ export declare const renderElementToSvg: (element: NonDeletedExcalidrawElement, rsvg: RoughSVG, svgRoot: SVGElement, files: BinaryFiles, offsetX: number, offsetY: number, exportWithDarkMode?: boolean, exportingFrameId?: string | null, renderEmbeddables?: boolean) => void;
32
23
  export declare let pathsCache: WeakMap<ExcalidrawFreeDrawElement, Path2D>;
33
24
  export declare function generateFreeDrawShape(element: ExcalidrawFreeDrawElement): Path2D;
34
25
  export declare function getFreeDrawPath2D(element: ExcalidrawFreeDrawElement): Path2D | undefined;
35
26
  export declare function getFreeDrawSvgPath(element: ExcalidrawFreeDrawElement): string;
36
- export {};
@@ -1,41 +1,31 @@
1
- import { RoughCanvas } from "roughjs/bin/canvas";
2
1
  import { RoughSVG } from "roughjs/bin/svg";
3
- import { AppState, BinaryFiles } from "../types";
2
+ import { BinaryFiles } from "../types";
4
3
  import { NonDeletedExcalidrawElement } from "../element/types";
5
- import { RenderConfig } from "../scene/types";
4
+ import { InteractiveSceneRenderConfig, StaticSceneRenderConfig } from "../scene/types";
5
+ import "canvas-roundrect-polyfill";
6
6
  export declare const DEFAULT_SPACING = 2;
7
- export declare const _renderScene: ({ elements, appState, scale, rc, canvas, renderConfig, }: {
8
- elements: readonly NonDeletedExcalidrawElement[];
9
- appState: AppState;
10
- scale: number;
11
- rc: RoughCanvas;
12
- canvas: HTMLCanvasElement;
13
- renderConfig: RenderConfig;
14
- }) => {
7
+ /**
8
+ * Interactive scene is the ui-canvas where we render boundinb boxes, selections
9
+ * and other ui stuff.
10
+ */
11
+ export declare const renderInteractiveScene: <U extends ({ canvas, elements, visibleElements, selectedElements, scale, appState, renderConfig, }: InteractiveSceneRenderConfig) => {
15
12
  atLeastOneVisibleElement: boolean;
16
- scrollBars?: undefined;
17
- } | {
18
- atLeastOneVisibleElement: boolean;
19
- scrollBars: import("../scene/types").ScrollBars | undefined;
20
- };
21
- /** renderScene throttled to animation framerate */
22
- export declare const renderScene: <T extends boolean = false>(config: {
23
13
  elements: readonly NonDeletedExcalidrawElement[];
24
- appState: AppState;
25
- scale: number;
26
- rc: RoughCanvas;
27
- canvas: HTMLCanvasElement;
28
- renderConfig: RenderConfig;
29
- callback?: ((data: ReturnType<typeof _renderScene>) => void) | undefined;
30
- }, throttle?: T | undefined) => T extends true ? void : {
31
- atLeastOneVisibleElement: boolean;
32
14
  scrollBars?: undefined;
33
15
  } | {
34
- atLeastOneVisibleElement: boolean;
35
16
  scrollBars: import("../scene/types").ScrollBars | undefined;
36
- };
37
- export declare const renderSceneToSvg: (elements: readonly NonDeletedExcalidrawElement[], rsvg: RoughSVG, svgRoot: SVGElement, files: BinaryFiles, { offsetX, offsetY, exportWithDarkMode, }?: {
17
+ atLeastOneVisibleElement: boolean;
18
+ elements: readonly NonDeletedExcalidrawElement[];
19
+ }, T extends boolean = false>(renderConfig: InteractiveSceneRenderConfig, throttle?: T | undefined) => T extends true ? void : ReturnType<U>;
20
+ /**
21
+ * Static scene is the non-ui canvas where we render elements.
22
+ */
23
+ export declare const renderStaticScene: (renderConfig: StaticSceneRenderConfig, throttle?: boolean) => void;
24
+ export declare const cancelRender: () => void;
25
+ export declare const renderSceneToSvg: (elements: readonly NonDeletedExcalidrawElement[], rsvg: RoughSVG, svgRoot: SVGElement, files: BinaryFiles, { offsetX, offsetY, exportWithDarkMode, exportingFrameId, renderEmbeddables, }?: {
38
26
  offsetX?: number | undefined;
39
27
  offsetY?: number | undefined;
40
28
  exportWithDarkMode?: boolean | undefined;
29
+ exportingFrameId?: string | null | undefined;
30
+ renderEmbeddables?: boolean | undefined;
41
31
  }) => void;
@@ -0,0 +1,2 @@
1
+ import { InteractiveCanvasAppState } from "../types";
2
+ export declare const renderSnaps: (context: CanvasRenderingContext2D, appState: InteractiveCanvasAppState) => void;
@@ -8,4 +8,4 @@
8
8
  * @param {Number} height The height of the rectangle
9
9
  * @param {Number} radius The corner radius
10
10
  */
11
- export declare const roundRect: (context: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, radius: number) => void;
11
+ export declare const roundRect: (context: CanvasRenderingContext2D, x: number, y: number, width: number, height: number, radius: number, strokeColor?: string) => void;
@@ -0,0 +1,25 @@
1
+ import { NonDeletedExcalidrawElement } from "../element/types";
2
+ import { AppState } from "../types";
3
+ import Scene from "./Scene";
4
+ export declare class Renderer {
5
+ private scene;
6
+ constructor(scene: Scene);
7
+ getRenderableElements: ((opts: {
8
+ zoom: AppState["zoom"];
9
+ offsetLeft: AppState["offsetLeft"];
10
+ offsetTop: AppState["offsetTop"];
11
+ scrollX: AppState["scrollX"];
12
+ scrollY: AppState["scrollY"];
13
+ height: AppState["height"];
14
+ width: AppState["width"];
15
+ editingElement: AppState["editingElement"];
16
+ pendingImageElementId: AppState["pendingImageElementId"];
17
+ versionNonce: ReturnType<InstanceType<typeof Scene>["getVersionNonce"]>;
18
+ }) => {
19
+ canvasElements: NonDeletedExcalidrawElement[];
20
+ visibleElements: readonly NonDeletedExcalidrawElement[];
21
+ }) & {
22
+ clear: () => void;
23
+ };
24
+ destroy(): void;
25
+ }
@@ -1,9 +1,11 @@
1
- import { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted } from "../element/types";
1
+ import { ExcalidrawElement, NonDeletedExcalidrawElement, NonDeleted, ExcalidrawFrameElement } from "../element/types";
2
2
  import { LinearElementEditor } from "../element/linearElementEditor";
3
- declare type ElementIdKey = InstanceType<typeof LinearElementEditor>["elementId"];
4
- declare type ElementKey = ExcalidrawElement | ElementIdKey;
5
- declare type SceneStateCallback = () => void;
6
- declare type SceneStateCallbackRemover = () => void;
3
+ import { AppState } from "../types";
4
+ type ElementIdKey = InstanceType<typeof LinearElementEditor>["elementId"];
5
+ type ElementKey = ExcalidrawElement | ElementIdKey;
6
+ type SceneStateCallback = () => void;
7
+ type SceneStateCallbackRemover = () => void;
8
+ export type ExcalidrawElementsIncludingDeleted = readonly ExcalidrawElement[];
7
9
  declare class Scene {
8
10
  private static sceneMapByElement;
9
11
  private static sceneMapById;
@@ -12,10 +14,28 @@ declare class Scene {
12
14
  private callbacks;
13
15
  private nonDeletedElements;
14
16
  private elements;
17
+ private nonDeletedFrames;
18
+ private frames;
15
19
  private elementsMap;
20
+ private selectedElementsCache;
21
+ private versionNonce;
16
22
  getElementsIncludingDeleted(): readonly ExcalidrawElement[];
17
23
  getNonDeletedElements(): readonly NonDeletedExcalidrawElement[];
24
+ getFramesIncludingDeleted(): readonly ExcalidrawFrameElement[];
25
+ getSelectedElements(opts: {
26
+ selectedElementIds: AppState["selectedElementIds"];
27
+ /**
28
+ * for specific cases where you need to use elements not from current
29
+ * scene state. This in effect will likely result in cache-miss, and
30
+ * the cache won't be updated in this case.
31
+ */
32
+ elements?: readonly ExcalidrawElement[];
33
+ includeBoundTextElement?: boolean;
34
+ includeElementsInFrames?: boolean;
35
+ }): NonDeleted<ExcalidrawElement>[];
36
+ getNonDeletedFrames(): readonly NonDeleted<ExcalidrawFrameElement>[];
18
37
  getElement<T extends ExcalidrawElement>(id: T["id"]): T | null;
38
+ getVersionNonce(): number | undefined;
19
39
  getNonDeletedElement(id: ExcalidrawElement["id"]): NonDeleted<ExcalidrawElement> | null;
20
40
  /**
21
41
  * A utility method to help with updating all scene elements, with the added
@@ -35,6 +55,8 @@ declare class Scene {
35
55
  addCallback(cb: SceneStateCallback): SceneStateCallbackRemover;
36
56
  destroy(): void;
37
57
  insertElementAtIndex(element: ExcalidrawElement, index: number): void;
58
+ insertElementsAtIndex(elements: ExcalidrawElement[], index: number): void;
59
+ addNewElement: (element: ExcalidrawElement) => void;
38
60
  getElementIndex(elementId: string): number;
39
61
  }
40
62
  export default Scene;
@@ -0,0 +1,12 @@
1
+ import type { Drawable, Options } from "roughjs/bin/core";
2
+ import type { RoughGenerator } from "roughjs/bin/generator";
3
+ import type { ExcalidrawElement, NonDeletedExcalidrawElement, ExcalidrawSelectionElement } from "../element/types";
4
+ export declare const generateRoughOptions: (element: ExcalidrawElement, continuousPath?: boolean) => Options;
5
+ /**
6
+ * Generates the roughjs shape for given element.
7
+ *
8
+ * Low-level. Use `ShapeCache.generateElementShape` instead.
9
+ *
10
+ * @private
11
+ */
12
+ export declare const _generateElementShape: (element: Exclude<NonDeletedExcalidrawElement, ExcalidrawSelectionElement>, generator: RoughGenerator, isExporting?: boolean) => Drawable | Drawable[] | null;
@@ -0,0 +1,20 @@
1
+ import { Drawable } from "roughjs/bin/core";
2
+ import { ExcalidrawElement } from "../element/types";
3
+ import { ElementShape, ElementShapes } from "./types";
4
+ export declare class ShapeCache {
5
+ private static rg;
6
+ private static cache;
7
+ /**
8
+ * Retrieves shape from cache if available. Use this only if shape
9
+ * is optional and you have a fallback in case it's not cached.
10
+ */
11
+ static get: <T extends ExcalidrawElement>(element: T) => T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] | undefined : ElementShape | undefined;
12
+ static set: <T extends ExcalidrawElement>(element: T, shape: T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] : Drawable) => WeakMap<ExcalidrawElement, ElementShape>;
13
+ static delete: (element: ExcalidrawElement) => boolean;
14
+ static destroy: () => void;
15
+ /**
16
+ * Generates & caches shape for element if not already cached, otherwise
17
+ * returns cached shape.
18
+ */
19
+ static generateElementShape: <T extends import("../element/types").ExcalidrawLinearElement | import("../element/types").ExcalidrawRectangleElement | import("../element/types").ExcalidrawDiamondElement | import("../element/types").ExcalidrawEllipseElement | import("../element/types").ExcalidrawEmbeddableElement | import("../element/types").ExcalidrawImageElement | import("../element/types").ExcalidrawFrameElement | import("../element/types").ExcalidrawTextElement | import("../element/types").ExcalidrawFreeDrawElement>(element: T, isExporting?: boolean) => ((T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] | undefined : ElementShape | undefined) & ({} | null)) | (T["type"] extends keyof ElementShapes ? ElementShapes[T["type"]] : Drawable | null);
20
+ }
@@ -3,7 +3,7 @@ export declare const hasBackground: (type: string) => boolean;
3
3
  export declare const hasStrokeColor: (type: string) => boolean;
4
4
  export declare const hasStrokeWidth: (type: string) => boolean;
5
5
  export declare const hasStrokeStyle: (type: string) => boolean;
6
- export declare const canChangeSharpness: (type: string) => boolean;
6
+ export declare const canChangeRoundness: (type: string) => boolean;
7
7
  export declare const hasText: (type: string) => boolean;
8
8
  export declare const canHaveArrowheads: (type: string) => boolean;
9
9
  export declare const getElementAtPosition: (elements: readonly NonDeletedExcalidrawElement[], isAtPositionFn: (element: NonDeletedExcalidrawElement) => boolean) => NonDeletedExcalidrawElement | null;
@@ -1,13 +1,181 @@
1
- import { NonDeletedExcalidrawElement } from "../element/types";
1
+ import { NonDeletedExcalidrawElement, Theme } from "../element/types";
2
2
  import { AppState, BinaryFiles } from "../types";
3
+ import { serializeAsJSON } from "../data/json";
3
4
  export declare const SVG_EXPORT_TAG = "<!-- svg-source:excalidraw -->";
4
- export declare const exportToCanvas: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState, files: BinaryFiles, { exportBackground, exportPadding, viewBackgroundColor, }: {
5
- exportBackground: boolean;
6
- exportPadding?: number | undefined;
7
- viewBackgroundColor: string;
8
- }, createCanvas?: (width: number, height: number) => {
9
- canvas: HTMLCanvasElement;
10
- scale: number;
5
+ export type ExportToCanvasData = {
6
+ elements: readonly NonDeletedExcalidrawElement[];
7
+ appState?: Partial<Omit<AppState, "offsetTop" | "offsetLeft">>;
8
+ files: BinaryFiles | null;
9
+ };
10
+ export type ExportToCanvasConfig = {
11
+ theme?: Theme;
12
+ /**
13
+ * Canvas background. Valid values are:
14
+ *
15
+ * - `undefined` - the background of "appState.viewBackgroundColor" is used.
16
+ * - `false` - no background is used (set to "transparent").
17
+ * - `string` - should be a valid CSS color.
18
+ *
19
+ * @default undefined
20
+ */
21
+ canvasBackgroundColor?: string | false;
22
+ /**
23
+ * Canvas padding in pixels. Affected by `scale`.
24
+ *
25
+ * When `fit` is set to `none`, padding is added to the content bounding box
26
+ * (including if you set `width` or `height` or `maxWidthOrHeight` or
27
+ * `widthOrHeight`).
28
+ *
29
+ * When `fit` set to `contain`, padding is subtracted from the content
30
+ * bounding box (ensuring the size doesn't exceed the supplied values, with
31
+ * the exeception of using alongside `scale` as noted above), and the padding
32
+ * serves as a minimum distance between the content and the canvas edges, as
33
+ * it may exceed the supplied padding value from one side or the other in
34
+ * order to maintain the aspect ratio. It is recommended to set `position`
35
+ * to `center` when using `fit=contain`.
36
+ *
37
+ * When `fit` is set to `cover`, padding is disabled (set to 0).
38
+ *
39
+ * When `fit` is set to `none` and either `width` or `height` or
40
+ * `maxWidthOrHeight` is set, padding is simply adding to the bounding box
41
+ * and the content may overflow the canvas, thus right or bottom padding
42
+ * may be ignored.
43
+ *
44
+ * @default 0
45
+ */
46
+ padding?: number;
47
+ /**
48
+ * Makes sure the canvas content fits into a frame of width/height no larger
49
+ * than this value, while maintaining the aspect ratio.
50
+ *
51
+ * Final dimensions can get smaller/larger if used in conjunction with
52
+ * `scale`.
53
+ */
54
+ maxWidthOrHeight?: number;
55
+ /**
56
+ * Scale the canvas content to be excatly this many pixels wide/tall,
57
+ * maintaining the aspect ratio.
58
+ *
59
+ * Cannot be used in conjunction with `maxWidthOrHeight`.
60
+ *
61
+ * Final dimensions can get smaller/larger if used in conjunction with
62
+ * `scale`.
63
+ */
64
+ widthOrHeight?: number;
65
+ /**
66
+ * Width of the frame. Supply `x` or `y` if you want to ofsset the canvas
67
+ * content.
68
+ *
69
+ * If `width` omitted but `height` supplied, `width` is calculated from the
70
+ * the content's bounding box to preserve the aspect ratio.
71
+ *
72
+ * Defaults to the content bounding box width when both `width` and `height`
73
+ * are omitted.
74
+ */
75
+ width?: number;
76
+ /**
77
+ * Height of the frame.
78
+ *
79
+ * If `height` omitted but `width` supplied, `height` is calculated from the
80
+ * content's bounding box to preserve the aspect ratio.
81
+ *
82
+ * Defaults to the content bounding box height when both `width` and `height`
83
+ * are omitted.
84
+ */
85
+ height?: number;
86
+ /**
87
+ * Left canvas offset. By default the coordinate is relative to the canvas.
88
+ * You can switch to content coordinates by setting `origin` to `content`.
89
+ *
90
+ * Defaults to the `x` postion of the content bounding box.
91
+ */
92
+ x?: number;
93
+ /**
94
+ * Top canvas offset. By default the coordinate is relative to the canvas.
95
+ * You can switch to content coordinates by setting `origin` to `content`.
96
+ *
97
+ * Defaults to the `y` postion of the content bounding box.
98
+ */
99
+ y?: number;
100
+ /**
101
+ * Indicates the coordinate system of the `x` and `y` values.
102
+ *
103
+ * - `canvas` - `x` and `y` are relative to the canvas [0, 0] position.
104
+ * - `content` - `x` and `y` are relative to the content bounding box.
105
+ *
106
+ * @default "canvas"
107
+ */
108
+ origin?: "canvas" | "content";
109
+ /**
110
+ * If dimensions specified and `x` and `y` are not specified, this indicates
111
+ * how the canvas should be scaled.
112
+ *
113
+ * Behavior aligns with the `object-fit` CSS property.
114
+ *
115
+ * - `none` - no scaling.
116
+ * - `contain` - scale to fit the frame. Includes `padding`.
117
+ * - `cover` - scale to fill the frame while maintaining aspect ratio. If
118
+ * content overflows, it will be cropped.
119
+ *
120
+ * If `maxWidthOrHeight` or `widthOrHeight` is set, `fit` is ignored.
121
+ *
122
+ * @default "contain" unless `width`, `height`, `maxWidthOrHeight`, or
123
+ * `widthOrHeight` is specified in which case `none` is the default (can be
124
+ * changed). If `x` or `y` are specified, `none` is forced.
125
+ */
126
+ fit?: "none" | "contain" | "cover";
127
+ /**
128
+ * When either `x` or `y` are not specified, indicates how the canvas should
129
+ * be aligned on the respective axis.
130
+ *
131
+ * - `none` - canvas aligned to top left.
132
+ * - `center` - canvas is centered on the axis which is not specified
133
+ * (or both).
134
+ *
135
+ * If `maxWidthOrHeight` or `widthOrHeight` is set, `position` is ignored.
136
+ *
137
+ * @default "center"
138
+ */
139
+ position?: "center" | "topLeft";
140
+ /**
141
+ * A multiplier to increase/decrease the frame dimensions
142
+ * (content resolution).
143
+ *
144
+ * For example, if your canvas is 300x150 and you set scale to 2, the
145
+ * resulting size will be 600x300.
146
+ *
147
+ * @default 1
148
+ */
149
+ scale?: number;
150
+ /**
151
+ * If you need to suply your own canvas, e.g. in test environments or in
152
+ * Node.js.
153
+ *
154
+ * Do not set `canvas.width/height` or modify the canvas context as that's
155
+ * handled by Excalidraw.
156
+ *
157
+ * Defaults to `document.createElement("canvas")`.
158
+ */
159
+ createCanvas?: () => HTMLCanvasElement;
160
+ /**
161
+ * If you want to supply `width`/`height` dynamically (or derive from the
162
+ * content bounding box), you can use this function.
163
+ *
164
+ * Ignored if `maxWidthOrHeight`, `width`, or `height` is set.
165
+ */
166
+ getDimensions?: (width: number, height: number) => {
167
+ width: number;
168
+ height: number;
169
+ scale?: number;
170
+ };
171
+ };
172
+ /**
173
+ * This API is usually used as a precursor to searializing to Blob or PNG,
174
+ * but can also be used to create a canvas for other purposes.
175
+ */
176
+ export declare const exportToCanvas: ({ data, config, }: {
177
+ data: ExportToCanvasData;
178
+ config?: ExportToCanvasConfig | undefined;
11
179
  }) => Promise<HTMLCanvasElement>;
12
180
  export declare const exportToSvg: (elements: readonly NonDeletedExcalidrawElement[], appState: {
13
181
  exportBackground: boolean;
@@ -16,5 +184,9 @@ export declare const exportToSvg: (elements: readonly NonDeletedExcalidrawElemen
16
184
  viewBackgroundColor: string;
17
185
  exportWithDarkMode?: boolean;
18
186
  exportEmbedScene?: boolean;
19
- }, files: BinaryFiles | null) => Promise<SVGSVGElement>;
20
- export declare const getExportSize: (elements: readonly NonDeletedExcalidrawElement[], exportPadding: number, scale: number) => [number, number];
187
+ renderFrame?: boolean;
188
+ }, files: BinaryFiles | null, opts?: {
189
+ serializeAsJSON?: () => string;
190
+ renderEmbeddables?: boolean;
191
+ }) => Promise<SVGSVGElement>;
192
+ export declare const getCanvasSize: (elements: readonly NonDeletedExcalidrawElement[]) => [minX: number, minY: number, width: number, height: number];
@@ -1,5 +1,5 @@
1
1
  export { isOverScrollBars } from "./scrollbars";
2
2
  export { isSomeElementSelected, getElementsWithinSelection, getCommonAttributeOfSelectedElements, getSelectedElements, getTargetElements, } from "./selection";
3
3
  export { calculateScrollCenter } from "./scroll";
4
- export { hasBackground, hasStrokeWidth, hasStrokeStyle, canHaveArrowheads, canChangeSharpness, getElementAtPosition, hasText, getElementsAtPosition, } from "./comparisons";
4
+ export { hasBackground, hasStrokeWidth, hasStrokeStyle, canHaveArrowheads, canChangeRoundness, getElementAtPosition, hasText, getElementsAtPosition, } from "./comparisons";
5
5
  export { getNormalizedZoom } from "./zoom";
@@ -11,7 +11,7 @@ export declare const centerScrollOn: ({ scenePoint, viewportDimensions, zoom, }:
11
11
  scrollX: number;
12
12
  scrollY: number;
13
13
  };
14
- export declare const calculateScrollCenter: (elements: readonly ExcalidrawElement[], appState: AppState, canvas: HTMLCanvasElement | null) => {
14
+ export declare const calculateScrollCenter: (elements: readonly ExcalidrawElement[], appState: AppState) => {
15
15
  scrollX: number;
16
16
  scrollY: number;
17
17
  };
@@ -1,14 +1,10 @@
1
1
  import { ExcalidrawElement } from "../element/types";
2
- import { Zoom } from "../types";
2
+ import { InteractiveCanvasAppState } from "../types";
3
3
  import { ScrollBars } from "./types";
4
4
  export declare const SCROLLBAR_MARGIN = 4;
5
5
  export declare const SCROLLBAR_WIDTH = 6;
6
6
  export declare const SCROLLBAR_COLOR = "rgba(0,0,0,0.3)";
7
- export declare const getScrollBars: (elements: readonly ExcalidrawElement[], viewportWidth: number, viewportHeight: number, { scrollX, scrollY, zoom, }: {
8
- scrollX: number;
9
- scrollY: number;
10
- zoom: Zoom;
11
- }) => ScrollBars;
7
+ export declare const getScrollBars: (elements: readonly ExcalidrawElement[], viewportWidth: number, viewportHeight: number, appState: InteractiveCanvasAppState) => ScrollBars;
12
8
  export declare const isOverScrollBars: (scrollBars: ScrollBars, x: number, y: number) => {
13
9
  isOverEither: boolean;
14
10
  isOverHorizontal: boolean;
@@ -1,11 +1,32 @@
1
1
  import { ExcalidrawElement, NonDeletedExcalidrawElement } from "../element/types";
2
- import { AppState } from "../types";
3
- export declare const getElementsWithinSelection: (elements: readonly NonDeletedExcalidrawElement[], selection: NonDeletedExcalidrawElement) => NonDeletedExcalidrawElement[];
4
- export declare const isSomeElementSelected: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState) => boolean;
2
+ import { AppState, InteractiveCanvasAppState } from "../types";
3
+ /**
4
+ * Frames and their containing elements are not to be selected at the same time.
5
+ * Given an array of selected elements, if there are frames and their containing elements
6
+ * we only keep the frames.
7
+ * @param selectedElements
8
+ */
9
+ export declare const excludeElementsInFramesFromSelection: <T extends ExcalidrawElement>(selectedElements: readonly T[]) => T[];
10
+ export declare const getElementsWithinSelection: (elements: readonly NonDeletedExcalidrawElement[], selection: NonDeletedExcalidrawElement, excludeElementsInFrames?: boolean) => NonDeletedExcalidrawElement[];
11
+ export declare const getVisibleAndNonSelectedElements: (elements: readonly NonDeletedExcalidrawElement[], selectedElements: readonly NonDeletedExcalidrawElement[], appState: AppState) => NonDeletedExcalidrawElement[];
12
+ export declare const isSomeElementSelected: {
13
+ (elements: readonly NonDeletedExcalidrawElement[], appState: Pick<AppState, "selectedElementIds">): boolean;
14
+ clearCache(): void;
15
+ };
5
16
  /**
6
17
  * Returns common attribute (picked by `getAttribute` callback) of selected
7
18
  * elements. If elements don't share the same value, returns `null`.
8
19
  */
9
- export declare const getCommonAttributeOfSelectedElements: <T>(elements: readonly NonDeletedExcalidrawElement[], appState: AppState, getAttribute: (element: ExcalidrawElement) => T) => T | null;
10
- export declare const getSelectedElements: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState, includeBoundTextElement?: boolean) => NonDeletedExcalidrawElement[];
11
- export declare const getTargetElements: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState) => NonDeletedExcalidrawElement[];
20
+ export declare const getCommonAttributeOfSelectedElements: <T>(elements: readonly NonDeletedExcalidrawElement[], appState: Pick<AppState, "selectedElementIds">, getAttribute: (element: ExcalidrawElement) => T) => T | null;
21
+ export declare const getSelectedElements: (elements: readonly NonDeletedExcalidrawElement[], appState: Pick<InteractiveCanvasAppState, "selectedElementIds">, opts?: {
22
+ includeBoundTextElement?: boolean;
23
+ includeElementsInFrames?: boolean;
24
+ }) => ExcalidrawElement[];
25
+ export declare const getTargetElements: (elements: readonly NonDeletedExcalidrawElement[], appState: Pick<AppState, "selectedElementIds" | "editingElement">) => ExcalidrawElement[];
26
+ /**
27
+ * returns prevState's selectedElementids if no change from previous, so as to
28
+ * retain reference identity for memoization
29
+ */
30
+ export declare const makeNextSelectedElementIds: (nextSelectedElementIds: AppState["selectedElementIds"], prevState: Pick<AppState, "selectedElementIds">) => Readonly<{
31
+ [id: string]: true;
32
+ }>;