@excalidraw/element 0.18.0-2874f9e → 0.18.0-2a82821

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 (144) hide show
  1. package/dist/dev/index.js +5228 -4610
  2. package/dist/dev/index.js.map +4 -4
  3. package/dist/prod/index.js +19 -18
  4. package/dist/types/common/src/appEventBus.d.ts +27 -0
  5. package/dist/types/common/src/colors.d.ts +2 -2
  6. package/dist/types/common/src/constants.d.ts +9 -7
  7. package/dist/types/common/src/index.d.ts +2 -0
  8. package/dist/types/common/src/utils.d.ts +1 -3
  9. package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
  10. package/dist/types/element/src/Scene.d.ts +7 -3
  11. package/dist/types/element/src/arrowheads.d.ts +3 -0
  12. package/dist/types/element/src/binding.d.ts +3 -4
  13. package/dist/types/element/src/bounds.d.ts +22 -3
  14. package/dist/types/element/src/comparisons.d.ts +1 -0
  15. package/dist/types/element/src/duplicate.d.ts +1 -0
  16. package/dist/types/element/src/elbowArrow.d.ts +2 -0
  17. package/dist/types/element/src/frame.d.ts +7 -6
  18. package/dist/types/element/src/index.d.ts +1 -0
  19. package/dist/types/element/src/linearElementEditor.d.ts +5 -2
  20. package/dist/types/element/src/mutateElement.d.ts +2 -0
  21. package/dist/types/element/src/newElement.d.ts +1 -0
  22. package/dist/types/element/src/selection.d.ts +7 -3
  23. package/dist/types/element/src/shape.d.ts +1 -1
  24. package/dist/types/element/src/textElement.d.ts +1 -1
  25. package/dist/types/element/src/textWrapping.d.ts +26 -0
  26. package/dist/types/element/src/typeChecks.d.ts +1 -0
  27. package/dist/types/element/src/types.d.ts +11 -2
  28. package/dist/types/element/src/utils.d.ts +2 -2
  29. package/dist/types/element/src/visualdebug.d.ts +1 -2
  30. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +35 -38
  31. package/dist/types/excalidraw/actions/actionBoundText.d.ts +25 -27
  32. package/dist/types/excalidraw/actions/actionCanvas.d.ts +144 -156
  33. package/dist/types/excalidraw/actions/actionClipboard.d.ts +24 -26
  34. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +12 -13
  35. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +36 -39
  36. package/dist/types/excalidraw/actions/actionDeselect.d.ts +160 -0
  37. package/dist/types/excalidraw/actions/actionElementLink.d.ts +8 -13
  38. package/dist/types/excalidraw/actions/actionElementLock.d.ts +24 -26
  39. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +12 -13
  40. package/dist/types/excalidraw/actions/actionExport.d.ts +67 -349
  41. package/dist/types/excalidraw/actions/actionFrame.d.ts +49 -52
  42. package/dist/types/excalidraw/actions/actionGroup.d.ts +25 -27
  43. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +13 -13
  44. package/dist/types/excalidraw/actions/actionLink.d.ts +12 -13
  45. package/dist/types/excalidraw/actions/actionMenu.d.ts +8 -13
  46. package/dist/types/excalidraw/actions/actionProperties.d.ts +36 -29
  47. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +12 -13
  48. package/dist/types/excalidraw/actions/actionStyles.d.ts +12 -12
  49. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +3 -3
  50. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +173 -0
  51. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +12 -13
  52. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +173 -0
  53. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +12 -13
  54. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +8 -13
  55. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +12 -13
  56. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +12 -13
  57. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +12 -13
  58. package/dist/types/excalidraw/actions/index.d.ts +4 -1
  59. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  60. package/dist/types/excalidraw/{animated-trail.d.ts → animatedTrail.d.ts} +4 -3
  61. package/dist/types/excalidraw/appState.d.ts +6 -2
  62. package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -0
  63. package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
  64. package/dist/types/excalidraw/charts/charts.helpers.d.ts +32 -0
  65. package/dist/types/excalidraw/charts/charts.line.d.ts +2 -0
  66. package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
  67. package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -0
  68. package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
  69. package/dist/types/excalidraw/charts/index.d.ts +7 -0
  70. package/dist/types/excalidraw/clipboard.d.ts +2 -5
  71. package/dist/types/excalidraw/components/ActiveConfirmDialog.d.ts +1 -1
  72. package/dist/types/excalidraw/components/App.d.ts +54 -14
  73. package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
  74. package/dist/types/excalidraw/components/ColorPicker/colorPickerUtils.d.ts +1 -1
  75. package/dist/types/excalidraw/components/CommandPalette/defaultCommandPaletteItems.d.ts +1 -2
  76. package/dist/types/excalidraw/components/ConvertElementTypePopup.d.ts +1 -1
  77. package/dist/types/excalidraw/components/EyeDropper.d.ts +1 -1
  78. package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
  79. package/dist/types/excalidraw/components/LibraryMenu.d.ts +1 -1
  80. package/dist/types/excalidraw/components/OverwriteConfirm/OverwriteConfirmState.d.ts +1 -1
  81. package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
  82. package/dist/types/excalidraw/components/Range.d.ts +10 -4
  83. package/dist/types/excalidraw/components/SVGLayer.d.ts +1 -1
  84. package/dist/types/excalidraw/components/SearchMenu.d.ts +1 -1
  85. package/dist/types/excalidraw/components/Sidebar/Sidebar.d.ts +1 -1
  86. package/dist/types/excalidraw/components/TTDDialog/CodeMirrorEditor.d.ts +11 -0
  87. package/dist/types/excalidraw/components/TTDDialog/TTDContext.d.ts +4 -4
  88. package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +3 -3
  89. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +4 -1
  90. package/dist/types/excalidraw/components/TTDDialog/mermaid-lang-lite.d.ts +2 -0
  91. package/dist/types/excalidraw/components/TTDDialog/useTTDChatStorage.d.ts +3 -3
  92. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidAutoFix.d.ts +1 -0
  93. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +10 -0
  94. package/dist/types/excalidraw/components/Toast.d.ts +8 -4
  95. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +2 -1
  96. package/dist/types/excalidraw/components/canvases/NewElementCanvas.d.ts +1 -0
  97. package/dist/types/excalidraw/components/canvases/StaticCanvas.d.ts +1 -1
  98. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.d.ts +2 -1
  99. package/dist/types/excalidraw/components/icons.d.ts +19 -8
  100. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +9 -3
  101. package/dist/types/excalidraw/components/shapes.d.ts +7 -0
  102. package/dist/types/excalidraw/data/blob.d.ts +31 -34
  103. package/dist/types/excalidraw/data/filesystem.d.ts +3 -5
  104. package/dist/types/excalidraw/data/index.d.ts +2 -3
  105. package/dist/types/excalidraw/data/json.d.ts +30 -23
  106. package/dist/types/excalidraw/data/library.d.ts +1 -1
  107. package/dist/types/excalidraw/data/resave.d.ts +7 -2
  108. package/dist/types/excalidraw/eraser/index.d.ts +2 -3
  109. package/dist/types/excalidraw/hooks/useLibraryItemSvg.d.ts +1 -1
  110. package/dist/types/excalidraw/{laser-trails.d.ts → laserTrails.d.ts} +5 -7
  111. package/dist/types/excalidraw/lasso/index.d.ts +2 -3
  112. package/dist/types/excalidraw/renderer/animation.d.ts +4 -1
  113. package/dist/types/excalidraw/scene/Renderer.d.ts +426 -19
  114. package/dist/types/excalidraw/scene/index.d.ts +1 -1
  115. package/dist/types/excalidraw/textAutoResizeHandle.d.ts +15 -0
  116. package/dist/types/excalidraw/types.d.ts +110 -18
  117. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +5 -1
  118. package/dist/types/fractional-indexing/src/index.d.ts +29 -0
  119. package/dist/types/laser-pointer/src/index.d.ts +2 -0
  120. package/dist/types/laser-pointer/src/math.d.ts +16 -0
  121. package/dist/types/laser-pointer/src/simplify.d.ts +2 -0
  122. package/dist/types/laser-pointer/src/state.d.ts +35 -0
  123. package/dist/types/math/src/constants.d.ts +0 -1
  124. package/dist/types/math/src/curve.d.ts +4 -1
  125. package/dist/types/math/src/point.d.ts +2 -1
  126. package/dist/types/utils/src/index.d.ts +1 -2
  127. package/package.json +4 -3
  128. package/dist/types/excalidraw/animation-frame-handler.d.ts +0 -16
  129. package/dist/types/excalidraw/charts.d.ts +0 -27
  130. package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
  131. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -15
  132. package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
  133. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -8
  134. package/dist/types/excalidraw/components/TTDDialog/utils/TTDStreamFetch.d.ts +0 -24
  135. package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
  136. package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -11
  137. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
  138. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
  139. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -84
  140. package/dist/types/excalidraw/data/reconcile.d.ts +0 -7
  141. package/dist/types/excalidraw/index.d.ts +0 -47
  142. package/dist/types/excalidraw/polyfill.d.ts +0 -2
  143. package/dist/types/utils/src/bbox.d.ts +0 -9
  144. package/dist/types/utils/src/withinBounds.d.ts +0 -19
