mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
chore: Update Typescript to 4.4.4 (#4188)
This commit is contained in:
parent
60262cb4cc
commit
8d4f455cd3
34 changed files with 132 additions and 125 deletions
|
@ -621,7 +621,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
this.onBlur();
|
||||
};
|
||||
|
||||
private disableEvent: EventHandlerNonNull = (event) => {
|
||||
private disableEvent: EventListener = (event) => {
|
||||
event.preventDefault();
|
||||
};
|
||||
|
||||
|
@ -665,7 +665,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
}
|
||||
this.setState({ isLibraryOpen: true });
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
window.alert(t("alerts.errorLoadingLibrary"));
|
||||
console.error(error);
|
||||
} finally {
|
||||
|
@ -1294,8 +1294,8 @@ class App extends React.Component<AppProps, AppState> {
|
|||
if ((await this.props.onPaste(data, event)) === false) {
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
if (data.errorMessage) {
|
||||
|
@ -3705,7 +3705,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
this.actionManager.executeAction(actionFinalize);
|
||||
},
|
||||
);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
this.scene.replaceAllElements(
|
||||
this.scene
|
||||
|
@ -3974,7 +3974,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
await normalizeSVG(await imageFile.text()),
|
||||
imageFile.name,
|
||||
);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.warn(error);
|
||||
throw new Error(t("errors.svgImageInsertError"));
|
||||
}
|
||||
|
@ -4000,7 +4000,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
imageFile,
|
||||
DEFAULT_MAX_IMAGE_WIDTH_OR_HEIGHT,
|
||||
);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error("error trying to resing image file on insertion", error);
|
||||
}
|
||||
|
||||
|
@ -4061,7 +4061,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
this.initializeImageDimensions(imageElement, true);
|
||||
}
|
||||
resolve(imageElement);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
reject(new Error(t("errors.imageInsertError")));
|
||||
} finally {
|
||||
|
@ -4092,7 +4092,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
imageElement,
|
||||
showCursorImagePreview,
|
||||
});
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
mutateElement(imageElement, {
|
||||
isDeleted: true,
|
||||
});
|
||||
|
@ -4187,7 +4187,7 @@ class App extends React.Component<AppProps, AppState> {
|
|||
},
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
if (error.name !== "AbortError") {
|
||||
console.error(error);
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ export const ToolButton = React.forwardRef((props: ToolButtonProps, ref) => {
|
|||
try {
|
||||
setIsLoading(true);
|
||||
await ret;
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
if (!(error instanceof AbortError)) {
|
||||
throw error;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ export class TopErrorBoundary extends React.Component<
|
|||
for (const [key, value] of Object.entries({ ...localStorage })) {
|
||||
try {
|
||||
_localStorage[key] = JSON.parse(value);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
_localStorage[key] = value;
|
||||
}
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ export class TopErrorBoundary extends React.Component<
|
|||
)
|
||||
).default;
|
||||
body = encodeURIComponent(templateStrFn(this.state.sentryEventId));
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
|
@ -86,7 +86,7 @@ export class TopErrorBoundary extends React.Component<
|
|||
try {
|
||||
localStorage.clear();
|
||||
window.location.reload();
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
}
|
||||
}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue