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 { 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' 25import { memo, ComponentBuilder, __memo_context_type, __memo_id_type } from './../stateManagement/runtime' 26import { Scroller, ScrollOnWillScrollCallback, ScrollOnScrollCallback, OnScrollFrameBeginCallback, OnScrollFrameBeginHandlerResult } from './scroll' 27import { ScrollState } from './list' 28import { 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' 29import { ComponentContent } from './../ComponentContent' 30import { HitTestMode, ImageSize, Alignment, BorderStyle, ColoringStrategy, HoverEffect, Color, Visibility, ItemAlign, Direction, GradientDirection, ObscuredReasons, RenderFit, ImageRepeat, Axis, ResponseType, FunctionKey, ModifierKey, BarState, EdgeEffect } from './enums' 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 36 37import { GestureInfo, BaseGestureEvent, GestureJudgeResult, GestureType, GestureMask } from './gesture' 38 39export type Callback_Number_Tuple_Number_Number = (index: number) => [ number, number ]; 40export type Tuple_Number_Number_Number_Number = [ 41 number, 42 number, 43 number, 44 number 45] 46export type Callback_Number_Tuple_Number_Number_Number_Number = (index: number) => [ number, number, number, number ]; 47export interface GridLayoutOptions { 48 regularSize: [ number, number ]; 49 irregularIndexes?: Array<number>; 50 onGetIrregularSizeByIndex?: ((index: number) => [ number, number ]); 51 onGetRectByIndex?: ((index: number) => [ number, number, number, number ]); 52} 53export type GridInterface = (scroller?: Scroller, layoutOptions?: GridLayoutOptions) => GridAttribute; 54export enum GridDirection { 55 ROW = 0, 56 Row = 0, 57 COLUMN = 1, 58 Column = 1, 59 ROW_REVERSE = 2, 60 RowReverse = 2, 61 COLUMN_REVERSE = 3, 62 ColumnReverse = 3 63} 64export enum GridItemAlignment { 65 DEFAULT = 0, 66 STRETCH = 1 67} 68export interface ComputedBarAttribute { 69 totalOffset: number; 70 totalLength: number; 71} 72export type Callback_Number_Number_ComputedBarAttribute = (index: number, offset: number) => ComputedBarAttribute; 73export type Callback_Number_Number_Void = (first: number, last: number) => void; 74export type Callback_ItemDragInfo_Void = (event: ItemDragInfo) => void; 75export type Callback_ItemDragInfo_Number_Number_Void = (event: ItemDragInfo, itemIndex: number, 76 insertIndex: number) => void; 77export type Callback_ItemDragInfo_Number_Void = (event: ItemDragInfo, itemIndex: number) => void; 78export type Callback_ItemDragInfo_Number_Number_Boolean_Void = (event: ItemDragInfo, itemIndex: number, 79 insertIndex: number, isSuccess: boolean) => void; 80export interface Literal_Number_offsetRemain { 81 offsetRemain: number; 82} 83export type Callback_Number_ScrollState_Literal_Number_offsetRemain = (offset: number, 84 state: ScrollState) => Literal_Number_offsetRemain; 85export interface GridAttribute extends ScrollableCommonMethod { 86 @memo 87 columnsTemplate(value: string): this; 88 @memo 89 rowsTemplate(value: string): this; 90 @memo 91 columnsGap(value: Length): this; 92 @memo 93 rowsGap(value: Length): this; 94 @memo 95 scrollBarWidth(value: number | string): this; 96 @memo 97 scrollBarColor(value: Color | number | string): this; 98 @memo 99 scrollBar(value: BarState): this; 100 @memo 101 onScrollBarUpdate(value: ((index: number,offset: number) => ComputedBarAttribute)): this; 102 @memo 103 onScrollIndex(value: ((first: number,last: number) => void)): this; 104 @memo 105 cachedCount(value: number): this; 106 @memo 107 editMode(value: boolean): this; 108 @memo 109 multiSelectable(value: boolean): this; 110 @memo 111 maxCount(value: number): this; 112 @memo 113 minCount(value: number): this; 114 @memo 115 cellLength(value: number): this; 116 @memo 117 layoutDirection(value: GridDirection): this; 118 @memo 119 supportAnimation(value: boolean): this; 120 @memo 121 onItemDragStart(value: ((event: ItemDragInfo,itemIndex: number) => CustomBuilder)): this; 122 @memo 123 onItemDragEnter(value: ((event: ItemDragInfo) => void)): this; 124 @memo 125 onItemDragMove(value: ((event: ItemDragInfo,itemIndex: number,insertIndex: number) => void)): this; 126 @memo 127 onItemDragLeave(value: ((event: ItemDragInfo,itemIndex: number) => void)): this; 128 @memo 129 onItemDrop(value: ((event: ItemDragInfo,itemIndex: number,insertIndex: number,isSuccess: boolean) => void)): this; 130 @memo 131 nestedScroll(value: NestedScrollOptions): this; 132 @memo 133 enableScrollInteraction(value: boolean): this; 134 @memo 135 friction(value: number | Resource): this; 136 @memo 137 alignItems(value: GridItemAlignment | undefined): this; 138 @memo 139 onScroll(value: ((first: number,last: number) => void)): this; 140 @memo 141 onReachStart(value: (() => void)): this; 142 @memo 143 onReachEnd(value: (() => void)): this; 144 @memo 145 onScrollStart(value: (() => void)): this; 146 @memo 147 onScrollStop(value: (() => void)): this; 148 @memo 149 onScrollFrameBegin(value: OnScrollFrameBeginCallback): this; 150 @memo 151 edgeEffect(value: EdgeEffect, options?: EdgeEffectOptions): this; 152} 153@memo 154@ComponentBuilder 155export declare function Grid( 156 scroller?: Scroller | undefined, layoutOptions?: GridLayoutOptions | undefined, 157 @memo 158 content_?: () => void, 159): GridAttribute 160