From 8e7b592e7440df3c524044af4cdaea4caafb7303 Mon Sep 17 00:00:00 2001 From: huiqiang Date: Thu, 24 Jul 2025 21:22:01 +0800 Subject: [PATCH] separate files Signed-off-by: huiqiang Change-Id: Id28030f114c7c2583c27a5f66253006db8c74be0 --- api/@internal/component/ets/flow_item.d.ts | 14 +- api/@internal/component/ets/grid.d.ts | 165 +--- api/@internal/component/ets/gridItem.d.ts | 61 +- .../component/ets/lazy_grid_layout.d.ts | 27 +- api/@internal/component/ets/list.d.ts | 289 ++---- api/@internal/component/ets/list_item.d.ts | 116 +-- .../component/ets/list_item_group.d.ts | 53 +- api/@internal/component/ets/refresh.d.ts | 77 +- api/@internal/component/ets/scroll.d.ts | 292 ++---- api/@internal/component/ets/scroll_bar.d.ts | 41 +- api/@internal/component/ets/water_flow.d.ts | 146 +-- api/@ohos.arkui.modifier.d.ets | 63 ++ api/arkui/GridItemModifier.static.d.ets | 34 + api/arkui/GridModifier.static.d.ets | 35 + api/arkui/ListItemGroupModifier.static.d.ets | 39 + api/arkui/ListItemModifier.static.d.ets | 35 + api/arkui/ListModifier.static.d.ets | 37 + api/arkui/RefreshModifier.static.d.ets | 37 + api/arkui/ScrollModifier.static.d.ets | 38 + api/arkui/WaterFlowModifier.static.d.ets | 36 + api/arkui/component/flowItem.static.d.ets | 57 ++ api/arkui/component/grid.d.ets | 159 --- api/arkui/component/grid.static.d.ets | 526 ++++++++++ api/arkui/component/gridItem.static.d.ets | 163 ++++ .../component/lazyGridLayout.static.d.ets | 97 ++ api/arkui/component/list.d.ets | 193 ---- api/arkui/component/list.static.d.ets | 902 ++++++++++++++++++ api/arkui/component/listItem.static.d.ets | 312 ++++++ .../component/listItemGroup.static.d.ets | 192 ++++ api/arkui/component/refresh.static.d.ets | 243 +++++ api/arkui/component/scroll.d.ets | 158 --- api/arkui/component/scroll.static.d.ets | 840 ++++++++++++++++ api/arkui/component/scrollBar.d.ets | 59 -- api/arkui/component/scrollBar.static.d.ets | 126 +++ api/arkui/component/waterFlow.static.d.ets | 446 +++++++++ 35 files changed, 4604 insertions(+), 1504 deletions(-) create mode 100755 api/arkui/GridItemModifier.static.d.ets create mode 100755 api/arkui/GridModifier.static.d.ets create mode 100755 api/arkui/ListItemGroupModifier.static.d.ets create mode 100755 api/arkui/ListItemModifier.static.d.ets create mode 100755 api/arkui/ListModifier.static.d.ets create mode 100644 api/arkui/RefreshModifier.static.d.ets create mode 100755 api/arkui/ScrollModifier.static.d.ets create mode 100755 api/arkui/WaterFlowModifier.static.d.ets create mode 100644 api/arkui/component/flowItem.static.d.ets delete mode 100644 api/arkui/component/grid.d.ets create mode 100644 api/arkui/component/grid.static.d.ets create mode 100644 api/arkui/component/gridItem.static.d.ets create mode 100644 api/arkui/component/lazyGridLayout.static.d.ets delete mode 100644 api/arkui/component/list.d.ets create mode 100644 api/arkui/component/list.static.d.ets create mode 100644 api/arkui/component/listItem.static.d.ets create mode 100644 api/arkui/component/listItemGroup.static.d.ets create mode 100644 api/arkui/component/refresh.static.d.ets delete mode 100644 api/arkui/component/scroll.d.ets create mode 100644 api/arkui/component/scroll.static.d.ets delete mode 100644 api/arkui/component/scrollBar.d.ets create mode 100644 api/arkui/component/scrollBar.static.d.ets create mode 100644 api/arkui/component/waterFlow.static.d.ets diff --git a/api/@internal/component/ets/flow_item.d.ts b/api/@internal/component/ets/flow_item.d.ts index 70cf009cce..628aab8e31 100644 --- a/api/@internal/component/ets/flow_item.d.ts +++ b/api/@internal/component/ets/flow_item.d.ts @@ -18,9 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { CommonMethod } from './common' -/*** endif */ /** * Mesh container for static fixed-size layout scenarios. @@ -44,8 +41,8 @@ import { CommonMethod } from './common' * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ interface FlowItemInterface { /** @@ -70,8 +67,7 @@ interface FlowItemInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ (): FlowItemAttribute; } @@ -98,8 +94,8 @@ interface FlowItemInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ declare class FlowItemAttribute extends CommonMethod {} diff --git a/api/@internal/component/ets/grid.d.ts b/api/@internal/component/ets/grid.d.ts index 32de925e32..bb45b3ac12 100644 --- a/api/@internal/component/ets/grid.d.ts +++ b/api/@internal/component/ets/grid.d.ts @@ -18,13 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { EdgeEffectOptions, NestedScrollOptions, ItemDragInfo, ScrollableCommonMethod, Optional, CommonMethod, OnWillScrollCallback, OnScrollCallback, OnItemDragStartCallback } from './common'; -import { Length, Resource } from './units'; -import { Scroller, OnScrollFrameBeginCallback } from './scroll'; -import { ScrollState } from './list'; -import { BarState, Color, EdgeEffect } from './enums'; -/*** endif */ /** * The options to help grid layout @@ -41,8 +34,7 @@ import { BarState, Color, EdgeEffect } from './enums'; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare interface GridLayoutOptions { /** @@ -60,8 +52,7 @@ declare interface GridLayoutOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ regularSize: [number, number]; @@ -82,8 +73,7 @@ declare interface GridLayoutOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ irregularIndexes?: number[]; @@ -104,8 +94,7 @@ declare interface GridLayoutOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onGetIrregularSizeByIndex?: (index: number) => [number, number] @@ -126,8 +115,7 @@ declare interface GridLayoutOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onGetRectByIndex?: (index: number) => [number, number, number, number] } @@ -154,8 +142,8 @@ declare interface GridLayoutOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ interface GridInterface { /** @@ -185,8 +173,7 @@ interface GridInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ (scroller?: Scroller, layoutOptions?: GridLayoutOptions): GridAttribute; } @@ -213,8 +200,7 @@ interface GridInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum GridDirection { /** @@ -236,8 +222,7 @@ declare enum GridDirection { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ Row, @@ -260,8 +245,7 @@ declare enum GridDirection { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ Column, @@ -284,8 +268,7 @@ declare enum GridDirection { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ RowReverse, @@ -308,8 +291,7 @@ declare enum GridDirection { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ ColumnReverse, } @@ -321,8 +303,7 @@ declare enum GridDirection { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare enum GridItemAlignment { @@ -332,8 +313,7 @@ declare enum GridItemAlignment { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ DEFAULT = 0, @@ -344,8 +324,7 @@ declare enum GridItemAlignment { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ STRETCH = 1, } @@ -365,8 +344,7 @@ declare enum GridItemAlignment { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare interface ComputedBarAttribute { /** @@ -384,8 +362,7 @@ declare interface ComputedBarAttribute { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ totalOffset: number; @@ -404,8 +381,7 @@ declare interface ComputedBarAttribute { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ totalLength: number; } @@ -491,8 +467,8 @@ declare type OnGridScrollIndexCallback = (first: number, last: number) => void; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ declare class GridAttribute extends ScrollableCommonMethod { /** @@ -520,8 +496,7 @@ declare class GridAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ columnsTemplate(value: string): GridAttribute; @@ -550,8 +525,7 @@ declare class GridAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ rowsTemplate(value: string): GridAttribute; @@ -580,8 +554,7 @@ declare class GridAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ columnsGap(value: Length): GridAttribute; @@ -610,8 +583,7 @@ declare class GridAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ rowsGap(value: Length): GridAttribute; @@ -723,8 +695,7 @@ declare class GridAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onScrollBarUpdate(event: (index: number, offset: number) => ComputedBarAttribute): GridAttribute; @@ -758,8 +729,7 @@ declare class GridAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onScrollIndex(event: (first: number, last: number) => void): GridAttribute; @@ -788,8 +758,7 @@ declare class GridAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ cachedCount(value: number): GridAttribute; @@ -801,8 +770,7 @@ declare class GridAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ cachedCount(count: number, show: boolean): GridAttribute; @@ -831,8 +799,7 @@ declare class GridAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ editMode(value: boolean): GridAttribute; @@ -861,8 +828,7 @@ declare class GridAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ multiSelectable(value: boolean): GridAttribute; @@ -891,8 +857,7 @@ declare class GridAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ maxCount(value: number): GridAttribute; @@ -921,8 +886,7 @@ declare class GridAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ minCount(value: number): GridAttribute; @@ -951,8 +915,7 @@ declare class GridAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ cellLength(value: number): GridAttribute; @@ -981,8 +944,7 @@ declare class GridAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ layoutDirection(value: GridDirection): GridAttribute; @@ -1011,8 +973,7 @@ declare class GridAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ supportAnimation(value: boolean): GridAttribute; @@ -1048,19 +1009,6 @@ declare class GridAttribute extends ScrollableCommonMethod { */ onItemDragStart(event: (event: ItemDragInfo, itemIndex: number) => (() => any) | void): GridAttribute; - /** - * 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)) - * - * @param { OnItemDragStartCallback } event - * @returns { GridAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - onItemDragStart(event: OnItemDragStartCallback): GridAttribute; - /** * After binding, a callback is triggered when the component is dragged to the range of the component. * @@ -1086,8 +1034,7 @@ declare class GridAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onItemDragEnter(event: (event: ItemDragInfo) => void): GridAttribute; @@ -1116,8 +1063,7 @@ declare class GridAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onItemDragMove(event: (event: ItemDragInfo, itemIndex: number, insertIndex: number) => void): GridAttribute; @@ -1146,8 +1092,7 @@ declare class GridAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onItemDragLeave(event: (event: ItemDragInfo, itemIndex: number) => void): GridAttribute; @@ -1179,8 +1124,7 @@ declare class GridAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onItemDrop( event: (event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void, @@ -1278,8 +1222,7 @@ declare class GridAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ alignItems(alignment: Optional): GridAttribute; @@ -1449,34 +1392,8 @@ declare class GridAttribute extends ScrollableCommonMethod { * @crossplatform * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ onScrollFrameBegin(event: OnScrollFrameBeginCallback): GridAttribute; - - /** - * Called when the scrollable will scroll. - * - * @param { Optional } handler - callback of scrollable. - * @returns { GridAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - onWillScroll(handler: Optional): GridAttribute; - - /** - * Called when the scrollable did scroll. - * - * @param { OnScrollCallback } handler - callback of scrollable, - * scrollOffset is offset this frame did scroll, scrollState is current scroll state. - * @returns { GridAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - onDidScroll(handler: OnScrollCallback): GridAttribute; } /** diff --git a/api/@internal/component/ets/gridItem.d.ts b/api/@internal/component/ets/gridItem.d.ts index bfb7548327..028808a5a7 100644 --- a/api/@internal/component/ets/gridItem.d.ts +++ b/api/@internal/component/ets/gridItem.d.ts @@ -18,9 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { CommonMethod, Bindable } from './common' -/*** endif */ /** * Defines the grid item style. @@ -37,8 +34,7 @@ import { CommonMethod, Bindable } from './common' * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare enum GridItemStyle { /** @@ -54,8 +50,7 @@ declare enum GridItemStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ NONE = 0, @@ -72,8 +67,7 @@ declare enum GridItemStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ PLAIN = 1, } @@ -93,8 +87,7 @@ declare enum GridItemStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface GridItemOptions { /** @@ -112,8 +105,7 @@ declare interface GridItemOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ style?: GridItemStyle; } @@ -140,8 +132,8 @@ declare interface GridItemOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ interface GridItemInterface { /** @@ -167,8 +159,7 @@ interface GridItemInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ (value?: GridItemOptions): GridItemAttribute; } @@ -189,8 +180,8 @@ interface GridItemInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ declare class GridItemAttribute extends CommonMethod { /** @@ -218,8 +209,7 @@ declare class GridItemAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ rowStart(value: number): GridItemAttribute; @@ -248,8 +238,7 @@ declare class GridItemAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ rowEnd(value: number): GridItemAttribute; @@ -278,8 +267,7 @@ declare class GridItemAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ columnStart(value: number): GridItemAttribute; @@ -308,8 +296,7 @@ declare class GridItemAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ columnEnd(value: number): GridItemAttribute; @@ -349,8 +336,7 @@ declare class GridItemAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ selectable(value: boolean): GridItemAttribute; @@ -377,20 +363,6 @@ declare class GridItemAttribute extends CommonMethod { */ selected(value: boolean): GridItemAttribute; - /** - * Called when judging whether it is selected. - * This parameter supports $$ for two-way binding of variables. - * - * @param { boolean | Bindable } value - * @returns { GridItemAttribute } the attribute of the gridItem. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - selected(value: boolean | Bindable): GridItemAttribute; - /** * Called when the gridItem is selected. * @@ -416,8 +388,7 @@ declare class GridItemAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onSelect(event: (isSelected: boolean) => void): GridItemAttribute; } diff --git a/api/@internal/component/ets/lazy_grid_layout.d.ts b/api/@internal/component/ets/lazy_grid_layout.d.ts index cd82bcfe98..4b5ed852df 100644 --- a/api/@internal/component/ets/lazy_grid_layout.d.ts +++ b/api/@internal/component/ets/lazy_grid_layout.d.ts @@ -19,10 +19,6 @@ */ -/*** if arkts 1.2 */ -import { CommonMethod } from './common'; -import { LengthMetrics } from '../Graphics'; -/*** endif */ /** * Defines the lazy vertical grid layout component. @@ -31,8 +27,8 @@ import { LengthMetrics } from '../Graphics'; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 + * @noninterop */ interface LazyVGridLayoutInterface { /** @@ -42,8 +38,7 @@ interface LazyVGridLayoutInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ (): LazyVGridLayoutAttribute; } @@ -55,8 +50,7 @@ interface LazyVGridLayoutInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ declare class LazyGridLayoutAttribute extends CommonMethod { /** @@ -67,8 +61,7 @@ declare class LazyGridLayoutAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ rowsGap(value: LengthMetrics): T; @@ -80,8 +73,7 @@ declare class LazyGridLayoutAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ columnsGap(value: LengthMetrics): T; } @@ -93,8 +85,8 @@ declare class LazyGridLayoutAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 + * @noninterop */ declare class LazyVGridLayoutAttribute extends LazyGridLayoutAttribute { /** @@ -105,8 +97,7 @@ declare class LazyVGridLayoutAttribute extends LazyGridLayoutAttributevoid } @@ -778,8 +736,7 @@ declare interface CloseSwipeActionOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface VisibleListContentInfo { /** @@ -789,8 +746,7 @@ declare interface VisibleListContentInfo { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ index: number @@ -802,8 +758,7 @@ declare interface VisibleListContentInfo { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ itemGroupArea?: ListItemGroupArea @@ -815,8 +770,7 @@ declare interface VisibleListContentInfo { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ itemIndexInGroup?: number } @@ -830,8 +784,7 @@ declare interface VisibleListContentInfo { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare type OnScrollVisibleContentChangeCallback = (start: VisibleListContentInfo, end: VisibleListContentInfo) => void; @@ -861,8 +814,7 @@ declare type OnListScrollIndexCallback = (start: number, end: number, center: nu * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class ListScroller extends Scroller { /** @@ -904,8 +856,7 @@ declare class ListScroller extends Scroller { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ getItemRectInGroup(index: number, indexInGroup: number): RectResult; @@ -947,8 +898,7 @@ declare class ListScroller extends Scroller { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ scrollToItemInGroup(index: number, indexInGroup:number, smooth?: boolean, align?: ScrollAlign): void; @@ -981,8 +931,7 @@ declare class ListScroller extends Scroller { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ closeAllSwipeActions(options?: CloseSwipeActionOptions): void; @@ -1006,8 +955,7 @@ declare class ListScroller extends Scroller { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ getVisibleListContentInfo(x: number, y: number): VisibleListContentInfo; } @@ -1024,8 +972,7 @@ declare class ListScroller extends Scroller { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ interface ListOptions { /** @@ -1077,8 +1024,7 @@ interface ListOptions { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ initialIndex?: number; /** @@ -1131,8 +1077,7 @@ interface ListOptions { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ space?: number | string; /** @@ -1182,8 +1127,7 @@ interface ListOptions { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ scroller?: Scroller; } @@ -1220,8 +1164,8 @@ interface ListOptions { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ interface ListInterface { /** @@ -1272,8 +1216,7 @@ interface ListInterface { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ (options?: ListOptions): ListAttribute; } @@ -1286,8 +1229,7 @@ interface ListInterface { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare interface ListDividerOptions { /** @@ -1333,8 +1275,7 @@ declare interface ListDividerOptions { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ strokeWidth: Length; /** @@ -1381,8 +1322,7 @@ declare interface ListDividerOptions { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ color?: ResourceColor; /** @@ -1429,8 +1369,7 @@ declare interface ListDividerOptions { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ startMargin?: Length; /** @@ -1477,8 +1416,7 @@ declare interface ListDividerOptions { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ endMargin?: Length; } @@ -1507,8 +1445,8 @@ declare interface ListDividerOptions { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ declare class ListAttribute extends ScrollableCommonMethod { /** @@ -1542,8 +1480,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ lanes(value: number | LengthConstrain, gutter?: Dimension): ListAttribute; @@ -1576,8 +1513,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ alignListItem(value: ListItemAlign): ListAttribute; @@ -1617,8 +1553,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ listDirection(value: Axis): ListAttribute; @@ -1730,8 +1665,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ contentStartOffset(value: number): ListAttribute; @@ -1752,8 +1686,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ contentEndOffset(value: number): ListAttribute; @@ -1805,8 +1738,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ divider( value: ListDividerOptions | null, @@ -1861,8 +1793,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ multiSelectable(value: boolean): ListAttribute; @@ -1904,8 +1835,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ cachedCount(value: number): ListAttribute; @@ -1921,8 +1851,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ cachedCount(count: number, show: boolean): ListAttribute; @@ -1965,8 +1894,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ chainAnimation(value: boolean): ListAttribute; @@ -1977,8 +1905,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @returns { ListAttribute } the attribute of the list. * @syscap SystemCapability.ArkUI.ArkUI.Full * @systemapi - * @since arkts {'1.1':'10','1.2':'20'} - * @arkts 1.1&1.2 + * @since 10 */ chainAnimationOptions(value: ChainAnimationOptions): ListAttribute; @@ -2016,8 +1943,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ sticky(value: StickyStyle): ListAttribute; @@ -2038,8 +1964,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ scrollSnapAlign(value: ScrollSnapAlign): ListAttribute; @@ -2120,8 +2045,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ childrenMainSize(value: ChildrenMainSize): ListAttribute; @@ -2145,8 +2069,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ maintainVisibleContentPosition(enabled: boolean): ListAttribute; @@ -2168,8 +2091,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'19','1.2':'20'} - * @arkts 1.1&1.2 + * @since 19 */ stackFromEnd(enabled: boolean): ListAttribute; @@ -2275,8 +2197,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onScrollIndex(event: (start: number, end: number, center: number) => void): ListAttribute; @@ -2288,8 +2209,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onScrollVisibleContentChange(handler: OnScrollVisibleContentChangeCallback): ListAttribute; @@ -2483,8 +2403,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onItemMove(event: (from: number, to: number) => boolean): ListAttribute; @@ -2519,19 +2438,6 @@ declare class ListAttribute extends ScrollableCommonMethod { */ onItemDragStart(event: (event: ItemDragInfo, itemIndex: number) => ((() => any) | void)): ListAttribute; - /** - * 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)) - * - * @param { OnItemDragStartCallback } event - callback function, triggered when the item drag start. - * @returns { ListAttribute } Returns the instance of the ListAttribute. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - onItemDragStart(event: OnItemDragStartCallback): ListAttribute; - /** * After binding, a callback is triggered when the component is dragged to the range of the component. * @@ -2557,8 +2463,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onItemDragEnter(event: (event: ItemDragInfo) => void): ListAttribute; @@ -2587,8 +2492,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onItemDragMove(event: (event: ItemDragInfo, itemIndex: number, insertIndex: number) => void): ListAttribute; @@ -2617,8 +2521,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onItemDragLeave(event: (event: ItemDragInfo, itemIndex: number) => void): ListAttribute; @@ -2649,8 +2552,7 @@ declare class ListAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onItemDrop(event: (event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void): ListAttribute; @@ -2696,35 +2598,8 @@ declare class ListAttribute extends ScrollableCommonMethod { * @form * @atomicservice * @since 20 - * @arkts 1.1&1.2 */ onScrollFrameBegin(event: OnScrollFrameBeginCallback): ListAttribute; - - /** - * Called when the scrollable will scroll. - * - * @param { Optional } handler - callback of scrollable. - * @returns { ListAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - onWillScroll(handler: Optional): ListAttribute; - - /** - * Called when the scrollable did scroll. - * - * @param { OnScrollCallback } handler - callback of scrollable, - * scrollOffset is offset this frame did scroll, scrollState is current scroll state. - * @returns { ListAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - onDidScroll(handler: OnScrollCallback): ListAttribute; } /** diff --git a/api/@internal/component/ets/list_item.d.ts b/api/@internal/component/ets/list_item.d.ts index 914f1fd993..a2b4c2132f 100644 --- a/api/@internal/component/ets/list_item.d.ts +++ b/api/@internal/component/ets/list_item.d.ts @@ -18,12 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { CommonMethod, Bindable } from './common'; -import { CustomBuilder } from './builder' -import { Length } from './units'; -import { ComponentContent } from '../ComponentContent' -/*** endif */ /** * Declare item ceiling attribute. @@ -122,8 +116,7 @@ declare enum EditMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum SwipeEdgeEffect { /** @@ -145,8 +138,7 @@ declare enum SwipeEdgeEffect { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ Spring, @@ -169,8 +161,7 @@ declare enum SwipeEdgeEffect { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ None, } @@ -190,8 +181,7 @@ declare enum SwipeEdgeEffect { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare enum SwipeActionState { /** @@ -205,8 +195,7 @@ declare enum SwipeActionState { * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ COLLAPSED, @@ -221,8 +210,7 @@ declare enum SwipeActionState { * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ EXPANDED, @@ -237,8 +225,7 @@ declare enum SwipeActionState { * * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ ACTIONING, } @@ -257,8 +244,7 @@ declare enum SwipeActionState { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare interface SwipeActionItem { /** @@ -277,8 +263,7 @@ declare interface SwipeActionItem { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ builder?: CustomBuilder; @@ -290,8 +275,7 @@ declare interface SwipeActionItem { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ builderComponent?: ComponentContent; @@ -311,8 +295,7 @@ declare interface SwipeActionItem { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ actionAreaDistance?: Length; @@ -330,8 +313,7 @@ declare interface SwipeActionItem { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onAction?: () => void; @@ -349,8 +331,7 @@ declare interface SwipeActionItem { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onEnterActionArea?: () => void; @@ -368,8 +349,7 @@ declare interface SwipeActionItem { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onExitActionArea?: () => void; @@ -388,8 +368,7 @@ declare interface SwipeActionItem { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onStateChange?: (state: SwipeActionState) => void; } @@ -416,8 +395,7 @@ declare interface SwipeActionItem { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare interface SwipeActionOptions { /** @@ -445,8 +423,7 @@ declare interface SwipeActionOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ start?: CustomBuilder | SwipeActionItem; @@ -475,8 +452,7 @@ declare interface SwipeActionOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ end?: CustomBuilder | SwipeActionItem; @@ -502,8 +478,7 @@ declare interface SwipeActionOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ edgeEffect?: SwipeEdgeEffect; @@ -522,8 +497,7 @@ declare interface SwipeActionOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onOffsetChange?: (offset: number) => void; } @@ -542,8 +516,7 @@ declare interface SwipeActionOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum ListItemStyle { /** @@ -558,8 +531,7 @@ declare enum ListItemStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ NONE = 0, @@ -575,8 +547,7 @@ declare enum ListItemStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ CARD = 1, } @@ -595,8 +566,7 @@ declare enum ListItemStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare interface ListItemOptions { /** @@ -613,8 +583,7 @@ declare interface ListItemOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ style?: ListItemStyle; } @@ -651,8 +620,8 @@ declare interface ListItemOptions { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ interface ListItemInterface { /** @@ -674,8 +643,7 @@ interface ListItemInterface { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ (value?: ListItemOptions): ListItemAttribute; @@ -725,8 +693,8 @@ interface ListItemInterface { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ declare class ListItemAttribute extends CommonMethod { /** @@ -788,8 +756,7 @@ declare class ListItemAttribute extends CommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ selectable(value: boolean): ListItemAttribute; @@ -818,21 +785,6 @@ declare class ListItemAttribute extends CommonMethod { */ selected(value: boolean): ListItemAttribute; - /** - * Called when judging whether it is selected. - * This parameter supports $$ for two-way binding of variables. - * - * @param { boolean | Bindable } value - if the listItem is selected. - * @returns { ListItemAttribute } the attribute of the listItem. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @form - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - selected(value: boolean | Bindable): ListItemAttribute; - /** * Sets the action item that appears when the list item slides in the cross axis direction of the list. * @@ -858,8 +810,7 @@ declare class ListItemAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ swipeAction(value: SwipeActionOptions): ListItemAttribute; @@ -899,8 +850,7 @@ declare class ListItemAttribute extends CommonMethod { * @crossplatform * @form * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onSelect(event: (isSelected: boolean) => void): ListItemAttribute; } diff --git a/api/@internal/component/ets/list_item_group.d.ts b/api/@internal/component/ets/list_item_group.d.ts index 44000be5c5..7016cab705 100644 --- a/api/@internal/component/ets/list_item_group.d.ts +++ b/api/@internal/component/ets/list_item_group.d.ts @@ -18,12 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { ChildrenMainSize, CommonMethod } from './common'; -import { CustomBuilder } from './builder' -import { ComponentContent } from '../ComponentContent' -import { ListDividerOptions } from './list'; -/*** endif */ /** * Defines the list item group style. @@ -39,8 +33,7 @@ import { ListDividerOptions } from './list'; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum ListItemGroupStyle { /** @@ -55,8 +48,7 @@ declare enum ListItemGroupStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ NONE = 0, @@ -72,8 +64,7 @@ declare enum ListItemGroupStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ CARD = 1, } @@ -100,8 +91,7 @@ declare enum ListItemGroupStyle { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare interface ListItemGroupOptions { /** @@ -126,8 +116,7 @@ declare interface ListItemGroupOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ header?: CustomBuilder; @@ -138,8 +127,7 @@ declare interface ListItemGroupOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ headerComponent?: ComponentContent; @@ -165,8 +153,7 @@ declare interface ListItemGroupOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ footer?: CustomBuilder; @@ -177,8 +164,7 @@ declare interface ListItemGroupOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'13','1.2':'20'} - * @arkts 1.1&1.2 + * @since 13 */ footerComponent?: ComponentContent; @@ -204,8 +190,7 @@ declare interface ListItemGroupOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ space?: number | string; @@ -223,8 +208,7 @@ declare interface ListItemGroupOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ style?: ListItemGroupStyle; } @@ -251,8 +235,8 @@ declare interface ListItemGroupOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ interface ListItemGroupInterface { /** @@ -280,8 +264,7 @@ interface ListItemGroupInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ (options?: ListItemGroupOptions): ListItemGroupAttribute; } @@ -308,8 +291,8 @@ interface ListItemGroupInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ declare class ListItemGroupAttribute extends CommonMethod { /** @@ -363,8 +346,7 @@ declare class ListItemGroupAttribute extends CommonMethod } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - refreshing: boolean | Bindable; /** * Distance to the top of the parent component from the component that @@ -292,8 +267,7 @@ interface RefreshOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ promptText?: ResourceStr; @@ -312,8 +286,7 @@ interface RefreshOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ builder?: CustomBuilder; @@ -324,8 +297,7 @@ interface RefreshOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ refreshingContent?: ComponentContent; } @@ -352,8 +324,8 @@ interface RefreshOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ interface RefreshInterface { /** @@ -381,8 +353,7 @@ interface RefreshInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ (value: RefreshOptions): RefreshAttribute; } @@ -409,8 +380,8 @@ interface RefreshInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ declare class RefreshAttribute extends CommonMethod { /** @@ -438,8 +409,7 @@ declare class RefreshAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onStateChange(callback: (state: RefreshStatus) => void): RefreshAttribute; @@ -468,8 +438,7 @@ declare class RefreshAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ onRefreshing(callback: () => void): RefreshAttribute; @@ -481,8 +450,7 @@ declare class RefreshAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ refreshOffset(value: number): RefreshAttribute; @@ -494,8 +462,7 @@ declare class RefreshAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ pullToRefresh(value: boolean): RefreshAttribute; @@ -508,8 +475,7 @@ declare class RefreshAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onOffsetChange(callback: Callback): RefreshAttribute; @@ -521,8 +487,7 @@ declare class RefreshAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ pullDownRatio(ratio: Optional): RefreshAttribute; diff --git a/api/@internal/component/ets/scroll.d.ts b/api/@internal/component/ets/scroll.d.ts index 3121a85569..c3c3f540b9 100644 --- a/api/@internal/component/ets/scroll.d.ts +++ b/api/@internal/component/ets/scroll.d.ts @@ -18,12 +18,7 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { BarState, Edge, Color, EdgeEffect, ScrollSource ,Curve} from './enums' -import { ICurve, RectResult, ScrollableCommonMethod, EdgeEffectOptions, NestedScrollOptions,CommonMethod } from './common' -import { Dimension, Length, VoidCallback, Resource, LengthMetrics } from './units' -import { ScrollSnapAlign, ScrollState } from './list' -/*** endif */ + /** * Content scroll direction. @@ -47,8 +42,7 @@ import { ScrollSnapAlign, ScrollState } from './list' * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum ScrollDirection { /** @@ -70,8 +64,7 @@ declare enum ScrollDirection { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ Vertical, @@ -94,8 +87,7 @@ declare enum ScrollDirection { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ Horizontal, @@ -127,8 +119,7 @@ declare enum ScrollDirection { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ None, } @@ -148,8 +139,7 @@ declare enum ScrollDirection { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum ScrollAlign { /** @@ -165,8 +155,7 @@ declare enum ScrollAlign { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ START, @@ -183,8 +172,7 @@ declare enum ScrollAlign { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ CENTER, @@ -201,8 +189,7 @@ declare enum ScrollAlign { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ END, @@ -219,8 +206,7 @@ declare enum ScrollAlign { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ AUTO, } @@ -232,8 +218,7 @@ declare enum ScrollAlign { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare interface OffsetResult { /** @@ -243,8 +228,7 @@ declare interface OffsetResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ xOffset: number; @@ -255,8 +239,7 @@ declare interface OffsetResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ yOffset: number; } @@ -268,8 +251,7 @@ declare interface OffsetResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface ScrollEdgeOptions { /** @@ -281,8 +263,7 @@ declare interface ScrollEdgeOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ velocity?: number; } @@ -294,8 +275,7 @@ declare interface ScrollEdgeOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface ScrollToIndexOptions { /** @@ -305,8 +285,7 @@ declare interface ScrollToIndexOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ extraOffset?: LengthMetrics; } @@ -318,8 +297,7 @@ declare interface ScrollToIndexOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface ScrollAnimationOptions { /** @@ -334,8 +312,7 @@ declare interface ScrollAnimationOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ duration?: number; @@ -347,8 +324,7 @@ declare interface ScrollAnimationOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ curve?: Curve | ICurve; @@ -365,8 +341,7 @@ declare interface ScrollAnimationOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ canOverScroll?: boolean; } @@ -378,8 +353,7 @@ declare interface ScrollAnimationOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare interface OffsetOptions { /** @@ -390,8 +364,7 @@ declare interface OffsetOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ xOffset?: Dimension; @@ -403,8 +376,7 @@ declare interface OffsetOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ yOffset?: Dimension; } @@ -474,8 +446,7 @@ declare interface UIScrollEvent extends UIScrollableCommonEvent { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare class Scroller { /** @@ -497,8 +468,7 @@ declare class Scroller { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ constructor(); @@ -538,17 +508,6 @@ declare class Scroller { */ scrollTo(options: ScrollOptions); - /** - * Called when the setting slides to the specified position. - * - * @param { ScrollOptions } options - scroll options - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - scrollTo(options: ScrollOptions): void; /** * Called when scrolling to the edge of the container. @@ -588,18 +547,6 @@ declare class Scroller { */ scrollEdge(value: Edge, options?: ScrollEdgeOptions); - /** - * Called when scrolling to the edge of the container. - * - * @param { Edge } value - Edge type of the container. - * @param { ScrollEdgeOptions } [options] - Options of scrolling to edge. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - scrollEdge(value: Edge, options?: ScrollEdgeOptions): void; /** * Performs inertial scrolling based on the initial velocity passed in. @@ -616,8 +563,7 @@ declare class Scroller { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ fling(velocity: number): void; @@ -655,18 +601,6 @@ declare class Scroller { * @since 14 */ scrollPage(value: ScrollPageOptions); - - /** - * Called when page turning mode is set. - * - * @param { ScrollPageOptions } value - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - scrollPage(value: ScrollPageOptions): void; /** * Scrolls to the next or previous page. @@ -700,8 +634,7 @@ declare class Scroller { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ currentOffset() : OffsetResult; @@ -762,21 +695,6 @@ declare class Scroller { */ scrollToIndex(value: number, smooth?: boolean, align?: ScrollAlign, options?: ScrollToIndexOptions); - /** - * Scroll to the specified index. - * - * @param { number } value - Index to jump to. - * @param { boolean } [smooth] - If true, scroll to index item with animation. If false, scroll to index item without animation. - * @param { ScrollAlign } [align] - Sets the alignment mode of a specified index. - * @param { ScrollToIndexOptions } [options] - Sets the options of a specified index, such as extra offset. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - scrollToIndex(value: number, smooth?: boolean, align?: ScrollAlign, options?: ScrollToIndexOptions): void; - /** * Called when the setting slides by offset. * @@ -810,19 +728,6 @@ declare class Scroller { */ scrollBy(dx: Length, dy: Length); - /** - * Called when the setting slides by offset. - * - * @param { Length } dx - * @param { Length } dy - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - scrollBy(dx: Length, dy: Length): void; - /** * Indicates whether the component scrolls to the end position. * @@ -842,8 +747,7 @@ declare class Scroller { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ isAtEnd(): boolean; @@ -881,8 +785,7 @@ declare class Scroller { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ getItemRect(index: number): RectResult; @@ -904,8 +807,7 @@ declare class Scroller { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ getItemIndex(x: number, y: number): number; } @@ -917,8 +819,7 @@ declare class Scroller { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare interface ScrollOptions { /** @@ -954,8 +855,7 @@ declare interface ScrollOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ xOffset: number | string; @@ -992,8 +892,7 @@ declare interface ScrollOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ yOffset: number | string; @@ -1040,8 +939,7 @@ declare interface ScrollOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ animation?: ScrollAnimationOptions | boolean; @@ -1063,8 +961,7 @@ declare interface ScrollOptions { * @interface ScrollPageOptions * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ declare interface ScrollPageOptions { /** @@ -1075,8 +972,7 @@ declare interface ScrollPageOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ next: boolean; @@ -1089,8 +985,7 @@ declare interface ScrollPageOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ animation?: boolean; } @@ -1108,8 +1003,7 @@ declare interface ScrollPageOptions { * @interface ScrollSnapOptions * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare interface ScrollSnapOptions { /** @@ -1126,8 +1020,7 @@ declare interface ScrollSnapOptions { * @default ScrollSnapAlign.NONE * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ snapAlign: ScrollSnapAlign; @@ -1157,8 +1050,7 @@ declare interface ScrollSnapOptions { * @default 100% * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ snapPagination?: Dimension | Array; @@ -1183,8 +1075,7 @@ declare interface ScrollSnapOptions { * @default true * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ enableSnapToStart?: boolean; @@ -1209,8 +1100,7 @@ declare interface ScrollSnapOptions { * @default true * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ enableSnapToEnd?: boolean; } @@ -1237,8 +1127,8 @@ declare interface ScrollSnapOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ interface ScrollInterface { /** @@ -1266,8 +1156,7 @@ interface ScrollInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ (scroller?: Scroller): ScrollAttribute; } @@ -1280,8 +1169,7 @@ interface ScrollInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare type OnScrollEdgeCallback = (side: Edge) => void; @@ -1292,8 +1180,7 @@ declare type OnScrollEdgeCallback = (side: Edge) => void; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ interface OnScrollFrameBeginHandlerResult { /** @@ -1328,8 +1215,7 @@ interface OnScrollFrameBeginHandlerResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ offsetRemain: number; } @@ -1344,8 +1230,7 @@ interface OnScrollFrameBeginHandlerResult { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ declare type OnScrollFrameBeginCallback = (offset: number, state: ScrollState) => OnScrollFrameBeginHandlerResult; @@ -1371,8 +1256,8 @@ declare type OnScrollFrameBeginCallback = (offset: number, state: ScrollState) = * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ declare class ScrollAttribute extends ScrollableCommonMethod { /** @@ -1400,8 +1285,7 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ scrollable(value: ScrollDirection): ScrollAttribute; @@ -1459,8 +1343,7 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onWillScroll(handler: ScrollOnWillScrollCallback): ScrollAttribute; @@ -1479,8 +1362,7 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onDidScroll(handler: ScrollOnScrollCallback): ScrollAttribute; @@ -1527,8 +1409,7 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onScrollEdge(event: OnScrollEdgeCallback): ScrollAttribute; @@ -1573,8 +1454,7 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onScrollStart(event: VoidCallback): ScrollAttribute; @@ -1636,8 +1516,7 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onScrollStop(event: VoidCallback): ScrollAttribute; @@ -1666,8 +1545,7 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ scrollBar(barState: BarState): ScrollAttribute; @@ -1696,8 +1574,7 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ scrollBarColor(color: Color | number | string): ScrollAttribute; @@ -1726,8 +1603,7 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ scrollBarWidth(value: number | string): ScrollAttribute; @@ -1760,8 +1636,7 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ edgeEffect(edgeEffect: EdgeEffect, options?: EdgeEffectOptions): ScrollAttribute; @@ -1801,8 +1676,7 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ onScrollFrameBegin(event: OnScrollFrameBeginCallback): ScrollAttribute; @@ -1824,8 +1698,7 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ nestedScroll(value: NestedScrollOptions): ScrollAttribute; @@ -1847,8 +1720,7 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ enableScrollInteraction(value: boolean): ScrollAttribute; @@ -1874,8 +1746,7 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ friction(value: number | Resource): ScrollAttribute; @@ -1894,8 +1765,7 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @returns { ScrollAttribute } the attribute of the scroll. * @syscap SystemCapability.ArkUI.ArkUI.Full * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ scrollSnap(value: ScrollSnapOptions): ScrollAttribute; @@ -1917,8 +1787,7 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ enablePaging(value: boolean): ScrollAttribute; @@ -1932,8 +1801,7 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ initialOffset(value: OffsetOptions): ScrollAttribute; } @@ -1958,8 +1826,7 @@ declare class ScrollAttribute extends ScrollableCommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare type ScrollOnScrollCallback = (xOffset: number, yOffset: number, scrollState: ScrollState) => void; @@ -1985,25 +1852,6 @@ declare type ScrollOnScrollCallback = (xOffset: number, yOffset: number, scrollS declare type ScrollOnWillScrollCallback = (xOffset: number, yOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => void | OffsetResult; - /** - * Called before scroll to allow developer to control real offset the Scroll can scroll. - * - * @typedef { function } ScrollOnWillScrollCallback - * @param { number } xOffset - horizontal offset this frame will scroll, which may or may not be reached. - * @param { number } yOffset - vertical offset this frame will scroll, which may or may not be reached. - * @param { ScrollState } scrollState - current scroll state. - * @param { ScrollSource } scrollSource - source of current scroll. - * @returns { undefined | OffsetResult } the remain offset for the Scroll, - * same as (xOffset, yOffset) when no OffsetResult is returned. - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @crossplatform - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - declare type ScrollOnWillScrollCallback = - (xOffset: number, yOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => undefined | OffsetResult; - /** * Defines Scroll Component. * diff --git a/api/@internal/component/ets/scroll_bar.d.ts b/api/@internal/component/ets/scroll_bar.d.ts index 3dfc4cf07a..e2d619faa2 100644 --- a/api/@internal/component/ets/scroll_bar.d.ts +++ b/api/@internal/component/ets/scroll_bar.d.ts @@ -18,11 +18,7 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { Scroller } from './scroll' -import { BarState } from './enums' -import { Optional, CommonMethod } from './common' -/*** endif */ + /** * Content scroll direction. @@ -46,8 +42,7 @@ import { Optional, CommonMethod } from './common' * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare enum ScrollBarDirection { /** @@ -69,8 +64,7 @@ declare enum ScrollBarDirection { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ Vertical, @@ -93,8 +87,7 @@ declare enum ScrollBarDirection { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ Horizontal, } @@ -121,8 +114,7 @@ declare enum ScrollBarDirection { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare interface ScrollBarOptions { /** @@ -147,8 +139,7 @@ declare interface ScrollBarOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ scroller: Scroller; @@ -174,8 +165,7 @@ declare interface ScrollBarOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ direction?: ScrollBarDirection; @@ -201,8 +191,7 @@ declare interface ScrollBarOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ state?: BarState; } @@ -229,8 +218,8 @@ declare interface ScrollBarOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ interface ScrollBarInterface { /** @@ -258,8 +247,7 @@ interface ScrollBarInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ (value: ScrollBarOptions): ScrollBarAttribute; } @@ -286,8 +274,8 @@ interface ScrollBarInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ declare class ScrollBarAttribute extends CommonMethod { /** @@ -297,8 +285,7 @@ declare class ScrollBarAttribute extends CommonMethod { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'14','1.2':'20'} - * @arkts 1.1&1.2 + * @since 14 */ enableNestedScroll(enabled: Optional): ScrollBarAttribute; diff --git a/api/@internal/component/ets/water_flow.d.ts b/api/@internal/component/ets/water_flow.d.ts index 05823f127d..d1d22b7a6a 100644 --- a/api/@internal/component/ets/water_flow.d.ts +++ b/api/@internal/component/ets/water_flow.d.ts @@ -18,16 +18,6 @@ * @kit ArkUI */ -/*** if arkts 1.2 */ -import { ScrollableCommonMethod, NestedScrollOptions, CommonMethod, Optional, OnWillScrollCallback, OnScrollCallback } from './common'; -import { CustomBuilder } from './builder' -import { Length, Dimension, Margin, ConstraintSizeOptions, Resource } from './units'; -import { Scroller, OnScrollFrameBeginCallback } from './scroll'; -import { ScrollState } from './list' -import { FlexDirection } from './enums' -import { ComponentContent } from '../../arkui/ComponentContent' -/*** endif */ - /** * function that returns item main size by index. * @@ -37,8 +27,7 @@ import { ComponentContent } from '../../arkui/ComponentContent' * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare type GetItemMainSizeByIndex = (index: number) => number; @@ -48,8 +37,7 @@ declare type GetItemMainSizeByIndex = (index: number) => number; * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class SectionOptions { /** @@ -60,8 +48,7 @@ declare class SectionOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ itemsCount: number; @@ -74,8 +61,7 @@ declare class SectionOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ crossCount?: number; @@ -96,8 +82,7 @@ declare class SectionOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ onGetItemMainSizeByIndex?: GetItemMainSizeByIndex; @@ -110,8 +95,7 @@ declare class SectionOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ columnsGap?: Dimension; @@ -124,8 +108,7 @@ declare class SectionOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ rowsGap?: Dimension; @@ -137,8 +120,7 @@ declare class SectionOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ margin?: Margin | Dimension; } @@ -149,8 +131,7 @@ declare class SectionOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare class WaterFlowSections { /** @@ -159,8 +140,7 @@ declare class WaterFlowSections { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ constructor(); @@ -184,8 +164,7 @@ declare class WaterFlowSections { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ splice(start: number, deleteCount?: number, sections?: Array): boolean; @@ -197,8 +176,7 @@ declare class WaterFlowSections { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ push(section: SectionOptions): boolean; @@ -214,8 +192,7 @@ declare class WaterFlowSections { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ update(sectionIndex:number, section: SectionOptions): boolean; @@ -226,8 +203,7 @@ declare class WaterFlowSections { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ values(): Array; @@ -238,8 +214,7 @@ declare class WaterFlowSections { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ length(): number; } @@ -251,8 +226,7 @@ declare class WaterFlowSections { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ declare enum WaterFlowLayoutMode { /** @@ -262,8 +236,7 @@ declare enum WaterFlowLayoutMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ ALWAYS_TOP_DOWN = 0, @@ -287,8 +260,7 @@ declare enum WaterFlowLayoutMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ SLIDING_WINDOW = 1, } @@ -315,8 +287,7 @@ declare enum WaterFlowLayoutMode { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ declare interface WaterFlowOptions { /** @@ -341,8 +312,7 @@ declare interface WaterFlowOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ footer?: CustomBuilder; @@ -353,8 +323,7 @@ declare interface WaterFlowOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'18','1.2':'20'} - * @arkts 1.1&1.2 + * @since 18 */ footerContent?: ComponentContent; @@ -384,8 +353,7 @@ declare interface WaterFlowOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ scroller?: Scroller; @@ -401,8 +369,7 @@ declare interface WaterFlowOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ sections?: WaterFlowSections; @@ -414,8 +381,7 @@ declare interface WaterFlowOptions { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'12','1.2':'20'} - * @arkts 1.1&1.2 + * @since 12 */ layoutMode?: WaterFlowLayoutMode; } @@ -501,8 +467,8 @@ declare type OnWaterFlowScrollIndexCallback = (first: number, last: number) => v * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ interface WaterFlowInterface { /** @@ -530,8 +496,7 @@ interface WaterFlowInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 */ (options?: WaterFlowOptions): WaterFlowAttribute; } @@ -558,8 +523,8 @@ interface WaterFlowInterface { * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @atomicservice - * @since arkts {'1.1':'11','1.2':'20'} - * @arkts 1.1&1.2 + * @since 11 + * @noninterop */ declare class WaterFlowAttribute extends ScrollableCommonMethod { /** @@ -587,8 +552,7 @@ declare class WaterFlowAttribute extends ScrollableCommonMethod void): WaterFlowAttribute; - - /** - * Called when the scrollable will scroll. - * - * @param { Optional } handler - callback of scrollable. - * @returns { WaterFlowAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - onWillScroll(handler: Optional): WaterFlowAttribute; - - /** - * Called when the scrollable did scroll. - * - * @param { OnScrollCallback } handler - callback of scrollable, - * scrollOffset is offset this frame did scroll, scrollState is current scroll state. - * @returns { WaterFlowAttribute } - * @syscap SystemCapability.ArkUI.ArkUI.Full - * @atomicservice - * @since 20 - * @arkts 1.2 - */ - onDidScroll(handler: OnScrollCallback): WaterFlowAttribute; } /** diff --git a/api/@ohos.arkui.modifier.d.ets b/api/@ohos.arkui.modifier.d.ets index 4cdb3f34c0..8d9689e57f 100644 --- a/api/@ohos.arkui.modifier.d.ets +++ b/api/@ohos.arkui.modifier.d.ets @@ -42,6 +42,69 @@ export { CommonModifier } from './arkui/CommonModifier'; */ export { AttributeUpdater } from './arkui/AttributeUpdater'; +/** + * Export GridModifier, which is used to update attributes to native side. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ +export { GridModifier } from './arkui/GridModifier'; + +/** + * Export GridItemModifier, which is used to update attributes to native side. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ +export { GridItemModifier } from './arkui/GridItemModifier'; + +/** + * Export ListItemGroupModifier, which is used to update attributes to native side. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ +export { ListItemGroupModifier } from './arkui/ListItemGroupModifier'; + +/** + * Export ListItemModifier, which is used to update attributes to native side. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ +export { ListItemModifier } from './arkui/ListItemModifier'; + +/** + * Export ListModifier, which is used to update attributes to native side. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ +export { ListModifier } from './arkui/ListModifier'; + +/** + * Export RefreshModifier, which is used to update attributes to native side. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ +export { RefreshModifier } from './arkui/RefreshModifier'; + +/** + * Export RefreshModifier, which is used to update attributes to native side. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ +export { ScrollModifier } from './arkui/ScrollModifier'; + +/** + * Export RefreshModifier, which is used to update attributes to native side. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ +export { WaterFlowModifier } from './arkui/WaterFlowModifier'; /** * Export AttributeUpdater, which is used to update attributes to native side. diff --git a/api/arkui/GridItemModifier.static.d.ets b/api/arkui/GridItemModifier.static.d.ets new file mode 100755 index 0000000000..7c3bc9cc4c --- /dev/null +++ b/api/arkui/GridItemModifier.static.d.ets @@ -0,0 +1,34 @@ +'use static' +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file Grid modifier file,defines modifier and function. + * @kit ArkUI + * @arkts 1.2 + */ + +import { AttributeModifier } from './component/common'; +import { GridItemAttribute } from './component/gridItem'; + +/** + * Defines GridItem Modifier + * + * @implements { GridItemAttribute, AttributeModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 20 +*/ +export declare class GridItemModifier implements GridItemAttribute, AttributeModifier {} diff --git a/api/arkui/GridModifier.static.d.ets b/api/arkui/GridModifier.static.d.ets new file mode 100755 index 0000000000..9ace414736 --- /dev/null +++ b/api/arkui/GridModifier.static.d.ets @@ -0,0 +1,35 @@ +'use static' +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file Grid modifier file,defines modifier and function. + * @kit ArkUI + * @arkts 1.2 + */ + +import { AttributeModifier } from './component/common'; +import { GridAttribute } from './component/grid'; + + +/** + * Defines Grid Modifier + * + * @implements { GridAttribute, AttributeModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 20 +*/ +export declare class GridModifier implements GridAttribute, AttributeModifier {} diff --git a/api/arkui/ListItemGroupModifier.static.d.ets b/api/arkui/ListItemGroupModifier.static.d.ets new file mode 100755 index 0000000000..0610a4e57b --- /dev/null +++ b/api/arkui/ListItemGroupModifier.static.d.ets @@ -0,0 +1,39 @@ +'use static' +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file ListItemGroup modifier file,defines modifier and function. + * @kit ArkUI + * @arkts 1.2 + */ + +import { AttributeModifier } from './component/common'; +import { ListItemGroupAttribute } from './component/listItemGroup'; + + +/** + * Defines ListItemGroup Modifier + * + * @implements { ListItemGroupAttribute, AttributeModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ +export declare class ListItemGroupModifier + implements + ListItemGroupAttribute, + AttributeModifier { } \ No newline at end of file diff --git a/api/arkui/ListItemModifier.static.d.ets b/api/arkui/ListItemModifier.static.d.ets new file mode 100755 index 0000000000..6d973d3edf --- /dev/null +++ b/api/arkui/ListItemModifier.static.d.ets @@ -0,0 +1,35 @@ +'use static' +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file ListItem modifier file,defines modifier and function. + * @kit ArkUI + * @arkts 1.2 + */ + +import { AttributeModifier } from './component/common'; +import { ListItemAttribute } from './component/listItem'; + + +/** + * Defines ListItem Modifier + * + * @implements { ListItemAttribute, AttributeModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 20 +*/ +export declare class ListItemModifier implements ListItemAttribute, AttributeModifier {} \ No newline at end of file diff --git a/api/arkui/ListModifier.static.d.ets b/api/arkui/ListModifier.static.d.ets new file mode 100755 index 0000000000..91cf6f10bc --- /dev/null +++ b/api/arkui/ListModifier.static.d.ets @@ -0,0 +1,37 @@ +'use static' +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file List modifier file,defines modifier and function. + * @kit ArkUI + * @arkts 1.2 + */ + + +import { AttributeModifier } from './component/common'; +import { ListAttribute } from './component/list'; + + +/** + * Defines List Modifier + * + * @implements { ListAttribute, AttributeModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ +export declare class ListModifier implements ListAttribute, AttributeModifier {} diff --git a/api/arkui/RefreshModifier.static.d.ets b/api/arkui/RefreshModifier.static.d.ets new file mode 100644 index 0000000000..28046bf75b --- /dev/null +++ b/api/arkui/RefreshModifier.static.d.ets @@ -0,0 +1,37 @@ +'use static' +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file Refresh modifier file, defines modifier and function. + * @kit ArkUI + * @arkts 1.2 + */ + + +import { AttributeModifier } from './component/common'; +import { RefreshAttribute } from './component/refresh'; + +/** + * Defines Refresh Modifier + * + * @implements { RefreshAttribute, AttributeModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 +*/ +export declare class RefreshModifier implements RefreshAttribute, AttributeModifier {} + \ No newline at end of file diff --git a/api/arkui/ScrollModifier.static.d.ets b/api/arkui/ScrollModifier.static.d.ets new file mode 100755 index 0000000000..61c3292347 --- /dev/null +++ b/api/arkui/ScrollModifier.static.d.ets @@ -0,0 +1,38 @@ +'use static' +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file Scroll modifier file,defines modifier and function. + * @kit ArkUI + * @arkts 1.2 + */ + + +import { AttributeModifier } from './component/common'; +import { ScrollAttribute } from './component/scroll'; + + + +/** + * Defines Scroll Modifier + * + * @implements { ScrollAttribute,AttributeModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ +export declare class ScrollModifier implements ScrollAttribute, AttributeModifier {} diff --git a/api/arkui/WaterFlowModifier.static.d.ets b/api/arkui/WaterFlowModifier.static.d.ets new file mode 100755 index 0000000000..6f49593425 --- /dev/null +++ b/api/arkui/WaterFlowModifier.static.d.ets @@ -0,0 +1,36 @@ +'use static' +/* + * Copyright (c) 2024 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @file WaterFlow modifier file,defines modifier and function. + * @kit ArkUI + * @arkts 1.2 + */ + +import { AttributeModifier } from './component/common'; +import { WaterFlowAttribute } from './component/waterFlow'; + + +/** + * Defines WaterFlow Modifier + * + * @implements { WaterFlowAttribute, AttributeModifier } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ +export declare class WaterFlowModifier implements WaterFlowAttribute, AttributeModifier {} diff --git a/api/arkui/component/flowItem.static.d.ets b/api/arkui/component/flowItem.static.d.ets new file mode 100644 index 0000000000..a0e2e060ea --- /dev/null +++ b/api/arkui/component/flowItem.static.d.ets @@ -0,0 +1,57 @@ +'use static' +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ +import { CommonMethod } from './common'; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; +import { AttributeModifier, CommonMethod } from "./common"; +/** + * The FlowItemAttribute. + * + * @extends CommonMethod + * @interface FlowItemAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface FlowItemAttribute extends CommonMethod { + /** + * Call attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Defines FlowItem Component + * + * @param { function } [content_] - container + * @returns { FlowItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function FlowItem( + @memo + content_?: () => void, +): FlowItemAttribute \ No newline at end of file diff --git a/api/arkui/component/grid.d.ets b/api/arkui/component/grid.d.ets deleted file mode 100644 index 8b8f81b107..0000000000 --- a/api/arkui/component/grid.d.ets +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2024-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @file - * @kit ArkUI - * @arkts 1.2 - */ - - -// WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! - -import { Tuple_Number_Number, ItemDragInfo, ScrollableCommonMethod, CommonMethod, DrawModifier, Rectangle, Callback_Array_TouchTestInfo_TouchResult, TouchTestInfo, TouchResult, PixelRoundPolicy, BackgroundEffectOptions, ForegroundEffectOptions, BorderImageOption, OutlineStyle, Callback_ClickEvent_Void, ClickEvent, Callback_Boolean_HoverEvent_Void, HoverEvent, AccessibilityCallback, Callback_MouseEvent_Void, MouseEvent, Callback_TouchEvent_Void, TouchEvent, Callback_KeyEvent_Void, KeyEvent, Callback_KeyEvent_Boolean, AnimateParam, TransitionOptions, TransitionEffect, MotionBlurOptions, InvertOptions, TranslateOptions, ScaleOptions, RotateOptions, Callback_Area_Area_Void, Literal_Union_Number_Literal_Number_offset_span_lg_md_sm_xs, Literal_Number_offset_span, AlignRuleOption, LocalizedAlignRuleOptions, ClickEffect, Callback_DragEvent_String_Union_CustomBuilder_DragItemInfo, DragEvent, CustomBuilder, DragItemInfo, Callback_DragEvent_String_Void, Callback_PreDragStatus_Void, PreDragStatus, Type_CommonMethod_linearGradient_value, Tuple_ResourceColor_Number, Type_CommonMethod_sweepGradient_value, Tuple_Length_Length, Type_CommonMethod_radialGradient_value, MotionPathOptions, ShadowOptions, ShadowStyle, ProgressMask, StateStyles, PixelStretchEffectOptions, AttributeModifier, GestureModifier, BackgroundBrightnessOptions, Callback_GestureInfo_BaseGestureEvent_GestureJudgeResult, GestureRecognizerJudgeBeginCallback, ShouldBuiltInRecognizerParallelWithCallback, Callback_TouchEvent_HitTestMode, SizeChangeCallback, SafeAreaType, SafeAreaEdge, Literal_Alignment_align, BlurStyle, BackgroundBlurStyleOptions, ForegroundBlurStyleOptions, TransitionFinishCallback, BlurOptions, LinearGradientBlurOptions, EffectType, sharedTransitionOptions, ChainStyle, DragPreviewOptions, DragInteractionOptions, OverlayOptions, BlendMode, BlendApplyType, GeometryTransitionOptions, PopupOptions, CustomPopupOptions, MenuElement, MenuOptions, ContextMenuOptions, ModalTransition, ContentCoverOptions, SheetOptions, VisibleAreaChangeCallback, NestedScrollOptions, ContentClipMode, EdgeEffectOptions, FadingEdgeOptions } from './common' -import { memo, ComponentBuilder, __memo_context_type, __memo_id_type } from './../stateManagement/runtime' -import { Scroller, ScrollOnWillScrollCallback, ScrollOnScrollCallback, OnScrollFrameBeginCallback, OnScrollFrameBeginHandlerResult } from './scroll' -import { ScrollState } from './list' -import { VisualEffect, Filter, UniformDataType, Blender, Length, SizeOptions, ConstraintSizeOptions, ChainWeightOptions, Padding, LocalizedPadding, Margin, LocalizedMargin, ResourceColor, Position, BorderOptions, EdgeStyles, EdgeWidths, LocalizedEdgeWidths, EdgeColors, LocalizedEdgeColors, BorderRadiuses, LocalizedBorderRadiuses, OutlineOptions, EdgeOutlineStyles, Dimension, EdgeOutlineWidths, OutlineRadiuses, Area, Edges, LocalizedEdges, LocalizedPosition, ResourceStr, AccessibilityOptions, PixelMap } from './units' -import { ComponentContent } from './../ComponentContent' -import { HitTestMode, ImageSize, Alignment, BorderStyle, ColoringStrategy, HoverEffect, Color, Visibility, ItemAlign, Direction, GradientDirection, ObscuredReasons, RenderFit, ImageRepeat, Axis, ResponseType, FunctionKey, ModifierKey, BarState, EdgeEffect } from './enums' -import { LengthMetrics } from './../Graphics' -import { CircleShape, EllipseShape, PathShape, RectShape } from './../../../api/@ohos.arkui.shape' -import { ResizableOptions } from './image' -import { Resource } from './../../../api/global/resource' - - -import { GestureInfo, BaseGestureEvent, GestureJudgeResult, GestureType, GestureMask } from './gesture' - -export type Callback_Number_Tuple_Number_Number = (index: number) => [ number, number ]; -export type Tuple_Number_Number_Number_Number = [ - number, - number, - number, - number -] -export type Callback_Number_Tuple_Number_Number_Number_Number = (index: number) => [ number, number, number, number ]; -export interface GridLayoutOptions { - regularSize: [ number, number ]; - irregularIndexes?: Array; - onGetIrregularSizeByIndex?: ((index: number) => [ number, number ]); - onGetRectByIndex?: ((index: number) => [ number, number, number, number ]); -} -export type GridInterface = (scroller?: Scroller, layoutOptions?: GridLayoutOptions) => GridAttribute; -export enum GridDirection { - ROW = 0, - Row = 0, - COLUMN = 1, - Column = 1, - ROW_REVERSE = 2, - RowReverse = 2, - COLUMN_REVERSE = 3, - ColumnReverse = 3 -} -export enum GridItemAlignment { - DEFAULT = 0, - STRETCH = 1 -} -export interface ComputedBarAttribute { - totalOffset: number; - totalLength: number; -} -export type Callback_Number_Number_ComputedBarAttribute = (index: number, offset: number) => ComputedBarAttribute; -export type Callback_Number_Number_Void = (first: number, last: number) => void; -export type Callback_ItemDragInfo_Void = (event: ItemDragInfo) => void; -export type Callback_ItemDragInfo_Number_Number_Void = (event: ItemDragInfo, itemIndex: number, - insertIndex: number) => void; -export type Callback_ItemDragInfo_Number_Void = (event: ItemDragInfo, itemIndex: number) => void; -export type Callback_ItemDragInfo_Number_Number_Boolean_Void = (event: ItemDragInfo, itemIndex: number, - insertIndex: number, isSuccess: boolean) => void; -export interface Literal_Number_offsetRemain { - offsetRemain: number; -} -export type Callback_Number_ScrollState_Literal_Number_offsetRemain = (offset: number, - state: ScrollState) => Literal_Number_offsetRemain; -export interface GridAttribute extends ScrollableCommonMethod { - @memo - columnsTemplate(value: string): this; - @memo - rowsTemplate(value: string): this; - @memo - columnsGap(value: Length): this; - @memo - rowsGap(value: Length): this; - @memo - scrollBarWidth(value: number | string): this; - @memo - scrollBarColor(value: Color | number | string): this; - @memo - scrollBar(value: BarState): this; - @memo - onScrollBarUpdate(value: ((index: number,offset: number) => ComputedBarAttribute)): this; - @memo - onScrollIndex(value: ((first: number,last: number) => void)): this; - @memo - cachedCount(value: number): this; - @memo - editMode(value: boolean): this; - @memo - multiSelectable(value: boolean): this; - @memo - maxCount(value: number): this; - @memo - minCount(value: number): this; - @memo - cellLength(value: number): this; - @memo - layoutDirection(value: GridDirection): this; - @memo - supportAnimation(value: boolean): this; - @memo - onItemDragStart(value: ((event: ItemDragInfo,itemIndex: number) => CustomBuilder)): this; - @memo - onItemDragEnter(value: ((event: ItemDragInfo) => void)): this; - @memo - onItemDragMove(value: ((event: ItemDragInfo,itemIndex: number,insertIndex: number) => void)): this; - @memo - onItemDragLeave(value: ((event: ItemDragInfo,itemIndex: number) => void)): this; - @memo - onItemDrop(value: ((event: ItemDragInfo,itemIndex: number,insertIndex: number,isSuccess: boolean) => void)): this; - @memo - nestedScroll(value: NestedScrollOptions): this; - @memo - enableScrollInteraction(value: boolean): this; - @memo - friction(value: number | Resource): this; - @memo - alignItems(value: GridItemAlignment | undefined): this; - @memo - onScroll(value: ((first: number,last: number) => void)): this; - @memo - onReachStart(value: (() => void)): this; - @memo - onReachEnd(value: (() => void)): this; - @memo - onScrollStart(value: (() => void)): this; - @memo - onScrollStop(value: (() => void)): this; - @memo - onScrollFrameBegin(value: OnScrollFrameBeginCallback): this; - @memo - edgeEffect(value: EdgeEffect, options?: EdgeEffectOptions): this; -} -@memo -@ComponentBuilder -export declare function Grid( - scroller?: Scroller | undefined, layoutOptions?: GridLayoutOptions | undefined, - @memo - content_?: () => void, -): GridAttribute diff --git a/api/arkui/component/grid.static.d.ets b/api/arkui/component/grid.static.d.ets new file mode 100644 index 0000000000..6faa716eea --- /dev/null +++ b/api/arkui/component/grid.static.d.ets @@ -0,0 +1,526 @@ +'use static' +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ +import { EdgeEffectOptions, NestedScrollOptions, ItemDragInfo, ScrollableCommonMethod, CommonMethod, OnWillScrollCallback, OnScrollCallback, OnItemDragStartCallback } from './common'; +import { Length, Resource } from './units'; +import { Scroller, OnScrollFrameBeginCallback } from './scroll'; +import { BarState, Color, EdgeEffect } from './enums'; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; +import { AttributeModifier, CommonMethod } from "./common"; +/** + * The options to help grid layout + * + * @interface GridLayoutOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface GridLayoutOptions { + /** + * The size of most grid items, in [rows, columns], generally [1, 1] + * + * @type { [number, number] } regularSize + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + regularSize: [ + number, + number + ]; + /** + * The indexes of grid items with irregular size. + * + * @type { ?number[] } irregularIndexes + * @default number[] no irregular grid item + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + irregularIndexes?: number[]; + /** + * Called to return the size of the irregular grid items with the specified index in [rows, columns]. + * + * @type { ?function } onGetIrregularSizeByIndex, + * all irregular grid items will occupy an entire line if not set + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onGetIrregularSizeByIndex?: (index: number) => [ + number, + number + ]; + /** + * Called to return the size of the grid items with the specified index in + * [rowStart, columnStart, rowSpan, columnSpan]. + * + * @type { ?function } onGetRectByIndex + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onGetRectByIndex?: (index: number) => [ + number, + number, + number, + number + ]; +} +/** + * The enum of property layoutDirection + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum GridDirection { + /** + * The row direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Row, + /** + * The column direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Column, + /** + * The row reverse direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + RowReverse, + /** + * The column reverse direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + ColumnReverse +} +/** + * Declare grid item alignment status + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum GridItemAlignment { + /** + * Use the default alignment of the Grid. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + DEFAULT = 0, + /** + * The height of the tallest grid item in the current line + * will be used as the height for the other items in the same line + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + STRETCH = 1 +} +/** + * The attribute of scrollbar to compute scrollbar position and height. + * + * @interface ComputedBarAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ComputedBarAttribute { + /** + * The offset of the grid. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + totalOffset: number; + /** + * The range of the grid. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + totalLength: number; +} + +/** + * The gridAttribute. + * + * @extends ScrollableCommonMethod + * @interface GridAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface GridAttribute extends ScrollableCommonMethod { + /** + * This parameter specifies the number of columns in the current grid layout. + * + * @param { string | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default columnsTemplate(value: string | undefined): this; + /** + * Lets you set the number of rows in the current grid layout, + * + * @param { string | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default rowsTemplate(value: string | undefined): this; + /** + * Allows you to set the spacing between columns. + * + * @param { Length | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default columnsGap(value: Length | undefined): this; + /** + * Lets you set the spacing between rows. + * + * @param { Length | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default rowsGap(value: Length | undefined): this; + /** + * This parameter specifies the width of the scroll bar. + * + * @param { number | string | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default scrollBarWidth(value: number | string | undefined): this; + /** + * Sets the color of the scroll bar. + * + * @param { Color | number | string | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default scrollBarColor(value: Color | number | string | undefined): this; + /** + * Lets you set the spacing between rows. + * + * @param { BarState | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default scrollBar(value: BarState | undefined): this; + /** + * Set scrollbar position. + * + * @param { function | undefined } event - callback of grid scroll, + * index is the current first displayed item, offset is the grid offset, + * return ComputedBarAttribute to update scrollbar position and height. + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default onScrollBarUpdate(event: ((index: number, offset: number) => ComputedBarAttribute) | undefined): this; + /** + * Called when the first or last item displayed in the grid changes. + * + * @param { function | undefined } event - of grid scroll, + * first is the index of the first item displayed in the grid, + * last is the index of the last item displayed in the grid. + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default onScrollIndex(event: ((first: number, last: number) => void) | undefined): this; + /** + * cached Count + * + * @param { number | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default cachedCount(value: number | undefined): this; + /** + * Called to set number of GridItems to be preloaded (cached) in LazyForEach / Repeat. + * @param { number | undefined } count - number of GridItems to be preloaded (cached). + * @param { boolean | undefined } show - if true, cached items are displayed when clip is disabled. + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default cachedCount(count: number | undefined, show: boolean | undefined): this; + /** + * editMode + * + * @param { boolean | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default editMode(value: boolean | undefined): this; + /** + * Called when judging whether it is multiSelectable. + * + * @param { boolean | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default multiSelectable(value: boolean | undefined): this; + /** + * maxCount + * + * @param { number | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default maxCount(value: number | undefined): this; + /** + * minCount + * + * @param { number | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default minCount(value: number | undefined): this; + /** + * cellLength + * + * @param { number | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default cellLength(value: number | undefined): this; + /** + * Control GridDirection of the grid. + * + * @param { GridDirection | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default layoutDirection(value: GridDirection | undefined): this; + /** + * Control if the grid supports animation. + * + * @param { boolean | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default supportAnimation(value: boolean | undefined): this; + /** + * 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)) + * + * @param { OnItemDragStartCallback | undefined } event + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 20 + */ + default onItemDragStart(event: OnItemDragStartCallback | undefined): this; + /** + * After binding, a callback is triggered when the component is dragged to the range of the component. + * + * @param { function | undefined } event + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default onItemDragEnter(event: ((event: ItemDragInfo) => void) | undefined): this; + /** + * After binding, a callback is triggered when the drag moves within the range of a placeable component. + * + * @param { function | undefined } event + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default onItemDragMove(event: ((event: ItemDragInfo, itemIndex: number, insertIndex: number) => void) | undefined): this; + /** + * After binding, a callback is triggered when the component is dragged out of the component range. + * + * @param { function | undefined } event + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default onItemDragLeave(event: ((event: ItemDragInfo, itemIndex: number) => void) | undefined): this; + /** + * 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. + * + * @param { function | undefined } event + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default onItemDrop(event: ((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void) | undefined): this; + /** + * Called when the sliding effect is set. + * + * @param { EdgeEffect | undefined } value + * @param { EdgeEffectOptions } [options] + * @returns { this } The attribute of the grid + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default edgeEffect(value: EdgeEffect | undefined, options?: EdgeEffectOptions): this; + /** + * Called to setting the nested scroll options. + * + * @param { NestedScrollOptions | undefined } value - options for nested scrolling. + * @returns { this } the attribute of the grid. + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default nestedScroll(value: NestedScrollOptions | undefined): this; + /** + * Called when setting whether to enable scroll by gesture or mouse. + * + * @param { boolean | undefined } value + * @returns { this } The attribute of the grid + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default enableScrollInteraction(value: boolean | undefined): this; + /** + * Called to setting the friction. + * + * @param { number | Resource | undefined } value - options for scrolling friction. + * @returns { this } the attribute of the grid. + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default friction(value: number | Resource | undefined): this; + /** + * Set the alignment of grid items. + * + * @param { GridItemAlignment | undefined } alignment - Items alignment + * @returns { this } The attribute of the grid. + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default alignItems(alignment: GridItemAlignment | undefined): this; + /** + * Called when scrolling begin each frame. + * Anonymous Object Rectification. + * + * @param { OnScrollFrameBeginCallback | undefined } event - callback function, + * triggered when the scrolling begin each frame. + * @returns { this } Returns the instance of the GridAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + + * @since 20 + */ + default onScrollFrameBegin(event: OnScrollFrameBeginCallback | undefined): this; + /** + * Called when the scrollable will scroll. + * + * @param { OnWillScrollCallback | undefined } handler - callback of scrollable. + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 20 + */ + default onWillScroll(handler: OnWillScrollCallback | undefined): this; + /** + * Called when the scrollable did scroll. + * + * @param { OnScrollCallback | undefined } handler - callback of scrollable, + * scrollOffset is offset this frame did scroll, scrollState is current scroll state. + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 20 + */ + default onDidScroll(handler: OnScrollCallback | undefined): this; + /** + * Call attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @atomicservice + * @since 20 + */ + default attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Grid is returned when the parameter is transferred. + * + * @param { Scroller } [scroller] - Controller bound to the grid + * @param { GridLayoutOptions } [layoutOptions] - The options to help grid layout + * @param { function } [content_] - container + * @returns { GridAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function Grid( + scroller?: Scroller, layoutOptions?: GridLayoutOptions, + @memo + content_?: () => void, +): GridAttribute \ No newline at end of file diff --git a/api/arkui/component/gridItem.static.d.ets b/api/arkui/component/gridItem.static.d.ets new file mode 100644 index 0000000000..ea32080385 --- /dev/null +++ b/api/arkui/component/gridItem.static.d.ets @@ -0,0 +1,163 @@ +'use static' +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ +import { CommonMethod, Bindable } from './common'; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; +import { AttributeModifier, CommonMethod } from "./common"; +/** + * Defines the grid item style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum GridItemStyle { + /** + * Show none style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + NONE = 0, + /** + * Show plain style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + PLAIN = 1 +} +/** + * Defines the grid item options. + * + * @interface GridItemOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface GridItemOptions { + /** + * Describes the GridItem style. + * + * @type { ?GridItemStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + style?: GridItemStyle; +} +/** + * The GridItemAttribute. + * + * @extends CommonMethod + * @interface GridItemAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface GridItemAttribute extends CommonMethod { + /** + * This parameter specifies the start line number of the current element. + * + * @param { numnumber | undefinedber } value + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default rowStart(value: number | undefined): this; + /** + * Specifies the end line number of the current element. + * + * @param { number | undefined } value + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default rowEnd(value: number | undefined): this; + /** + * This parameter specifies the start column number of the current element. + * + * @param { number | undefined } value + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default columnStart(value: number | undefined): this; + /** + * This parameter specifies the end column number of the current element. + * + * @param { number | undefined } value + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default columnEnd(value: number | undefined): this; + /** + * Called when judging whether it is selectable. + * + * @param { boolean | undefined } value + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default selectable(value: boolean | undefined): this; + /** + * Called when judging whether it is selected. + * This parameter supports $$ for two-way binding of variables. + * + * @param { boolean | Bindable | undefined } value + * @returns { GridItemAttribute } the attribute of the gridItem. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default selected(value: boolean | Bindable | undefined): this; + /** + * Called when the gridItem is selected. + * + * @param { function | undefined } event + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onSelect(event: ((isSelected: boolean) => void) | undefined): this; + /** + * Called attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Defines GridItem Component. + * + * @param { GridItemOptions } [value] - options + * @param { function } [content_] - container + * @returns { GridItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function GridItem( + value?: GridItemOptions, + @memo + content_?: () => void, +): GridItemAttribute \ No newline at end of file diff --git a/api/arkui/component/lazyGridLayout.static.d.ets b/api/arkui/component/lazyGridLayout.static.d.ets new file mode 100644 index 0000000000..2c4a488add --- /dev/null +++ b/api/arkui/component/lazyGridLayout.static.d.ets @@ -0,0 +1,97 @@ +'use static' +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ +import { CommonMethod } from './common'; +import { LengthMetrics } from '../Graphics'; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; +import { AttributeModifier, CommonMethod } from "./common"; + +/** + * The LazyGridLayoutAttribute. + * + * @extends CommonMethod + * @interface LazyGridLayoutAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface LazyGridLayoutAttribute extends CommonMethod { + /** + * The spacing between rows. + * + * @param { LengthMetrics | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default rowsGap(value: LengthMetrics | undefined): this; + /** + * The spacing between columns. + * + * @param { LengthMetrics | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default columnsGap(value: LengthMetrics | undefined): this; +} + +/** + * The LazyVGridLayoutAttribute + * + * @extends LazyGridLayoutAttribute + * @interface LazyVGridLayoutAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface LazyVGridLayoutAttribute extends LazyGridLayoutAttribute { + /** + * This parameter specifies the number of columns in the current grid layout. + * + * @param { string | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default columnsTemplate(value: string | undefined): this; + /** + * Called attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Defines LazyVGridLayout Component. + * + * @param { function } [content_] - container + * @returns { LazyVGridLayoutAttribute } The attribute of the grid + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function LazyVGridLayout( + @memo + content_?: () => void, +): LazyVGridLayoutAttribute \ No newline at end of file diff --git a/api/arkui/component/list.d.ets b/api/arkui/component/list.d.ets deleted file mode 100644 index 29463f211c..0000000000 --- a/api/arkui/component/list.d.ets +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright (c) 2024-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @file - * @kit ArkUI - * @arkts 1.2 - */ - - -// WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! - -import { memo, ComponentBuilder, __memo_context_type, __memo_id_type } from './../stateManagement/runtime' -import { Length, ResourceColor, VisualEffect, Filter, UniformDataType, Blender, SizeOptions, ConstraintSizeOptions, ChainWeightOptions, Padding, LocalizedPadding, Margin, LocalizedMargin, Position, BorderOptions, EdgeStyles, EdgeWidths, LocalizedEdgeWidths, EdgeColors, LocalizedEdgeColors, BorderRadiuses, LocalizedBorderRadiuses, OutlineOptions, EdgeOutlineStyles, Dimension, EdgeOutlineWidths, OutlineRadiuses, Area, Edges, LocalizedEdges, LocalizedPosition, ResourceStr, AccessibilityOptions, LengthConstrain, PixelMap } from './units' - -import { Scroller, ScrollOptions, ScrollEdgeOptions, ScrollPageOptions, Literal_Boolean_next_Axis_direction, OffsetResult, ScrollAlign, ScrollToIndexOptions, ScrollOnWillScrollCallback, ScrollOnScrollCallback } from './scroll' -import { Edge, Axis, HitTestMode, ImageSize, Alignment, BorderStyle, ColoringStrategy, HoverEffect, Color, Visibility, ItemAlign, Direction, GradientDirection, ObscuredReasons, RenderFit, ImageRepeat, ResponseType, FunctionKey, ModifierKey, BarState, EdgeEffect } from './enums' -import { RectResult, ScrollableCommonMethod, CommonMethod, DrawModifier, Rectangle, Callback_Array_TouchTestInfo_TouchResult, TouchTestInfo, TouchResult, PixelRoundPolicy, BackgroundEffectOptions, ForegroundEffectOptions, BorderImageOption, OutlineStyle, Callback_ClickEvent_Void, ClickEvent, Callback_Boolean_HoverEvent_Void, HoverEvent, AccessibilityCallback, Callback_MouseEvent_Void, MouseEvent, Callback_TouchEvent_Void, TouchEvent, Callback_KeyEvent_Void, KeyEvent, Callback_KeyEvent_Boolean, AnimateParam, TransitionOptions, TransitionEffect, MotionBlurOptions, InvertOptions, TranslateOptions, ScaleOptions, RotateOptions, Callback_Area_Area_Void, Literal_Union_Number_Literal_Number_offset_span_lg_md_sm_xs, Literal_Number_offset_span, AlignRuleOption, LocalizedAlignRuleOptions, ClickEffect, Callback_DragEvent_String_Union_CustomBuilder_DragItemInfo, DragEvent, CustomBuilder, DragItemInfo, Callback_DragEvent_String_Void, Callback_PreDragStatus_Void, PreDragStatus, Type_CommonMethod_linearGradient_value, Tuple_ResourceColor_Number, Type_CommonMethod_sweepGradient_value, Tuple_Length_Length, Type_CommonMethod_radialGradient_value, MotionPathOptions, ShadowOptions, ShadowStyle, ProgressMask, StateStyles, PixelStretchEffectOptions, AttributeModifier, GestureModifier, BackgroundBrightnessOptions, Callback_GestureInfo_BaseGestureEvent_GestureJudgeResult, GestureRecognizerJudgeBeginCallback, ShouldBuiltInRecognizerParallelWithCallback, Callback_TouchEvent_HitTestMode, SizeChangeCallback, SafeAreaType, SafeAreaEdge, Literal_Alignment_align, BlurStyle, BackgroundBlurStyleOptions, ForegroundBlurStyleOptions, TransitionFinishCallback, BlurOptions, LinearGradientBlurOptions, EffectType, sharedTransitionOptions, ChainStyle, DragPreviewOptions, DragInteractionOptions, OverlayOptions, BlendMode, BlendApplyType, GeometryTransitionOptions, PopupOptions, CustomPopupOptions, MenuElement, MenuOptions, ContextMenuOptions, ModalTransition, ContentCoverOptions, SheetOptions, VisibleAreaChangeCallback, NestedScrollOptions, ContentClipMode, EdgeEffectOptions, FadingEdgeOptions, ChildrenMainSize, ItemDragInfo } from './common' -import { ComponentContent } from './../ComponentContent' -import { LengthMetrics } from './../Graphics' -import { CircleShape, EllipseShape, PathShape, RectShape } from './../../../api/@ohos.arkui.shape' -import { ResizableOptions } from './image' -import { Resource } from './../../../api/global/resource' - -import { GestureInfo, BaseGestureEvent, GestureJudgeResult, GestureType, GestureMask } from './gesture' -import { Callback_Number_Number_Void, Callback_ItemDragInfo_Void, Callback_ItemDragInfo_Number_Number_Void, Callback_ItemDragInfo_Number_Void, Callback_ItemDragInfo_Number_Number_Boolean_Void, Callback_Number_ScrollState_Literal_Number_offsetRemain, Literal_Number_offsetRemain } from './grid' -import { OnScrollFrameBeginCallback, OnScrollFrameBeginHandlerResult } from './scroll' - -export enum ScrollState { - IDLE = 0, - Idle = 0, - SCROLL = 1, - Scroll = 1, - FLING = 2, - Fling = 2 -} -export enum ListItemAlign { - START = 0, - Start = 0, - CENTER = 1, - Center = 1, - END = 2, - End = 2 -} -export enum ListItemGroupArea { - NONE = 0, - IN_LIST_ITEM_AREA = 1, - IN_HEADER_AREA = 2, - IN_FOOTER_AREA = 3 -} -export enum StickyStyle { - NONE = 0, - None = 0, - HEADER = 1, - Header = 1, - FOOTER = 2, - Footer = 2 -} -export enum ChainEdgeEffect { - DEFAULT = 0, - STRETCH = 1 -} -export enum ScrollSnapAlign { - NONE = 0, - START = 1, - CENTER = 2, - END = 3 -} -export interface ChainAnimationOptions { - minSpace: Length; - maxSpace: Length; - conductivity?: number; - intensity?: number; - edgeEffect?: ChainEdgeEffect; - stiffness?: number; - damping?: number; -} -export interface CloseSwipeActionOptions { - onFinish?: (() => void); -} -export interface VisibleListContentInfo { - index: number; - itemGroupArea?: ListItemGroupArea; - itemIndexInGroup?: number; -} -export type OnScrollVisibleContentChangeCallback = (start: VisibleListContentInfo, end: VisibleListContentInfo) => void; -export declare class ListScroller extends Scroller { - getItemRectInGroup(index: number, indexInGroup: number): RectResult - scrollToItemInGroup(index: number, indexInGroup: number, smooth?: boolean, align?: ScrollAlign): void - closeAllSwipeActions(options?: CloseSwipeActionOptions): void - getVisibleListContentInfo(x: number, y: number): VisibleListContentInfo -} -export interface ListOptions { - initialIndex?: number; - space?: number | string; - scroller?: Scroller; -} -export type ListInterface = (options?: ListOptions) => ListAttribute; -export interface ListDividerOptions { - strokeWidth: Length; - color?: ResourceColor; - startMargin?: Length; - endMargin?: Length; -} -export type Callback_Number_Number_Number_Void = (start: number, end: number, center: number) => void; -export type Callback_Number_Boolean = (index: number) => boolean; -export type Callback_Number_Number_Boolean = (from: number, to: number) => boolean; -export interface ListAttribute extends ScrollableCommonMethod { - @memo - alignListItem(value: ListItemAlign): this; - @memo - listDirection(value: Axis): this; - @memo - scrollBar(value: BarState): this; - @memo - contentStartOffset(value: number): this; - @memo - contentEndOffset(value: number): this; - @memo - divider(value: ListDividerOptions | undefined): this; - @memo - editMode(value: boolean): this; - @memo - multiSelectable(value: boolean): this; - @memo - cachedCount(value: number): this; - @memo - chainAnimation(value: boolean): this; - @memo - chainAnimationOptions(value: ChainAnimationOptions): this; - @memo - sticky(value: StickyStyle): this; - @memo - scrollSnapAlign(value: ScrollSnapAlign): this; - @memo - nestedScroll(value: NestedScrollOptions): this; - @memo - enableScrollInteraction(value: boolean): this; - @memo - friction(value: number | Resource): this; - @memo - childrenMainSize(value: ChildrenMainSize): this; - @memo - maintainVisibleContentPosition(value: boolean): this; - @memo - onScroll(value: ((first: number,last: number) => void)): this; - @memo - onScrollIndex(value: ((start: number,end: number,center: number) => void)): this; - @memo - onScrollVisibleContentChange(value: OnScrollVisibleContentChangeCallback): this; - @memo - onReachStart(value: (() => void)): this; - @memo - onReachEnd(value: (() => void)): this; - @memo - onScrollStart(value: (() => void)): this; - @memo - onScrollStop(value: (() => void)): this; - @memo - onItemDelete(value: ((index: number) => boolean)): this; - @memo - onItemMove(value: ((from: number,to: number) => boolean)): this; - @memo - onItemDragStart(value: ((event: ItemDragInfo,itemIndex: number) => CustomBuilder)): this; - @memo - onItemDragEnter(value: ((event: ItemDragInfo) => void)): this; - @memo - onItemDragMove(value: ((event: ItemDragInfo,itemIndex: number,insertIndex: number) => void)): this; - @memo - onItemDragLeave(value: ((event: ItemDragInfo,itemIndex: number) => void)): this; - @memo - onItemDrop(value: ((event: ItemDragInfo,itemIndex: number,insertIndex: number,isSuccess: boolean) => void)): this; - @memo - onScrollFrameBegin(value: ((offset: number,state: ScrollState) => OnScrollFrameBeginHandlerResult)): this; -} -@memo -@ComponentBuilder -export declare function List( - options?: ListOptions | undefined, - @memo - content_?: () => void, -): ListAttribute diff --git a/api/arkui/component/list.static.d.ets b/api/arkui/component/list.static.d.ets new file mode 100644 index 0000000000..ad2b22a9b8 --- /dev/null +++ b/api/arkui/component/list.static.d.ets @@ -0,0 +1,902 @@ +'use static' +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ +import { ChildrenMainSize, ItemDragInfo, RectResult, ScrollableCommonMethod, Optional, OnWillScrollCallback, OnScrollCallback, OnItemDragStartCallback } from './common'; +import { Axis } from './enums'; +import { OnScrollFrameBeginCallback, ScrollAlign, Scroller } from "./scroll"; +import { Dimension, Length, LengthConstrain, ResourceColor } from './units'; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; +import { AttributeModifier, CommonMethod } from "./common"; +/** + * Declare scroll status + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum ScrollState { + /** + * Idle state. Triggered when the scroll state returns to idle, and when the controller's + * non-animated methods are used to control the scroll. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Idle, + /** + * Scrolling state. Triggered when the list is dragged with the finger, + * when the scrollbar is dragged, or when the mouse scroll wheel is used. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Scroll, + /** + * Inertial scrolling state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Fling +} +/** + * Declare list item alignment status + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum ListItemAlign { + /** + * The list items are packed toward the start edge of the List component along the cross axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Start, + /** + * The list items are centered in the List component along the cross axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Center, + /** + * The list items are packed toward the end edge of the List component along the cross axis. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + End +} +/** + * Declare list item group area + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum ListItemGroupArea { + /** + * The edge of the viewport is in the position of none. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + NONE = 0, + /** + * The edge of the viewport is in the position of a list item. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + IN_LIST_ITEM_AREA = 1, + /** + * The edge of the viewport is in the position of a header. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + IN_HEADER_AREA = 2, + /** + * The edge of the viewport is in the position of a footer. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + IN_FOOTER_AREA = 3 +} +/** + * Declare item group sticky style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum StickyStyle { + /** + * In the ListItemGroup component, the header is not pinned to the top, + * and the footer is not pinned to the bottom. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + None = 0, + /** + * In the ListItemGroup component, the header is pinned to the top, + * and the footer is not pinned to the bottom. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Header = 1, + /** + * In the ListItemGroup component, the footer is pinned to the bottom, + * and the header is not pinned to the top. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Footer = 2 +} +/** + * Declare edge effect of chain animation. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 20 + */ +export declare enum ChainEdgeEffect { + /** + * Default edge effect. Compress the space in the drag direction + * and stretch the space in the opposite drag direction. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 20 + */ + DEFAULT, + /** + * Stretch all space. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 20 + */ + STRETCH +} +/** + * Declare limited position when scroll end. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum ScrollSnapAlign { + /** + * No alignment. This is the default value. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + NONE = 0, + /** + * The first item in the view is aligned at the start of the list. + * + *

NOTE + *
When the list hits the end, the items at the end must be completely displayed. + * In this case, the items at the start may not be aligned. + *

+ * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + START = 1, + /** + * The middle items in the view are aligned in the center of the list. + * + *

NOTE + *
The top and end items can be aligned in the center of the list. + * In this case, a blank area may result, and the first or last item is aligned to the center of the list. + * + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + CENTER = 2, + /** + * The last item in the view is aligned at the end of the list. + * + *

NOTE + *
When the list hits the start, the items at the start must be completely displayed. + * In this case, the items at the end may not be aligned. + *

+ * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + END = 3 +} +/** + * Defines the chain animation options. + * + * @interface ChainAnimationOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 20 + */ +export declare interface ChainAnimationOptions { + /** + * Minimum space for chain animation. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 20 + */ + minSpace: Length; + /** + * Maximum space for chain animation. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 20 + */ + maxSpace: Length; + /** + * Conductivity of chain animation. + * + * @type { ?number } + * @default 0.7 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 20 + */ + conductivity?: number; + /** + * Intensity of chain animation. + * + * @type { ?number } + * @default 0.3 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 20 + */ + intensity?: number; + /** + * Edge effect of chain animation. + * + * @type { ?ChainEdgeEffect } + * @default ChainEdgeEffect.DEFAULT + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 20 + */ + edgeEffect?: ChainEdgeEffect; + /** + * Stiffness of chain spring. + * + * @type { ?number } + * @default 228 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 20 + */ + stiffness?: number; + /** + * Damping of chain spring. + * + * @type { ?number } + * @default 30 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 20 + */ + damping?: number; +} +/** + * Defines the close swipe action options. + * + * @interface CloseSwipeActionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface CloseSwipeActionOptions { + /** + * Triggered after the collapse animation is complete. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onFinish?: () => void; +} +/** + * Defines the visible list content info. + * + * @interface VisibleListContentInfo + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface VisibleListContentInfo { + /** + * Index of the list item or list item group in the list display area. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + index: number; + /** + * Position of the top or bottom edge of the viewport in the + * list item group to which the edge is located, if applicable. + * + * @type { ?ListItemGroupArea } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + itemGroupArea?: ListItemGroupArea; + /** + * Index of the starting or ending list item in the list + * item group to which the top or bottom edge of the viewport is located. + * + * @type { ?number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + itemIndexInGroup?: number; +} +/** + * Called when a child component enters or leaves the list display area. + * + * @typedef {function} OnScrollVisibleContentChangeCallback + * @param {VisibleListContentInfo} start - Information about the currently displayed first list item or list item group. + * @param {VisibleListContentInfo} end - Information about the currently displayed last list item or list item group. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type OnScrollVisibleContentChangeCallback = (start: VisibleListContentInfo, end: VisibleListContentInfo) => void; +/** + * @extends Scroller + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class ListScroller extends Scroller { + /** + * Obtains the size of a list item in a list item group and its position relative to the list. + * + *

NOTE: + *
- The value of index must be the index of a child component visible in the display area. + * Otherwise, the value is considered invalid. + *
- The child component for which index is set must be a list item group. Otherwise, + * the index value is considered invalid. + *
- The value of indexInGroup must be the index of a list item in the list item group + * visible in the display area. Otherwise, the value is considered invalid. + *
- When index or indexInGroup is set to an invalid value, the returned size and position are both 0. + *

+ * + * @param { number } index - Index of the list item group in the list. + * @param { number } indexInGroup - Index of the list item in the list item group. + * @returns { RectResult } - Size of the list item in the list item group and its position relative to the list. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + getItemRectInGroup(index: number, indexInGroup: number): RectResult; + /** + * Scrolls to the specified list item in the specified list item group. + * + * @param { number } index - Index of the target list item group in the current container. + *
NOTE + *
If the value set is a negative value or greater than the maximum index of the items in the container, + * the value is deemed abnormal, and no scrolling will be performed. + * @param { number } indexInGroup - Index of the target list item in the list item group specified by index. + *
NOTE + *
If the value set is a negative value or greater than the maximum index of the items in the list item group, + * the value is deemed abnormal, and no scrolling will be performed. + * @param { boolean } [smooth] - Whether to enable the smooth animation for scrolling to the item with the specified index. + * The value true means to enable that the smooth animation, and false means the opposite.
Default value: false + * @param { ScrollAlign } [align] - How the list item to scroll to is aligned with the container.
Default value: ScrollAlign.START + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + scrollToItemInGroup(index: number, indexInGroup: number, smooth?: boolean, align?: ScrollAlign): void; + /** + * Collapses the list items in the EXPANDED state and sets callback events. + * + *

NOTE: + *
- A ListScroller must be bound to the List component. + *

+ * + * @param { CloseSwipeActionOptions } options - Callback events for collapsing list items in the EXPANDED state. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + closeAllSwipeActions(options?: CloseSwipeActionOptions): void; + /** + * Obtains the index information of the child component at the specified coordinates. + * + *

NOTE: + *
- If the provided value of x or y is invalid, + * the returned VisibleListContentInfo object has the index property set to -1, + * and both itemGroupArea and itemIndexInGroup are undefined. + *

+ * + * @param { number } x - X-coordinate, in vp. + * @param { number } y - Y-coordinate, in vp. + * @returns { VisibleListContentInfo } Index information of the child component at the specified coordinates. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - The controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + getVisibleListContentInfo(x: number, y: number): VisibleListContentInfo; +} +/** + * Defines the options of the List component. + * + *

NOTE: + *
- The default value of the universal attribute clip is true for the List component. + *

+ * + * @interface ListOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface ListOptions { + /** + * Index of the item to be displayed at the start when the list is initially loaded. + * Anonymous Object Rectification. + * + *

NOTE + *
If the set value is a negative number or is greater than the index of the last item in the list, + * the value is invalid. In this case, the default value will be used. + *

+ * + * @type { ?number } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + initialIndex?: number; + /** + * Spacing between list items along the main axis. + * Anonymous Object Rectification. + * + *

NOTE + *
If this parameter is set to a negative number or a value greater than or equal to the length of the list content area, the default value is used. + *
If this parameter is set to a value less than the width of the list divider, the width of the list divider is used as the spacing. + *
Child components of List whose visibility attribute is set to None are not displayed, but the spacing above and below them still takes effect. + *

+ * + * @type { ?(number | string) } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + space?: number | string; + /** + * Scroller, which can be bound to scrollable components. + * Anonymous Object Rectification. + * + *

NOTE + *
The scroller cannot be bound to other scrollable components. + *

+ * + * @type { ?Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + scroller?: Scroller; +} +/** + * Defines the divider style of the list or list item group. + * + * @interface ListDividerOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ListDividerOptions { + /** + * Width of the divider. + * Anonymous Object Rectification. + * + * @type { Length } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + strokeWidth: Length; + /** + * Color of the divider. + * Anonymous Object Rectification. + * + * @type { ?ResourceColor } + * @default 0x08000000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + color?: ResourceColor; + /** + * Distance between the divider and the start edge of the list. + * Anonymous Object Rectification. + * + * @type { ?Length } + * @default 0vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + startMargin?: Length; + /** + * Distance between the divider and the end edge of the list. + * Anonymous Object Rectification. + * + * @type { ?Length } + * @default 0vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + endMargin?: Length; +} +/** + * The ListAttribute. + * + * @extends ScrollableCommonMethod + * @interface ListAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ListAttribute extends ScrollableCommonMethod { + /** + * Sets the number of columns or rows in the list. If the value is set to the gutter type, it indicates the gap between columns. + * It takes effect when the number of columns is greater than 1. + * + * @param { number | LengthConstrain | undefined } value - Number of columns or rows in the list.
Default value: 1 + * @param { Dimension | undefined } [gutter] - Gap between columns.
Default value: 0 + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default lanes(value: number | LengthConstrain | undefined, gutter?: Dimension | undefined): this; + /** + * Alignment mode of list items along the cross axis when the cross-axis width of the list is greater + * than the cross-axis width of list items multiplied by the value of lanes. + * + * @param { ListItemAlign | undefined } value - Alignment mode of list items along the cross axis.
Default value: ListItemAlign.Start + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default alignListItem(value: ListItemAlign | undefined): this; + /** + * Sets the direction in which the list items are arranged. + * + * @param { Axis | undefined } value - Direction in which the list items are arranged.
Default value: Axis.Vertical + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default listDirection(value: Axis | undefined): this; + /** + * Sets the offset from the start of the list content to the boundary of the list display area. + * @param { number | undefined } value - Offset from the start of the list content to the boundary of the list display + *
Default value: 0 + * @returns { this } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default contentStartOffset(value: number | undefined): this; + /** + * Sets the offset from the end of the list content to the boundary of the list display area. + * + * @param { number | undefined } value - Offset from the end of the list content to the boundary of the list display area. + *
Default value: 0 + * @returns { this } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default contentEndOffset(value: number | undefined): this; + /** + * Sets the style of the divider for the list items. By default, there is no divider. + * Anonymous Object Rectification. + * + * @param { ListDividerOptions | null | undefined } value - Style of the divider for the list items.
Default value: null + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default divider(value: ListDividerOptions | null | undefined): this; + /** + * Sets whether to enable multiselect. + * + * @param { boolean | undefined } value - Whether to enable multiselect. + *
false (default): Multiselect is disabled. + *
true: Multiselect is enabled. + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default multiSelectable(value: boolean | undefined): this; + /** + * Called when the minimum number of list item caches is set for long list deferred loading. + * + * @param { number | undefined } value - Number of list items to be preloaded. + *
Default value: number of nodes visible on the screen, with the maximum value of 16 + *
Value range: [0, +∞) + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default cachedCount(value: number | undefined): this; + /** + * Sets the number of list items or list item groups to be cached (preloaded) and specifies whether to display the preloaded nodes. + * + * @param { number | undefined } count - Number of list items to be preloaded. + *
Default value: number of nodes visible on the screen, with the maximum value of 16 + *
Value range: [0, +∞) + * @param { boolean | undefined } show - Whether to display the preloaded list items.
Default value: false + * @returns { this } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default cachedCount(count: number | undefined, show: boolean | undefined): this; + /** + * Sets whether to enable chained animations, which provide a visually connected, + * or "chained," effect when the list is scrolled or its top or bottom edge is dragged. + * + * @param { boolean | undefined } value - Whether to enable chained animations. + *
false (default): Chained animations are disabled. + *
true: Chained animations are enabled. + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default chainAnimation(value: boolean | undefined): this; + /** + * Called to setting chain linkage dynamic effect options. + * + * @param { ChainAnimationOptions | undefined } value - options of the chain animation. + * @returns { this } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @systemapi + * @since 20 + */ + default chainAnimationOptions(value: ChainAnimationOptions | undefined): this; + /** + * Sets whether to pin the header to the top or the footer to the bottom in the list item group, + * + *

NOTE: + *
- Occasionally, after sticky is set, floating-point calculation precision may result in small gaps appearing during scrolling. + * To address this issue, you can apply the pixelRound attribute to the current component, which rounds down the pixel values and help eliminate the gaps. + *

+ * + * @param { StickyStyle | undefined } value - Whether to pin the header to the top or the footer to the bottom in the list item group. + *
Default value: StickyStyle.None + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default sticky(value: StickyStyle | undefined): this; + /** + * Sets the scroll snap alignment effect for list items. + * This effect aligns list items to the nearest snap point when scrolling ends. + * + * @param { ScrollSnapAlign | undefined } value - Alignment mode of the scroll snap position.
Default value: ScrollSnapAlign.NONE + * @returns { this } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default scrollSnapAlign(value: ScrollSnapAlign | undefined): this; + /** + * Sets the size information of the child components of a List component along the main axis. + * + * @param { ChildrenMainSize | undefined } value - children main size for List + * @returns { this } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default childrenMainSize(value: ChildrenMainSize | undefined): this; + /** + * Sets whether the visible content position should remain unchanged when data is inserted or deleted above the visible area. + * + *

NOTE: + *
- The visible content position will only remain unchanged when LazyForEach is used to insert or delete data outside the visible area. + * If ForEach is used to insert or delete data, or if LazyForEach is used for data reloading, + * the visible content position will change even if maintainVisibleContentPosition is set to true. + *
- When maintainVisibleContentPosition is set to true, + * inserting or deleting data above the visible area will trigger onDidScroll and onScrollIndex events. + *
- In a multi-column scenario, setting maintainVisibleContentPosition to true allows + * you to insert or delete entire rows of data while keeping the visible content position unchanged. + * If the insertion or deletion does not involve entire rows, however, the visible content position will still change. + *

+ * + * @param { boolean | undefined } enabled - Whether the visible content position should remain unchanged + * when data is inserted or deleted above the visible area.
Default value: false + * @returns { this } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default maintainVisibleContentPosition(enabled: boolean | undefined): this; + /** + * Sets whether the list's layout starts from the bottom (end) rather than the top (beginning). + * + *

NOTE: + *
- When stackFromEnd is set to true, the following rules apply: + *
If the content of the List component is shorter than the component height, + * the content will be aligned to the bottom of the component. + *
- If the height of a list item in the visible area changes, or if a new list item is inserted, + * the list items above the changed or inserted item will move upwards to accommodate the new layout. + *
- The default value of initialIndex becomes the total number of list items minus one. + *

+ * + * @param { boolean | undefined } enabled - Whether the list's layout starts from the bottom (end) rather than the top (beginning). + *
Default value: false + * @returns { this } the attribute of the list. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default stackFromEnd(enabled: boolean | undefined): this; + /** + * Triggered when a child component enters or leaves the list display area. + * + * @param { function | undefined } event + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onScrollIndex(event: ((start: number, end: number, center: number) => void) | undefined): this; + /** + * Triggered when a child component enters or leaves the list display area. + * + * @param { OnScrollVisibleContentChangeCallback | undefined } handler - Callback invoked when the displayed content changes. + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onScrollVisibleContentChange(handler: OnScrollVisibleContentChangeCallback | undefined): this; + /** + * Triggered when a list item moves. + * + * @param { function } event + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onItemMove(event: ((from: number, to: number) => boolean) | undefined): this; + /** + * 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)) + * + * @param { OnItemDragStartCallback | undefined } event - callback function, triggered when the item drag start. + * @returns { this } Returns the instance of the ListAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onItemDragStart(event: OnItemDragStartCallback | undefined): this; + /** + * Triggered when the dragged item enters the drop target of the list. + * + * @param { function | undefined } event + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onItemDragEnter(event: ((event: ItemDragInfo) => void) | undefined): this; + /** + * Triggered when the dragged item moves over the drop target of the list. + * + * @param { function } event + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onItemDragMove(event: ((event: ItemDragInfo, itemIndex: number, insertIndex: number) => void) | undefined): this; + /** + * Triggered when the dragged item leaves the drop target of the list. + * + * @param { function | undefined } event + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onItemDragLeave(event: ((event: ItemDragInfo, itemIndex: number) => void) | undefined): this; + /** + * Triggered when the dragged item is dropped on the drop target of the list. + * + * @param { function | undefined } event + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onItemDrop(event: ((event: ItemDragInfo, itemIndex: number, insertIndex: number, isSuccess: boolean) => void) | undefined): this; + /** + * Called when scrolling begin each frame. + * Anonymous Object Rectification. + * + * @param { OnScrollFrameBeginCallback | undefined } event - callback function, triggered when the scrolling begin each frame. + * @returns { this } Returns the instance of the ListAttribute. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onScrollFrameBegin(event: OnScrollFrameBeginCallback | undefined): this; + /** + * Called when the scrollable will scroll. + * + * @param { OnWillScrollCallback | undefined } handler - callback of scrollable. + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onWillScroll(handler: OnWillScrollCallback | undefined): this; + /** + * Called when the scrollable did scroll. + * + * @param { OnScrollCallback | undefined } handler - callback of scrollable, + * scrollOffset is offset this frame did scroll, scrollState is current scroll state. + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onDidScroll(handler: OnScrollCallback | undefined): this; + /** + * Called attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Defines List Component. + * + * @param { ListOptions } [options] + * @param { function } [content_] + * @returns { ListAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function List( + options?: ListOptions, + @memo + content_?: () => void, +): ListAttribute \ No newline at end of file diff --git a/api/arkui/component/listItem.static.d.ets b/api/arkui/component/listItem.static.d.ets new file mode 100644 index 0000000000..5a42e5c009 --- /dev/null +++ b/api/arkui/component/listItem.static.d.ets @@ -0,0 +1,312 @@ +'use static' +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ +import { CommonMethod, Bindable } from './common'; +import { CustomBuilder } from './builder'; +import { Length } from './units'; +import { ComponentContent } from '../ComponentContent'; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; +import { AttributeModifier, CommonMethod } from "./common"; +/** + * Sliding effect + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum SwipeEdgeEffect { + /** + * Elastic physical action, sliding to the edge can continue to slide for a distance based on the initial speed or touch event, and spring back when released. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ + Spring, + /** + * Sliding to the edge has no effect. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ + None +} +/** + * Declare enum SwipeActionState. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum SwipeActionState { + /** + * Collapsed type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + COLLAPSED, + /** + * EXPANDED type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + EXPANDED, + /** + * Action type. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + ACTIONING +} +/** + * Defines the swipe action item for SwipeActionOptions. + * + * @interface SwipeActionItem + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface SwipeActionItem { + /** + * An action item that appears when a list item slides right (when list direction is Vertical) or + * slides down (when list direction Horizontal). + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ + builder?: CustomBuilder; + /** + * An action item that appears when a list item slides right (when list direction is Vertical) or + * slides down (when list direction Horizontal). + * + * @type { ?ComponentContent } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + builderComponent?: ComponentContent; + /** + * Defines distance for the delete area. + * + * @type { ?Length } + * @default 56vp + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ + actionAreaDistance?: Length; + /** + * Called when ListItem need to be deleted. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ + onAction?: () => void; + /** + * Called when swipe entry delete area. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ + onEnterActionArea?: () => void; + /** + * Called when swipe exit delete area. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ + onExitActionArea?: () => void; + /** + * Called when component swipe action state changed. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @since 20 + */ + onStateChange?: (state: SwipeActionState) => void; +} +/** + * Defines the SwipeActionOption of swipeAction attribute method. + * + * @interface SwipeActionOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface SwipeActionOptions { + /** + * An action item that appears when a list item slides right (when list direction is Vertical) or + * slides down (when list direction Horizontal). + * + * @type { ?(CustomBuilder | SwipeActionItem) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + start?: CustomBuilder | SwipeActionItem; + /** + * An action item that appears when a list item slides left (when list direction is Vertical) or + * slides up (when list direction Horizontal). + * + * @type { ?(CustomBuilder | SwipeActionItem) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + end?: CustomBuilder | SwipeActionItem; + /** + * Sets whether sliding to a boundary has a spring effect. + * + * @type { ?SwipeEdgeEffect } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + edgeEffect?: SwipeEdgeEffect; + /** + * Called when swipe action offset changed. + * + * @type { ?function } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onOffsetChange?: (offset: number) => void; +} +/** + * Defines the list item style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum ListItemStyle { + /** + * Show custom style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + NONE = 0, + /** + * Show default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + CARD = 1 +} +/** + * Defines the list item options. + * + * @interface ListItemOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ListItemOptions { + /** + * Describes the ListItem style. + * + * @type { ?ListItemStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + style?: ListItemStyle; +} + +/** + * The ListItemAttribute. + * + * @extends CommonMethod + * @interface ListItemAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ListItemAttribute extends CommonMethod { + /** + * Called when judging whether it is selectable. + * + * @param { boolean | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default selectable(value: boolean | undefined): this; + /** + * Called when judging whether it is selected. + * This parameter supports $$ for two-way binding of variables. + * + * @param { boolean | Bindable | undefined } value - if the listItem is selected. + * @returns { this } the attribute of the listItem. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default selected(value: boolean | Bindable | undefined): this; + /** + * Sets the action item that appears when the list item slides in the cross axis direction of the list. + * + * @param { SwipeActionOptions | undefined } value - items defines in the SwipeActionOption. + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default swipeAction(value: SwipeActionOptions | undefined): this; + /** + * Called when the listItem is selected. + * + * @param { function | undefined } event + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onSelect(event: ((isSelected: boolean) => void) | undefined): this; + /** + * Called attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Defines ListItem Component. + * + * @param { ListItemOptions } [value] + * @param { function } [content_] + * @returns { ListItemAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function ListItem( + value?: ListItemOptions, + @memo + content_?: () => void, +): ListItemAttribute \ No newline at end of file diff --git a/api/arkui/component/listItemGroup.static.d.ets b/api/arkui/component/listItemGroup.static.d.ets new file mode 100644 index 0000000000..e1ca99080d --- /dev/null +++ b/api/arkui/component/listItemGroup.static.d.ets @@ -0,0 +1,192 @@ +'use static' +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ +import { ChildrenMainSize, CommonMethod } from './common'; +import { CustomBuilder } from './builder'; +import { ComponentContent } from '../ComponentContent'; +import { ListDividerOptions } from "./list"; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; +import { AttributeModifier, CommonMethod } from "./common"; +/** + * Defines the list item group style. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ +export declare enum ListItemGroupStyle { + /** + * Show custom style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + NONE = 0, + /** + * Show default style. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + CARD = 1 +} +/** + * Defines the list item group options. + * + * @interface ListItemGroupOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ +export declare interface ListItemGroupOptions { + /** + * Describes the ListItemGroup header. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + header?: CustomBuilder; + /** + * Describes the ListItemGroup headerComponent. + * + * @type { ?ComponentContent } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + headerComponent?: ComponentContent; + /** + * Describes the ListItemGroup footer. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + footer?: CustomBuilder; + /** + * Describes the ListItemGroup footerComponent. + * + * @type { ?ComponentContent } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + footerComponent?: ComponentContent; + /** + * Describes the ListItemGroup space. + * + * @type { ?(number | string) } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + space?: number | string; + /** + * Describes the ListItemGroup style. + * + * @type { ?ListItemGroupStyle } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + style?: ListItemGroupStyle; +} + +/** + * The ListItemGroupAttribute. + * + * @extends CommonMethod + * @interface ListItemGroupAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ +export declare interface ListItemGroupAttribute extends CommonMethod { + /** + * Called when the ListItemGroup split line style is set. + * Anonymous Object Rectification. + * + * @param { ListDividerOptions | null | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + default divider(value: ListDividerOptions | null | undefined): this; + /** + * Set children main size for ListItemGroup. + * + * @param { ChildrenMainSize | undefined } value - children main size for ListItemGroup + * @returns { this } the attribute of the ListItemGroup. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + default childrenMainSize(value: ChildrenMainSize | undefined): this; + /** + * Called attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + default attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Defines ListItemGroup Component. + * + * @param { ListItemGroupOptions } [options] - options + * @param { function } [content_] - container + * @returns { ListItemGroupAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ +@memo +@ComponentBuilder +export declare function ListItemGroup( + options?: ListItemGroupOptions, + @memo + content_?: () => void, +): ListItemGroupAttribute \ No newline at end of file diff --git a/api/arkui/component/refresh.static.d.ets b/api/arkui/component/refresh.static.d.ets new file mode 100644 index 0000000000..38bb904aa4 --- /dev/null +++ b/api/arkui/component/refresh.static.d.ets @@ -0,0 +1,243 @@ +'use static' +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ +import { Callback, Optional, CommonMethod, Bindable } from './common'; +import { CustomBuilder } from './builder'; +import { ResourceStr } from './units'; +import { ComponentContent } from '../ComponentContent'; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; +import { AttributeModifier, CommonMethod } from "./common"; +/** + * The refresh status of the drop-down refresh. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ +export declare enum RefreshStatus { + /** + * The refresh status of the drop-down refresh. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + Inactive, + /** + * Drop down, but the drop-down distance is less than the refresh distance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + Drag, + /** + * The pull-down exceeds the refresh distance. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + OverDrag, + /** + * After the pull-down, it rebounds to the refresh distance and enters the refresh state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + Refresh, + /** + * After refresh, return to the initial state. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + Done +} +/** + * Defines the options of refresh component. + * + * @interface RefreshOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ +export interface RefreshOptions { + /** + * Whether the current component is being refreshed. + * This parameter supports $$ for two-way binding of variables. + * + * @type { boolean | Bindable } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + refreshing: boolean | Bindable; + /** + * The text displayed during refreshing + * + * @type { ?ResourceStr } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + promptText?: ResourceStr; + /** + * Custom component to display during dragging. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + builder?: CustomBuilder; + /** + * Custom component to display during dragging. + * + * @type { ?ComponentContent } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + refreshingContent?: ComponentContent; +} +/** + * The RefreshAttribute. + * + * @extends CommonMethod + * @interface RefreshAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ +export declare interface RefreshAttribute extends CommonMethod { + /** + * Called when the refresh state changes. + * + * @param { function | undefined } callback + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + default onStateChange(callback: ((state: RefreshStatus) => void) | undefined): this; + /** + * Called when the refresh state is entered. + * + * @param { function | undefined } callback + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + default onRefreshing(callback: (() => void) | undefined): this; + /** + * The pull-down offset to trigger refresh. + * + * @param { number | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + default refreshOffset(value: number | undefined): this; + /** + * Sets whether to trigger refresh when the pull-down distance exceeds the refreshOffset. + * + * @param { boolean | undefined } value + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + default pullToRefresh(value: boolean | undefined): this; + /** + * Called when the refresh offset changed. + * The unit is vp. + * + * @param { Callback | undefined } callback + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + default onOffsetChange(callback: Callback | undefined): this; + /** + * Pull-down follow ratio for Refresh. + * + * @param { number | undefined } ratio - Pull-down follow ratio for Refresh. + * @returns { this } The attribute of the Refresh. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + default pullDownRatio(ratio: number | undefined): this; + /** + * Called attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ + default attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Defines Refresh Component. + * + * @param { RefreshOptions } value - value + * @param { function } [content_] - container + * @returns { RefreshAttribute } The attribute of the grid + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ +@memo +@ComponentBuilder +export declare function Refresh( + value: RefreshOptions, + @memo + content_?: () => void, +): RefreshAttribute \ No newline at end of file diff --git a/api/arkui/component/scroll.d.ets b/api/arkui/component/scroll.d.ets deleted file mode 100644 index c7189c5c1e..0000000000 --- a/api/arkui/component/scroll.d.ets +++ /dev/null @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2024-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @file - * @kit ArkUI - * @arkts 1.2 - */ - - -// WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! - -import { memo, ComponentBuilder, __memo_context_type, __memo_id_type } from './../stateManagement/runtime' -import { LengthMetrics } from './../Graphics' -import { Curve, Axis, Edge, HitTestMode, ImageSize, Alignment, BorderStyle, ColoringStrategy, HoverEffect, Color, Visibility, ItemAlign, Direction, GradientDirection, ObscuredReasons, RenderFit, ImageRepeat, ResponseType, FunctionKey, ModifierKey, BarState, EdgeEffect, ScrollSource } from './enums' -import { ICurve, RectResult, ScrollableCommonMethod, CommonMethod, DrawModifier, Rectangle, Callback_Array_TouchTestInfo_TouchResult, TouchTestInfo, TouchResult, PixelRoundPolicy, BackgroundEffectOptions, ForegroundEffectOptions, BorderImageOption, OutlineStyle, Callback_ClickEvent_Void, ClickEvent, Callback_Boolean_HoverEvent_Void, HoverEvent, AccessibilityCallback, Callback_MouseEvent_Void, MouseEvent, Callback_TouchEvent_Void, TouchEvent, Callback_KeyEvent_Void, KeyEvent, Callback_KeyEvent_Boolean, AnimateParam, TransitionOptions, TransitionEffect, MotionBlurOptions, InvertOptions, TranslateOptions, ScaleOptions, RotateOptions, Callback_Area_Area_Void, Literal_Union_Number_Literal_Number_offset_span_lg_md_sm_xs, Literal_Number_offset_span, AlignRuleOption, LocalizedAlignRuleOptions, ClickEffect, Callback_DragEvent_String_Union_CustomBuilder_DragItemInfo, DragEvent, CustomBuilder, DragItemInfo, Callback_DragEvent_String_Void, Callback_PreDragStatus_Void, PreDragStatus, Type_CommonMethod_linearGradient_value, Tuple_ResourceColor_Number, Type_CommonMethod_sweepGradient_value, Tuple_Length_Length, Type_CommonMethod_radialGradient_value, MotionPathOptions, ShadowOptions, ShadowStyle, ProgressMask, StateStyles, PixelStretchEffectOptions, AttributeModifier, GestureModifier, BackgroundBrightnessOptions, Callback_GestureInfo_BaseGestureEvent_GestureJudgeResult, GestureRecognizerJudgeBeginCallback, ShouldBuiltInRecognizerParallelWithCallback, Callback_TouchEvent_HitTestMode, SizeChangeCallback, SafeAreaType, SafeAreaEdge, Literal_Alignment_align, BlurStyle, BackgroundBlurStyleOptions, ForegroundBlurStyleOptions, TransitionFinishCallback, BlurOptions, LinearGradientBlurOptions, EffectType, sharedTransitionOptions, ChainStyle, DragPreviewOptions, DragInteractionOptions, OverlayOptions, BlendMode, BlendApplyType, GeometryTransitionOptions, PopupOptions, CustomPopupOptions, MenuElement, MenuOptions, ContextMenuOptions, ModalTransition, ContentCoverOptions, SheetOptions, VisibleAreaChangeCallback, NestedScrollOptions, ContentClipMode, EdgeEffectOptions, FadingEdgeOptions } from './common' -import { Dimension, Length, VisualEffect, Filter, UniformDataType, Blender, SizeOptions, ConstraintSizeOptions, ChainWeightOptions, Padding, LocalizedPadding, Margin, LocalizedMargin, ResourceColor, Position, BorderOptions, EdgeStyles, EdgeWidths, LocalizedEdgeWidths, EdgeColors, LocalizedEdgeColors, BorderRadiuses, LocalizedBorderRadiuses, OutlineOptions, EdgeOutlineStyles, EdgeOutlineWidths, OutlineRadiuses, Area, Edges, LocalizedEdges, LocalizedPosition, ResourceStr, AccessibilityOptions, VoidCallback, PixelMap } from './units' -import { ScrollSnapAlign, ScrollState } from './list' -import { ComponentContent } from './../ComponentContent' -import { CircleShape, EllipseShape, PathShape, RectShape } from './../../../api/@ohos.arkui.shape' -import { ResizableOptions } from './image' -import { Resource } from './../../../api/global/resource' - - -import { GestureInfo, BaseGestureEvent, GestureJudgeResult, GestureType, GestureMask } from './gesture' -import { Callback_Number_Number_Void } from './grid' -export enum ScrollDirection { - VERTICAL = 0, - Vertical = 0, - HORIZONTAL = 1, - Horizontal = 1, - FREE = 2, - Free = 2, - NONE = 3, - None = 3 -} -export enum ScrollAlign { - START = 0, - CENTER = 1, - END = 2, - AUTO = 3 -} -export interface OffsetResult { - xOffset: number; - yOffset: number; -} -export interface ScrollEdgeOptions { - velocity?: number; -} -export interface ScrollToIndexOptions { - extraOffset?: LengthMetrics; -} -export interface ScrollAnimationOptions { - duration?: number; - curve?: Curve | ICurve; - canOverScroll?: boolean; -} -export interface OffsetOptions { - xOffset?: Dimension; - yOffset?: Dimension; -} -export interface Literal_Boolean_next_Axis_direction { - next: boolean; - direction?: Axis; -} -export declare class Scroller { - scrollTo(options: ScrollOptions): undefined - scrollEdge(value: Edge, options?: ScrollEdgeOptions): undefined - fling(velocity: number): void - scrollPage(value: ScrollPageOptions): undefined - - currentOffset(): OffsetResult - scrollToIndex(value: number, smooth?: boolean, align?: ScrollAlign, options?: ScrollToIndexOptions): undefined - scrollBy(dx: Length, dy: Length): undefined - isAtEnd(): boolean - getItemRect(index: number): RectResult - getItemIndex(x: number, y: number): number -} -export interface ScrollOptions { - xOffset: number | string; - yOffset: number | string; - animation?: ScrollAnimationOptions | boolean; -} -export interface ScrollPageOptions { - next: boolean; - animation?: boolean; -} -export interface ScrollSnapOptions { - snapAlign: ScrollSnapAlign; - snapPagination?: Dimension | Array; - enableSnapToStart?: boolean; - enableSnapToEnd?: boolean; -} -export type ScrollInterface = (scroller?: Scroller) => ScrollAttribute; -export type OnScrollEdgeCallback = (side: Edge) => void; -export interface OnScrollFrameBeginHandlerResult { - offsetRemain: number; -} -export type OnScrollFrameBeginCallback = (offset: number, state: ScrollState) => OnScrollFrameBeginHandlerResult; -export interface ScrollAttribute extends ScrollableCommonMethod { - @memo - scrollable(value: ScrollDirection): this; - @memo - onScroll(value: ((first: number,last: number) => void)): this; - @memo - onWillScroll(value: ScrollOnWillScrollCallback | undefined): this; - @memo - onDidScroll(value: ScrollOnScrollCallback): this; - @memo - onScrollEdge(value: OnScrollEdgeCallback): this; - @memo - onScrollStart(value: VoidCallback): this; - @memo - onScrollEnd(value: (() => void)): this; - @memo - onScrollStop(value: VoidCallback): this; - @memo - scrollBar(value: BarState): this; - @memo - scrollBarColor(value: Color | number | string): this; - @memo - scrollBarWidth(value: number | string): this; - @memo - onScrollFrameBegin(value: OnScrollFrameBeginCallback): this; - @memo - nestedScroll(value: NestedScrollOptions): this; - @memo - enableScrollInteraction(value: boolean): this; - @memo - friction(value: number | Resource): this; - @memo - scrollSnap(value: ScrollSnapOptions): this; - @memo - enablePaging(value: boolean): this; - @memo - initialOffset(value: OffsetOptions): this; -} -export type ScrollOnScrollCallback = (scrollOffset: number, scrollState: ScrollState) => void; -export type ScrollOnWillScrollCallback = (xOffset: number, yOffset: number, scrollState: ScrollState, - scrollSource: ScrollSource) => OffsetResult; -@memo -@ComponentBuilder -export declare function Scroll( - scroller?: Scroller | undefined, - @memo - content_?: () => void, -): ScrollAttribute diff --git a/api/arkui/component/scroll.static.d.ets b/api/arkui/component/scroll.static.d.ets new file mode 100644 index 0000000000..ba937716b9 --- /dev/null +++ b/api/arkui/component/scroll.static.d.ets @@ -0,0 +1,840 @@ +'use static' +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ +import { BarState, Edge, Color, EdgeEffect, ScrollSource, Curve } from './enums'; +import { ICurve, RectResult, ScrollableCommonMethod, EdgeEffectOptions, NestedScrollOptions, CommonMethod } from './common'; +import { Dimension, Length, VoidCallback, Resource, LengthMetrics } from './units'; +import { ScrollSnapAlign, ScrollState } from "./list"; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; +import { AttributeModifier, CommonMethod } from "./common"; +/** + * Enumerates the scrolling directions. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum ScrollDirection { + /** + * Only vertical scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Vertical, + /** + * Only horizontal scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Horizontal, + /** + * Scrolling is disabled. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + None +} +/** + * Enumerates alignment modes. + * + * @enum { number } ScrollAlign + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum ScrollAlign { + /** + * The start edge of the list item is flush with the start edge of the list. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + START, + /** + * The list item is centered along the main axis of the list. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + CENTER, + /** + * The end edge of the list item is flush with the end edge of the list. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + END, + /** + * The list item is automatically aligned. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + AUTO +} +/** + * Represents the offset values resulting from a scroll operation. + * + * @interface OffsetResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface OffsetResult { + /** + * Horizontal scrolling offset. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + xOffset: number; + /** + * Vertical scrolling offset. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + yOffset: number; +} +/** + * Provides parameters for scrolling to the edge of a scrollable container. + * + * @interface ScrollEdgeOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ScrollEdgeOptions { + /** + * Fixed velocity for scrolling to the edge of the container. + * If the value specified is less than or equal to 0, the parameter will not take effect. + * + * @type { ?number } + * @default 0vp/s + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + velocity?: number; +} +/** + * Provides parameters for scrolling to a specific index. + * + * @interface ScrollToIndexOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ScrollToIndexOptions { + /** + * Extra offset for scrolling to a specified index. + * + * @type { ?LengthMetrics } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + extraOffset?: LengthMetrics; +} +/** + * Provides parameters for customizing scroll animations. + * + * @interface ScrollAnimationOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ScrollAnimationOptions { + /** + * Scrolling duration. + * + *

NOTE + *
A value less than 0 evaluates to the default value. + *

+ * + * @type { ?number } + * @default 1000 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + duration?: number; + /** + * Scrolling curve. + * + * @type { ?(Curve | ICurve) } + * @default Curve.Ease + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + curve?: Curve | ICurve; + /** + * Whether to enable overscroll. + * + *

NOTE + *
Scrolling can exceed the boundary and initiate a bounce animation when this parameter is set to true, + * and the component's edgeEffect attribute is set to EdgeEffect.Spring. + *

+ * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + canOverScroll?: boolean; +} +/** + * Provides parameters for setting the initial scrolling offset. + * + * @interface OffsetOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ +export declare interface OffsetOptions { + /** + * Horizontal scrolling offset. + * + * @type { ?Dimension } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + xOffset?: Dimension; + /** + * Vertical scrolling offset. + * + * @type { ?Dimension } + * @default 0 + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + yOffset?: Dimension; +} +/** + * Defines a controller for scrollable container components. + * + *

NOTE + *
1. The binding of a Scroller instance to a scrollable container component occurs during the component creation phase. + *
2. Scroller APIs can only be effectively called after the Scroller instance is bound to a scrollable container component. + * Otherwise, depending on the API called, it may have no effect or throw an exception. + *
3. For example, with aboutToAppear, this callback is executed after a new instance of a custom component is + * created and before its build() method is called. + * Therefore, if a scrollable component is defined within the build method of a custom component, + * the internal scrollable component has not yet been created during the aboutToAppear callback + * of that custom component, and therefore the Scroller APIs cannot be called effectively. + *

+ * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class Scroller { + /** + * A constructor used to create a Scroller object. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(); + /** + * Called when the setting slides to the specified position. + * + * @param { ScrollOptions } options - scroll options + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + scrollTo(options: ScrollOptions): void; + /** + * Called when scrolling to the edge of the container. + * + * @param { Edge } value - Edge type of the container. + * @param { ScrollEdgeOptions } [options] - Options of scrolling to edge. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + scrollEdge(value: Edge, options?: ScrollEdgeOptions): void; + /** + * Performs inertial scrolling based on the initial velocity passed in. + * + * @param { number } velocity - Initial velocity of inertial scrolling. Unit: vp/s + *
NOTE + *
If the value specified is 0, it is considered as invalid, and the scrolling for this instance will not take effect. + * A positive value indicates scrolling towards the top, while a negative value indicates scrolling towards the bottom. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + fling(velocity: number): void; + /** + * Called when page turning mode is set. + * + * @param { ScrollPageOptions } value + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + scrollPage(value: ScrollPageOptions): void; + /** + * Obtains the current scrolling offset. + * + * @returns { OffsetResult } Returns the current scrolling offset. If the scroller not bound to a component, the return value is void. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + currentOffset(): OffsetResult; + /** + * Scroll to the specified index. + * + * @param { number } value - Index to jump to. + * @param { boolean } [smooth] - If true, scroll to index item with animation. If false, scroll to index item without animation. + * @param { ScrollAlign } [align] - Sets the alignment mode of a specified index. + * @param { ScrollToIndexOptions } [options] - Sets the options of a specified index, such as extra offset. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + scrollToIndex(value: number, smooth?: boolean, align?: ScrollAlign, options?: ScrollToIndexOptions): void; + /** + * Called when the setting slides by offset. + * + * @param { Length } dx + * @param { Length } dy + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + scrollBy(dx: Length, dy: Length): void; + /** + * Checks whether the component has scrolled to the bottom. + * + *

NOTE + *
This API is available for the ArcList, Scroll, List, Grid, and WaterFlow components. + *

+ * + * @returns { boolean } Returns whether the component scrolls to the end position. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + isAtEnd(): boolean; + /** + * Obtains the size and position of a child component relative to its container. + * + *

NOTE + *
- The value of index must be the index of a child component visible in the display area. + * Otherwise, the value is considered invalid. + *
- The value of index must be the index of a child component visible in the display area. Otherwise, + * the value is considered invalid. + *

+ * + * @param { number } index - Index of the target child component. + * @returns { RectResult } Returns the size and position. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - Controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + getItemRect(index: number): RectResult; + /** + * Obtains the index of a child component based on coordinates. + * + *

NOTE + *
The returned index is -1 for invalid coordinates. + *

+ * + * @param { number } x - X-coordinate, in vp. + * @param { number } y - Y-coordinate, in vp. + * @returns { number } Index of the item. + * @throws { BusinessError } 401 - Parameter error. Possible causes: + *
1. Mandatory parameters are left unspecified. + *
2. Incorrect parameters types. + *
3. Parameter verification failed. + * @throws { BusinessError } 100004 - The controller not bound to component. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + getItemIndex(x: number, y: number): number; +} +/** + * Provides parameters for scrolling to a specific position in a scrollable container. + * + * @interface ScrollOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ScrollOptions { + /** + * Horizontal scrolling offset. + * Anonymous Object Rectification. + * + *

NOTE + *
This parameter cannot be set in percentage. + *
If the value is less than 0, the offset will be 0 for non-animated scrolling. + * Animated scrolling stops at the starting position by default. + * By setting the animation parameter, you can enable a bounce effect when the scrolling goes beyond the boundary. + *
This parameter takes effect only when the scroll axis is the x-axis. + *

+ * + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + xOffset: number | string; + /** + * Vertical scrolling offset. + * Anonymous Object Rectification. + * + *

NOTE + *
This parameter cannot be set in percentage. + *
If the value is less than 0, the offset will be 0 for non-animated scrolling. + * Animated scrolling stops at the starting position by default. + * By setting the animation parameter, you can enable a bounce effect when the scrolling goes beyond the boundary. + *
This parameter takes effect only when the scroll axis is the y-axis. + *

+ * + * @type { number | string } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + yOffset: number | string; + /** + * Animation configuration + * Anonymous Object Rectification. + * + *

NOTE + *
Currently, the List, Scroll, Grid, and WaterFlow support the Boolean type and ICurve. + *

+ * + * @type { ?( ScrollAnimationOptions | boolean) } The ScrollAnimationOptions type provides custom animation parameters + * and the boolean type enables default spring animation. + * @default ScrollAnimationOptions: { duration: 1000, curve: Curve.Ease, canOverScroll: false } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + animation?: ScrollAnimationOptions | boolean; +} +/** + * Provides parameters for page scrolling behavior. + * + * @interface ScrollPageOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ScrollPageOptions { + /** + * Whether to turn to the next page.The value true means to scroll to the next page, + * and false means to scroll to the previous page. + * + * @type { boolean } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + next: boolean; + /** + * Whether to enable the page-turning animation.The value true means to enable the page-turning animation, + * and false means the opposite. + * + * @type { ?boolean } + * @default false + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + animation?: boolean; +} +/** + * Defines a scroll snapping mode object. + * + * @interface ScrollSnapOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ScrollSnapOptions { + /** + * Alignment mode for the scroll snap position. + * + * @type { ScrollSnapAlign } + * @default ScrollSnapAlign.NONE + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + snapAlign: ScrollSnapAlign; + /** + * Pagination points for scroll snapping. + * + *

NOTE + *
1. If the value is of the Dimension type, it indicates the size of each page, and the system will paginate based on this size. + *
2. If the value is of the Array\ type, each Dimension represents a pagination point, + * and the system will paginate accordingly. Each Dimension value must be within the [0, scrollable distance] range. + *
3. If this parameter is not set or Dimension is set to a value less than or equal to 0, the value is regarded as an invalid value. + * In this case, there is no scroll snapping. When the value is of the Array\ type, the items in the array must be monotonically increasing. + *
4. When the value is a percentage, the actual size is the product of the viewport of the Scroll component and the percentage value. + *

+ * + * @type { ?(Dimension | Array) } + * @default 100% + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + snapPagination?: Dimension | Array; + /** + * Whether to enable the snap to start feature. When scroll snapping is defined for the Scroll component, + * setting this parameter to false enables the component to scroll between the start and the first page. + * + *

NOTE + *
2. This attribute takes effect only when snapPagination is set to a value of the Array\ type; + * it does not work with values of the Dimension type. + *

+ * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + enableSnapToStart?: boolean; + /** + * Whether to enable the snap to end feature. When scroll snapping is defined for the Scroll component, + * setting this parameter to false enables the component to scroll between the end and the last page. + * + *

NOTE + *
2. This attribute takes effect only when snapPagination is set to a value of the Array\ type; + * it does not work with values of the Dimension type. + *

+ * + * @type { ?boolean } + * @default true + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + enableSnapToEnd?: boolean; +} +/** + * Represents the callback triggered when scrolling reaches an edge. + * + * @typedef { function } OnScrollEdgeCallback + * @param { Edge } side - Edge position to scroll to. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type OnScrollEdgeCallback = (side: Edge) => void; +/** + * The data returned by the event handler when onScrollFrameBegin. + * + * @interface OnScrollFrameBeginHandlerResult + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export interface OnScrollFrameBeginHandlerResult { + /** + * Actual scroll offset. + * Anonymous Object Rectification. + * + * @type { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + offsetRemain: number; +} +/** + * Represents the callback triggered before each frame scrolling starts. + * + * @typedef { function } OnScrollFrameBeginCallback + * @param { number } offset - Amount to scroll by, in vp. + * @param { ScrollState } state - Current scroll state. + * @returns { OnScrollFrameBeginHandlerResult } data - the scroll data return by handler + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type OnScrollFrameBeginCallback = (offset: number, state: ScrollState) => OnScrollFrameBeginHandlerResult; + +/** + * The ScrollAttribute + * + * @extends ScrollableCommonMethod + * @interface ScrollAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ScrollAttribute extends ScrollableCommonMethod { + /** + * Sets the scrolling direction. + * + * @param { ScrollDirection | undefined } value - Scrolling direction.
Default value: ScrollDirection.Vertical + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default scrollable(value: ScrollDirection | undefined): this; + /** + * Triggered before scrolling. + * + *

NOTE + *
1. This event is triggered when scrolling is started by the Scroll component or other input settings, + * such as keyboard and mouse operations. + *
2. This event is triggered when the controller API is called. + *
3. This event supports the out-of-bounds bounce effect. + *

+ * + * @param { ScrollOnWillScrollCallback | undefined } handler - Callback triggered before scrolling. + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onWillScroll(handler: ScrollOnWillScrollCallback | undefined): this; + /** + * Triggered when the Scroll component scrolls. + * + *

NOTE + *
1. This event is triggered when scrolling is started by the Scroll component or other input settings, + * such as keyboard and mouse operations. + *
2. This event is triggered when the controller API is called. + *
3. This event supports the out-of-bounds bounce effect. + *

+ * + * @param { ScrollOnScrollCallback | undefined } handler - Callback triggered when the Scroll component scrolls. + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onDidScroll(handler: ScrollOnScrollCallback | undefined): this; + /** + * Triggered when scrolling reaches the edge. + * Anonymous Object Rectification. + * + *

NOTE + *
1. This event is triggered when scrolling reaches the edge after being started by the Scroll component or other input settings, + * such as keyboard and mouse operations. + *
2. This event is triggered when the controller API is called. + *
3. This event supports the out-of-bounds bounce effect. + *

+ * + * @param { OnScrollEdgeCallback | undefined } event - Edge position to scroll to. + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onScrollEdge(event: OnScrollEdgeCallback | undefined): this; + /** + * Called when scrolling start. + * Anonymous Object Rectification. + * + *

NOTE + *
1. This event is triggered when scrolling is started by the Scroll component or other input settings, such as keyboard and mouse operations. + *
2. This event is triggered when the controller API is called, accompanied by a transition animation. + *

+ * + * @param { VoidCallback | undefined } event - Callback triggered when scrolling starts. + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onScrollStart(event: VoidCallback | undefined): this; + /** + * Called when scrolling has stopped. + * Anonymous Object Rectification. + * + *

NOTE + *
1. This event is triggered when scrolling is stopped by the Scroll component or other input settings, such as keyboard and mouse operations. + *
2. This event is triggered when the controller API is called, accompanied by a transition animation. + *

+ * + * @param { VoidCallback | undefined } event - Callback triggered when scrolling stops. + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onScrollStop(event: VoidCallback | undefined): this; + /** + * Sets the scrollbar state. + * + * @param { BarState | undefined } barState - Scrollbar state.
Default value: BarState.Auto + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default scrollBar(barState: BarState | undefined): this; + /** + * Sets the scrollbar color. + * + * @param { Color | number | string | undefined } color - Scrollbar color.
Default value: '\#182431' (40% opacity) + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default scrollBarColor(color: Color | number | string | undefined): this; + /** + * Sets the scrollbar width. + * + * @param { number | string | undefined } value - Scrollbar width.
Default value: 4
Unit: vp + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default scrollBarWidth(value: number | string | undefined): this; + /** + * Sets the effect used when the scroll boundary is reached. + * + * @param { EdgeEffect | undefined } edgeEffect - Effect used when the scroll boundary is reached. The spring and shadow effects are supported. + *
Default value: EdgeEffect.None + * @param { EdgeEffectOptions | undefined } [options] - Whether to enable the scroll effect when the component content is smaller than the component itself. + * The value { alwaysEnabled: true } means to enable the scroll effect, and { alwaysEnabled: false } means the opposite. + *
Default value: { alwaysEnabled: true } + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default edgeEffect(edgeEffect: EdgeEffect | undefined, options?: EdgeEffectOptions | undefined): this; + /** + * Triggered when each frame scrolling starts. + * Anonymous Object Rectification. + * + * @param { OnScrollFrameBeginCallback | undefined } event - Callback triggered when each frame scrolling starts. + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onScrollFrameBegin(event: OnScrollFrameBeginCallback | undefined): this; + /** + * Sets the nested scrolling options. You can set the nested scrolling mode in the forward and backward directions + * to implement scrolling linkage with the parent component. + * + * @param { NestedScrollOptions | undefined } value - Nested scrolling options. + *
Default value: { scrollForward: NestedScrollMode.SELF_ONLY, scrollBackward: NestedScrollMode.SELF_ONLY } + * @returns { this } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default nestedScroll(value: NestedScrollOptions | undefined): this; + /** + * Sets whether to support scroll gestures. When this attribute is set to false, + * scrolling by finger or mouse is not supported, but the scroll controller API is not affected. + * + * @param { boolean | undefined } value - Whether to support scroll gestures.
Default value: true + * @returns { this } The attribute of the scroll + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default enableScrollInteraction(value: boolean | undefined): this; + /** + * Sets the friction coefficient. It applies only to gestures in the scrolling area, and + * it affects only indirectly the scroll chaining during the inertial scrolling process. + * If this attribute is set to a value less than or equal to 0, the default value is used. + * + * @param { number | Resource | undefined } value - Friction coefficient. + *
Default value: 0.9 for wearable devices and 0.6 for non-wearable devices + *
Since API version 11, the default value for non-wearable devices is 0.7. + *
Since API version 12, the default value for non-wearable devices is 0.75. + * @returns { this } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default friction(value: number | Resource | undefined): this; + /** + * Sets the scroll snapping mode. + * + * @param { ScrollSnapOptions | undefined } value - Scroll snapping mode. + * @returns { this } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default scrollSnap(value: ScrollSnapOptions | undefined): this; + /** + * Sets whether to enable the swipe-to-turn-pages feature. + * + * @param { boolean | undefined } value - Whether to enable the swipe-to-turn-pages feature. + * The value true means to enable the swipe-to-turn-pages feature, and false means the opposite. + * @returns { this } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default enablePaging(value: boolean | undefined): this; + /** + * Sets the initial scrolling offset. + * + * @param { OffsetOptions | undefined } value - Initial scrolling offset. When the value specified is a percentage, + * the initial scrolling offset is calculated as the product of the Scroll component's size + * in the main axis direction and the percentage value. + * @returns { this } the attribute of the scroll. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default initialOffset(value: OffsetOptions | undefined): this; + /** + * Called attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} +/** + * Represents the callback triggered when the Scroll component scrolls. + * + *

NOTE + *
If the onScrollFrameBegin event and scrollBy method are used to implement nested scrolling, + * set the edgeEffect attribute of the scrollable child component to None. For example, + * if a List is nested in the Scroll component, edgeEffect of the List must be set to EdgeEffect.None. + *

+ * + * @typedef { function } ScrollOnScrollCallback + * @param { number } xOffset - Horizontal offset per frame during scrolling. A positive offset indicates scrolling to the left, + * and a negative offset indicates scrolling to the right. + *
Unit: vp + * @param { number } yOffset - Vertical offset per frame during scrolling. + * A positive offset indicates scrolling upward, and a negative offset indicates scrolling downward. + *
Unit: vp + * @param { ScrollState } scrollState - Current scrolling state. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type ScrollOnScrollCallback = (xOffset: number, yOffset: number, scrollState: ScrollState) => void; +/** + * Called before scroll to allow developer to control real offset the Scroll can scroll. + * + * @typedef { function } ScrollOnWillScrollCallback + * @param { number } xOffset - horizontal offset this frame will scroll, which may or may not be reached. + * @param { number } yOffset - vertical offset this frame will scroll, which may or may not be reached. + * @param { ScrollState } scrollState - current scroll state. + * @param { ScrollSource } scrollSource - source of current scroll. + * @returns { undefined | OffsetResult } the remain offset for the Scroll, + * same as (xOffset, yOffset) when no OffsetResult is returned. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type ScrollOnWillScrollCallback = (xOffset: number, yOffset: number, scrollState: ScrollState, scrollSource: ScrollSource) => undefined | OffsetResult; + +/** + * Defines Scroll Component. + * + * @param { Scroller } [scroller] - scroller + * @param { function } [content_] - container + * @returns { ScrollAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function Scroll( + scroller?: Scroller, + @memo + content_?: () => void, +): ScrollAttribute \ No newline at end of file diff --git a/api/arkui/component/scrollBar.d.ets b/api/arkui/component/scrollBar.d.ets deleted file mode 100644 index 66c465ef7b..0000000000 --- a/api/arkui/component/scrollBar.d.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2024-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @file - * @kit ArkUI - * @arkts 1.2 - */ - - -// WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! - -import { memo, ComponentBuilder, __memo_context_type, __memo_id_type } from './../stateManagement/runtime' -import { Scroller } from './scroll' -import { BarState, HitTestMode, ImageSize, Alignment, BorderStyle, ColoringStrategy, HoverEffect, Color, Visibility, ItemAlign, Direction, GradientDirection, ObscuredReasons, RenderFit, ImageRepeat, Axis, ResponseType, FunctionKey, ModifierKey } from './enums' -import { CommonMethod, DrawModifier, Rectangle, Callback_Array_TouchTestInfo_TouchResult, TouchTestInfo, TouchResult, PixelRoundPolicy, BackgroundEffectOptions, ForegroundEffectOptions, BorderImageOption, OutlineStyle, Callback_ClickEvent_Void, ClickEvent, Callback_Boolean_HoverEvent_Void, HoverEvent, AccessibilityCallback, Callback_MouseEvent_Void, MouseEvent, Callback_TouchEvent_Void, TouchEvent, Callback_KeyEvent_Void, KeyEvent, Callback_KeyEvent_Boolean, AnimateParam, TransitionOptions, TransitionEffect, MotionBlurOptions, InvertOptions, TranslateOptions, ScaleOptions, RotateOptions, Callback_Area_Area_Void, Literal_Union_Number_Literal_Number_offset_span_lg_md_sm_xs, Literal_Number_offset_span, AlignRuleOption, LocalizedAlignRuleOptions, ClickEffect, Callback_DragEvent_String_Union_CustomBuilder_DragItemInfo, DragEvent, CustomBuilder, DragItemInfo, Callback_DragEvent_String_Void, Callback_PreDragStatus_Void, PreDragStatus, Type_CommonMethod_linearGradient_value, Tuple_ResourceColor_Number, Type_CommonMethod_sweepGradient_value, Tuple_Length_Length, Type_CommonMethod_radialGradient_value, MotionPathOptions, ShadowOptions, ShadowStyle, ProgressMask, StateStyles, PixelStretchEffectOptions, AttributeModifier, GestureModifier, BackgroundBrightnessOptions, Callback_GestureInfo_BaseGestureEvent_GestureJudgeResult, GestureRecognizerJudgeBeginCallback, ShouldBuiltInRecognizerParallelWithCallback, Callback_TouchEvent_HitTestMode, SizeChangeCallback, SafeAreaType, SafeAreaEdge, Literal_Alignment_align, BlurStyle, BackgroundBlurStyleOptions, ForegroundBlurStyleOptions, TransitionFinishCallback, BlurOptions, LinearGradientBlurOptions, EffectType, sharedTransitionOptions, ChainStyle, DragPreviewOptions, DragInteractionOptions, OverlayOptions, BlendMode, BlendApplyType, GeometryTransitionOptions, PopupOptions, CustomPopupOptions, MenuElement, MenuOptions, ContextMenuOptions, ModalTransition, ContentCoverOptions, SheetOptions, VisibleAreaChangeCallback } from './common' -import { VisualEffect, Filter, UniformDataType, Blender, Length, SizeOptions, ConstraintSizeOptions, ChainWeightOptions, Padding, LocalizedPadding, Margin, LocalizedMargin, ResourceColor, Position, BorderOptions, EdgeStyles, EdgeWidths, LocalizedEdgeWidths, EdgeColors, LocalizedEdgeColors, BorderRadiuses, LocalizedBorderRadiuses, OutlineOptions, EdgeOutlineStyles, Dimension, EdgeOutlineWidths, OutlineRadiuses, Area, Edges, LocalizedEdges, LocalizedPosition, ResourceStr, AccessibilityOptions, PixelMap } from './units' -import { ComponentContent } from './../ComponentContent' -import { LengthMetrics } from './../Graphics' -import { CircleShape, EllipseShape, PathShape, RectShape } from './../../../api/@ohos.arkui.shape' -import { ResizableOptions } from './image' -import { Resource } from './../../../api/global/resource' - - -import { GestureInfo, BaseGestureEvent, GestureJudgeResult, GestureType, GestureMask } from './gesture' -export enum ScrollBarDirection { - VERTICAL = 0, - Vertical = 0, - HORIZONTAL = 1, - Horizontal = 1 -} -export interface ScrollBarOptions { - scroller: Scroller; - direction?: ScrollBarDirection; - state?: BarState; -} -export type ScrollBarInterface = (value: ScrollBarOptions) => ScrollBarAttribute; -export interface ScrollBarAttribute extends CommonMethod { - @memo - enableNestedScroll(value: boolean | undefined): this; -} -@memo -@ComponentBuilder -export declare function ScrollBar( - value: ScrollBarOptions, - @memo - content_?: () => void, -): ScrollBarAttribute diff --git a/api/arkui/component/scrollBar.static.d.ets b/api/arkui/component/scrollBar.static.d.ets new file mode 100644 index 0000000000..0a9330a156 --- /dev/null +++ b/api/arkui/component/scrollBar.static.d.ets @@ -0,0 +1,126 @@ +'use static' +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ +import { Scroller } from "./scroll"; +import { BarState } from './enums'; +import { Optional, CommonMethod } from './common'; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; +import { AttributeModifier, CommonMethod } from "./common"; +/** + * Content scroll direction. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum ScrollBarDirection { + /** + * Vertical scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Vertical, + /** + * Horizontal scrolling is supported. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + Horizontal +} +/** + * Defines the options of ScrollBar. + * + * @interface ScrollBarOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ScrollBarOptions { + /** + * Sets the scroller of scroll bar. + * + * @type { Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + scroller: Scroller; + /** + * Sets the direction of scroll bar. + * + * @type { ?ScrollBarDirection } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + direction?: ScrollBarDirection; + /** + * Sets the state of scroll bar. + * + * @type { ?BarState } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + state?: BarState; +} + +/** + * The ScrollBarAttribute + * + * @extends CommonMethod + * @interface ScrollBarAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface ScrollBarAttribute extends CommonMethod { + /** + * Called when setting whether to enable nested scroll. + * @param { Optional } enabled - Whether to enable nested scroll. + * @returns { this } The attribute of the scroll bar + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default enableNestedScroll(enabled: boolean | undefined): this; + /** + * Called attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Defines ScrollBar Component. + * + * @param { ScrollBarOptions } value - value + * @param { function } [content_] - container + * @returns { ScrollBarAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function ScrollBar( + value: ScrollBarOptions, + @memo + content_?: () => void, +): ScrollBarAttribute \ No newline at end of file diff --git a/api/arkui/component/waterFlow.static.d.ets b/api/arkui/component/waterFlow.static.d.ets new file mode 100644 index 0000000000..e18f776b44 --- /dev/null +++ b/api/arkui/component/waterFlow.static.d.ets @@ -0,0 +1,446 @@ +'use static' +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * @file + * @kit ArkUI + * @arkts 1.2 + */ +import { ScrollableCommonMethod, NestedScrollOptions, CommonMethod, Optional, OnWillScrollCallback, OnScrollCallback } from './common'; +import { CustomBuilder } from './builder'; +import { Length, Dimension, Margin, ConstraintSizeOptions, Resource } from './units'; +import { Scroller, OnScrollFrameBeginCallback } from "./scroll"; +import { ScrollState } from "./list"; +import { FlexDirection } from './enums'; +import { ComponentContent } from '../../arkui/ComponentContent'; +import { memo, ComponentBuilder } from "./../stateManagement/runtime"; +import { AttributeModifier, CommonMethod } from "./common"; +/** + * function that returns item main size by index. + * + * @typedef { function } GetItemMainSizeByIndex + * @param { number } index - Index of the target water flow item.
Value range: [0, total number of child nodes - 1]. + * @returns { number } main size of the FlowItem at index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export type GetItemMainSizeByIndex = (index: number) => number; +/** + * Describes the configuration of the water flow item section. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare class SectionOptions { + /** + * The number of FlowItems in this section. + * + * @type { number } itemsCount - Number of water flow items in the section. The value must be a positive integer. + * If the splice, push, or update APIs receive a section where the itemsCount value is less than 0, these APIs will not be executed. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + itemsCount: number; + /** + * The columns of this section in vertical layout, or rows in horizontal layout. + * + * @type { ?number } crossCount - Number of columns (in vertical layout) or rows (in horizontal layout). + *
If the value is less than 1, the default value is used. + * @default 1 one column in vertical layout, or one row in horizontal layout + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + crossCount?: number; + /** + * Callback used to obtain the main axis size,in vp, of the water flow item at a specified index during + * the layout process of the WaterFlow component. + * + *

NOTE + *
1. When both onGetItemMainSizeByIndex and the width or height attribute of the water flow item are used, + * the main axis size is determined by the return value of onGetItemMainSizeByIndex, + * which will override the main axis length of water flow item. + *
2. Using onGetItemMainSizeByIndex can improve the efficiency of jumping to a specific position or index in the WaterFlow component. + * Avoid mixing the use of onGetItemMainSizeByIndex with sections that do not have it set, as this can cause layout exceptions. + *
3. If onGetItemMainSizeByIndex returns a negative number, the height of the water flow item is 0. + *

+ * + * @type { ?GetItemMainSizeByIndex } onGetItemMainSizeByIndex - function that returns item main size by index + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + onGetItemMainSizeByIndex?: GetItemMainSizeByIndex; + /** + * Gap between columns. If this parameter is not set, the value of columnsGap for the water flow is used. + * If this parameter is set to an invalid value, 0 vp is used. + * + * @type { ?Dimension } columnsGap - column gap of this section + * same with columnsGap of WaterFlow if not set + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + columnsGap?: Dimension; + /** + * Gap between rows. If this parameter is not set, the value of rowsGap for the water flow is used. + * If this parameter is set to an invalid value, 0 vp is used. + * + * @type { ?Dimension } rowsGap - row gap of this section + * same with rowsGap of WaterFlow if not set + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + rowsGap?: Dimension; + /** + * Padding of the section. A value of the Length type specifies the margin for all the four sides. + * + * @type { ?(Margin | Dimension) } margin - outer margin of this section + * @default {top: 0, right: 0, bottom: 0, left: 0} + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + margin?: Margin | Dimension; +} +/** + * Describes the water flow item sections. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @crossplatform + * @atomicservice + * @since 20 + */ +export declare class WaterFlowSections { + /** + * A constructor used to create a WaterFlowSections object. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + constructor(); + /** + * Changes sections by removing or replacing an existing section and/or adding a section. + * + * @param { number } start - Zero-based index at which the changing starts. The value is converted to an integer. + *
NOTE + *
1. A negative index counts back from the end of the section list. If -WaterFlowSections.length() <= start < 0, start + array.length is used. + *
2. If start < -WaterFlowSections.length(), 0 is used. + *
3. If start >= WaterFlowSections.length(), a new section is added at the end. + * @param { number } [deleteCount] - Number of sections to be deleted from the position specified by start. + *
NOTE + *
1. If deleteCount is omitted, or if its value is greater than or equal to the number of sections from + * the position specified by start to the end of the WaterFlowSections, + * then all sections from the position specified by start to the end of the WaterFlowSections will be deleted. + *
2. If deleteCount is 0 or a negative number, no sections are deleted. + * @param { Array } [sections] - Sections to add to the section list, beginning from the position specified by start. + * If no section is specified, splice() will only delete sections from the WaterFlow component. + * @returns { boolean } Whether the splice was successful. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + splice(start: number, deleteCount?: number, sections?: Array): boolean; + /** + * Adds the specified sections to the end of the WaterFlow component. + * + * @param { SectionOptions } section - Sections to add to the end of the WaterFlow component. + * @returns { boolean } Whether the push was successful. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + push(section: SectionOptions): boolean; + /** + * Updates the configuration of a specified water flow item section. + * + * @param { number } sectionIndex - Zero-based index of the water flow item section to update. The value is converted to an integer. + *
NOTE + *
1. A negative index counts back from the end of the section list. If -WaterFlowSections.length() <= sectionIndex < 0, sectionIndex + array.length is used. + *
2. If sectionIndex < -WaterFlowSections.length(), 0 is used.
3. If sectionIndex >= WaterFlowSections.length(), a new section is added at the end. + * @param { SectionOptions } section - New section configuration. + * @returns { boolean } Whether the update was successful. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + update(sectionIndex: number, section: SectionOptions): boolean; + /** + * Obtains the configuration of all sections in the WaterFlow component. + * + * @returns { Array } Returns all the section options in the WaterFlow. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + values(): Array; + /** + * Obtains the number of sections in the WaterFlow component. + * + * @returns { number } Returns section counts in the WaterFlow. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + length(): number; +} +/** + * Declare layout modes of WaterFlow. + * + * @enum { number } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare enum WaterFlowLayoutMode { + /** + * Default layout mode where water flow items are arranged from top to bottom. Items in the viewport depend on the layout of all items above them. + * As such, in cases of redirection or switching the number of columns, the layout of all items above the viewport must be recalculated. + * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + ALWAYS_TOP_DOWN = 0, + /** + * Sliding window mode. This mode only takes into account the layout in the viewport, + * without depending on water flow items above the viewport. + * + *

NOTE + *
1. During a non-animated redirection to a distant location, water flow items are laid out forward or backward based on the target position. + * If the user then swipes back to the position prior to the redirection, the layout of the content may not be consistent with its previous state. + * This can lead to misalignment of the top nodes when the user swipes back to the top after the redirection. + * To counteract this issue, in this layout mode, the layout will be automatically adjusted after reaching the top of the viewport to ensure that the top is aligned. + * If there are multiple sections, adjustments will be made to the sections within the viewport when scrolling ends. + *
2. The total offset returned by the currentOffset API of scroller is inaccurate after a redirection or data update. This offset will be recalibrated when the user swipes back to the top. + *
3. If a jump action (for example, by calling scrollToIndex without animation or scrollEdge) and + * an input offset (such as from a swipe gesture or a scrolling animation) are both initiated within the same frame, both will be executed. + *
4. If the scrollToIndex API is called without animation to jump to a distant position (beyond the range of visible water flow items in the window), + * the total offset is calculated in the sliding window mode. + *

+ * + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + SLIDING_WINDOW = 1 +} +/** + * Provides parameters of the WaterFlow component. + * + * @interface WaterFlowOptions + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface WaterFlowOptions { + /** + * Footer of the WaterFlow component. + * + * @type { ?CustomBuilder } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + footer?: CustomBuilder; + /** + * Footer of the WaterFlow component. + * + * @type { ?ComponentContent } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + footerContent?: ComponentContent; + /** + * Controller of the scrollable component, bound to the scrollable component. + * + *

NOTE + *
The scroller cannot be bound to other scrollable components, such as ArcList, List, Grid, or Scroll. + *

+ * + * @type { ?Scroller } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + scroller?: Scroller; + /** + * Water flow item sections. Different sections can have different numbers of columns. + * + *

NOTE + *
1. When sections is used, the columnsTemplate and rowsTemplate attributes are ignored. + *
2. When sections is used, the footer cannot be set separately. The last section can function as the footer. + *

+ * + * @type { ?WaterFlowSections } sections - sections with different cross count + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + sections?: WaterFlowSections; + /** + * Layout mode of the WaterFlow component. + * + * @type { ?WaterFlowLayoutMode } + * @default ALWAYS_TOP_DOWN + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + layoutMode?: WaterFlowLayoutMode; +} + +/** + * The WaterFlowAttribute. + * + * @extends ScrollableCommonMethod + * @interface WaterFlowAttribute + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +export declare interface WaterFlowAttribute extends ScrollableCommonMethod { + /** + * Sets the number of columns in the layout. If this attribute is not set, one column is used by default. + * + * @param { string | undefined } value - Number of columns in the layout.
Default value: '1fr' + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default columnsTemplate(value: string | undefined): this; + /** + * Sets the size constraints of the child components during layout. + * + * @param { ConstraintSizeOptions | undefined } value - Size constraints of the child components during layout. + * If the value specified is less than 0, this parameter does not take effect. + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default itemConstraintSize(value: ConstraintSizeOptions | undefined): this; + /** + * Sets the number of rows in the layout. If this attribute is not set, one row is used by default. + * + * @param { string | undefined } value - Number of rows in the layout.
Default value: '1fr' + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default rowsTemplate(value: string | undefined): this; + /** + * Sets the gap between columns. + * + * @param { Length | undefined } value - Gap between columns.
Default value: 0 + *
Value range: [0, +∞). + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default columnsGap(value: Length | undefined): this; + /** + * Sets the gap between rows. + * + * @param { Length | undefined } value - Gap between rows.
Default value: 0 + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default rowsGap(value: Length | undefined): this; + /** + * Sets the main axis direction of the layout. + * + * @param { FlexDirection | undefined } value - Main axis direction of the layout.
Default value: FlexDirection.Column + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default layoutDirection(value: FlexDirection | undefined): this; + /** + * Sets the number of items to be cached. + * + * @param { number | undefined } value - Number of water flow items to be preloaded (cached). + *
Default value: number of nodes visible on the screen, with the maximum value of 16 + *
Value range: [0, +∞). + *
Values less than 0 are treated as 1. + * @returns { this } the attribute of the water flow. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default cachedCount(value: number | undefined): this; + /** + * Sets the number of water flow items to be cached (preloaded) and specifies whether to display the cached nodes. + * + * @param { number | undefined } count - Number of water flow items to be preloaded (cached). + *
Default value: number of nodes visible on the screen, with the maximum value of 16 + *
Value range: [0, +∞). + *
Values less than 0 are treated as 1. + * @param { boolean | undefined } show - Whether to display the cached water flow items. + * @returns { this } the attribute of the water flow. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default cachedCount(count: number | undefined, show: boolean | undefined): this; + /** + * Called when scrolling begin each frame. + * Anonymous Object Rectification. + * + * @param { OnScrollFrameBeginCallback | undefined } event - callback function, triggered when the scrolling begin each frame. + * @returns { this } the attribute of the water flow. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onScrollFrameBegin(event: OnScrollFrameBeginCallback | undefined): this; + /** + * Triggered when the first or last item displayed in the component changes. + * It is triggered once when the component is initialized. + * + * @param { function | undefined } event - Callback function, triggered when the first or last item + * displayed in the waterflow changes. + * "first": the index of the first item displayed in the waterflow, + * "last": the index of the last item displayed in the waterflow. + * @returns { this } the attribute of the water flow. + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onScrollIndex(event: ((first: number, last: number) => void) | undefined): this; + /** + * Called when the scrollable will scroll. + * + * @param { OnWillScrollCallback | undefined } handler - callback of scrollable. + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onWillScroll(handler: OnWillScrollCallback | undefined): this; + /** + * Called when the scrollable did scroll. + * + * @param { OnScrollCallback | undefined } handler - callback of scrollable, + * scrollOffset is offset this frame did scroll, scrollState is current scroll state. + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default onDidScroll(handler: OnScrollCallback | undefined): this; + /** + * Called attributeModifier. + * + * @param { AttributeModifier | AttributeModifier | undefined } modifier + * @returns { this } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ + default attributeModifier(modifier: AttributeModifier | AttributeModifier | undefined): this; +} + +/** + * Defines WaterFlow Component. + * + * @param { WaterFlowOptions } [options] - options + * @param { function } [content_] - container + * @returns { WaterFlowAttribute } + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @since 20 + */ +@memo +@ComponentBuilder +export declare function WaterFlow( + options?: WaterFlowOptions, + @memo + content_?: () => void, +): WaterFlowAttribute \ No newline at end of file -- Gitee