@@ -3,9 +3,12 @@ export type Animation<R extends object> = (params: {
3
3
  state?: R;
4
4
  }) => R | null | undefined;
5
5
  export declare class AnimationController {
6
- private static isRunning;
6
+ private static scheduledFrame;
7
7
  private static animations;
8
8
  static start<R extends object>(key: string, animation: Animation<R>): void;
9
+ private static scheduleNextFrame;
10
+ private static cancelScheduledFrame;
11
+ private static cancelScheduledFrameIfIdle;
9
12
  private static tick;
10
13
  static running(key: string): boolean;
11
14
  static cancel(key: string): void;
@@ -1,30 +1,437 @@
1
- import type { ExcalidrawElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
1
+ import type { NonDeletedExcalidrawElement } from "@excalidraw/element/types";
2
2
  import type { Scene } from "@excalidraw/element";
3
3
  import type { RenderableElementsMap } from "./types";
4
4
  import type { AppState } from "../types";
5
+ type GetRenderableElementsOpts = {
6
+ zoom: AppState["zoom"];
7
+ offsetLeft: AppState["offsetLeft"];
8
+ offsetTop: AppState["offsetTop"];
9
+ scrollX: AppState["scrollX"];
10
+ scrollY: AppState["scrollY"];
11
+ height: AppState["height"];
12
+ width: AppState["width"];
13
+ editingTextElement: AppState["editingTextElement"];
14
+ newElement: AppState["newElement"];
15
+ selectedElements: readonly NonDeletedExcalidrawElement[];
16
+ selectedElementsAreBeingDragged: AppState["selectedElementsAreBeingDragged"];
17
+ frameToHighlight: AppState["frameToHighlight"];
18
+ };
5
19
  export declare class Renderer {
6
20
  private scene;
7
21
  constructor(scene: Scene);
8
- getRenderableElements: ((opts: {
9
- zoom: Readonly<{
10
- value: import("../types").NormalizedZoomValue;
11
- }>;
12
- offsetLeft: AppState["offsetLeft"];
13
- offsetTop: AppState["offsetTop"];
14
- scrollX: AppState["scrollX"];
15
- scrollY: AppState["scrollY"];
16
- height: AppState["height"];
17
- width: AppState["width"];
18
- editingTextElement: AppState["editingTextElement"];
19
- /** note: first render of newElement will always bust the cache
20
- * (we'd have to prefilter elements outside of this function) */
21
- newElementId: ExcalidrawElement["id"] | undefined;
22
- sceneNonce: ReturnType<InstanceType<typeof Scene>["getSceneNonce"]>;
23
- }) => {
22
+ private getVisibleCanvasElements;
23
+ private getRenderableElementsMap;
24
+ private sortSelectedElementsIntoHighlightedFrame;
25
+ private _getRenderableElements;
26
+ getRenderableElements: (opts: GetRenderableElementsOpts) => {
24
27
  elementsMap: RenderableElementsMap;
25
28
  visibleElements: readonly NonDeletedExcalidrawElement[];
26
- }) & {
27
- clear: () => void;
29
+ newElementCanvasElement: (Readonly<{
30
+ id: string;
31
+ x: number;
32
+ y: number;
33
+ strokeColor: string;
34
+ backgroundColor: string;
35
+ fillStyle: import("@excalidraw/element/types").FillStyle;
36
+ strokeWidth: number;
37
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
38
+ roundness: null | {
39
+ type: import("@excalidraw/element/types").RoundnessType;
40
+ value?: number;
41
+ };
42
+ roughness: number;
43
+ opacity: number;
44
+ width: number;
45
+ height: number;
46
+ angle: import("@excalidraw/math").Radians;
47
+ seed: number;
48
+ version: number;
49
+ versionNonce: number;
50
+ index: import("@excalidraw/element/types").FractionalIndex | null;
51
+ isDeleted: boolean;
52
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
53
+ frameId: string | null;
54
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
55
+ updated: number;
56
+ link: string | null;
57
+ locked: boolean;
58
+ customData?: Record<string, any>;
59
+ }> & Readonly<{
60
+ type: "line" | "arrow";
61
+ points: readonly import("@excalidraw/math").LocalPoint[];
62
+ startBinding: import("@excalidraw/element/types").FixedPointBinding | null;
63
+ endBinding: import("@excalidraw/element/types").FixedPointBinding | null;
64
+ startArrowhead: import("@excalidraw/element/types").Arrowhead | null;
65
+ endArrowhead: import("@excalidraw/element/types").Arrowhead | null;
66
+ }> & {
67
+ isDeleted: boolean;
68
+ }) | (Readonly<{
69
+ id: string;
70
+ x: number;
71
+ y: number;
72
+ strokeColor: string;
73
+ backgroundColor: string;
74
+ fillStyle: import("@excalidraw/element/types").FillStyle;
75
+ strokeWidth: number;
76
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
77
+ roundness: null | {
78
+ type: import("@excalidraw/element/types").RoundnessType;
79
+ value?: number;
80
+ };
81
+ roughness: number;
82
+ opacity: number;
83
+ width: number;
84
+ height: number;
85
+ angle: import("@excalidraw/math").Radians;
86
+ seed: number;
87
+ version: number;
88
+ versionNonce: number;
89
+ index: import("@excalidraw/element/types").FractionalIndex | null;
90
+ isDeleted: boolean;
91
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
92
+ frameId: string | null;
93
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
94
+ updated: number;
95
+ link: string | null;
96
+ locked: boolean;
97
+ customData?: Record<string, any>;
98
+ }> & {
99
+ type: "rectangle";
100
+ } & {
101
+ isDeleted: boolean;
102
+ }) | (Readonly<{
103
+ id: string;
104
+ x: number;
105
+ y: number;
106
+ strokeColor: string;
107
+ backgroundColor: string;
108
+ fillStyle: import("@excalidraw/element/types").FillStyle;
109
+ strokeWidth: number;
110
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
111
+ roundness: null | {
112
+ type: import("@excalidraw/element/types").RoundnessType;
113
+ value?: number;
114
+ };
115
+ roughness: number;
116
+ opacity: number;
117
+ width: number;
118
+ height: number;
119
+ angle: import("@excalidraw/math").Radians;
120
+ seed: number;
121
+ version: number;
122
+ versionNonce: number;
123
+ index: import("@excalidraw/element/types").FractionalIndex | null;
124
+ isDeleted: boolean;
125
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
126
+ frameId: string | null;
127
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
128
+ updated: number;
129
+ link: string | null;
130
+ locked: boolean;
131
+ customData?: Record<string, any>;
132
+ }> & {
133
+ type: "diamond";
134
+ } & {
135
+ isDeleted: boolean;
136
+ }) | (Readonly<{
137
+ id: string;
138
+ x: number;
139
+ y: number;
140
+ strokeColor: string;
141
+ backgroundColor: string;
142
+ fillStyle: import("@excalidraw/element/types").FillStyle;
143
+ strokeWidth: number;
144
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
145
+ roundness: null | {
146
+ type: import("@excalidraw/element/types").RoundnessType;
147
+ value?: number;
148
+ };
149
+ roughness: number;
150
+ opacity: number;
151
+ width: number;
152
+ height: number;
153
+ angle: import("@excalidraw/math").Radians;
154
+ seed: number;
155
+ version: number;
156
+ versionNonce: number;
157
+ index: import("@excalidraw/element/types").FractionalIndex | null;
158
+ isDeleted: boolean;
159
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
160
+ frameId: string | null;
161
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
162
+ updated: number;
163
+ link: string | null;
164
+ locked: boolean;
165
+ customData?: Record<string, any>;
166
+ }> & {
167
+ type: "ellipse";
168
+ } & {
169
+ isDeleted: boolean;
170
+ }) | (Readonly<{
171
+ id: string;
172
+ x: number;
173
+ y: number;
174
+ strokeColor: string;
175
+ backgroundColor: string;
176
+ fillStyle: import("@excalidraw/element/types").FillStyle;
177
+ strokeWidth: number;
178
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
179
+ roundness: null | {
180
+ type: import("@excalidraw/element/types").RoundnessType;
181
+ value?: number;
182
+ };
183
+ roughness: number;
184
+ opacity: number;
185
+ width: number;
186
+ height: number;
187
+ angle: import("@excalidraw/math").Radians;
188
+ seed: number;
189
+ version: number;
190
+ versionNonce: number;
191
+ index: import("@excalidraw/element/types").FractionalIndex | null;
192
+ isDeleted: boolean;
193
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
194
+ frameId: string | null;
195
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
196
+ updated: number;
197
+ link: string | null;
198
+ locked: boolean;
199
+ customData?: Record<string, any>;
200
+ }> & Readonly<{
201
+ type: "embeddable";
202
+ }> & {
203
+ isDeleted: boolean;
204
+ }) | (Readonly<{
205
+ id: string;
206
+ x: number;
207
+ y: number;
208
+ strokeColor: string;
209
+ backgroundColor: string;
210
+ fillStyle: import("@excalidraw/element/types").FillStyle;
211
+ strokeWidth: number;
212
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
213
+ roundness: null | {
214
+ type: import("@excalidraw/element/types").RoundnessType;
215
+ value?: number;
216
+ };
217
+ roughness: number;
218
+ opacity: number;
219
+ width: number;
220
+ height: number;
221
+ angle: import("@excalidraw/math").Radians;
222
+ seed: number;
223
+ version: number;
224
+ versionNonce: number;
225
+ index: import("@excalidraw/element/types").FractionalIndex | null;
226
+ isDeleted: boolean;
227
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
228
+ frameId: string | null;
229
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
230
+ updated: number;
231
+ link: string | null;
232
+ locked: boolean;
233
+ customData?: Record<string, any>;
234
+ }> & Readonly<{
235
+ type: "iframe";
236
+ customData?: {
237
+ generationData?: import("@excalidraw/element/types").MagicGenerationData;
238
+ };
239
+ }> & {
240
+ isDeleted: boolean;
241
+ }) | (Readonly<{
242
+ id: string;
243
+ x: number;
244
+ y: number;
245
+ strokeColor: string;
246
+ backgroundColor: string;
247
+ fillStyle: import("@excalidraw/element/types").FillStyle;
248
+ strokeWidth: number;
249
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
250
+ roundness: null | {
251
+ type: import("@excalidraw/element/types").RoundnessType;
252
+ value?: number;
253
+ };
254
+ roughness: number;
255
+ opacity: number;
256
+ width: number;
257
+ height: number;
258
+ angle: import("@excalidraw/math").Radians;
259
+ seed: number;
260
+ version: number;
261
+ versionNonce: number;
262
+ index: import("@excalidraw/element/types").FractionalIndex | null;
263
+ isDeleted: boolean;
264
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
265
+ frameId: string | null;
266
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
267
+ updated: number;
268
+ link: string | null;
269
+ locked: boolean;
270
+ customData?: Record<string, any>;
271
+ }> & Readonly<{
272
+ type: "image";
273
+ fileId: import("@excalidraw/element/types").FileId | null;
274
+ status: "pending" | "saved" | "error";
275
+ scale: [number, number];
276
+ crop: import("@excalidraw/element/types").ImageCrop | null;
277
+ }> & {
278
+ isDeleted: boolean;
279
+ }) | (Readonly<{
280
+ id: string;
281
+ x: number;
282
+ y: number;
283
+ strokeColor: string;
284
+ backgroundColor: string;
285
+ fillStyle: import("@excalidraw/element/types").FillStyle;
286
+ strokeWidth: number;
287
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
288
+ roundness: null | {
289
+ type: import("@excalidraw/element/types").RoundnessType;
290
+ value?: number;
291
+ };
292
+ roughness: number;
293
+ opacity: number;
294
+ width: number;
295
+ height: number;
296
+ angle: import("@excalidraw/math").Radians;
297
+ seed: number;
298
+ version: number;
299
+ versionNonce: number;
300
+ index: import("@excalidraw/element/types").FractionalIndex | null;
301
+ isDeleted: boolean;
302
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
303
+ frameId: string | null;
304
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
305
+ updated: number;
306
+ link: string | null;
307
+ locked: boolean;
308
+ customData?: Record<string, any>;
309
+ }> & {
310
+ type: "frame";
311
+ name: string | null;
312
+ } & {
313
+ isDeleted: boolean;
314
+ }) | (Readonly<{
315
+ id: string;
316
+ x: number;
317
+ y: number;
318
+ strokeColor: string;
319
+ backgroundColor: string;
320
+ fillStyle: import("@excalidraw/element/types").FillStyle;
321
+ strokeWidth: number;
322
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
323
+ roundness: null | {
324
+ type: import("@excalidraw/element/types").RoundnessType;
325
+ value?: number;
326
+ };
327
+ roughness: number;
328
+ opacity: number;
329
+ width: number;
330
+ height: number;
331
+ angle: import("@excalidraw/math").Radians;
332
+ seed: number;
333
+ version: number;
334
+ versionNonce: number;
335
+ index: import("@excalidraw/element/types").FractionalIndex | null;
336
+ isDeleted: boolean;
337
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
338
+ frameId: string | null;
339
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
340
+ updated: number;
341
+ link: string | null;
342
+ locked: boolean;
343
+ customData?: Record<string, any>;
344
+ }> & {
345
+ type: "magicframe";
346
+ name: string | null;
347
+ } & {
348
+ isDeleted: boolean;
349
+ }) | (Readonly<{
350
+ id: string;
351
+ x: number;
352
+ y: number;
353
+ strokeColor: string;
354
+ backgroundColor: string;
355
+ fillStyle: import("@excalidraw/element/types").FillStyle;
356
+ strokeWidth: number;
357
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
358
+ roundness: null | {
359
+ type: import("@excalidraw/element/types").RoundnessType;
360
+ value?: number;
361
+ };
362
+ roughness: number;
363
+ opacity: number;
364
+ width: number;
365
+ height: number;
366
+ angle: import("@excalidraw/math").Radians;
367
+ seed: number;
368
+ version: number;
369
+ versionNonce: number;
370
+ index: import("@excalidraw/element/types").FractionalIndex | null;
371
+ isDeleted: boolean;
372
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
373
+ frameId: string | null;
374
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
375
+ updated: number;
376
+ link: string | null;
377
+ locked: boolean;
378
+ customData?: Record<string, any>;
379
+ }> & Readonly<{
380
+ type: "text";
381
+ fontSize: number;
382
+ fontFamily: import("@excalidraw/element/types").FontFamilyValues;
383
+ text: string;
384
+ textAlign: import("@excalidraw/element/types").TextAlign;
385
+ verticalAlign: import("@excalidraw/element/types").VerticalAlign;
386
+ containerId: import("@excalidraw/element/types").ExcalidrawGenericElement["id"] | null;
387
+ originalText: string;
388
+ autoResize: boolean;
389
+ lineHeight: number & {
390
+ _brand: "unitlessLineHeight";
391
+ };
392
+ }> & {
393
+ isDeleted: boolean;
394
+ }) | (Readonly<{
395
+ id: string;
396
+ x: number;
397
+ y: number;
398
+ strokeColor: string;
399
+ backgroundColor: string;
400
+ fillStyle: import("@excalidraw/element/types").FillStyle;
401
+ strokeWidth: number;
402
+ strokeStyle: import("@excalidraw/element/types").StrokeStyle;
403
+ roundness: null | {
404
+ type: import("@excalidraw/element/types").RoundnessType;
405
+ value?: number;
406
+ };
407
+ roughness: number;
408
+ opacity: number;
409
+ width: number;
410
+ height: number;
411
+ angle: import("@excalidraw/math").Radians;
412
+ seed: number;
413
+ version: number;
414
+ versionNonce: number;
415
+ index: import("@excalidraw/element/types").FractionalIndex | null;
416
+ isDeleted: boolean;
417
+ groupIds: readonly import("@excalidraw/element/types").GroupId[];
418
+ frameId: string | null;
419
+ boundElements: readonly import("@excalidraw/element/types").BoundElement[] | null;
420
+ updated: number;
421
+ link: string | null;
422
+ locked: boolean;
423
+ customData?: Record<string, any>;
424
+ }> & Readonly<{
425
+ type: "freedraw";
426
+ points: readonly import("@excalidraw/math").LocalPoint[];
427
+ pressures: readonly number[];
428
+ simulatePressure: boolean;
429
+ strokeOptions: import("@excalidraw/element/types").StrokeOptions;
430
+ }> & {
431
+ isDeleted: boolean;
432
+ }) | null;
433
+ canvasNonce: string;
28
434
  };
29
435
  destroy(): void;
30
436
  }
437
+ export {};
@@ -1,4 +1,4 @@
1
1
  export { isSomeElementSelected, getElementsWithinSelection, getSelectedElements, getTargetElements, } from "@excalidraw/element";
2
2
  export { calculateScrollCenter } from "./scroll";
3
- export { hasBackground, hasStrokeWidth, hasStrokeStyle, canHaveArrowheads, canChangeRoundness, } from "@excalidraw/element";
3
+ export { hasBackground, hasStrokeWidth, hasStrokeStyle, hasFreedrawMode, canHaveArrowheads, canChangeRoundness, } from "@excalidraw/element";
4
4
  export { getNormalizedZoom, getNormalizedGridSize, getNormalizedGridStep, } from "./normalize";
@@ -0,0 +1,15 @@
1
+ import { type GlobalPoint } from "@excalidraw/math";
2
+ import type { EditorInterface } from "@excalidraw/common";
3
+ import type { ExcalidrawTextElement } from "@excalidraw/element/types";
4
+ export declare const getTextBoxPadding: (zoomValue: number) => number;
5
+ export declare const getTextAutoResizeHandle: (textElement: ExcalidrawTextElement, zoomValue: number, formFactor: EditorInterface["formFactor"]) => {
6
+ center: GlobalPoint | import("@excalidraw/math").LocalPoint;
7
+ start: GlobalPoint;
8
+ end: GlobalPoint;
9
+ hitboxWidth: number;
10
+ hitboxHeight: number;
11
+ } | null;
12
+ export declare const isPointHittingTextAutoResizeHandle: (point: Readonly<{
13
+ x: number;
14
+ y: number;
15
+ }>, textElement: ExcalidrawTextElement, zoomValue: number, formFactor: EditorInterface["formFactor"]) => boolean;