diff --git a/src/renderer/main.ts b/src/renderer/main.ts index 5001e0e..cf28fa5 100644 --- a/src/renderer/main.ts +++ b/src/renderer/main.ts @@ -6,29 +6,6 @@ import vuetify from '@/renderer/plugins/vuetify' import i18n from '@/renderer/plugins/i18n' import pinia from '@/renderer/plugins/pinia' -// Add API key defined in contextBridge to window object type -declare global { - interface Window { - mainApi?: any - ConfirmDialogManager?: { - showConfirm: (options: { - title: string; - message: string; - confirmText?: string; - cancelText?: string; - confirmColor?: string; - }) => Promise; - showMessage: (options: { - title: string; - message: string; - confirmText?: string; - confirmColor?: string; - dialogColor?: string; - }) => Promise; - }; - } -} - const app = createApp(App) app.use(vuetify).use(i18n).use(router).use(pinia) diff --git a/src/renderer/types/global.d.ts b/src/renderer/types/global.d.ts index a7a2870..582cfc7 100644 --- a/src/renderer/types/global.d.ts +++ b/src/renderer/types/global.d.ts @@ -16,4 +16,11 @@ interface Window { dialogColor?: string; }) => Promise; }; + mainApi: { + send: (channel: string, ...data: any[]) => void; + on: (channel: string, listener: (event: any, ...args: any[]) => void) => void; + once: (channel: string, listener: (event: any, ...args: any[]) => void) => void; + off: (channel: string, listener: (event: any, ...args: any[]) => void) => void; + invoke: (channel: string, ...data: any[]) => Promise; + }; } \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index ff005a8..30896b7 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,8 @@ "jsx": "preserve", "noImplicitAny": false, "allowSyntheticDefaultImports": true, - "declaration": true, + "declaration": false, + "declarationMap": false, "resolveJsonModule": true, "esModuleInterop": true, "sourceMap": true, @@ -19,7 +20,8 @@ }, "lib": ["esnext", "dom"] }, - "include": ["src/*.ts", "src/*.d.ts", "src/renderer", "src/types"], + "include": ["src/**/*.ts", "src/**/*.d.ts", "src/renderer", "src/types"], + "exclude": ["src/main", "src/preload"], "references": [ { "path": "./tsconfig.node.json" diff --git a/tsconfig.node.json b/tsconfig.node.json index b813579..e519ecd 100644 --- a/tsconfig.node.json +++ b/tsconfig.node.json @@ -12,7 +12,6 @@ "include": [ "src/main", "src/preload", - "src/types", "package.json", "eslint.config.ts", "vite.config.mts",