import EventEmitter from '@antv/event-emitter'; import { IElement, IEventEmitter, IMatrixValue, IMaxtrix } from '../types'; /** * 图形画布中的容器元素,可以包含有子元素 */ export declare class Group extends EventEmitter implements IEventEmitter, IElement, IMaxtrix { /** * 元素的 id,自动生成 */ id: string; /** * 元素的 tag,自动根据元素类型设置 */ tag: string; /** * 类型,用于查找元素 */ className: string; /** * 元素的 attributes 配置 */ attributes: Record; /** * 当前的 matrix 数据,默认设置为初始的矩阵 */ matrix: IMatrixValue; /** * 子元素 */ children: IElement[]; /** * 获取属性 * @param key */ getAttribute(key: string): any; /** * 设置属性 * @param key * @param value */ setAttribute(key: string, value: any): Record; /** * 删除属性 * @param key */ removeAttribute(key: string): boolean; /** * 通过 id 查找 */ getElementById(id: string): IElement; /** * 通过 class name 查找数组 */ getEelementsByClassName(className: string): any[]; /** * 通过 tag 查找 */ getEelementsByTag(tag: string): any[]; /** * 添加子元素 */ add(): void; /** * 删除子元素 */ remove(): void; /** * 移动到 x y 位置 * @param x * @param y */ moveTo(x: number, y: number): IMatrixValue; /** * 移动 x y 位移 * @param x * @param y */ moveBy(x: number, y: number): IMatrixValue; /** * 放大缩小到 x y * @param x * @param y */ scaleTo(x: number, y: number): IMatrixValue; /** * 放大缩小 x y 比例 * @param x * @param y */ scaleBy(x: number, y: number): IMatrixValue; /** * 旋转到 angle 角度 * @param angle */ rotateTo(angle: number): IMatrixValue; /** * 旋转 angle 角度 * @param angle */ rotateBy(angle: number): IMatrixValue; }