konva/konva-node/index.js
2017-10-11 12:17:54 +04:00

23 lines
486 B
JavaScript

var Konva = require('konva-dev');
var Canvas = require('canvas');
Konva.window = {
Image: Canvas.Image,
devicePixelRatio: 1
};
Konva.document = {
createElement: function() {},
documentElement: {
addEventListener: function() {}
}
};
// Konva.window = new JSDOM(
// '<!DOCTYPE html><html><head></head><body></body></html>'
// ).window;
// Konva.document = Konva.window.document;
// Konva.window.Image = Canvas.Image;
Konva._nodeCanvas = Canvas;
module.exports = Konva;