@excalidraw/common 0.18.0-9ba0f5d → 0.18.0-a9ca16e

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 (128) hide show
  1. package/dist/dev/index.js +315 -21
  2. package/dist/dev/index.js.map +3 -3
  3. package/dist/prod/index.js +3 -3
  4. package/dist/types/common/debug.d.ts +21 -0
  5. package/dist/types/common/src/appEventBus.d.ts +27 -0
  6. package/dist/types/common/src/colors.d.ts +13 -13
  7. package/dist/types/common/src/constants.d.ts +4 -0
  8. package/dist/types/common/src/index.d.ts +3 -0
  9. package/dist/types/common/src/utils.d.ts +4 -7
  10. package/dist/types/common/src/versionedSnapshotStore.d.ts +17 -0
  11. package/dist/types/element/src/Scene.d.ts +2 -0
  12. package/dist/types/element/src/arrowheads.d.ts +3 -0
  13. package/dist/types/element/src/arrows/focus.d.ts +27 -0
  14. package/dist/types/element/src/arrows/helpers.d.ts +5 -0
  15. package/dist/types/element/src/binding.d.ts +13 -8
  16. package/dist/types/element/src/bounds.d.ts +1 -1
  17. package/dist/types/element/src/collision.d.ts +4 -3
  18. package/dist/types/element/src/distribute.d.ts +2 -1
  19. package/dist/types/element/src/elbowArrow.d.ts +2 -0
  20. package/dist/types/element/src/index.d.ts +3 -0
  21. package/dist/types/element/src/linearElementEditor.d.ts +5 -0
  22. package/dist/types/element/src/mutateElement.d.ts +2 -0
  23. package/dist/types/element/src/selection.d.ts +6 -2
  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/types.d.ts +5 -2
  27. package/dist/types/element/src/utils.d.ts +5 -3
  28. package/dist/types/element/src/zindex.d.ts +1 -1
  29. package/dist/types/excalidraw/actions/actionAddToLibrary.d.ts +38 -35
  30. package/dist/types/excalidraw/actions/actionBoundText.d.ts +27 -25
  31. package/dist/types/excalidraw/actions/actionCanvas.d.ts +216 -204
  32. package/dist/types/excalidraw/actions/actionClipboard.d.ts +26 -24
  33. package/dist/types/excalidraw/actions/actionCropEditor.d.ts +13 -12
  34. package/dist/types/excalidraw/actions/actionDeleteSelected.d.ts +42 -37
  35. package/dist/types/excalidraw/actions/actionElementLink.d.ts +9 -12
  36. package/dist/types/excalidraw/actions/actionElementLock.d.ts +26 -24
  37. package/dist/types/excalidraw/actions/actionEmbeddable.d.ts +13 -12
  38. package/dist/types/excalidraw/actions/actionExport.d.ts +114 -386
  39. package/dist/types/excalidraw/actions/actionFrame.d.ts +52 -48
  40. package/dist/types/excalidraw/actions/actionGroup.d.ts +29 -27
  41. package/dist/types/excalidraw/actions/actionLinearEditor.d.ts +15 -12
  42. package/dist/types/excalidraw/actions/actionLink.d.ts +13 -12
  43. package/dist/types/excalidraw/actions/actionMenu.d.ts +9 -12
  44. package/dist/types/excalidraw/actions/actionProperties.d.ts +29 -27
  45. package/dist/types/excalidraw/actions/actionSelectAll.d.ts +14 -13
  46. package/dist/types/excalidraw/actions/actionStyles.d.ts +13 -11
  47. package/dist/types/excalidraw/actions/actionTextAutoResize.d.ts +3 -3
  48. package/dist/types/excalidraw/actions/actionToggleArrowBinding.d.ts +172 -0
  49. package/dist/types/excalidraw/actions/actionToggleGridMode.d.ts +13 -12
  50. package/dist/types/excalidraw/actions/actionToggleMidpointSnapping.d.ts +172 -0
  51. package/dist/types/excalidraw/actions/actionToggleObjectsSnapMode.d.ts +13 -12
  52. package/dist/types/excalidraw/actions/actionToggleSearchMenu.d.ts +9 -12
  53. package/dist/types/excalidraw/actions/actionToggleStats.d.ts +13 -12
  54. package/dist/types/excalidraw/actions/actionToggleViewMode.d.ts +13 -12
  55. package/dist/types/excalidraw/actions/actionToggleZenMode.d.ts +13 -12
  56. package/dist/types/excalidraw/actions/index.d.ts +2 -0
  57. package/dist/types/excalidraw/actions/shortcuts.d.ts +1 -1
  58. package/dist/types/excalidraw/actions/types.d.ts +1 -1
  59. package/dist/types/excalidraw/appState.d.ts +29 -27
  60. package/dist/types/excalidraw/charts/charts.bar.d.ts +2 -0
  61. package/dist/types/excalidraw/charts/charts.constants.d.ts +48 -0
  62. package/dist/types/excalidraw/charts/charts.helpers.d.ts +32 -0
  63. package/dist/types/excalidraw/charts/charts.line.d.ts +2 -0
  64. package/dist/types/excalidraw/charts/charts.parse.d.ts +10 -0
  65. package/dist/types/excalidraw/charts/charts.radar.d.ts +2 -0
  66. package/dist/types/excalidraw/charts/charts.types.d.ts +18 -0
  67. package/dist/types/excalidraw/charts/index.d.ts +7 -0
  68. package/dist/types/excalidraw/clipboard.d.ts +8 -9
  69. package/dist/types/excalidraw/components/App.d.ts +53 -13
  70. package/dist/types/excalidraw/components/AppStateObserver.d.ts +37 -0
  71. package/dist/types/excalidraw/components/CommandPalette/types.d.ts +1 -1
  72. package/dist/types/excalidraw/components/IconPicker.d.ts +14 -9
  73. package/dist/types/excalidraw/components/PasteChartDialog.d.ts +4 -5
  74. package/dist/types/excalidraw/components/PropertiesPopover.d.ts +1 -1
  75. package/dist/types/excalidraw/components/Range.d.ts +10 -4
  76. package/dist/types/excalidraw/components/TTDDialog/Chat/ChatInterface.d.ts +2 -6
  77. package/dist/types/excalidraw/components/TTDDialog/Chat/TTDChatPanel.d.ts +2 -1
  78. package/dist/types/excalidraw/components/TTDDialog/CodeMirrorEditor.d.ts +11 -0
  79. package/dist/types/excalidraw/components/TTDDialog/TTDDialog.d.ts +11 -7
  80. package/dist/types/excalidraw/components/TTDDialog/TTDDialogInput.d.ts +3 -3
  81. package/dist/types/excalidraw/components/TTDDialog/TTDDialogOutput.d.ts +4 -1
  82. package/dist/types/excalidraw/components/TTDDialog/TTDWelcomeMessage.d.ts +1 -0
  83. package/dist/types/excalidraw/components/TTDDialog/TextToDiagram.d.ts +2 -1
  84. package/dist/types/excalidraw/components/TTDDialog/mermaid-lang-lite.d.ts +2 -0
  85. package/dist/types/excalidraw/components/TTDDialog/types.d.ts +4 -0
  86. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidAutoFix.d.ts +1 -0
  87. package/dist/types/excalidraw/components/TTDDialog/utils/mermaidError.d.ts +10 -0
  88. package/dist/types/excalidraw/components/Toast.d.ts +8 -4
  89. package/dist/types/excalidraw/components/canvases/InteractiveCanvas.d.ts +1 -0
  90. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenu.d.ts +30 -16
  91. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuContent.d.ts +3 -2
  92. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItem.d.ts +11 -12
  93. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemCheckbox.d.ts +5 -0
  94. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuItemContent.d.ts +2 -1
  95. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSub.d.ts +23 -0
  96. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubContent.d.ts +8 -0
  97. package/dist/types/excalidraw/components/dropdownMenu/DropdownMenuSubTrigger.d.ts +12 -0
  98. package/dist/types/excalidraw/components/dropdownMenu/common.d.ts +1 -1
  99. package/dist/types/excalidraw/components/dropdownMenu/dropdownMenuUtils.d.ts +2 -0
  100. package/dist/types/excalidraw/components/icons.d.ts +23 -9
  101. package/dist/types/excalidraw/components/main-menu/DefaultItems.d.ts +17 -0
  102. package/dist/types/excalidraw/components/main-menu/MainMenu.d.ts +23 -14
  103. package/dist/types/excalidraw/components/shapes.d.ts +74 -1
  104. package/dist/types/excalidraw/data/blob.d.ts +167 -166
  105. package/dist/types/excalidraw/data/filesystem.d.ts +3 -5
  106. package/dist/types/excalidraw/data/index.d.ts +2 -3
  107. package/dist/types/excalidraw/data/json.d.ts +94 -85
  108. package/dist/types/excalidraw/data/resave.d.ts +7 -2
  109. package/dist/types/excalidraw/textAutoResizeHandle.d.ts +15 -0
  110. package/dist/types/excalidraw/types.d.ts +93 -16
  111. package/dist/types/excalidraw/wysiwyg/textWysiwyg.d.ts +5 -1
  112. package/dist/types/math/src/point.d.ts +7 -2
  113. package/dist/types/math/src/types.d.ts +25 -1
  114. package/package.json +1 -1
  115. package/dist/types/excalidraw/charts.d.ts +0 -27
  116. package/dist/types/excalidraw/components/DiagramToCodePlugin/DiagramToCodePlugin.d.ts +0 -4
  117. package/dist/types/excalidraw/components/ExcalidrawLogo.d.ts +0 -15
  118. package/dist/types/excalidraw/components/InitializeApp.d.ts +0 -10
  119. package/dist/types/excalidraw/components/TTDDialog/TTDDialogTrigger.d.ts +0 -8
  120. package/dist/types/excalidraw/components/TTDDialog/utils/TTDStreamFetch.d.ts +0 -24
  121. package/dist/types/excalidraw/components/footer/FooterCenter.d.ts +0 -8
  122. package/dist/types/excalidraw/components/live-collaboration/LiveCollaborationTrigger.d.ts +0 -11
  123. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Center.d.ts +0 -58
  124. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.Hints.d.ts +0 -19
  125. package/dist/types/excalidraw/components/welcome-screen/WelcomeScreen.d.ts +0 -84
  126. package/dist/types/excalidraw/data/reconcile.d.ts +0 -7
  127. package/dist/types/excalidraw/index.d.ts +0 -46
  128. package/dist/types/excalidraw/polyfill.d.ts +0 -2
