From cb7b45ab59420e118156293e0439f7cd455dad6d Mon Sep 17 00:00:00 2001 From: abhishek-gaonkar Date: Sun, 10 Nov 2024 14:57:04 +0530 Subject: [PATCH] FIX: types issue during runtime --- common/image-formats.ts | 1 + electron/commands/paste-image.ts | 3 ++- electron/types/types.d.ts | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 common/image-formats.ts 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];