electron_scaffold_ipc_channel
Generate complete IPC boilerplate for a new feature: main handler, preload bridge, TypeScript types, and renderer example — all needed for a secure, type-safe Electron IPC channel.
Instructions
Generate complete IPC boilerplate for a new feature: ipcMain handler in the main process, preload bridge function with contextBridge, TypeScript type declarations, and renderer-side usage example. Produces all the files needed for a secure, type-safe IPC channel.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channelName | Yes | The IPC channel name, e.g. 'get-user-data', 'save-settings', 'open-file-dialog' | |
| direction | Yes | Communication direction for the channel | |
| description | Yes | What this IPC channel does, e.g. 'Fetches user profile from the database' | |
| args | No | TypeScript type for the arguments, e.g. '{ userId: string }' or 'string'. Omit for no arguments. | |
| returnType | No | TypeScript type for the return value (renderer-to-main only), e.g. '{ name: string; email: string }'. Omit for void. | |
| apiNamespace | No | The namespace on window.electronAPI to group this under, e.g. 'users', 'settings'. Defaults to 'api'. |