2025-11-05 10:36:16 -06:00
|
|
|
interface ServerConfig {
|
|
|
|
|
serverUrl?: string;
|
|
|
|
|
[key: string]: unknown;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface ConnectionTestResult {
|
|
|
|
|
success: boolean;
|
|
|
|
|
error?: string;
|
|
|
|
|
[key: string]: unknown;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface DialogOptions {
|
|
|
|
|
title?: string;
|
|
|
|
|
defaultPath?: string;
|
|
|
|
|
buttonLabel?: string;
|
|
|
|
|
filters?: Array<{ name: string; extensions: string[] }>;
|
|
|
|
|
properties?: string[];
|
|
|
|
|
[key: string]: unknown;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface DialogResult {
|
|
|
|
|
canceled: boolean;
|
|
|
|
|
filePath?: string;
|
|
|
|
|
filePaths?: string[];
|
|
|
|
|
[key: string]: unknown;
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-01 15:40:10 -05:00
|
|
|
export interface ElectronAPI {
|
|
|
|
|
getAppVersion: () => Promise<string>;
|
|
|
|
|
getPlatform: () => Promise<string>;
|
|
|
|
|
|
2025-11-05 10:36:16 -06:00
|
|
|
getServerConfig: () => Promise<ServerConfig>;
|
|
|
|
|
saveServerConfig: (config: ServerConfig) => Promise<{ success: boolean }>;
|
|
|
|
|
testServerConnection: (serverUrl: string) => Promise<ConnectionTestResult>;
|
2025-10-01 15:40:10 -05:00
|
|
|
|
2025-11-05 10:36:16 -06:00
|
|
|
showSaveDialog: (options: DialogOptions) => Promise<DialogResult>;
|
|
|
|
|
showOpenDialog: (options: DialogOptions) => Promise<DialogResult>;
|
2025-10-01 15:40:10 -05:00
|
|
|
|
2025-11-05 10:36:16 -06:00
|
|
|
onUpdateAvailable: (callback: () => void) => void;
|
|
|
|
|
onUpdateDownloaded: (callback: () => void) => void;
|
2025-10-01 15:40:10 -05:00
|
|
|
|
|
|
|
|
removeAllListeners: (channel: string) => void;
|
|
|
|
|
isElectron: boolean;
|
|
|
|
|
isDev: boolean;
|
|
|
|
|
|
2025-11-05 10:36:16 -06:00
|
|
|
invoke: (channel: string, ...args: unknown[]) => Promise<unknown>;
|
2025-10-01 15:40:10 -05:00
|
|
|
|
|
|
|
|
createTempFile: (fileData: {
|
|
|
|
|
fileName: string;
|
|
|
|
|
content: string;
|
|
|
|
|
encoding?: "base64" | "utf8";
|
|
|
|
|
}) => Promise<{
|
|
|
|
|
success: boolean;
|
|
|
|
|
tempId?: string;
|
|
|
|
|
path?: string;
|
|
|
|
|
error?: string;
|
|
|
|
|
}>;
|
|
|
|
|
|
|
|
|
|
createTempFolder: (folderData: {
|
|
|
|
|
folderName: string;
|
|
|
|
|
files: Array<{
|
|
|
|
|
relativePath: string;
|
|
|
|
|
content: string;
|
|
|
|
|
encoding?: "base64" | "utf8";
|
|
|
|
|
}>;
|
|
|
|
|
}) => Promise<{
|
|
|
|
|
success: boolean;
|
|
|
|
|
tempId?: string;
|
|
|
|
|
path?: string;
|
|
|
|
|
error?: string;
|
|
|
|
|
}>;
|
|
|
|
|
|
|
|
|
|
startDragToDesktop: (dragData: {
|
|
|
|
|
tempId: string;
|
|
|
|
|
fileName: string;
|
|
|
|
|
}) => Promise<{
|
|
|
|
|
success: boolean;
|
|
|
|
|
error?: string;
|
|
|
|
|
}>;
|
|
|
|
|
|
|
|
|
|
cleanupTempFile: (tempId: string) => Promise<{
|
|
|
|
|
success: boolean;
|
|
|
|
|
error?: string;
|
|
|
|
|
}>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
declare global {
|
|
|
|
|
interface Window {
|
|
|
|
|
electronAPI: ElectronAPI;
|
|
|
|
|
IS_ELECTRON: boolean;
|
|
|
|
|
}
|
|
|
|
|
}
|