Compare commits

...

2 Commits

Author SHA1 Message Date
Daniel J. Geiger
48c1f93e3e fix: Include src/data/restore.ts. 2023-09-08 13:37:08 -05:00
Daniel J. Geiger
3dd446dc15 feat: Add a subtype?: string property to ExcalidrawElement. 2023-09-08 13:17:03 -05:00
2 changed files with 6 additions and 1 deletions

View File

@ -92,7 +92,8 @@ const repairBinding = (binding: PointBinding | null) => {
};
const restoreElementWithProperties = <
T extends Required<Omit<ExcalidrawElement, "customData">> & {
T extends Required<Omit<ExcalidrawElement, "subtype" | "customData">> & {
subtype?: ExcalidrawElement["subtype"];
customData?: ExcalidrawElement["customData"];
/** @deprecated */
boundElementIds?: readonly ExcalidrawElement["id"][];
@ -158,6 +159,9 @@ const restoreElementWithProperties = <
locked: element.locked ?? false,
};
if ("subtype" in element) {
base.subtype = element.subtype;
}
if ("customData" in element) {
base.customData = element.customData;
}

View File

@ -65,6 +65,7 @@ type _ExcalidrawElementBase = Readonly<{
updated: number;
link: string | null;
locked: boolean;
subtype?: string;
customData?: Record<string, any>;
}>;