
* feat: dnt share library & attach to the excalidraw instance * fix * Add addToLibrary, resetLibrary and libraryItems in initialData * remove comment * handle errors & improve types * remove resetLibrary and addToLibrary and add onLibraryChange prop * set library cache to empty arrary on reset * Add i18n for remove/add library * Update src/locales/en.json Co-authored-by: David Luzar <luzar.david@gmail.com> * update docs * Assign unique ID to each excalidraw component and remove csrfToken from library as its not needed * tweaks Co-authored-by: David Luzar <luzar.david@gmail.com> * update * tweak Co-authored-by: dwelle <luzar.david@gmail.com>
31 lines
807 B
TypeScript
31 lines
807 B
TypeScript
import { ExcalidrawElement } from "../element/types";
|
|
import { AppState, LibraryItems } from "../types";
|
|
import type { cleanAppStateForExport } from "../appState";
|
|
|
|
export interface ExportedDataState {
|
|
type: string;
|
|
version: number;
|
|
source: string;
|
|
elements: readonly ExcalidrawElement[];
|
|
appState: ReturnType<typeof cleanAppStateForExport>;
|
|
}
|
|
|
|
export interface ImportedDataState {
|
|
type?: string;
|
|
version?: number;
|
|
source?: string;
|
|
elements?: readonly ExcalidrawElement[] | null;
|
|
appState?: Readonly<Partial<AppState>> | null;
|
|
scrollToContent?: boolean;
|
|
libraryItems?: LibraryItems;
|
|
}
|
|
|
|
export interface ExportedLibraryData {
|
|
type: string;
|
|
version: number;
|
|
source: string;
|
|
library: LibraryItems;
|
|
}
|
|
|
|
export interface ImportedLibraryData extends Partial<ExportedLibraryData> {}
|