From 1a9f3a6297500353205c1bb7141f91dee2a864d6 Mon Sep 17 00:00:00 2001 From: yan-shuifeng Date: Wed, 16 Feb 2022 09:37:41 +0800 Subject: [PATCH] add pixelmap info for drag Signed-off-by: yan-shuifeng Change-Id: Id160ae51ecfbcc956b12e8b7595000c8a714642e --- 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..0dbb0a2a53 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 { + /** + * Defines the pixelmap info for draw. + * @since 8 + */ + pixelMap?: PixelMap; + + /** + * The custom builder function. If pixelmap is set, this value is ignored. + * @since 8 + */ + builder?: CustomBuilder; + + /** + * The extra info for drag info message. + * @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