mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-09 17:45:02 +09:00
56 lines
No EOL
1.1 KiB
JavaScript
56 lines
No EOL
1.1 KiB
JavaScript
const RendererEvents = {};
|
|
|
|
window.AnytypeGlobalConfig = {
|
|
debug: {
|
|
mw: true,
|
|
},
|
|
};
|
|
|
|
window.Electron = {
|
|
platform: 'Windows',
|
|
version: {
|
|
},
|
|
isMaximized: () => {},
|
|
getGlobal: (v) => {
|
|
switch (v) {
|
|
case 'serverAddress':
|
|
return window.serverAddress;
|
|
};
|
|
},
|
|
removeAllListeners: function () {},
|
|
on: function (id, callBack) {
|
|
RendererEvents[id] = callBack;
|
|
console.log(RendererEvents);
|
|
},
|
|
send: function () {},
|
|
currentWindow: function () {
|
|
return {};
|
|
},
|
|
Api: () => {},
|
|
};
|
|
|
|
window.require = window.require || function (mod) {
|
|
const ret = {};
|
|
|
|
switch (mod) {
|
|
case '@electron/remote':
|
|
ret.app = {
|
|
getVersion: function () { return ''; },
|
|
getPath: function () { return ''; },
|
|
};
|
|
|
|
ret.process = {
|
|
getSystemVersion: function () { return ''; },
|
|
};
|
|
|
|
break;
|
|
|
|
case 'os':
|
|
ret.platform = function () { return 'darwin'; };
|
|
ret.release = function () { return ''; };
|
|
break;
|
|
|
|
};
|
|
|
|
return ret;
|
|
}; |