diff --git a/.gitignore b/.gitignore index cc81c7d..0a3d92c 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,7 @@ test-screenshot-*.png test-expand-*.png browser-debug-screenshot.png -app/.webpack-cache \ No newline at end of file +app/.webpack-cache + +# Temporary files +/tmp \ No newline at end of file diff --git a/events/DialogTypes.ts b/events/DialogTypes.ts new file mode 100644 index 0000000..b2fc557 --- /dev/null +++ b/events/DialogTypes.ts @@ -0,0 +1,59 @@ +/** + * Browser-compatible dialog type definitions + * These types mirror Electron's dialog types but don't require the electron package + */ + +export interface FileFilter { + name: string + extensions: string[] +} + +export interface OpenDialogOptions { + title?: string + defaultPath?: string + buttonLabel?: string + filters?: FileFilter[] + properties?: Array< + | 'openFile' + | 'openDirectory' + | 'multiSelections' + | 'showHiddenFiles' + | 'createDirectory' + | 'promptToCreate' + | 'noResolveAliases' + | 'treatPackageAsDirectory' + | 'dontAddToRecent' + > + message?: string + securityScopedBookmarks?: boolean +} + +export interface OpenDialogReturnValue { + canceled: boolean + filePaths: string[] + bookmarks?: string[] +} + +export interface SaveDialogOptions { + title?: string + defaultPath?: string + buttonLabel?: string + filters?: FileFilter[] + message?: string + nameFieldLabel?: string + showsTagField?: boolean + properties?: Array< + | 'showHiddenFiles' + | 'createDirectory' + | 'treatPackageAsDirectory' + | 'showOverwriteConfirmation' + | 'dontAddToRecent' + > + securityScopedBookmarks?: boolean +} + +export interface SaveDialogReturnValue { + canceled: boolean + filePath?: string + bookmark?: string +} diff --git a/events/EventsV2.ts b/events/EventsV2.ts index 048784d..bd512f4 100644 --- a/events/EventsV2.ts +++ b/events/EventsV2.ts @@ -62,8 +62,8 @@ export interface CertificateUploadResponse { data: string // base64 encoded } -// Electron dialog types (re-exported for convenience) -import { OpenDialogOptions, OpenDialogReturnValue, SaveDialogOptions, SaveDialogReturnValue } from 'electron' +// Dialog types (browser-compatible versions) +import type { OpenDialogOptions, OpenDialogReturnValue, SaveDialogOptions, SaveDialogReturnValue } from './DialogTypes' export type OpenDialogOptionsV2 = OpenDialogOptions export type OpenDialogReturnValueV2 = OpenDialogReturnValue diff --git a/events/OpenDialogRequest.ts b/events/OpenDialogRequest.ts index aba391e..8e64da1 100644 --- a/events/OpenDialogRequest.ts +++ b/events/OpenDialogRequest.ts @@ -1,4 +1,4 @@ -import { OpenDialogOptions, OpenDialogReturnValue, SaveDialogOptions, SaveDialogReturnValue } from 'electron' +import type { OpenDialogOptions, OpenDialogReturnValue, SaveDialogOptions, SaveDialogReturnValue } from './DialogTypes' import { RpcEvent } from './EventSystem/Rpc' // Legacy functions - use RpcEvents from EventsV2.ts for new code