1/* 2 * Copyright (c) 2021 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 16import {CommonMethod, Axis, Color, Resource, BarState, EdgeEffect} from "./common"; 17import {Scroller} from "./scroll"; 18 19export declare enum ScrollState { 20 Idle, 21 Scroll, 22 Fling 23} 24 25export declare class ListExtend<T> extends ListAttribute<T> { 26} 27 28interface List extends ListAttribute<List> { 29 (value?: { initialIndex?: number, space?: number | string, scroller?: Scroller }): List; 30} 31 32declare class ListAttribute<T> extends CommonMethod<T> { 33 listDirection(value: Axis): T; 34 35 scrollBar(value: BarState): T; 36 37 edgeEffect(value: EdgeEffect): T; 38 39 divider(value: { 40 strokeWidth: number | string | Resource, color?: Color | number | string | Resource, 41 startMargin?: number | string | Resource, endMargin?: number | string | Resource 42 } | null): T; 43 44 editMode(value: boolean): T; 45 46 cachedCount(value: number): T; 47 48 chainAnimation(value: boolean): T; 49 50 onScroll(event: (scrollOffset: number, scrollState: ScrollState) => void): T; 51 52 onScrollIndex(event: (start: number, end: number) => void): T; 53 54 onReachStart(event: () => void): T; 55 56 onReachEnd(event: () => void): T; 57 58 onScrollStop(event: () => void): T; 59 60 onItemDelete(event: (index: number) => boolean): T; 61 62 onItemMove(event: (from: number, to: number) => boolean): T; 63} 64 65export declare const ListInterface: List; 66