let host call convertToExcalidrawElements when using programmatic API

This commit is contained in:
Aakansha Doshi
2023-07-14 14:50:27 +05:30
parent c1a61b06df
commit 25e2f80709
5 changed files with 58 additions and 48 deletions

View File

@@ -41,7 +41,10 @@ import {
getDefaultLineHeight,
measureBaseline,
} from "../element/textElement";
import { convertToExcalidrawElements } from "../data/transform";
import {
ExcalidrawProgrammaticAPI,
convertToExcalidrawElements,
} from "../data/transform";
type RestoredAppState = Omit<
AppState,
@@ -366,7 +369,7 @@ const repairBoundElement = (
};
export const restoreElements = (
elements: ImportedDataState["elements"],
elements: ExcalidrawProgrammaticAPI["elements"],
/** NOTE doesn't serve for reconciliation */
localElements: readonly ExcalidrawElement[] | null | undefined,
opts?: { refreshDimensions?: boolean; repairBindings?: boolean } | undefined,