mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 10:00:17 +05:30
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:
@@ -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
|
||||
|
||||
Vendored
+14
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user