mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
remove ts ignore
This commit is contained in:
parent
03131750be
commit
2c52107f6f
2 changed files with 12 additions and 4 deletions
|
@ -49,7 +49,7 @@ const DEFAULT_LINEAR_ELEMENT_PROPS = {
|
||||||
const DEFAULT_DIMENSION = 100;
|
const DEFAULT_DIMENSION = 100;
|
||||||
|
|
||||||
const bindTextToContainer = (
|
const bindTextToContainer = (
|
||||||
containerProps: ValidContainer | ValidLinearElement,
|
containerProps: ValidContainer | ({ type: "arrow" } & ValidLinearElement),
|
||||||
textProps: { text: string } & MarkOptional<ElementConstructorOpts, "x" | "y">,
|
textProps: { text: string } & MarkOptional<ElementConstructorOpts, "x" | "y">,
|
||||||
) => {
|
) => {
|
||||||
let container;
|
let container;
|
||||||
|
@ -67,7 +67,6 @@ const bindTextToContainer = (
|
||||||
...containerProps,
|
...containerProps,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
//@ts-ignore
|
|
||||||
container = newElement({
|
container = newElement({
|
||||||
...containerProps,
|
...containerProps,
|
||||||
});
|
});
|
||||||
|
@ -283,7 +282,11 @@ export const convertToExcalidrawElements = (
|
||||||
elementWithid?.label?.text
|
elementWithid?.label?.text
|
||||||
) {
|
) {
|
||||||
let [container, text] = bindTextToContainer(
|
let [container, text] = bindTextToContainer(
|
||||||
elementWithid,
|
elementWithid as
|
||||||
|
| ValidContainer
|
||||||
|
| ({
|
||||||
|
type: "arrow";
|
||||||
|
} & ValidLinearElement),
|
||||||
elementWithid?.label,
|
elementWithid?.label,
|
||||||
);
|
);
|
||||||
excalidrawElements.push(container);
|
excalidrawElements.push(container);
|
||||||
|
|
|
@ -44,7 +44,7 @@ export type LegacyAppState = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ValidLinearElement = {
|
export type ValidLinearElement = {
|
||||||
type: ExcalidrawLinearElement["type"];
|
type: "arrow" | "line";
|
||||||
x: number;
|
x: number;
|
||||||
y: number;
|
y: number;
|
||||||
label?: {
|
label?: {
|
||||||
|
@ -113,6 +113,11 @@ export interface ImportedDataState {
|
||||||
| ExcalidrawImageElement
|
| ExcalidrawImageElement
|
||||||
| ExcalidrawFreeDrawElement
|
| ExcalidrawFreeDrawElement
|
||||||
>
|
>
|
||||||
|
| ({
|
||||||
|
type: Extract<ExcalidrawLinearElement["type"], "line">;
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
} & Partial<ExcalidrawLinearElement>)
|
||||||
| ValidContainer
|
| ValidContainer
|
||||||
| ValidLinearElement
|
| ValidLinearElement
|
||||||
| ({
|
| ({
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue