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
|
@ -24,7 +24,7 @@ const parseFileContents = async (blob: Blob | File) => {
|
|||
return await (
|
||||
await import(/* webpackChunkName: "image" */ "./image")
|
||||
).decodePngMetadata(blob);
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
if (error.message === "INVALID") {
|
||||
throw new DOMException(
|
||||
t("alerts.imageDoesNotContainScene"),
|
||||
|
@ -58,7 +58,7 @@ const parseFileContents = async (blob: Blob | File) => {
|
|||
).decodeSvgMetadata({
|
||||
svg: contents,
|
||||
});
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
if (error.message === "INVALID") {
|
||||
throw new DOMException(
|
||||
t("alerts.imageDoesNotContainScene"),
|
||||
|
@ -156,7 +156,7 @@ export const loadFromBlob = async (
|
|||
);
|
||||
|
||||
return result;
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error.message);
|
||||
throw new Error(t("alerts.couldNotLoadInvalidFile"));
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ export const canvasToBlob = async (
|
|||
}
|
||||
resolve(blob);
|
||||
});
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
|
@ -208,7 +208,7 @@ export const generateIdFromFile = async (file: File) => {
|
|||
// convert to hex string
|
||||
.map((byte) => byte.toString(16).padStart(2, "0"))
|
||||
.join("") as FileId;
|
||||
} catch (error) {
|
||||
} catch (error: any) {
|
||||
console.error(error);
|
||||
// length 40 to align with the HEX length of SHA-1 (which is 160 bit)
|
||||
id = nanoid(40) as FileId;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue