more types

This commit is contained in:
Aakansha Doshi 2023-07-17 18:18:14 +05:30
parent 23f212367a
commit a6b389ca62

View file

@ -129,9 +129,7 @@ export type ValidContainer =
} & MarkOptional<ElementConstructorOpts, "x" | "y">; } & MarkOptional<ElementConstructorOpts, "x" | "y">;
} & ElementConstructorOpts; } & ElementConstructorOpts;
export interface ExcalidrawProgrammaticAPI { export type ExcalidrawProgrammaticElement =
elements?:
| readonly (
| Extract< | Extract<
ExcalidrawElement, ExcalidrawElement,
| ExcalidrawSelectionElement | ExcalidrawSelectionElement
@ -156,9 +154,10 @@ export interface ExcalidrawProgrammaticAPI {
type: Extract<ExcalidrawImageElement["type"], "image">; type: Extract<ExcalidrawImageElement["type"], "image">;
x: number; x: number;
y: number; y: number;
} & Partial<ExcalidrawImageElement>) } & Partial<ExcalidrawImageElement>);
)[]
| null; export interface ExcalidrawProgrammaticAPI {
elements?: readonly ExcalidrawProgrammaticElement[] | null;
} }
export const ELEMENTS_SUPPORTING_PROGRAMMATIC_API = [ export const ELEMENTS_SUPPORTING_PROGRAMMATIC_API = [
"rectangle", "rectangle",