@excalidraw/excalidraw 0.15.2-3ddcc48 → 0.15.2-5302490

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 (117) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/excalidraw-assets/locales/{es-ES-json-f2467c6a875a9e288756.js → es-ES-json-4f3da97feff33cb00e6d.js} +1 -1
  3. package/dist/excalidraw-assets/locales/{hi-IN-json-e22f4ad73126c2971850.js → hi-IN-json-3898c9c1216b44476529.js} +1 -1
  4. package/dist/excalidraw-assets/locales/{id-ID-json-0e69caf5d919807ed234.js → id-ID-json-43d505d7071a0e359681.js} +1 -1
  5. package/dist/excalidraw-assets/locales/{kk-KZ-json-106d2a41c68f69765668.js → kk-KZ-json-f648362328b839e9313f.js} +1 -1
  6. package/dist/excalidraw-assets/locales/{pa-IN-json-0fd029451b07248c5194.js → pa-IN-json-d9ee09801ed220840b2b.js} +1 -1
  7. package/dist/excalidraw-assets/{vendor-53d1c69ef585b6dd219b.js → vendor-ef3c5d81a00ef582b871.js} +2 -2
  8. package/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.js → vendor-a14cd58fa2db417e42b2.js} +6 -6
  9. package/dist/excalidraw.development.js +2237 -2116
  10. package/dist/excalidraw.production.min.js +1 -1
  11. package/package.json +7 -2
  12. package/types/actions/actionAddToLibrary.d.ts +51 -25
  13. package/types/actions/actionAlign.d.ts +19 -20
  14. package/types/actions/actionBoundText.d.ts +38 -20
  15. package/types/actions/actionCanvas.d.ts +182 -90
  16. package/types/actions/actionClipboard.d.ts +81 -40
  17. package/types/actions/actionDeleteSelected.d.ts +45 -22
  18. package/types/actions/actionDistribute.d.ts +5 -6
  19. package/types/actions/actionDuplicateSelection.d.ts +0 -1
  20. package/types/actions/actionElementLock.d.ts +36 -19
  21. package/types/actions/actionExport.d.ts +161 -80
  22. package/types/actions/actionFinalize.d.ts +32 -18
  23. package/types/actions/actionFlip.d.ts +2 -3
  24. package/types/actions/actionFrame.d.ts +56 -30
  25. package/types/actions/actionGroup.d.ts +246 -9
  26. package/types/actions/actionLinearEditor.d.ts +19 -11
  27. package/types/actions/actionMenu.d.ts +51 -25
  28. package/types/actions/actionProperties.d.ts +223 -105
  29. package/types/actions/actionSelectAll.d.ts +121 -2
  30. package/types/actions/actionStyles.d.ts +17 -9
  31. package/types/actions/actionToggleGridMode.d.ts +17 -9
  32. package/types/actions/actionToggleStats.d.ts +17 -9
  33. package/types/actions/actionToggleViewMode.d.ts +17 -9
  34. package/types/actions/actionToggleZenMode.d.ts +17 -9
  35. package/types/actions/types.d.ts +4 -3
  36. package/types/appState.d.ts +7 -7
  37. package/types/clipboard.d.ts +1 -0
  38. package/types/colors.d.ts +9 -9
  39. package/types/components/Actions.d.ts +2 -2
  40. package/types/components/App.d.ts +24 -7
  41. package/types/components/Button.d.ts +0 -1
  42. package/types/components/Card.d.ts +0 -1
  43. package/types/components/ColorPicker/keyboardNavHandlers.d.ts +0 -1
  44. package/types/components/DefaultSidebar.d.ts +0 -1
  45. package/types/components/ExcalidrawLogo.d.ts +15 -0
  46. package/types/components/EyeDropper.d.ts +0 -1
  47. package/types/components/HintViewer.d.ts +3 -4
  48. package/types/components/JSONExportDialog.d.ts +1 -1
  49. package/types/components/LayerUI.d.ts +4 -2
  50. package/types/components/LibraryMenuHeaderContent.d.ts +0 -1
  51. package/types/components/LibraryUnit.d.ts +0 -1
  52. package/types/components/LoadingMessage.d.ts +0 -1
  53. package/types/components/MobileMenu.d.ts +4 -3
  54. package/types/components/Section.d.ts +1 -1
  55. package/types/components/Sidebar/SidebarTab.d.ts +0 -1
  56. package/types/components/Sidebar/SidebarTabTrigger.d.ts +0 -1
  57. package/types/components/Sidebar/SidebarTabTriggers.d.ts +0 -1
  58. package/types/components/Sidebar/SidebarTabs.d.ts +0 -1
  59. package/types/components/Stack.d.ts +2 -2
  60. package/types/components/Trans.d.ts +2 -1
  61. package/types/components/canvases/InteractiveCanvas.d.ts +27 -0
  62. package/types/components/canvases/StaticCanvas.d.ts +18 -0
  63. package/types/components/canvases/index.d.ts +3 -0
  64. package/types/components/dropdownMenu/DropdownMenuTrigger.d.ts +0 -1
  65. package/types/components/icons.d.ts +1 -0
  66. package/types/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -1
  67. package/types/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -1
  68. package/types/components/welcome-screen/WelcomeScreen.d.ts +0 -1
  69. package/types/constants.d.ts +17 -3
  70. package/types/data/transform.d.ts +71 -0
  71. package/types/data/url.d.ts +5 -0
  72. package/types/element/Hyperlink.d.ts +27 -13
  73. package/types/element/binding.d.ts +1 -0
  74. package/types/element/collision.d.ts +2 -2
  75. package/types/element/embeddable.d.ts +153 -0
  76. package/types/element/linearElementEditor.d.ts +20 -12
  77. package/types/element/newElement.d.ts +14 -7
  78. package/types/element/sizeHelpers.d.ts +8 -1
  79. package/types/element/textElement.d.ts +5 -7
  80. package/types/element/textWysiwyg.d.ts +1 -1
  81. package/types/element/transformHandles.d.ts +3 -3
  82. package/types/element/typeChecks.d.ts +2 -1
  83. package/types/element/types.d.ts +13 -2
  84. package/types/frame.d.ts +5 -5
  85. package/types/groups.d.ts +12 -12
  86. package/types/history.d.ts +3 -3
  87. package/types/hooks/useOutsideClick.d.ts +0 -1
  88. package/types/hooks/useScrollPosition.d.ts +0 -1
  89. package/types/i18n.d.ts +5 -2
  90. package/types/keys.d.ts +1 -0
  91. package/types/packages/excalidraw/example/initialData.d.ts +182 -70
  92. package/types/packages/excalidraw/index.d.ts +1 -0
  93. package/types/packages/excalidraw/webpack.dev.config.d.ts +5 -2
  94. package/types/packages/excalidraw/webpack.prod.config.d.ts +3 -0
  95. package/types/packages/utils.d.ts +2 -1
  96. package/types/renderer/renderElement.d.ts +10 -22
  97. package/types/renderer/renderScene.d.ts +18 -37
  98. package/types/scene/Renderer.d.ts +25 -0
  99. package/types/scene/Scene.d.ts +15 -0
  100. package/types/scene/Shape.d.ts +12 -0
  101. package/types/scene/ShapeCache.d.ts +20 -0
  102. package/types/scene/export.d.ts +1 -0
  103. package/types/scene/scroll.d.ts +1 -1
  104. package/types/scene/scrollbars.d.ts +2 -6
  105. package/types/scene/selection.d.ts +13 -3
  106. package/types/scene/types.d.ts +57 -24
  107. package/types/types.d.ts +63 -12
  108. package/types/utility-types.d.ts +3 -1
  109. package/types/utils.d.ts +13 -5
  110. /package/dist/excalidraw-assets/{vendor-53d1c69ef585b6dd219b.js.LICENSE.txt → vendor-ef3c5d81a00ef582b871.js.LICENSE.txt} +0 -0
  111. /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{es-ES-json-f2467c6a875a9e288756.d.ts → es-ES-json-4f3da97feff33cb00e6d.d.ts} +0 -0
  112. /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{hi-IN-json-e22f4ad73126c2971850.d.ts → hi-IN-json-3898c9c1216b44476529.d.ts} +0 -0
  113. /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{id-ID-json-0e69caf5d919807ed234.d.ts → id-ID-json-43d505d7071a0e359681.d.ts} +0 -0
  114. /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{kk-KZ-json-106d2a41c68f69765668.d.ts → kk-KZ-json-f648362328b839e9313f.d.ts} +0 -0
  115. /package/types/packages/excalidraw/dist/excalidraw-assets/locales/{pa-IN-json-0fd029451b07248c5194.d.ts → pa-IN-json-d9ee09801ed220840b2b.d.ts} +0 -0
  116. /package/types/packages/excalidraw/dist/excalidraw-assets/{vendor-53d1c69ef585b6dd219b.d.ts → vendor-ef3c5d81a00ef582b871.d.ts} +0 -0
  117. /package/types/packages/excalidraw/dist/excalidraw-assets-dev/{vendor-e6df8519da951026ff69.d.ts → vendor-a14cd58fa2db417e42b2.d.ts} +0 -0
