mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
style: fix formatting with Prettier
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -5,40 +5,44 @@
|
||||
* All other operations go through HTTP API.
|
||||
*/
|
||||
|
||||
import { contextBridge, ipcRenderer, OpenDialogOptions, SaveDialogOptions } from "electron";
|
||||
import { contextBridge, ipcRenderer, OpenDialogOptions, SaveDialogOptions } from 'electron';
|
||||
|
||||
// Expose minimal API for native features
|
||||
contextBridge.exposeInMainWorld("electronAPI", {
|
||||
contextBridge.exposeInMainWorld('electronAPI', {
|
||||
// Platform info
|
||||
platform: process.platform,
|
||||
isElectron: true,
|
||||
|
||||
// Connection check
|
||||
ping: (): Promise<string> => ipcRenderer.invoke("ping"),
|
||||
ping: (): Promise<string> => ipcRenderer.invoke('ping'),
|
||||
|
||||
// Get server URL for HTTP client
|
||||
getServerUrl: (): Promise<string> => ipcRenderer.invoke("server:getUrl"),
|
||||
getServerUrl: (): Promise<string> => ipcRenderer.invoke('server:getUrl'),
|
||||
|
||||
// Native dialogs - better UX than prompt()
|
||||
openDirectory: (): Promise<Electron.OpenDialogReturnValue> =>
|
||||
ipcRenderer.invoke("dialog:openDirectory"),
|
||||
ipcRenderer.invoke('dialog:openDirectory'),
|
||||
openFile: (options?: OpenDialogOptions): Promise<Electron.OpenDialogReturnValue> =>
|
||||
ipcRenderer.invoke("dialog:openFile", options),
|
||||
ipcRenderer.invoke('dialog:openFile', options),
|
||||
saveFile: (options?: SaveDialogOptions): Promise<Electron.SaveDialogReturnValue> =>
|
||||
ipcRenderer.invoke("dialog:saveFile", options),
|
||||
ipcRenderer.invoke('dialog:saveFile', options),
|
||||
|
||||
// Shell operations
|
||||
openExternalLink: (url: string): Promise<{ success: boolean; error?: string }> =>
|
||||
ipcRenderer.invoke("shell:openExternal", url),
|
||||
ipcRenderer.invoke('shell:openExternal', url),
|
||||
openPath: (filePath: string): Promise<{ success: boolean; error?: string }> =>
|
||||
ipcRenderer.invoke("shell:openPath", filePath),
|
||||
openInEditor: (filePath: string, line?: number, column?: number): Promise<{ success: boolean; error?: string }> =>
|
||||
ipcRenderer.invoke("shell:openInEditor", filePath, line, column),
|
||||
ipcRenderer.invoke('shell:openPath', filePath),
|
||||
openInEditor: (
|
||||
filePath: string,
|
||||
line?: number,
|
||||
column?: number
|
||||
): Promise<{ success: boolean; error?: string }> =>
|
||||
ipcRenderer.invoke('shell:openInEditor', filePath, line, column),
|
||||
|
||||
// App info
|
||||
getPath: (name: string): Promise<string> => ipcRenderer.invoke("app:getPath", name),
|
||||
getVersion: (): Promise<string> => ipcRenderer.invoke("app:getVersion"),
|
||||
isPackaged: (): Promise<boolean> => ipcRenderer.invoke("app:isPackaged"),
|
||||
getPath: (name: string): Promise<string> => ipcRenderer.invoke('app:getPath', name),
|
||||
getVersion: (): Promise<string> => ipcRenderer.invoke('app:getVersion'),
|
||||
isPackaged: (): Promise<boolean> => ipcRenderer.invoke('app:isPackaged'),
|
||||
});
|
||||
|
||||
console.log("[Preload] Electron API exposed (TypeScript)");
|
||||
console.log('[Preload] Electron API exposed (TypeScript)');
|
||||
|
||||
Reference in New Issue
Block a user