make fileId mandatory for image and export convertToExcalidrawElements

This commit is contained in:
Aakansha Doshi 2023-07-18 13:03:59 +05:30
parent a6b389ca62
commit 756b924518
4 changed files with 6 additions and 3 deletions

View file

@ -32,6 +32,7 @@ import {
ExcalidrawLinearElement,
ExcalidrawSelectionElement,
ExcalidrawTextElement,
FileId,
FontFamilyValues,
TextAlign,
VerticalAlign,
@ -154,6 +155,7 @@ export type ExcalidrawProgrammaticElement =
type: Extract<ExcalidrawImageElement["type"], "image">;
x: number;
y: number;
fileId: FileId;
} & Partial<ExcalidrawImageElement>);
export interface ExcalidrawProgrammaticAPI {

View file

@ -31,7 +31,6 @@ import { ImportedLibraryData } from "../../../data/types";
import CustomFooter from "./CustomFooter";
import MobileFooter from "./MobileFooter";
import { KEYS } from "../../../keys";
import { convertToExcalidrawElements } from "../../../data/transform";
declare global {
interface Window {
@ -76,6 +75,7 @@ const {
WelcomeScreen,
MainMenu,
LiveCollaborationTrigger,
convertToExcalidrawElements,
} = window.ExcalidrawLib;
const COMMENT_ICON_DIMENSION = 32;

View file

@ -32,8 +32,8 @@ const elements: ExcalidrawProgrammaticAPI["elements"] = [
type: "image",
x: 606.1042326312408,
y: 153.57729779411773,
width: 231.30325348751828,
height: 231.64340533088227,
width: 230,
height: 230,
fileId: "rocket" as FileId,
},
];

View file

@ -249,3 +249,4 @@ export { LiveCollaborationTrigger };
export { DefaultSidebar } from "../../components/DefaultSidebar";
export { normalizeLink } from "../../data/url";
export { convertToExcalidrawElements } from "../../data/transform";