• Exposes clipboard operations to the renderer process via context bridge. Allows the renderer to write text to the system clipboard securely.

    Returns void

    If electron modules are unavailable.

    export function exposeClipboardContext() {
    try {
    if (!contextBridge || !ipcRenderer) {
    throw new Error(
    "Failed to load electron modules: contextBridge or ipcRenderer is undefined",
    );
    }

    contextBridge.exposeInMainWorld("electronClipboard", {
    writeText: (text: string) =>
    ipcRenderer.invoke(CLIPBOARD_WRITE_CHANNEL, text),
    });

    console.log(
    "[ClipboardContext] ✅ Clipboard context exposed in main world",
    );
    } catch (error) {
    console.error(
    "[ClipboardContext] ❌ Error exposing clipboard context:",
    error,
    );
    }
    }