From ac1a16b0d6beaaf3a4495a075cf78eee84bf17b8 Mon Sep 17 00:00:00 2001 From: ougunbu <36983387+ougunbu@users.noreply.github.com> Date: Fri, 20 Apr 2018 01:59:28 +0800 Subject: [PATCH] Added the statement of ActiveSelection (#25084) * Added the statement of ActiveSelection A declaration about ActiveSelection has been added after Group. * Update types Line number 1723: changed any[] to Object[] Line number 1751: changed any to Group Line number 1751: changed "(activeSelection: ActiveSelection) => any" to "(activeSelection: ActiveSelection) => void" --- types/fabric/fabric-impl.d.ts | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) 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")