diff --git a/types/fabric/fabric-impl.d.ts b/types/fabric/fabric-impl.d.ts index 31509435a5..369856130c 100644 --- a/types/fabric/fabric-impl.d.ts +++ b/types/fabric/fabric-impl.d.ts @@ -1710,6 +1710,47 @@ export class Group { static fromObject(object: any, callback: (group: Group) => any): void; } +/////////////////////////////////////////////////////////////////////////////// +// ActiveSelection +////////////////////////////////////////////////////////////////////////////// +export interface ActiveSelection extends Object, ICollection {} +export class ActiveSelection { + /** + * Constructor + * @param objects ActiveSelection objects + * @param [options] Options object + */ + constructor(items?: Object[], options?: IObjectOptions); + + /** + * Change te activeSelection to a normal group, + * High level function that automatically adds it to canvas as + * active object. no events fired. + */ + toGroup(): Group; + + /** + * Removes objects from a collection, then renders canvas (if `renderOnAddRemove` is not `false`) + * @param object Zero or more fabric instances + * @return thisArg + * @chainable + */ + remove(...object: Object[]): Group; + + /** + * Returns string represenation of a group + */ + toString(): string; + + /** + * Returns {@link fabric.ActiveSelection} instance from an object representation + * @memberOf fabric.ActiveSelection + * @param object Object to create a group from + * @param [callback] Callback to invoke when an ActiveSelection instance is created + */ + static fromObject(object: Group, callback: (activeSelection: ActiveSelection) => void): void; +} + interface IImageOptions extends IObjectOptions { /** * crossOrigin value (one of "", "anonymous", "allow-credentials")