This commit is contained in:
Aakansha Doshi 2023-05-03 13:41:41 +05:30
parent 7087db42c0
commit 59e8bf498d
9 changed files with 109 additions and 65 deletions

View file

@ -1,4 +1,4 @@
import { ExcalidrawElement } from "../element/types";
import { ExcalidrawElement, ExcalidrawGenericElement } from "../element/types";
import {
AppState,
BinaryFiles,
@ -7,6 +7,8 @@ import {
} from "../types";
import type { cleanAppStateForExport } from "../appState";
import { VERSIONS } from "../constants";
import { MarkOptional } from "../utility-types";
import { ElementConstructorOpts } from "../element/newElement";
export interface ExportedDataState {
type: string;
@ -35,7 +37,28 @@ export interface ImportedDataState {
type?: string;
version?: number;
source?: string;
elements?: readonly ExcalidrawElement[] | null;
elements?:
| readonly (
| (ExcalidrawElement & {
children?: [
{ text: string } & MarkOptional<
ElementConstructorOpts,
"x" | "y"
>,
];
})
| {
type: Exclude<ExcalidrawGenericElement["type"], "selection">;
children?: [
{ text: string } & MarkOptional<
ElementConstructorOpts,
"x" | "y"
>,
] &
MarkOptional<ElementConstructorOpts, "x" | "y">;
}
)[]
| null;
appState?: Readonly<
Partial<
AppState & {