@@ -1,39 +1,59 @@
1
- import { ExcalidrawTextElement } from "../element/types";
2
- import { AppClassProperties, AppState } from "../types";
3
- export type RenderConfig = {
4
- scrollX: AppState["scrollX"];
5
- scrollY: AppState["scrollY"];
6
- /** null indicates transparent bg */
7
- viewBackgroundColor: AppState["viewBackgroundColor"] | null;
8
- zoom: AppState["zoom"];
9
- shouldCacheIgnoreZoom: AppState["shouldCacheIgnoreZoom"];
10
- theme: AppState["theme"];
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 StaticCanvasRenderConfig = {
6
+ imageCache: AppClassProperties["imageCache"];
7
+ renderGrid: boolean;
8
+ /** when exporting the behavior is slightly different (e.g. we can't use
9
+ CSS filters), and we disable render optimizations for best output */
10
+ isExporting: boolean;
11
+ };
12
+ export type InteractiveCanvasRenderConfig = {
13
+ remoteSelectedElementIds: {
14
+ [elementId: string]: string[];
15
+ };
11
16
  remotePointerViewportCoords: {
12
17
  [id: string]: {
13
18
  x: number;
14
19
  y: number;
15
20
  };
16
21
  };
17
- remotePointerButton?: {
18
- [id: string]: string | undefined;
19
- };
20
- remoteSelectedElementIds: {
21
- [elementId: string]: string[];
22
+ remotePointerUserStates: {
23
+ [id: string]: string;
22
24
  };
23
25
  remotePointerUsernames: {
24
26
  [id: string]: string;
25
27
  };
26
- remotePointerUserStates: {
27
- [id: string]: string;
28
+ remotePointerButton?: {
29
+ [id: string]: string | undefined;
28
30
  };
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
31
  selectionColor?: string;
32
+ renderScrollbars?: boolean;
33
+ };
34
+ export type RenderInteractiveSceneCallback = {
35
+ atLeastOneVisibleElement: boolean;
36
+ elements: readonly NonDeletedExcalidrawElement[];
37
+ scrollBars?: ScrollBars;
38
+ };
39
+ export type StaticSceneRenderConfig = {
40
+ canvas: HTMLCanvasElement;
41
+ rc: RoughCanvas;
42
+ elements: readonly NonDeletedExcalidrawElement[];
43
+ visibleElements: readonly NonDeletedExcalidrawElement[];
44
+ scale: number;
45
+ appState: StaticCanvasAppState;
46
+ renderConfig: StaticCanvasRenderConfig;
47
+ };
48
+ export type InteractiveSceneRenderConfig = {
49
+ canvas: HTMLCanvasElement | null;
50
+ elements: readonly NonDeletedExcalidrawElement[];
51
+ visibleElements: readonly NonDeletedExcalidrawElement[];
52
+ selectedElements: readonly NonDeletedExcalidrawElement[];
53
+ scale: number;
54
+ appState: InteractiveCanvasAppState;
55
+ renderConfig: InteractiveCanvasRenderConfig;
56
+ callback: (data: RenderInteractiveSceneCallback) => void;
37
57
  };
38
58
  export type SceneScroll = {
39
59
  scrollX: number;
@@ -57,3 +77,16 @@ export type ScrollBars = {
57
77
  height: number;
58
78
  } | null;
59
79
  };
80
+ export type ElementShape = Drawable | Drawable[] | null;
81
+ export type ElementShapes = {
82
+ rectangle: Drawable;
83
+ ellipse: Drawable;
84
+ diamond: Drawable;
85
+ embeddable: Drawable;
86
+ freedraw: Drawable | null;
87
+ arrow: Drawable[];
88
+ line: Drawable[];
89
+ text: null;
90
+ image: null;
91
+ frame: null;
92
+ };
package/types/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, ChartType, FontFamilyValues, FileId, ExcalidrawImageElement, Theme, StrokeRoundness, ExcalidrawFrameElement } from "./element/types";
2
+ import { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, ChartType, FontFamilyValues, FileId, ExcalidrawImageElement, Theme, StrokeRoundness, ExcalidrawFrameElement, ExcalidrawEmbeddableElement } from "./element/types";
3
3
  import { SHAPES } from "./shapes";
4
4
  import { Point as RoughPoint } from "roughjs/bin/geometry";
5
5
  import { LinearElementEditor } from "./element/linearElementEditor";
@@ -57,7 +57,7 @@ export type BinaryFileData = {
57
57
  export type BinaryFileMetadata = Omit<BinaryFileData, "dataURL">;
58
58
  export type BinaryFiles = Record<ExcalidrawElement["id"], BinaryFileData>;
59
59
  export type LastActiveTool = {
60
- type: typeof SHAPES[number]["value"] | "eraser" | "hand" | "frame";
60
+ type: typeof SHAPES[number]["value"] | "eraser" | "hand" | "frame" | "embeddable";
61
61
  customType: null;
62
62
  } | {
63
63
  type: "custom";
@@ -65,6 +65,45 @@ export type LastActiveTool = {
65
65
  } | null;
66
66
  export type SidebarName = string;
67
67
  export type SidebarTabName = string;
68
+ type _CommonCanvasAppState = {
69
+ zoom: AppState["zoom"];
70
+ scrollX: AppState["scrollX"];
71
+ scrollY: AppState["scrollY"];
72
+ width: AppState["width"];
73
+ height: AppState["height"];
74
+ viewModeEnabled: AppState["viewModeEnabled"];
75
+ editingGroupId: AppState["editingGroupId"];
76
+ selectedElementIds: AppState["selectedElementIds"];
77
+ frameToHighlight: AppState["frameToHighlight"];
78
+ offsetLeft: AppState["offsetLeft"];
79
+ offsetTop: AppState["offsetTop"];
80
+ theme: AppState["theme"];
81
+ pendingImageElementId: AppState["pendingImageElementId"];
82
+ };
83
+ export type StaticCanvasAppState = Readonly<_CommonCanvasAppState & {
84
+ shouldCacheIgnoreZoom: AppState["shouldCacheIgnoreZoom"];
85
+ /** null indicates transparent bg */
86
+ viewBackgroundColor: AppState["viewBackgroundColor"] | null;
87
+ exportScale: AppState["exportScale"];
88
+ selectedElementsAreBeingDragged: AppState["selectedElementsAreBeingDragged"];
89
+ gridSize: AppState["gridSize"];
90
+ frameRendering: AppState["frameRendering"];
91
+ }>;
92
+ export type InteractiveCanvasAppState = Readonly<_CommonCanvasAppState & {
93
+ activeEmbeddable: AppState["activeEmbeddable"];
94
+ editingLinearElement: AppState["editingLinearElement"];
95
+ selectionElement: AppState["selectionElement"];
96
+ selectedGroupIds: AppState["selectedGroupIds"];
97
+ selectedLinearElement: AppState["selectedLinearElement"];
98
+ multiElement: AppState["multiElement"];
99
+ isBindingEnabled: AppState["isBindingEnabled"];
100
+ suggestedBindings: AppState["suggestedBindings"];
101
+ isRotating: AppState["isRotating"];
102
+ elementsToHighlight: AppState["elementsToHighlight"];
103
+ openSidebar: AppState["openSidebar"];
104
+ showHyperlinkPopup: AppState["showHyperlinkPopup"];
105
+ collaborators: AppState["collaborators"];
106
+ }>;
68
107
  export type AppState = {
69
108
  contextMenu: {
70
109
  items: ContextMenuItems;
@@ -74,6 +113,10 @@ export type AppState = {
74
113
  showWelcomeScreen: boolean;
75
114
  isLoading: boolean;
76
115
  errorMessage: React.ReactNode;
116
+ activeEmbeddable: {
117
+ element: NonDeletedExcalidrawElement;
118
+ state: "hover" | "active";
119
+ } | null;
77
120
  draggingElement: NonDeletedExcalidrawElement | null;
78
121
  resizingElement: NonDeletedExcalidrawElement | null;
79
122
  multiElement: NonDeleted<ExcalidrawLinearElement> | null;
@@ -82,7 +125,12 @@ export type AppState = {
82
125
  startBoundElement: NonDeleted<ExcalidrawBindableElement> | null;
83
126
  suggestedBindings: SuggestedBinding[];
84
127
  frameToHighlight: NonDeleted<ExcalidrawFrameElement> | null;
85
- shouldRenderFrames: boolean;
128
+ frameRendering: {
129
+ enabled: boolean;
130
+ name: boolean;
131
+ outline: boolean;
132
+ clip: boolean;
133
+ };
86
134
  editingFrame: string | null;
87
135
  elementsToHighlight: NonDeleted<ExcalidrawElement>[] | null;
88
136
  editingElement: NonDeletedExcalidrawElement | null;
@@ -95,7 +143,7 @@ export type AppState = {
95
143
  lastActiveTool: LastActiveTool;
96
144
  locked: boolean;
97
145
  } & ({
98
- type: typeof SHAPES[number]["value"] | "eraser" | "hand" | "frame";
146
+ type: typeof SHAPES[number]["value"] | "eraser" | "hand" | "frame" | "embeddable";
99
147
  customType: null;
100
148
  } | {
101
149
  type: "custom";
@@ -145,11 +193,11 @@ export type AppState = {
145
193
  */
146
194
  defaultSidebarDockedPreference: boolean;
147
195
  lastPointerDownWith: PointerType;
148
- selectedElementIds: {
149
- [id: string]: boolean;
150
- };
196
+ selectedElementIds: Readonly<{
197
+ [id: string]: true;
198
+ }>;
151
199
  previousSelectedElementIds: {
152
- [id: string]: boolean;
200
+ [id: string]: true;
153
201
  };
154
202
  selectedElementsAreBeingDragged: boolean;
155
203
  shouldCacheIgnoreZoom: boolean;
@@ -272,6 +320,8 @@ export interface ExcalidrawProps {
272
320
  onPointerDown?: (activeTool: AppState["activeTool"], pointerDownState: PointerDownState) => void;
273
321
  onScrollChange?: (scrollX: number, scrollY: number) => void;
274
322
  children?: React.ReactNode;
323
+ validateEmbeddable?: boolean | string[] | RegExp | RegExp[] | ((link: string) => boolean | undefined);
324
+ renderEmbeddable?: (element: NonDeleted<ExcalidrawEmbeddableElement>, appState: AppState) => JSX.Element | null;
275
325
  }
276
326
  export type SceneData = {
277
327
  elements?: ImportedDataState["elements"];
@@ -286,8 +336,8 @@ export declare enum UserIdleState {
286
336
  }
287
337
  export type ExportOpts = {
288
338
  saveFileToDisk?: boolean;
289
- onExportToBackend?: (exportedElements: readonly NonDeletedExcalidrawElement[], appState: UIAppState, files: BinaryFiles, canvas: HTMLCanvasElement | null) => void;
290
- renderCustomUI?: (exportedElements: readonly NonDeletedExcalidrawElement[], appState: UIAppState, files: BinaryFiles, canvas: HTMLCanvasElement | null) => JSX.Element;
339
+ onExportToBackend?: (exportedElements: readonly NonDeletedExcalidrawElement[], appState: UIAppState, files: BinaryFiles, canvas: HTMLCanvasElement) => void;
340
+ renderCustomUI?: (exportedElements: readonly NonDeletedExcalidrawElement[], appState: UIAppState, files: BinaryFiles, canvas: HTMLCanvasElement) => JSX.Element;
291
341
  };
292
342
  type CanvasActions = Partial<{
293
343
  changeViewBackgroundColor: boolean;
@@ -319,7 +369,8 @@ export type AppProps = Merge<ExcalidrawProps, {
319
369
  * in the app, eg Manager. Factored out into a separate type to keep DRY. */
320
370
  export type AppClassProperties = {
321
371
  props: AppProps;
322
- canvas: HTMLCanvasElement | null;
372
+ canvas: HTMLCanvasElement;
373
+ interactiveCanvas: HTMLCanvasElement | null;
323
374
  focusContainer(): void;
324
375
  library: Library;
325
376
  imageCache: Map<FileId, {
@@ -421,7 +472,7 @@ export type ExcalidrawImperativeAPI = {
421
472
  * the frames are still interactive in edit mode. As such, this API should be
422
473
  * used in conjunction with view mode (props.viewModeEnabled).
423
474
  */
424
- toggleFrameRendering: InstanceType<typeof App>["toggleFrameRendering"];
475
+ updateFrameRendering: InstanceType<typeof App>["updateFrameRendering"];
425
476
  };
426
477
  export type Device = Readonly<{
427
478
  isSmScreen: boolean;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export type Mutable<T> = {
3
2
  -readonly [P in keyof T]: T[P];
4
3
  };
@@ -20,3 +19,6 @@ export type SignatureType<T> = T extends (...args: infer R) => any ? R : never;
20
19
  export type CallableType<T extends (...args: any[]) => any> = (...args: SignatureType<T>) => ReturnType<T>;
21
20
  export type ForwardRef<T, P = any> = Parameters<CallableType<React.ForwardRefRenderFunction<T, P>>>[1];
22
21
  export type ExtractSetType<T extends Set<any>> = T extends Set<infer U> ? U : never;
22
+ export type SameType<T, U> = T extends U ? (U extends T ? true : false) : false;
23
+ export type Assert<T extends true> = T;
24
+ export type NestedKeyOf<T, K = keyof T> = K extends keyof T & (string | number) ? `${K}` | (T[K] extends object ? `${K}.${NestedKeyOf<T[K]>}` : never) : never;
package/types/utils.d.ts CHANGED
@@ -81,17 +81,17 @@ export declare const selectNode: (node: Element) => void;
81
81
  export declare const removeSelection: () => void;
82
82
  export declare const distance: (x: number, y: number) => number;
83
83
  export declare const updateActiveTool: (appState: Pick<AppState, "activeTool">, data: ({
84
- type: (typeof SHAPES)[number]["value"] | "eraser" | "hand" | "frame";
84
+ type: (typeof SHAPES)[number]["value"] | "eraser" | "hand" | "frame" | "embeddable";
85
85
  } | {
86
86
  type: "custom";
87
87
  customType: string;
88
88
  }) & {
89
89
  lastActiveToolBeforeEraser?: LastActiveTool;
90
90
  }) => AppState["activeTool"];
91
- export declare const resetCursor: (canvas: HTMLCanvasElement | null) => void;
92
- export declare const setCursor: (canvas: HTMLCanvasElement | null, cursor: string) => void;
93
- export declare const setEraserCursor: (canvas: HTMLCanvasElement | null, theme: AppState["theme"]) => void;
94
- export declare const setCursorForShape: (canvas: HTMLCanvasElement | null, appState: Pick<AppState, "activeTool" | "theme">) => void;
91
+ export declare const resetCursor: (interactiveCanvas: HTMLCanvasElement | null) => void;
92
+ export declare const setCursor: (interactiveCanvas: HTMLCanvasElement | null, cursor: string) => void;
93
+ export declare const setEraserCursor: (interactiveCanvas: HTMLCanvasElement | null, theme: AppState["theme"]) => void;
94
+ export declare const setCursorForShape: (interactiveCanvas: HTMLCanvasElement | null, appState: Pick<AppState, "activeTool" | "theme">) => void;
95
95
  export declare const isFullScreen: () => boolean;
96
96
  export declare const allowFullScreen: () => Promise<void>;
97
97
  export declare const exitFullScreen: () => Promise<void>;
@@ -190,3 +190,11 @@ export declare const composeEventHandlers: <E>(originalEventHandler?: ((event: E
190
190
  checkForDefaultPrevented?: boolean | undefined;
191
191
  }) => (event: E) => void;
192
192
  export declare const isOnlyExportingSingleFrame: (elements: readonly NonDeletedExcalidrawElement[]) => boolean;
193
+ export declare const assertNever: (value: never, message: string, softAssert?: boolean) => never;
194
+ /**
195
+ * Memoizes on values of `opts` object (strict equality).
196
+ */
197
+ export declare const memoize: <T extends Record<string, any>, R extends unknown>(func: (opts: T) => R) => ((opts: T) => R) & {
198
+ clear: () => void;
199
+ };
200
+ export declare const isRenderThrottlingEnabled: () => boolean;