From a44e492599c154201cb13071ca23fe04fd36e823 Mon Sep 17 00:00:00 2001 From: xuzhidan Date: Mon, 21 Feb 2022 11:24:06 +0800 Subject: [PATCH] update drag window feature. Signed-off-by: xuzhidan Change-Id: I39cbfc365aba1420baf79c631886f6a227e657c9 --- api/@internal/component/ets/common.d.ts | 36 ++++++++++++++++++++----- 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts index 77f868468c..be8398aac2 100644 --- a/api/@internal/component/ets/common.d.ts +++ b/api/@internal/component/ets/common.d.ts @@ -250,6 +250,30 @@ interface ItemDragInfo { y: number; } +/** + * DragItemInfo object description + * @since 8 + */ +interface DragItemInfo { + /** + * Uses the pixelMap object for drawing. + * @since 8 + */ + pixelMap?: PixelMap; + + /** + * Uses the custom builder for drawing, if pixelMap is set, this value is ignored. + * @since 8 + */ + builder?: CustomBuilder; + + /** + * Sets the extra info for drag event. + * @since 8 + */ + extraInfo?: string; +} + /** * Defining animation function. * @since 7 @@ -1256,32 +1280,32 @@ declare class CommonMethod { /** * After a listener is bound, the component can be dragged. After the drag occurs, a callback is triggered. * (To be triggered, press and hold for 170 milliseconds (ms)) - * @since 7 + * @since 8 */ - onDragStart(event: (event?: DragEvent, extraParams?: string) => (() => any) | void): T; + onDragStart(event: (event?: DragEvent, extraParams?: string) => CustomBuilder | DragItemInfo): T; /** * After binding, a callback is triggered when the component is dragged to the range of the component. - * @since 7 + * @since 8 */ onDragEnter(event: (event?: DragEvent, extraParams?: string) => void): T; /** * After binding, a callback is triggered when the drag moves within the range of a placeable component. - * @since 7 + * @since 8 */ onDragMove(event: (event?: DragEvent, extraParams?: string) => void): T; /** * After binding, a callback is triggered when the component is dragged out of the component range. - * @since 7 + * @since 8 */ onDragLeave(event: (event?: DragEvent, extraParams?: string) => void): T; /** * The component bound to this event can be used as the drag release target. * This callback is triggered when the drag behavior is stopped within the scope of the component. - * @since 7 + * @since 8 */ onDrop(event: (event?: DragEvent, extraParams?: string) => void): T; -- Gitee