mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
udpdate api
This commit is contained in:
parent
8aed24312f
commit
eb415c1851
1 changed files with 5 additions and 5 deletions
|
@ -266,7 +266,7 @@ const bindLinearElementToElement = (
|
|||
let existingElement;
|
||||
if (start.id) {
|
||||
existingElement = elementStore
|
||||
.get()
|
||||
.getElements()
|
||||
.find((ele) => ele?.id === start.id) as Exclude<
|
||||
ExcalidrawBindableElement,
|
||||
ExcalidrawImageElement | ExcalidrawFrameElement
|
||||
|
@ -333,7 +333,7 @@ const bindLinearElementToElement = (
|
|||
let existingElement;
|
||||
if (end.id) {
|
||||
existingElement = elementStore
|
||||
.get()
|
||||
.getElements()
|
||||
.find((ele) => ele?.id === end.id) as Exclude<
|
||||
ExcalidrawBindableElement,
|
||||
ExcalidrawImageElement | ExcalidrawFrameElement
|
||||
|
@ -416,7 +416,7 @@ class ElementStore {
|
|||
this.elementMap.set(ele.id, index);
|
||||
}
|
||||
};
|
||||
get = () => {
|
||||
getElements = () => {
|
||||
return this.res;
|
||||
};
|
||||
hasElementWithId = (id: string) => {
|
||||
|
@ -448,7 +448,7 @@ export const convertToExcalidrawElements = (
|
|||
});
|
||||
|
||||
const pushedElements =
|
||||
elementStore.get() as readonly ExcalidrawProgrammaticElement[];
|
||||
elementStore.getElements() as readonly ExcalidrawProgrammaticElement[];
|
||||
pushedElements.forEach((element) => {
|
||||
const elementWithId = { ...element };
|
||||
|
||||
|
@ -550,5 +550,5 @@ export const convertToExcalidrawElements = (
|
|||
elementStore.add(element);
|
||||
}
|
||||
});
|
||||
return elementStore.get();
|
||||
return elementStore.getElements();
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue