• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2024-2025 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15/**
16 * @file
17 * @kit ArkUI
18 * @arkts 1.2
19 */
20
21
22// WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION!
23
24import { memo, ComponentBuilder, __memo_context_type, __memo_id_type } from './../stateManagement/runtime'
25import { 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'
26
27import { Scroller, ScrollOptions, ScrollEdgeOptions, ScrollPageOptions, Literal_Boolean_next_Axis_direction, OffsetResult, ScrollAlign, ScrollToIndexOptions, ScrollOnWillScrollCallback, ScrollOnScrollCallback } from './scroll'
28import { Edge, Axis, HitTestMode, ImageSize, Alignment, BorderStyle, ColoringStrategy, HoverEffect, Color, Visibility, ItemAlign, Direction, GradientDirection, ObscuredReasons, RenderFit, ImageRepeat, ResponseType, FunctionKey, ModifierKey, BarState, EdgeEffect } from './enums'
29import { 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'
30import { ComponentContent } from './../ComponentContent'
31import { LengthMetrics } from './../Graphics'
32import { CircleShape, EllipseShape, PathShape, RectShape } from './../../../api/@ohos.arkui.shape'
33import { ResizableOptions } from './image'
34import { Resource } from './../../../api/global/resource'
35
36import { GestureInfo, BaseGestureEvent, GestureJudgeResult, GestureType, GestureMask } from './gesture'
37import { 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'
38import { OnScrollFrameBeginCallback, OnScrollFrameBeginHandlerResult } from './scroll'
39
40export enum ScrollState {
41    IDLE = 0,
42    Idle = 0,
43    SCROLL = 1,
44    Scroll = 1,
45    FLING = 2,
46    Fling = 2
47}
48export enum ListItemAlign {
49    START = 0,
50    Start = 0,
51    CENTER = 1,
52    Center = 1,
53    END = 2,
54    End = 2
55}
56export enum ListItemGroupArea {
57    NONE = 0,
58    IN_LIST_ITEM_AREA = 1,
59    IN_HEADER_AREA = 2,
60    IN_FOOTER_AREA = 3
61}
62export enum StickyStyle {
63    NONE = 0,
64    None = 0,
65    HEADER = 1,
66    Header = 1,
67    FOOTER = 2,
68    Footer = 2
69}
70export enum ChainEdgeEffect {
71    DEFAULT = 0,
72    STRETCH = 1
73}
74export enum ScrollSnapAlign {
75    NONE = 0,
76    START = 1,
77    CENTER = 2,
78    END = 3
79}
80export interface ChainAnimationOptions {
81    minSpace: Length;
82    maxSpace: Length;
83    conductivity?: number;
84    intensity?: number;
85    edgeEffect?: ChainEdgeEffect;
86    stiffness?: number;
87    damping?: number;
88}
89export interface CloseSwipeActionOptions {
90    onFinish?: (() => void);
91}
92export interface VisibleListContentInfo {
93    index: number;
94    itemGroupArea?: ListItemGroupArea;
95    itemIndexInGroup?: number;
96}
97export type OnScrollVisibleContentChangeCallback = (start: VisibleListContentInfo, end: VisibleListContentInfo) => void;
98export declare class ListScroller extends Scroller {
99    getItemRectInGroup(index: number, indexInGroup: number): RectResult
100    scrollToItemInGroup(index: number, indexInGroup: number, smooth?: boolean, align?: ScrollAlign): void
101    closeAllSwipeActions(options?: CloseSwipeActionOptions): void
102    getVisibleListContentInfo(x: number, y: number): VisibleListContentInfo
103}
104export interface ListOptions {
105    initialIndex?: number;
106    space?: number | string;
107    scroller?: Scroller;
108}
109export type ListInterface = (options?: ListOptions) => ListAttribute;
110export interface ListDividerOptions {
111    strokeWidth: Length;
112    color?: ResourceColor;
113    startMargin?: Length;
114    endMargin?: Length;
115}
116export type Callback_Number_Number_Number_Void = (start: number, end: number, center: number) => void;
117export type Callback_Number_Boolean = (index: number) => boolean;
118export type Callback_Number_Number_Boolean = (from: number, to: number) => boolean;
119export interface ListAttribute extends ScrollableCommonMethod {
120    @memo
121    alignListItem(value: ListItemAlign): this;
122    @memo
123    listDirection(value: Axis): this;
124    @memo
125    scrollBar(value: BarState): this;
126    @memo
127    contentStartOffset(value: number): this;
128    @memo
129    contentEndOffset(value: number): this;
130    @memo
131    divider(value: ListDividerOptions | undefined): this;
132    @memo
133    editMode(value: boolean): this;
134    @memo
135    multiSelectable(value: boolean): this;
136    @memo
137    cachedCount(value: number): this;
138    @memo
139    chainAnimation(value: boolean): this;
140    @memo
141    chainAnimationOptions(value: ChainAnimationOptions): this;
142    @memo
143    sticky(value: StickyStyle): this;
144    @memo
145    scrollSnapAlign(value: ScrollSnapAlign): this;
146    @memo
147    nestedScroll(value: NestedScrollOptions): this;
148    @memo
149    enableScrollInteraction(value: boolean): this;
150    @memo
151    friction(value: number | Resource): this;
152    @memo
153    childrenMainSize(value: ChildrenMainSize): this;
154    @memo
155    maintainVisibleContentPosition(value: boolean): this;
156    @memo
157    onScroll(value: ((first: number,last: number) => void)): this;
158    @memo
159    onScrollIndex(value: ((start: number,end: number,center: number) => void)): this;
160    @memo
161    onScrollVisibleContentChange(value: OnScrollVisibleContentChangeCallback): this;
162    @memo
163    onReachStart(value: (() => void)): this;
164    @memo
165    onReachEnd(value: (() => void)): this;
166    @memo
167    onScrollStart(value: (() => void)): this;
168    @memo
169    onScrollStop(value: (() => void)): this;
170    @memo
171    onItemDelete(value: ((index: number) => boolean)): this;
172    @memo
173    onItemMove(value: ((from: number,to: number) => boolean)): this;
174    @memo
175    onItemDragStart(value: ((event: ItemDragInfo,itemIndex: number) => CustomBuilder)): this;
176    @memo
177    onItemDragEnter(value: ((event: ItemDragInfo) => void)): this;
178    @memo
179    onItemDragMove(value: ((event: ItemDragInfo,itemIndex: number,insertIndex: number) => void)): this;
180    @memo
181    onItemDragLeave(value: ((event: ItemDragInfo,itemIndex: number) => void)): this;
182    @memo
183    onItemDrop(value: ((event: ItemDragInfo,itemIndex: number,insertIndex: number,isSuccess: boolean) => void)): this;
184    @memo
185    onScrollFrameBegin(value: ((offset: number,state: ScrollState) => OnScrollFrameBeginHandlerResult)): this;
186}
187@memo
188@ComponentBuilder
189export declare function List(
190    options?: ListOptions | undefined,
191    @memo
192    content_?: () => void,
193): ListAttribute
194