feat(ipc): expose monospace settings through preload bridge

- Add 'get-monospace-settings' + 'set-monospace-settings' to allowlist
- Expose electronAPI.monospace.{getSettings,saveSettings}
- Extend ElectronAPI TypeScript interface with the monospace namespace
This commit is contained in:
2026-07-23 09:34:57 +05:30
parent d29f19b1f5
commit 28ef350f39
2 changed files with 23 additions and 0 deletions
+9
View File
@@ -149,6 +149,10 @@ const ALLOWED_SEND_CHANNELS = [
'crash:open-dir',
'crash:delete',
// Monospace font settings
'get-monospace-settings',
'set-monospace-settings',
// Git diff
'git-diff',
@@ -496,6 +500,11 @@ contextBridge.exposeInMainWorld('electronAPI', {
openDir: () => ipcRenderer.send('crash:open-dir'),
delete: (filename) => ipcRenderer.invoke('crash:delete', filename),
},
monospace: {
getSettings: () => ipcRenderer.invoke('get-monospace-settings'),
saveSettings: (partial) => ipcRenderer.invoke('set-monospace-settings', partial),
},
});
// Log successful preload initialization
+14
View File
@@ -128,6 +128,20 @@ export interface ElectronAPI {
openDir: () => void;
delete: (filename: string) => Promise<unknown>;
};
monospace: {
getSettings: () => Promise<{
monospaceFont: 'jetbrains-mono' | 'fira-code';
monospaceLigatures: boolean;
}>;
saveSettings: (partial: {
monospaceFont?: 'jetbrains-mono' | 'fira-code';
monospaceLigatures?: boolean;
}) => Promise<{
monospaceFont: 'jetbrains-mono' | 'fira-code';
monospaceLigatures: boolean;
}>;
};
}
declare global {