This commit is contained in:
Eugene Pankov
2021-10-24 21:50:55 +02:00
parent c61c816e32
commit eae970f969
50 changed files with 1521 additions and 1385 deletions

View File

@@ -1,41 +1,41 @@
import * as domino from 'domino';
import * as fs from 'fs';
import * as path from 'path';
import * as domino from 'domino'
import * as fs from 'fs'
import * as path from 'path'
const template = fs.readFileSync(path.join(process.cwd(), 'build', 'index.html')).toString();
const win = domino.createWindow(template);
const template = fs.readFileSync(path.join(process.cwd(), 'build', 'index.html')).toString()
const win = domino.createWindow(template)
global['window'] = win;
global['window'] = win
Object.defineProperty(win.document.body.style, 'transform', {
value: () => {
return {
enumerable: true,
configurable: true
};
configurable: true,
}
},
});
})
Object.defineProperty(win.document.body.style, 'z-index', {
value: () => {
return {
enumerable: true,
configurable: true
};
return {
enumerable: true,
configurable: true,
}
},
});
})
global['document'] = win.document;
global['CSS'] = null;
global['document'] = win.document
global['CSS'] = null
// global['atob'] = win.atob;
global['atob'] = (base64: string) => {
return Buffer.from(base64, 'base64').toString();
};
function setDomTypes() {
// Make all Domino types available as types in the global env.
Object.assign(global, domino['impl']);
(global as any)['KeyboardEvent'] = domino['impl'].Event;
return Buffer.from(base64, 'base64').toString()
}
setDomTypes();
function setDomTypes () {
// Make all Domino types available as types in the global env.
Object.assign(global, domino['impl']);
(global as any)['KeyboardEvent'] = domino['impl'].Event
}
setDomTypes()