feat: support adding multiple library items on canvas (#5116)

This commit is contained in:
David Luzar
2022-05-11 15:51:02 +02:00
committed by GitHub
parent cad6097d60
commit d2cc76e52e
11 changed files with 275 additions and 34 deletions

View File

@ -59,9 +59,10 @@ export class API {
};
static createElement = <
T extends Exclude<ExcalidrawElement["type"], "selection">,
T extends Exclude<ExcalidrawElement["type"], "selection"> = "rectangle",
>({
type,
// @ts-ignore
type = "rectangle",
id,
x = 0,
y = x,
@ -71,7 +72,7 @@ export class API {
groupIds = [],
...rest
}: {
type: T;
type?: T;
x?: number;
y?: number;
height?: number;