import type { ExcalidrawElement } from "@excalidraw/element/types"; import type { MaybePromise } from "@excalidraw/common/utility-types"; import type { AppState, BinaryFiles } from "../types"; import type { ImportedDataState } from "./types"; export type JSONExportData = { elements: readonly ExcalidrawElement[]; appState: AppState; files: BinaryFiles; }; export declare const serializeAsJSON: (elements: readonly ExcalidrawElement[], appState: Partial, files: BinaryFiles, type: "local" | "database") => string; export declare const saveAsJSON: ({ data, filename, fileHandle, }: { data: MaybePromise; filename: string; fileHandle: AppState["fileHandle"]; }) => Promise<{ fileHandle: FileSystemFileHandle | null; }>; export declare const loadFromJSON: (localAppState: AppState, localElements: readonly ExcalidrawElement[] | null) => Promise<{ elements: import("@excalidraw/element/types").OrderedExcalidrawElement[]; appState: { viewBackgroundColor: string; theme: import("@excalidraw/element/types").Theme; frameRendering: { enabled: boolean; name: boolean; outline: boolean; clip: boolean; }; name: string | null; zoom: import("../types").Zoom; scrollX: number; scrollY: number; viewpointFlip: import("@excalidraw/common").ViewpointFlip; viewModeEnabled: boolean; openDialog: null | { name: "imageExport" | "help" | "jsonExport"; } | { name: "settings"; } | { name: "elementLinkSelector"; sourceElementId: ExcalidrawElement["id"]; } | { name: "charts"; data: import("../charts").Spreadsheet; rawText: string; }; editingGroupId: import("@excalidraw/element/types").GroupId | null; selectedElementIds: Readonly<{ [id: string]: true; }>; frameToHighlight: import("@excalidraw/element/types").NonDeleted | null; activeTool: { lastActiveTool: import("../types").ActiveTool | null; locked: boolean; fromSelection: boolean; } & import("../types").ActiveTool; activeEmbeddable: { element: import("@excalidraw/element/types").NonDeletedExcalidrawElement; state: "hover" | "active"; } | null; selectionElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null; selectedGroupIds: { [groupId: string]: boolean; }; selectedLinearElement: import("@excalidraw/element").LinearElementEditor | null; multiElement: import("@excalidraw/element/types").NonDeleted | null; newElement: import("@excalidraw/element/types").NonDeleted | null; isBindingEnabled: boolean; isMidpointSnappingEnabled: boolean; gridModeEnabled: boolean; suggestedBinding: { element: import("@excalidraw/element/types").NonDeleted; midPoint?: import("@excalidraw/math").GlobalPoint; } | null; hoveredArrowTextAnchor: { elementId: import("@excalidraw/element/types").ExcalidrawArrowElement["id"]; anchor: "start" | "end" | "label"; } | null; isRotating: boolean; elementsToHighlight: readonly import("@excalidraw/element/types").NonDeletedExcalidrawElement[] | null; collaborators: Map; snapLines: readonly import("../snapping").SnapLine[]; zenModeEnabled: boolean; editingTextElement: import("@excalidraw/element/types").ExcalidrawTextElement | null; isCropping: boolean; croppingElementId: ExcalidrawElement["id"] | null; searchMatches: Readonly<{ focusedId: ExcalidrawElement["id"] | null; matches: readonly import("../types").SearchMatch[]; }> | null; activeLockedId: string | null; hoveredElementIds: Readonly<{ [id: string]: true; }>; shouldCacheIgnoreZoom: boolean; exportScale: number; currentItemArrowType: "sharp" | "round" | "elbow"; gridSize: number; bindMode: import("@excalidraw/element/types").BindMode; viewModeOnly: boolean; objectsSnapModeEnabled: boolean; wheelZoomsOnDefault?: boolean | undefined; selectedElementsAreBeingDragged: boolean; gridStep: number; currentHoveredFontFamily: import("@excalidraw/element/types").FontFamilyValues | null; contextMenu: { items: import("../components/ContextMenu").ContextMenuItems; top: number; left: number; } | null; showWelcomeScreen: boolean; isLoading: boolean; myocSimplifiedMode: boolean; dontResizeLimitMBs: number; hideMainMenus: boolean; alignConfiguration: { stacking: boolean; }; arrangeConfiguration: { algorithm: import("@excalidraw/element/types").ArrangeAlgorithms; gap: number; }; normaliseConfiguration: { mode: import("../types").NormaliseMode; metric: import("../types").NormaliseMetric; }; errorMessage: React.ReactNode; resizingElement: import("@excalidraw/element/types").NonDeletedExcalidrawElement | null; boxSelectionMode: import("../types").BoxSelectionMode; bindingPreference: "enabled" | "disabled"; editingFrame: import("@excalidraw/element/types").ExcalidrawFrameLikeElement["id"] | null; preferredSelectionTool: { type: "selection" | "lasso"; initialized: boolean; }; penMode: boolean; penDetected: boolean; exportBackground: boolean; exportEmbedScene: boolean; exportWithDarkMode: boolean; currentItemStrokeColor: string; currentItemBackgroundColor: string; currentItemFillStyle: ExcalidrawElement["fillStyle"]; currentItemStrokeWidthKey: import("@excalidraw/common").StrokeWidthKey; currentItemStrokeStyle: ExcalidrawElement["strokeStyle"]; currentItemRoughness: number; currentItemStrokeVariability: import("@excalidraw/element/types").StrokeVariability; currentItemOpacity: number; currentItemFontFamily: import("@excalidraw/element/types").FontFamilyValues; currentItemFontSize: number; currentItemTextAlign: import("@excalidraw/element/types").TextAlign; currentItemStartArrowhead: import("@excalidraw/element/types").Arrowhead | null; currentItemEndArrowhead: import("@excalidraw/element/types").Arrowhead | null; currentItemRoundness: import("@excalidraw/element/types").StrokeRoundness; scrollConstraints: import("../types").ScrollConstraints | null; cursorButton: "up" | "down"; scrolledOutside: boolean; isResizing: boolean; openMenu: "canvas" | null; openPopup: "canvasBackground" | "elementBackground" | "elementStroke" | "fontFamily" | "compactTextProperties" | "compactStrokeStyles" | "compactOtherProperties" | "compactArrowProperties" | "gifFrameGallery" | "gifSpeedPicker" | null; openSidebar: { name: import("../types").SidebarName; tab?: import("../types").SidebarTabName; } | null; defaultSidebarDockedPreference: boolean; lastPointerDownWith: import("@excalidraw/element/types").PointerType; previousSelectedElementIds: { [id: string]: true; }; toast: { message: React.ReactNode; closable?: boolean; duration?: number; } | null; fileHandle: FileSystemFileHandle | null; stats: { open: boolean; panels: number; }; showHyperlinkPopup: false | "info" | "editor"; originSnapOffset: { x: number; y: number; } | null; lockedMultiSelections: { [groupId: string]: true; }; colorTopPicks: { elementStroke: readonly string[] | null; elementBackground: readonly string[] | null; bucketFill: readonly string[] | null; }; }; files: BinaryFiles; }>; export declare const isValidExcalidrawData: (data?: { type?: any; elements?: any; appState?: any; }) => data is ImportedDataState;