Files
konva/src/Group.ts

27 lines
630 B
TypeScript
Raw Normal View History

2019-01-01 15:59:27 -05:00
import { Util, Collection } from './Util';
import { Container } from './Container';
2019-02-24 12:06:04 -05:00
2019-01-01 15:59:27 -05:00
/**
* Group constructor. Groups are used to contain shapes or other groups.
* @constructor
* @memberof Konva
* @augments Konva.Container
* @param {Object} config
* @@nodeParams
* @@containerParams
* @example
* var group = new Konva.Group();
*/
export class Group extends Container {
_validateAdd(child) {
var type = child.getType();
if (type !== 'Group' && type !== 'Shape') {
Util.throw('You may only add groups and shapes to groups.');
}
}
}
2019-01-25 00:20:15 -05:00
Group.prototype.nodeType = 'Group';
2019-01-01 15:59:27 -05:00
Collection.mapMethods(Group);