generated from LiteLoaderQQNT/Plugin-Template
-
Notifications
You must be signed in to change notification settings - Fork 15
/
preload.js
48 lines (47 loc) · 1.36 KB
/
preload.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const { contextBridge, ipcRenderer } = require("electron");
contextBridge.exposeInMainWorld("transitio", {
rendererReady: () => ipcRenderer.send(
"LiteLoader.transitio.rendererReady"
),
configChange: (path, arg) => ipcRenderer.send(
"LiteLoader.transitio.configChange",
path, arg
),
devMode: (enable) => ipcRenderer.send(
"LiteLoader.transitio.devMode",
enable
),
reloadStyle: () => ipcRenderer.send(
"LiteLoader.transitio.reloadStyle"
),
importStyle: (fname, content) => ipcRenderer.send(
"LiteLoader.transitio.importStyle",
fname, content
),
removeStyle: (path) => ipcRenderer.send(
"LiteLoader.transitio.removeStyle",
path
),
resetStyle: (path) => ipcRenderer.send(
"LiteLoader.transitio.resetStyle",
path
),
open: (type, uri) => ipcRenderer.send(
"LiteLoader.transitio.open",
type, uri
),
queryIsDebug: () => ipcRenderer.invoke(
"LiteLoader.transitio.queryIsDebug"
),
queryDevMode: () => ipcRenderer.invoke(
"LiteLoader.transitio.queryDevMode"
),
onUpdateStyle: (callback) => ipcRenderer.on(
"LiteLoader.transitio.updateStyle",
callback
),
onResetStyle: (callback) => ipcRenderer.on(
"LiteLoader.transitio.resetStyle",
callback
),
});