@@ -2,12 +2,11 @@ import { IMAGE_MIME_TYPES, MIME_TYPES } from "@excalidraw/common";
2
2
  import type { ValueOf } from "@excalidraw/common/utility-types";
3
3
  import type { ExcalidrawElement, FileId } from "@excalidraw/element/types";
4
4
  import type { AppState, DataURL, LibraryItem } from "../types";
5
- import type { FileSystemHandle } from "browser-fs-access";
6
5
  import type { ImportedLibraryData } from "./types";
7
6
  export declare const getMimeType: (blob: Blob | string) => string;
8
- export declare const getFileHandleType: (handle: FileSystemHandle | null) => string | null;
7
+ export declare const getFileHandleType: (handle: FileSystemFileHandle | null) => string | null;
9
8
  export declare const isImageFileHandleType: (type: string | null) => type is "png" | "svg";
10
- export declare const isImageFileHandle: (handle: FileSystemHandle | null) => boolean;
9
+ export declare const isImageFileHandle: (handle: FileSystemFileHandle | null) => handle is FileSystemFileHandle;
11
10
  export declare const isSupportedImageFileType: (type: string | null | undefined) => boolean;
12
11
  export declare const isSupportedImageFile: (blob: Blob | null | undefined) => blob is Blob & {
13
12
  type: ValueOf<typeof IMAGE_MIME_TYPES>;
@@ -15,76 +14,25 @@ export declare const isSupportedImageFile: (blob: Blob | null | undefined) => bl
15
14
  export declare const loadSceneOrLibraryFromBlob: (blob: Blob | File,
16
15
  /** @see restore.localAppState */
17
16
  localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null,
18
- /** FileSystemHandle. Defaults to `blob.handle` if defined, otherwise null. */
19
- fileHandle?: FileSystemHandle | null) => Promise<{
17
+ /** FileSystemFileHandle. Defaults to `blob.handle` if defined, otherwise null. */
18
+ fileHandle?: FileSystemFileHandle | null) => Promise<{
20
19
  type: "application/vnd.excalidraw+json";
21
20
  data: {
22
21
  elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
23
22
  appState: {
24
- viewBackgroundColor: string;
25
- theme: import("@excalidraw/element/types").Theme;
26
- frameRendering: {
27
- enabled: boolean;
28
- name: boolean;
29
- outline: boolean;
30
- clip: boolean;
31
- };
32
- name: string | null;
33
- zoom: import("../types").Zoom;
34
- scrollX: number;
35
- scrollY: number;
36
23
  viewModeEnabled: boolean;
37
- openDialog: null | {
38
- name: "imageExport" | "help" | "jsonExport";
39
- } | {
40
- name: "ttd";
41
- tab: "text-to-diagram" | "mermaid";
42
- } | {
43
- name: "commandPalette";
44
- } | {
45
- name: "settings";
46
- } | {
47
- name: "elementLinkSelector";
48
- sourceElementId: ExcalidrawElement["id"];
49
- };
50
- editingGroupId: import("@excalidraw/element/types").GroupId | null;
51
- selectedElementIds: Readonly<{
52
- [id: string]: true;
53
- }>;
54
- frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
55
- activeEmbeddable: {
56
- element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
57
- state: "hover" | "active";
58
- } | null;
59
- selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
60
- selectedGroupIds: {
61
- [groupId: string]: boolean;
62
- };
63
- selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
64
- multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
65
- newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
66
- isBindingEnabled: boolean;
67
- suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
68
- isRotating: boolean;
69
- elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
70
- collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
71
- snapLines: readonly import("../snapping").SnapLine[];
72
24
  zenModeEnabled: boolean;
73
- editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
74
- isCropping: boolean;
75
- croppingElementId: ExcalidrawElement["id"] | null;
76
- searchMatches: Readonly<{
77
- focusedId: ExcalidrawElement["id"] | null;
78
- matches: readonly import("../types").SearchMatch[];
79
- }> | null;
80
- activeLockedId: string | null;
81
- hoveredElementIds: Readonly<{
82
- [id: string]: true;
83
- }>;
84
- shouldCacheIgnoreZoom: boolean;
85
- exportScale: number;
86
- bindMode: import("@excalidraw/element/types").BindMode;
25
+ gridModeEnabled: boolean;
26
+ objectsSnapModeEnabled: boolean;
27
+ theme: import("@excalidraw/element/types").Theme;
28
+ name: string | null;
29
+ currentItemArrowType: "sharp" | "round" | "elbow";
87
30
  gridSize: number;
31
+ activeTool: {
32
+ lastActiveTool: import("../types").ActiveTool | null;
33
+ locked: boolean;
34
+ fromSelection: boolean;
35
+ } & import("../types").ActiveTool;
88
36
  contextMenu: {
89
37
  items: import("../components/ContextMenu").ContextMenuItems;
90
38
  top: number;
@@ -93,14 +41,32 @@ fileHandle?: FileSystemHandle | null) => Promise<{
93
41
  showWelcomeScreen: boolean;
94
42
  isLoading: boolean;
95
43
  errorMessage: React.ReactNode;
44
+ activeEmbeddable: {
45
+ element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
46
+ state: "hover" | "active";
47
+ } | null;
48
+ newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
96
49
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
50
+ multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
51
+ selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
52
+ isBindingEnabled: boolean;
53
+ bindingPreference: "enabled" | "disabled";
54
+ isMidpointSnappingEnabled: boolean;
97
55
  startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
56
+ suggestedBinding: {
57
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
58
+ midPoint?: import("@excalidraw/math").GlobalPoint;
59
+ } | null;
60
+ frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
61
+ frameRendering: {
62
+ enabled: boolean;
63
+ name: boolean;
64
+ outline: boolean;
65
+ clip: boolean;
66
+ };
98
67
  editingFrame: string | null;
99
- activeTool: {
100
- lastActiveTool: import("../types").ActiveTool | null;
101
- locked: boolean;
102
- fromSelection: boolean;
103
- } & import("../types").ActiveTool;
68
+ elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
69
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
104
70
  preferredSelectionTool: {
105
71
  type: "selection" | "lasso";
106
72
  initialized: boolean;
@@ -110,6 +76,7 @@ fileHandle?: FileSystemHandle | null) => Promise<{
110
76
  exportBackground: boolean;
111
77
  exportEmbedScene: boolean;
112
78
  exportWithDarkMode: boolean;
79
+ exportScale: number;
113
80
  currentItemStrokeColor: string;
114
81
  currentItemBackgroundColor: string;
115
82
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
@@ -124,53 +91,86 @@ fileHandle?: FileSystemHandle | null) => Promise<{
124
91
  currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
125
92
  currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
126
93
  currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
127
- currentItemArrowType: "sharp" | "round" | "elbow";
94
+ viewBackgroundColor: string;
95
+ scrollX: number;
96
+ scrollY: number;
128
97
  cursorButton: "up" | "down";
129
98
  scrolledOutside: boolean;
130
99
  isResizing: boolean;
100
+ isRotating: boolean;
101
+ zoom: import("../types").Zoom;
131
102
  openMenu: "canvas" | null;
132
103
  openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
133
104
  openSidebar: {
134
105
  name: import("../types").SidebarName;
135
106
  tab?: import("../types").SidebarTabName;
136
107
  } | null;
108
+ openDialog: null | {
109
+ name: "imageExport" | "help" | "jsonExport";
110
+ } | {
111
+ name: "ttd";
112
+ tab: "text-to-diagram" | "mermaid";
113
+ } | {
114
+ name: "commandPalette";
115
+ } | {
116
+ name: "settings";
117
+ } | {
118
+ name: "elementLinkSelector";
119
+ sourceElementId: ExcalidrawElement["id"];
120
+ } | {
121
+ name: "charts";
122
+ data: import("../charts").Spreadsheet;
123
+ rawText: string;
124
+ };
137
125
  defaultSidebarDockedPreference: boolean;
138
126
  lastPointerDownWith: import("@excalidraw/element/types").PointerType;
127
+ selectedElementIds: Readonly<{
128
+ [id: string]: true;
129
+ }>;
130
+ hoveredElementIds: Readonly<{
131
+ [id: string]: true;
132
+ }>;
139
133
  previousSelectedElementIds: {
140
134
  [id: string]: true;
141
135
  };
142
136
  selectedElementsAreBeingDragged: boolean;
137
+ shouldCacheIgnoreZoom: boolean;
143
138
  toast: {
144
- message: string;
139
+ message: React.ReactNode;
145
140
  closable?: boolean;
146
141
  duration?: number;
147
142
  } | null;
148
143
  gridStep: number;
149
- gridModeEnabled: boolean;
150
- fileHandle: FileSystemHandle | null;
144
+ selectedGroupIds: {
145
+ [groupId: string]: boolean;
146
+ };
147
+ editingGroupId: import("@excalidraw/element/types").GroupId | null;
148
+ fileHandle: FileSystemFileHandle | null;
149
+ collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
151
150
  stats: {
152
151
  open: boolean;
153
152
  panels: number;
154
153
  };
155
- currentChartType: import("@excalidraw/element/types").ChartType;
156
- pasteDialog: {
157
- shown: false;
158
- data: null;
159
- } | {
160
- shown: true;
161
- data: import("../charts").Spreadsheet;
162
- };
163
154
  showHyperlinkPopup: false | "info" | "editor";
155
+ selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
156
+ snapLines: readonly import("../snapping").SnapLine[];
164
157
  originSnapOffset: {
165
158
  x: number;
166
159
  y: number;
167
160
  } | null;
168
- objectsSnapModeEnabled: boolean;
169
161
  userToFollow: import("../types").UserToFollow | null;
170
162
  followedBy: Set<import("../types").SocketId>;
163
+ isCropping: boolean;
164
+ croppingElementId: ExcalidrawElement["id"] | null;
165
+ searchMatches: Readonly<{
166
+ focusedId: ExcalidrawElement["id"] | null;
167
+ matches: readonly import("../types").SearchMatch[];
168
+ }> | null;
169
+ activeLockedId: string | null;
171
170
  lockedMultiSelections: {
172
171
  [groupId: string]: true;
173
172
  };
173
+ bindMode: import("@excalidraw/element/types").BindMode;
174
174
  };
175
175
  files: import("../types").BinaryFiles;
176
176
  };
@@ -181,74 +181,23 @@ fileHandle?: FileSystemHandle | null) => Promise<{
181
181
  export declare const loadFromBlob: (blob: Blob,
182
182
  /** @see restore.localAppState */
183
183
  localAppState: AppState | null, localElements: readonly ExcalidrawElement[] | null,
184
- /** FileSystemHandle. Defaults to `blob.handle` if defined, otherwise null. */
185
- fileHandle?: FileSystemHandle | null) => Promise<{
184
+ /** FileSystemFileHandle. Defaults to `blob.handle` if defined, otherwise null. */
185
+ fileHandle?: FileSystemFileHandle | null) => Promise<{
186
186
  elements: import("@excalidraw/element/types").OrderedExcalidrawElement[];
187
187
  appState: {
188
- viewBackgroundColor: string;
189
- theme: import("@excalidraw/element/types").Theme;
190
- frameRendering: {
191
- enabled: boolean;
192
- name: boolean;
193
- outline: boolean;
194
- clip: boolean;
195
- };
196
- name: string | null;
197
- zoom: import("../types").Zoom;
198
- scrollX: number;
199
- scrollY: number;
200
188
  viewModeEnabled: boolean;
201
- openDialog: null | {
202
- name: "imageExport" | "help" | "jsonExport";
203
- } | {
204
- name: "ttd";
205
- tab: "text-to-diagram" | "mermaid";
206
- } | {
207
- name: "commandPalette";
208
- } | {
209
- name: "settings";
210
- } | {
211
- name: "elementLinkSelector";
212
- sourceElementId: ExcalidrawElement["id"];
213
- };
214
- editingGroupId: import("@excalidraw/element/types").GroupId | null;
215
- selectedElementIds: Readonly<{
216
- [id: string]: true;
217
- }>;
218
- frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
219
- activeEmbeddable: {
220
- element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
221
- state: "hover" | "active";
222
- } | null;
223
- selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
224
- selectedGroupIds: {
225
- [groupId: string]: boolean;
226
- };
227
- selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
228
- multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
229
- newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
230
- isBindingEnabled: boolean;
231
- suggestedBinding: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
232
- isRotating: boolean;
233
- elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
234
- collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
235
- snapLines: readonly import("../snapping").SnapLine[];
236
189
  zenModeEnabled: boolean;
237
- editingTextElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
238
- isCropping: boolean;
239
- croppingElementId: ExcalidrawElement["id"] | null;
240
- searchMatches: Readonly<{
241
- focusedId: ExcalidrawElement["id"] | null;
242
- matches: readonly import("../types").SearchMatch[];
243
- }> | null;
244
- activeLockedId: string | null;
245
- hoveredElementIds: Readonly<{
246
- [id: string]: true;
247
- }>;
248
- shouldCacheIgnoreZoom: boolean;
249
- exportScale: number;
250
- bindMode: import("@excalidraw/element/types").BindMode;
190
+ gridModeEnabled: boolean;
191
+ objectsSnapModeEnabled: boolean;
192
+ theme: import("@excalidraw/element/types").Theme;
193
+ name: string | null;
194
+ currentItemArrowType: "sharp" | "round" | "elbow";
251
195
  gridSize: number;
196
+ activeTool: {
197
+ lastActiveTool: import("../types").ActiveTool | null;
198
+ locked: boolean;
199
+ fromSelection: boolean;
200
+ } & import("../types").ActiveTool;
252
201
  contextMenu: {
253
202
  items: import("../components/ContextMenu").ContextMenuItems;
254
203
  top: number;
@@ -257,14 +206,32 @@ fileHandle?: FileSystemHandle | null) => Promise<{
257
206
  showWelcomeScreen: boolean;
258
207
  isLoading: boolean;
259
208
  errorMessage: React.ReactNode;
209
+ activeEmbeddable: {
210
+ element: import("@excalidraw/element/types").NonDeletedExcalidrawElement;
211
+ state: "hover" | "active";
212
+ } | null;
213
+ newElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawNonSelectionElement> | null;
260
214
  resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
215
+ multiElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawLinearElement> | null;
216
+ selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null;
217
+ isBindingEnabled: boolean;
218
+ bindingPreference: "enabled" | "disabled";
219
+ isMidpointSnappingEnabled: boolean;
261
220
  startBoundElement: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement> | null;
221
+ suggestedBinding: {
222
+ element: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawBindableElement>;
223
+ midPoint?: import("@excalidraw/math").GlobalPoint;
224
+ } | null;
225
+ frameToHighlight: import("@excalidraw/element/types").NonDeleted<import("@excalidraw/element/types").ExcalidrawFrameLikeElement> | null;
226
+ frameRendering: {
227
+ enabled: boolean;
228
+ name: boolean;
229
+ outline: boolean;
230
+ clip: boolean;
231
+ };
262
232
  editingFrame: string | null;
263
- activeTool: {
264
- lastActiveTool: import("../types").ActiveTool | null;
265
- locked: boolean;
266
- fromSelection: boolean;
267
- } & import("../types").ActiveTool;
233
+ elementsToHighlight: import("@excalidraw/element/types").NonDeleted<ExcalidrawElement>[] | null;
234
+ editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null;
268
235
  preferredSelectionTool: {
269
236
  type: "selection" | "lasso";
270
237
  initialized: boolean;
@@ -274,6 +241,7 @@ fileHandle?: FileSystemHandle | null) => Promise<{
274
241
  exportBackground: boolean;
275
242
  exportEmbedScene: boolean;
276
243
  exportWithDarkMode: boolean;
244
+ exportScale: number;
277
245
  currentItemStrokeColor: string;
278
246
  currentItemBackgroundColor: string;
279
247
  currentItemFillStyle: ExcalidrawElement["fillStyle"];
@@ -288,53 +256,86 @@ fileHandle?: FileSystemHandle | null) => Promise<{
288
256
  currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null;
289
257
  currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null;
290
258
  currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness;
291
- currentItemArrowType: "sharp" | "round" | "elbow";
259
+ viewBackgroundColor: string;
260
+ scrollX: number;
261
+ scrollY: number;
292
262
  cursorButton: "up" | "down";
293
263
  scrolledOutside: boolean;
294
264
  isResizing: boolean;
265
+ isRotating: boolean;
266
+ zoom: import("../types").Zoom;
295
267
  openMenu: "canvas" | null;
296
268
  openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | null;
297
269
  openSidebar: {
298
270
  name: import("../types").SidebarName;
299
271
  tab?: import("../types").SidebarTabName;
300
272
  } | null;
273
+ openDialog: null | {
274
+ name: "imageExport" | "help" | "jsonExport";
275
+ } | {
276
+ name: "ttd";
277
+ tab: "text-to-diagram" | "mermaid";
278
+ } | {
279
+ name: "commandPalette";
280
+ } | {
281
+ name: "settings";
282
+ } | {
283
+ name: "elementLinkSelector";
284
+ sourceElementId: ExcalidrawElement["id"];
285
+ } | {
286
+ name: "charts";
287
+ data: import("../charts").Spreadsheet;
288
+ rawText: string;
289
+ };
301
290
  defaultSidebarDockedPreference: boolean;
302
291
  lastPointerDownWith: import("@excalidraw/element/types").PointerType;
292
+ selectedElementIds: Readonly<{
293
+ [id: string]: true;
294
+ }>;
295
+ hoveredElementIds: Readonly<{
296
+ [id: string]: true;
297
+ }>;
303
298
  previousSelectedElementIds: {
304
299
  [id: string]: true;
305
300
  };
306
301
  selectedElementsAreBeingDragged: boolean;
302
+ shouldCacheIgnoreZoom: boolean;
307
303
  toast: {
308
- message: string;
304
+ message: React.ReactNode;
309
305
  closable?: boolean;
310
306
  duration?: number;
311
307
  } | null;
312
308
  gridStep: number;
313
- gridModeEnabled: boolean;
314
- fileHandle: FileSystemHandle | null;
309
+ selectedGroupIds: {
310
+ [groupId: string]: boolean;
311
+ };
312
+ editingGroupId: import("@excalidraw/element/types").GroupId | null;
313
+ fileHandle: FileSystemFileHandle | null;
314
+ collaborators: Map<import("../types").SocketId, import("../types").Collaborator>;
315
315
  stats: {
316
316
  open: boolean;
317
317
  panels: number;
318
318
  };
319
- currentChartType: import("@excalidraw/element/types").ChartType;
320
- pasteDialog: {
321
- shown: false;
322
- data: null;
323
- } | {
324
- shown: true;
325
- data: import("../charts").Spreadsheet;
326
- };
327
319
  showHyperlinkPopup: false | "info" | "editor";
320
+ selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null;
321
+ snapLines: readonly import("../snapping").SnapLine[];
328
322
  originSnapOffset: {
329
323
  x: number;
330
324
  y: number;
331
325
  } | null;
332
- objectsSnapModeEnabled: boolean;
333
326
  userToFollow: import("../types").UserToFollow | null;
334
327
  followedBy: Set<import("../types").SocketId>;
328
+ isCropping: boolean;
329
+ croppingElementId: ExcalidrawElement["id"] | null;
330
+ searchMatches: Readonly<{
331
+ focusedId: ExcalidrawElement["id"] | null;
332
+ matches: readonly import("../types").SearchMatch[];
333
+ }> | null;
334
+ activeLockedId: string | null;
335
335
  lockedMultiSelections: {
336
336
  [groupId: string]: true;
337
337
  };
338
+ bindMode: import("@excalidraw/element/types").BindMode;
338
339
  };
339
340
  files: import("../types").BinaryFiles;
340
341
  }>;
@@ -358,7 +359,7 @@ export declare const SVGStringToFile: (SVGString: string, filename?: string) =>
358
359
  type: typeof MIME_TYPES.svg;
359
360
  };
360
361
  export declare const ImageURLToFile: (imageUrl: string, filename?: string) => Promise<File | undefined>;
361
- export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTransferItem) => Promise<FileSystemHandle | null>;
362
+ export declare const getFileHandle: (event: DragEvent | React.DragEvent | DataTransferItem) => Promise<FileSystemFileHandle | null>;
362
363
  export declare const createFile: (blob: File | Blob | ArrayBuffer, mimeType: string, name: string | undefined) => File;
363
364
  /** attempts to detect correct mimeType if none is set, or if an image
364
365
  * has an incorrect extension.
@@ -1,6 +1,5 @@
1
1
  import { supported as nativeFileSystemSupported } from "browser-fs-access";
2
2
  import { MIME_TYPES } from "@excalidraw/common";
3
- import type { FileSystemHandle } from "browser-fs-access";
4
3
  type FILE_EXTENSION = Exclude<keyof typeof MIME_TYPES, "binary">;
5
4
  export declare const fileOpen: <M extends boolean | undefined = false>(opts: {
6
5
  extensions?: FILE_EXTENSION[];
@@ -14,8 +13,7 @@ export declare const fileSave: (blob: Blob | Promise<Blob>, opts: {
14
13
  extension: FILE_EXTENSION;
15
14
  mimeTypes?: string[];
16
15
  description: string;
17
- /** existing FileSystemHandle */
18
- fileHandle?: FileSystemHandle | null;
19
- }) => Promise<FileSystemHandle | null>;
16
+ /** existing FileSystemFileHandle */
17
+ fileHandle?: FileSystemFileHandle | null;
18
+ }) => Promise<FileSystemFileHandle | null>;
20
19
  export { nativeFileSystemSupported };
21
- export type { FileSystemHandle };
@@ -1,5 +1,4 @@
1
1
  import type { ExcalidrawElement, ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "@excalidraw/element/types";
2
- import type { FileSystemHandle } from "./filesystem";
3
2
  import type { ExportType } from "../scene/types";
4
3
  import type { AppState, BinaryFiles } from "../types";
5
4
  export { loadFromBlob } from "./blob";
@@ -17,6 +16,6 @@ export declare const exportCanvas: (type: Omit<ExportType, "backend">, elements:
17
16
  viewBackgroundColor: string;
18
17
  /** filename, if applicable */
19
18
  name?: string;
20
- fileHandle?: FileSystemHandle | null;
19
+ fileHandle?: FileSystemFileHandle | null;
21
20
  exportingFrame: ExcalidrawFrameLikeElement | null;
22
- }) => Promise<FileSystemHandle | null | undefined>;
21
+ }) => Promise<FileSystemFileHandle | null | undefined>;