|
@@ -2,10 +2,10 @@ import { app, BrowserWindow } from 'electron/main';
|
|
|
import type { OpenDialogOptions, OpenDialogReturnValue, MessageBoxOptions, SaveDialogOptions, SaveDialogReturnValue, MessageBoxReturnValue, CertificateTrustDialogOptions } from 'electron/main';
|
|
|
const dialogBinding = process._linkedBinding('electron_browser_dialog');
|
|
|
|
|
|
-const DialogType = {
|
|
|
- OPEN: 'OPEN' as 'OPEN',
|
|
|
- SAVE: 'SAVE' as 'SAVE'
|
|
|
-};
|
|
|
+enum DialogType {
|
|
|
+ OPEN = 'OPEN',
|
|
|
+ SAVE = 'SAVE'
|
|
|
+}
|
|
|
|
|
|
enum SaveFileDialogProperties {
|
|
|
createDirectory = 1 << 0,
|
|
@@ -72,7 +72,7 @@ const setupSaveDialogProperties = (properties: (keyof typeof SaveFileDialogPrope
|
|
|
return dialogProperties;
|
|
|
};
|
|
|
|
|
|
-const setupDialogProperties = (type: keyof typeof DialogType, properties: string[]): number => {
|
|
|
+const setupDialogProperties = (type: DialogType, properties: string[]): number => {
|
|
|
if (type === DialogType.OPEN) {
|
|
|
return setupOpenDialogProperties(properties as (keyof typeof OpenFileDialogProperties)[]);
|
|
|
} else if (type === DialogType.SAVE) {
|