electron_generate_preload_bridge
Generates a complete preload.ts file with contextBridge.exposeInMainWorld to securely expose multiple IPC methods to the renderer process, including TypeScript declarations and security best practices.
Instructions
Generate a complete, secure preload.ts with contextBridge.exposeInMainWorld for multiple API methods. Produces the preload script, TypeScript declarations for window.electronAPI, and security best practices. Use this when you need to expose several main-process APIs to the renderer at once.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| methods | Yes | Array of methods to expose through the preload bridge | |
| namespace | No | The property name on window, e.g. 'electronAPI'. Defaults to 'electronAPI'. |