2020-03-07 10:20:38 -05:00
|
|
|
import { ExcalidrawElement } from "../element/types";
|
2022-05-11 15:08:54 +02:00
|
|
|
import {
|
|
|
|
AppState,
|
|
|
|
BinaryFiles,
|
|
|
|
LibraryItems,
|
|
|
|
LibraryItems_anyVersion,
|
|
|
|
} from "../types";
|
2021-04-10 19:17:49 +02:00
|
|
|
import type { cleanAppStateForExport } from "../appState";
|
2021-11-23 17:59:26 +01:00
|
|
|
import { VERSIONS } from "../constants";
|
2020-03-07 10:20:38 -05:00
|
|
|
|
2021-04-10 19:17:49 +02:00
|
|
|
export interface ExportedDataState {
|
|
|
|
type: string;
|
|
|
|
version: number;
|
|
|
|
source: string;
|
2020-03-07 10:20:38 -05:00
|
|
|
elements: readonly ExcalidrawElement[];
|
2021-04-10 19:17:49 +02:00
|
|
|
appState: ReturnType<typeof cleanAppStateForExport>;
|
2021-10-21 22:05:48 +02:00
|
|
|
files: BinaryFiles | undefined;
|
2020-09-22 21:51:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ImportedDataState {
|
|
|
|
type?: string;
|
2021-04-10 19:17:49 +02:00
|
|
|
version?: number;
|
2020-09-22 21:51:49 +02:00
|
|
|
source?: string;
|
2021-04-10 19:17:49 +02:00
|
|
|
elements?: readonly ExcalidrawElement[] | null;
|
|
|
|
appState?: Readonly<Partial<AppState>> | null;
|
2021-03-16 23:02:17 +05:30
|
|
|
scrollToContent?: boolean;
|
2022-05-11 15:08:54 +02:00
|
|
|
libraryItems?: LibraryItems_anyVersion;
|
2021-10-21 22:05:48 +02:00
|
|
|
files?: BinaryFiles;
|
2020-03-07 10:20:38 -05:00
|
|
|
}
|
2020-07-27 15:29:19 +03:00
|
|
|
|
2021-04-10 19:17:49 +02:00
|
|
|
export interface ExportedLibraryData {
|
|
|
|
type: string;
|
2021-11-23 17:59:26 +01:00
|
|
|
version: typeof VERSIONS.excalidrawLibrary;
|
2021-04-10 19:17:49 +02:00
|
|
|
source: string;
|
2021-11-17 23:53:43 +05:30
|
|
|
libraryItems: LibraryItems;
|
2020-07-27 15:29:19 +03:00
|
|
|
}
|
2021-04-10 19:17:49 +02:00
|
|
|
|
2021-11-17 23:53:43 +05:30
|
|
|
export interface ImportedLibraryData extends Partial<ExportedLibraryData> {
|
|
|
|
/** @deprecated v1 */
|
|
|
|
library?: LibraryItems;
|
|
|
|
}
|