mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-04-14 16:40:58 -04:00
ts fixes
This commit is contained in:
parent
eb415c1851
commit
1e633f7ed6
2 changed files with 15 additions and 7 deletions
|
@ -346,7 +346,10 @@ import { activeConfirmDialogAtom } from "./ActiveConfirmDialog";
|
|||
import { actionWrapTextInContainer } from "../actions/actionBoundText";
|
||||
import BraveMeasureTextError from "./BraveMeasureTextError";
|
||||
import { activeEyeDropperAtom } from "./EyeDropper";
|
||||
import { convertToExcalidrawElements } from "../data/transform";
|
||||
import {
|
||||
ExcalidrawProgrammaticElement,
|
||||
convertToExcalidrawElements,
|
||||
} from "../data/transform";
|
||||
import { ValueOf } from "../utility-types";
|
||||
import { isSidebarDockedAtom } from "./Sidebar/Sidebar";
|
||||
|
||||
|
@ -2288,8 +2291,9 @@ class App extends React.Component<AppProps, AppState> {
|
|||
} else if (data.elements) {
|
||||
const elements = (
|
||||
data.programmaticAPI
|
||||
? //@ts-ignore
|
||||
convertToExcalidrawElements(data.elements)
|
||||
? convertToExcalidrawElements(
|
||||
data.elements as ExcalidrawProgrammaticElement[],
|
||||
)
|
||||
: data.elements
|
||||
) as readonly ExcalidrawElement[];
|
||||
// TODO remove formatting from elements if isPlainPaste
|
||||
|
|
|
@ -334,10 +334,14 @@ const bindLinearElementToElement = (
|
|||
if (end.id) {
|
||||
existingElement = elementStore
|
||||
.getElements()
|
||||
.find((ele) => ele?.id === end.id) as Exclude<
|
||||
ExcalidrawBindableElement,
|
||||
ExcalidrawImageElement | ExcalidrawFrameElement
|
||||
>;
|
||||
.find(
|
||||
(
|
||||
ele,
|
||||
): ele is Exclude<
|
||||
ExcalidrawBindableElement,
|
||||
ExcalidrawImageElement | ExcalidrawFrameElement
|
||||
> => ele?.id === end.id,
|
||||
);
|
||||
if (!existingElement) {
|
||||
console.error(`No element for end binding with id ${end.id} found`);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue