forked from xh321/LiteLoaderQQNT-Background-Plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
preload.js
84 lines (83 loc) · 3.33 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
const { contextBridge, ipcRenderer } = require("electron");
contextBridge.exposeInMainWorld("background_plugin", {
repatchFrostedGlassStyleListener: (callback) =>
ipcRenderer.on(
"LiteLoader.background_plugin.mainWindow.repatchFrostedGlassStyle",
callback
),
reloadBgListener: (callback) =>
ipcRenderer.on(
"LiteLoader.background_plugin.mainWindow.reloadBg",
callback
),
reloadBgTransparentListener: (callback) =>
ipcRenderer.on(
"LiteLoader.background_plugin.mainWindow.reloadGlobalTransparentOffset",
callback
),
getNowBg: () => ipcRenderer.invoke("LiteLoader.background_plugin.getNowBg"),
saveNowBg: () => ipcRenderer.invoke("LiteLoader.background_plugin.saveNowBg"),
resetTimer: () =>
ipcRenderer.invoke("LiteLoader.background_plugin.resetTimer"),
reloadBg: () => ipcRenderer.invoke("LiteLoader.background_plugin.reloadBg"),
resetAll: () => ipcRenderer.invoke("LiteLoader.background_plugin.resetAll"),
setFrostedGlassStyle: (isEnable) =>
ipcRenderer.invoke(
"LiteLoader.background_plugin.setFrostedGlassStyle",
isEnable
),
setBGTransparent: (value) =>
ipcRenderer.invoke("LiteLoader.background_plugin.setBGTransparent", value),
clearTmpDir: () =>
ipcRenderer.invoke("LiteLoader.background_plugin.clearTmpDir"),
getTmpDirSize: () =>
ipcRenderer.invoke("LiteLoader.background_plugin.getTmpDirSize"),
showApiPathHelp: () =>
ipcRenderer.invoke("LiteLoader.background_plugin.showApiPathHelp"),
fetchApi: (api) =>
ipcRenderer.invoke("LiteLoader.background_plugin.fetchApi", api),
isImgOrVideo: (data) =>
ipcRenderer.invoke("LiteLoader.background_plugin.isImgOrVideo", data),
setImageSourceType: (type) =>
ipcRenderer.invoke("LiteLoader.background_plugin.setImageSourceType", type),
setEMediaViewer: (data) =>
ipcRenderer.invoke("LiteLoader.background_plugin.setEMediaViewer", data),
setCommonBg: (data) =>
ipcRenderer.invoke("LiteLoader.background_plugin.setCommonBg", data),
setApiType: (type) =>
ipcRenderer.invoke("LiteLoader.background_plugin.setApiType", type),
showFolderSelect: () =>
ipcRenderer.invoke("LiteLoader.background_plugin.showFolderSelect"),
showImgSaveFolderSelect: () =>
ipcRenderer.invoke("LiteLoader.background_plugin.showImgSaveFolderSelect"),
showFileSelect: () =>
ipcRenderer.invoke("LiteLoader.background_plugin.showFileSelect"),
apiJsonPathApply: (jsonPath) =>
ipcRenderer.invoke(
"LiteLoader.background_plugin.apiJsonPathApply",
jsonPath
),
networkImgConfigApply: (filePath) =>
ipcRenderer.invoke(
"LiteLoader.background_plugin.networkImgConfigApply",
filePath
),
randomSelect: (isForce) =>
ipcRenderer.invoke("LiteLoader.background_plugin.randomSelect", isForce),
getRefreshTime: () =>
ipcRenderer.invoke("LiteLoader.background_plugin.getRefreshTime"),
getNowConfig: () =>
ipcRenderer.invoke("LiteLoader.background_plugin.getNowConfig"),
changeRefreshTime: (refreshTime) =>
ipcRenderer.invoke(
"LiteLoader.background_plugin.changeRefreshTime",
refreshTime
),
setAutoRefresh: (isAutoRefresh) =>
ipcRenderer.invoke(
"LiteLoader.background_plugin.setAutoRefresh",
isAutoRefresh
),
setUseCache: (isUseCache) =>
ipcRenderer.invoke("LiteLoader.background_plugin.setUseCache", isUseCache),
});