ImportedDataState
Data structure for importing Excalidraw scenes. All fields are optional to allow partial imports.Type identifier for the data format
Version number of the data format
Source application or identifier
Array of elements to import, or null
Partial application state to import. Can include legacy AppState properties:
isSidebarDocked(deprecated) maps todefaultSidebarDockedPreference
Whether to scroll to the imported content after loading
Library items to import (supports v1 and v2 formats)
Binary files (images, etc.) associated with the elements
ExportedDataState
Data structure for exporting Excalidraw scenes. This is a stricter version of ImportedDataState with required fields.Type identifier, typically
"excalidraw"Version number of the Excalidraw format
Source application identifier
Array of all elements in the scene
Cleaned application state with only exportable properties
Binary files associated with the scene, or undefined if none
BinaryFileData
Represents a binary file (typically an image) in Excalidraw.MIME type of the file. Can be an image type or generic binary
Unique identifier for the file (branded string type)
Data URL containing the file contents (branded string type)
Epoch timestamp in milliseconds when the file was created
Epoch timestamp in milliseconds when the file was last retrieved from storage. Used to determine whether to delete unused files from storage
Version of the file. Used to determine whether the file dataURL has changed (e.g., as part of restore due to schema update)
BinaryFileMetadata
Binary file data without the actual data URL (useful for listing files without loading full data).MIME type of the file
File identifier
Creation timestamp
Last retrieved timestamp
File version
BinaryFiles
A record mapping element IDs to their associated binary file data.Library Types
LibraryItem
Represents a reusable component in the library (v2 format).Unique identifier for the library item
Publication status of the library item
Array of elements that make up this library item
Timestamp in epoch milliseconds when the item was created
Optional name for the library item
Error message if the library item failed to load
LibraryItems
Array of library items (v2 format).LibraryItem_v1 (Deprecated)
Legacy v1 library item format. Do not use outside of migration paths.LibraryItems_v1 (Deprecated)
Legacy v1 library items array. Do not use outside of migration paths.LibraryItems_anyVersion
Union type supporting both v1 and v2 library formats for backward compatibility.ExportedLibraryData
Data structure for exporting library data.Type identifier, typically
"excalidrawlib"Version number of the library format
Source application identifier
Array of library items (v2 format)
ImportedLibraryData
Data structure for importing library data. Supports both current and legacy formats.Type identifier
Version number
Source application identifier
Library items in v2 format
Deprecated (v1) - Legacy library format
ExcalidrawLibraryIds
Helper type for tracking library item IDs.Array of library item IDs
SceneData
Data structure for updating the scene, used with theupdateScene API method.
Elements to update in the scene
Application state to update
Collaborators to update
Whether to capture this update in history for undo/redo
ExcalidrawInitialDataState
Extended import data state used when initializing Excalidraw.ImportedDataState but allows libraryItems to be a Promise.
Branded Types
These are string types with runtime branding for type safety:DataURL
String representing a data URL (base64 encoded file data).FileId
String representing a unique file identifier.SocketId
String representing a WebSocket connection identifier.Legacy Types
LegacyAppState
Map of deprecated AppState keys for migration purposes.Deprecated #6213 - Maps to
defaultSidebarDockedPreference. TODO: remove 23-06-01The
LegacyAppState type is a helper for downstream abstractions during data migration. Do not consume it directly in new code.