| ... | @@ -8,6 +8,7 @@ import path from "node:path"; | ... | @@ -8,6 +8,7 @@ import path from "node:path"; |
| 8 | import { app, BrowserWindow, dialog, ipcMain, Menu, nativeImage, protocol, shell } from "electron"; | 8 | import { app, BrowserWindow, dialog, ipcMain, Menu, nativeImage, protocol, shell } from "electron"; |
| 9 | import type { MenuItemConstructorOptions } from "electron"; | 9 | import type { MenuItemConstructorOptions } from "electron"; |
| 10 | | 10 | |
| | 11 | import type { ContextMenuItem } from "@t3tools/contracts"; |
| 11 | import { showDesktopConfirmDialog } from "./confirmDialog"; | 12 | import { showDesktopConfirmDialog } from "./confirmDialog"; |
| 12 | import { fixPath } from "./fixPath"; | 13 | import { fixPath } from "./fixPath"; |
| 13 | | 14 | |
| ... | @@ -36,12 +37,6 @@ let restartTimer: ReturnType<typeof setTimeout> | null = null; | ... | @@ -36,12 +37,6 @@ let restartTimer: ReturnType<typeof setTimeout> | null = null; |
| 36 | let isQuitting = false; | 37 | let isQuitting = false; |
| 37 | let desktopProtocolRegistered = false; | 38 | let desktopProtocolRegistered = false; |
| 38 | | 39 | |
| 39 | interface DesktopContextMenuItem { | | |
| 40 | id: string; | | |
| 41 | label: string; | | |
| 42 | destructive?: boolean; | | |
| 43 | } | | |
| 44 | | | |
| 45 | let destructiveMenuIconCache: Electron.NativeImage | null | undefined; | 40 | let destructiveMenuIconCache: Electron.NativeImage | null | undefined; |
| 46 | | 41 | |
| 47 | function getDestructiveMenuIcon(): Electron.NativeImage | undefined { | 42 | function getDestructiveMenuIcon(): Electron.NativeImage | undefined { |
| ... | @@ -439,7 +434,7 @@ function registerIpcHandlers(): void { | ... | @@ -439,7 +434,7 @@ function registerIpcHandlers(): void { |
| 439 | CONTEXT_MENU_CHANNEL, | 434 | CONTEXT_MENU_CHANNEL, |
| 440 | async ( | 435 | async ( |
| 441 | _event, | 436 | _event, |
| 442 | items: DesktopContextMenuItem[], | 437 | items: ContextMenuItem[], |
| 443 | position?: { x: number; y: number }, | 438 | position?: { x: number; y: number }, |
| 444 | ) => { | 439 | ) => { |
| 445 | const normalizedItems = items | 440 | const normalizedItems = items |