electron_generate_preload_bridge
Generate a secure preload.ts and TypeScript window declarations to expose multiple main-process APIs via contextBridge.exposeInMainWorld, with security guidance.
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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"methods": "<methods>"
},
"name": "electron_generate_preload_bridge"
}
}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'. |