support arrow bindings via start and end in api

This commit is contained in:
Aakansha Doshi 2023-05-22 21:22:36 +05:30
parent 0449cccc39
commit d8c901e0c1
4 changed files with 114 additions and 12 deletions

View file

@ -1,5 +1,7 @@
import {
ExcalidrawBindableElement,
ExcalidrawElement,
ExcalidrawLinearElement,
FontFamilyValues,
TextAlign,
VerticalAlign,
@ -71,6 +73,22 @@ export interface ImportedDataState {
type: "text";
text: string;
} & ElementConstructorOpts)
| ({
type: "arrow";
label?: {
text: string;
fontSize?: number;
fontFamily?: FontFamilyValues;
textAlign?: TextAlign;
verticalAlign?: VerticalAlign;
} & MarkOptional<ElementConstructorOpts, "x" | "y">;
start?: {
type: ExcalidrawBindableElement["type"] & ElementConstructorOpts;
};
end?: {
type: ExcalidrawBindableElement["type"] & ElementConstructorOpts;
};
} & ElementConstructorOpts)
)[]
| null;
appState?: Readonly<