import { CanvasObject } from './CanvasObject'; import { GroupInterface } from '../../../CanvasInterface/Objects/Group'; import paper from 'paper'; export class Group extends CanvasObject implements GroupInterface { public static type = 'Group'; protected _src = ''; set src(src) { this._src = src; } get src() { return this._src; } loadFromURL(url) { return new Promise((resolve, reject) => { paper.project.importSVG(url, { onLoad: (group, xmlStr) => { this.wrappedObject = group; this.src = url; resolve(this); }, onError: reject, }); }); } toObject(...args) { const { src } = this; return { ...super.toObject(...args), src, }; } }