1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-09 17:45:02 +09:00
anytype-ts/dist/polyfill.js
2023-09-01 16:46:56 +02:00

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 { windowId: 1 };
},
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;
};