PC/node_modules/ssr-window/src/window.js
2026-01-26 23:20:48 +08:00

30 lines
521 B
JavaScript

import document from './document';
const win = (typeof window === 'undefined') ? {
document,
navigator: {
userAgent: '',
},
location: {},
history: {},
CustomEvent: function CustomEvent() {
return this;
},
addEventListener() {},
removeEventListener() {},
getComputedStyle() {
return {
getPropertyValue() {
return '';
},
};
},
Image() {},
Date() {},
screen: {},
setTimeout() {},
clearTimeout() {},
} : window; // eslint-disable-line
export default win;