Skip to content

πŸ†™ Upscayl - #1 Free and Open Source AI Image Upscaler for Linux, MacOS and Windows.

FIX: types issue during runtime

abhishek-gaonkarcb7b45ab5942
diff --git a/common/image-formats.ts b/common/image-formats.ts
new file mode 100644
index 0000000..4d489d3
--- /dev/null
+++ b/common/image-formats.ts
@@ -0,0 +1 @@
+export const imageFormats = ["png", "jpg", "jpeg", "webp"] as const;
diff --git a/electron/commands/paste-image.ts b/electron/commands/paste-image.ts
index 323c9a0..fe0ea1d 100644
--- a/electron/commands/paste-image.ts
+++ b/electron/commands/paste-image.ts
@@ -3,7 +3,8 @@ import logit from "../utils/logit";
import fs from "fs";
import path from "path";
import { ELECTRON_COMMANDS } from "../../common/electron-commands";
-import { ImageFormat, imageFormats } from "../types/types";
+import { ImageFormat } from "../types/types";
+import { imageFormats } from "../../common/image-formats";
interface IClipboardFileParameters {
name: string;
diff --git a/electron/types/types.d.ts b/electron/types/types.d.ts
index 77c1da5..3883004 100644
--- a/electron/types/types.d.ts
+++ b/electron/types/types.d.ts
@@ -1,3 +1,3 @@
-export const imageFormats = ["png", "jpg", "jpeg", "webp"] as const;
+import { imageFormats } from "../../common/image-formats";
export type ImageFormat = (typeof imageFormats)[number];