update plugin packages
This commit is contained in:
@@ -1,20 +0,0 @@
|
||||
"use strict";
|
||||
const electron = require("electron");
|
||||
const api = {
|
||||
openNoteWindow: (noteId) => {
|
||||
electron.ipcRenderer.send("open-note-window", noteId);
|
||||
}
|
||||
};
|
||||
const notesAPI = {
|
||||
call: (method, ...args) => electron.ipcRenderer.invoke("notesAPI:call", method, args)
|
||||
};
|
||||
if (process.contextIsolated) {
|
||||
try {
|
||||
electron.contextBridge.exposeInMainWorld("api", api);
|
||||
electron.contextBridge.exposeInMainWorld("notesAPI", notesAPI);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
} else {
|
||||
window.api = api;
|
||||
}
|
||||
19
out/preload/index.mjs
Normal file
19
out/preload/index.mjs
Normal file
@@ -0,0 +1,19 @@
|
||||
import { contextBridge, ipcRenderer } from "electron";
|
||||
const api = {
|
||||
openNoteWindow: (noteId) => {
|
||||
ipcRenderer.send("open-note-window", noteId);
|
||||
}
|
||||
};
|
||||
const notesAPI = {
|
||||
call: (method, ...args) => ipcRenderer.invoke("notesAPI:call", method, args)
|
||||
};
|
||||
if (process.contextIsolated) {
|
||||
try {
|
||||
contextBridge.exposeInMainWorld("api", api);
|
||||
contextBridge.exposeInMainWorld("notesAPI", notesAPI);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
} else {
|
||||
window.api = api;
|
||||
}
|
||||
Reference in New Issue
Block a user