1/* 2 * Copyright (c) 2022 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/** 17* Defines the water flow options. 18* @since 9 19*/ 20declare interface WaterFlowOptions { 21 /** 22 * Describes the water flow footer. 23 * @since 9 24 */ 25 footer?: CustomBuilder; 26 27 /** 28 * Describes the water flow scroller. 29 * @since 9 30 */ 31 scroller?: Scroller; 32} 33 34 35/** 36 * Defines the water flow interface. 37 * @since 9 38 */ 39interface WaterFlowInterface { 40 /** 41 * WaterFlow is returned when the parameter is transferred. Only support api: scrollToIndex 42 * @since 9 43 */ 44 (options?: WaterFlowOptions): WaterFlowAttribute; 45} 46 47/** 48 * Defines the water flow attribute. 49 * @since 9 50 */ 51declare class WaterFlowAttribute extends CommonMethod<WaterFlowAttribute> { 52 /** 53 * This parameter specifies the number of columns in the current waterflow. 54 * @since 9 55 */ 56 columnsTemplate(value: string): WaterFlowAttribute; 57 58 /** 59 * This parameter specifies the min or max size of each item. 60 * @since 9 61 */ 62 itemConstraintSize(value: ConstraintSizeOptions): WaterFlowAttribute; 63 64 /** 65 * Set the number of rows in the current waterflow. 66 * @since 9 67 */ 68 rowsTemplate(value: string): WaterFlowAttribute; 69 70 /** 71 * Set the spacing between columns. 72 * @since 9 73 */ 74 columnsGap(value: Length): WaterFlowAttribute; 75 76 /** 77 * Set the spacing between rows. 78 * @since 9 79 */ 80 rowsGap(value: Length): WaterFlowAttribute; 81 82 /** 83 * Control layout direction of the WaterFlow. 84 * @since 9 85 */ 86 layoutDirection(value: FlexDirection): WaterFlowAttribute; 87 88 /** 89 * Called when the water flow begins to arrive. 90 * @since 9 91 */ 92 onReachStart(event: () => void): WaterFlowAttribute; 93 94 /** 95 * Called when the water flow reaches the end. 96 * @since 9 97 */ 98 onReachEnd(event: () => void): WaterFlowAttribute; 99} 100 101/** 102 * Defines WaterFlow Component. 103 * @since 9 104 */ 105declare const WaterFlow: WaterFlowInterface; 106 107/** 108 * Defines WaterFlow Component instance. 109 * @since 9 110 */ 111declare const WaterFlowInstance: WaterFlowAttribute; 112