Group.d.ts 1.0 KB

123456789101112131415161718192021222324252627
  1. import Element, { ElementOption } from '../Element';
  2. import BoundingRect from '../core/BoundingRect';
  3. import Storage from '../Storage';
  4. export interface GroupOption extends ElementOption {
  5. }
  6. export default class Group extends Element {
  7. isGroup: boolean;
  8. type: string;
  9. private _children;
  10. __storage: Storage;
  11. constructor(opts?: GroupOption);
  12. children(): Element<ElementOption>[];
  13. childAt(idx: number): Element;
  14. childOfName(name: string): Element;
  15. childCount(): number;
  16. add(child: Element): Group;
  17. addBefore(child: Element, nextSibling: Element): this;
  18. _doAdd(child: Element): void;
  19. remove(child: Element): this;
  20. removeAll(): this;
  21. eachChild<Context>(cb: (this: Context, el: Element, index?: number) => void, context?: Context): this;
  22. traverse<T>(cb: (this: T, el: Element) => void, context?: T): this;
  23. addChildrenToStorage(storage: Storage): void;
  24. delChildrenFromStorage(storage: Storage): void;
  25. dirty(): this;
  26. getBoundingRect(includeChildren?: Element[]): BoundingRect;
  27. }