import type { MarkOptional } from "@excalidraw/common/utility-types"; import { type ElementConstructorOpts } from "./newElement"; import type { ExcalidrawBindableElement, ExcalidrawElement, ExcalidrawFrameElement, ExcalidrawFreeDrawElement, ExcalidrawGenericElement, ExcalidrawIframeLikeElement, ExcalidrawImageElement, ExcalidrawLinearElement, ExcalidrawMagicFrameElement, ExcalidrawSelectionElement, ExcalidrawTextElement, FileId, FontFamilyValues, TextAlign, VerticalAlign } from "./types"; export type ValidLinearElement = { type: "arrow" | "line"; x: number; y: number; label?: { text: string; fontSize?: number; fontFamily?: FontFamilyValues; textAlign?: TextAlign; verticalAlign?: VerticalAlign; } & MarkOptional; end?: (({ type: Exclude; id?: ExcalidrawGenericElement["id"]; } | { id: ExcalidrawGenericElement["id"]; type?: Exclude; }) | (({ type: "text"; text: string; } | { type?: "text"; id: ExcalidrawTextElement["id"]; text: string; }) & Partial)) & MarkOptional; start?: (({ type: Exclude; id?: ExcalidrawGenericElement["id"]; } | { id: ExcalidrawGenericElement["id"]; type?: Exclude; }) | (({ type: "text"; text: string; } | { type?: "text"; id: ExcalidrawTextElement["id"]; text: string; }) & Partial)) & MarkOptional; } & Partial; export type ValidContainer = { type: Exclude; id?: ExcalidrawGenericElement["id"]; label?: { text: string; fontSize?: number; fontFamily?: FontFamilyValues; textAlign?: TextAlign; verticalAlign?: VerticalAlign; } & MarkOptional; } & ElementConstructorOpts; export type ExcalidrawElementSkeleton = Extract, ExcalidrawIframeLikeElement | ExcalidrawFreeDrawElement> | ({ type: Extract; x: number; y: number; } & Partial) | ValidContainer | ValidLinearElement | ({ type: "text"; text: string; x: number; y: number; id?: ExcalidrawTextElement["id"]; } & Partial) | ({ type: Extract; x: number; y: number; fileId: FileId; } & Partial) | ({ type: "frame"; children: readonly ExcalidrawElement["id"][]; name?: string; } & Partial) | ({ type: "magicframe"; children: readonly ExcalidrawElement["id"][]; name?: string; } & Partial); export declare const convertToExcalidrawElements: (elementsSkeleton: ExcalidrawElementSkeleton[] | null, opts?: { regenerateIds: boolean; }) => import("./types").OrderedExcalidrawElement[];