mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-02 18:10:18 +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:open-dir',
|
||||||
'crash:delete',
|
'crash:delete',
|
||||||
|
|
||||||
|
// Monospace font settings
|
||||||
|
'get-monospace-settings',
|
||||||
|
'set-monospace-settings',
|
||||||
|
|
||||||
// Git diff
|
// Git diff
|
||||||
'git-diff',
|
'git-diff',
|
||||||
|
|
||||||
@@ -496,6 +500,11 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
|||||||
openDir: () => ipcRenderer.send('crash:open-dir'),
|
openDir: () => ipcRenderer.send('crash:open-dir'),
|
||||||
delete: (filename) => ipcRenderer.invoke('crash:delete', filename),
|
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
|
// Log successful preload initialization
|
||||||
|
|||||||
Vendored
+14
@@ -128,6 +128,20 @@ export interface ElectronAPI {
|
|||||||
openDir: () => void;
|
openDir: () => void;
|
||||||
delete: (filename: string) => Promise<unknown>;
|
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 {
|
declare global {
|
||||||
|
|||||||
Reference in New Issue
Block a user