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 16 17/** 18 * Declare item ceiling attribute. 19 * @since 7 20 */ 21declare enum Sticky { 22 /** 23 * No sticky. 24 * @since 7 25 */ 26 None, 27 28 /** 29 * Normal mode 30 * @since 7 31 */ 32 Normal, 33 34 /** 35 * Set opacity. 36 * @since 7 37 */ 38 Opacity, 39} 40 41/** 42 * Declare whether the ListItem element is editable. 43 * @since 7 44 */ 45declare enum EditMode { 46 /** 47 * Unrestricted operations. 48 * @since 7 49 */ 50 None, 51 52 /** 53 * Deleteable. 54 * @since 7 55 */ 56 Deletable, 57 58 /** 59 * Movable. 60 * @since 7 61 */ 62 Movable, 63} 64 65/** 66 * @since 7 67 */ 68 69/** 70 * Values in the list 71 * @since 7 72 */ 73interface ListItemInterface { 74 /** 75 * Called when an interface is used. 76 * @since 7 77 */ 78 (value?: string): ListItemAttribute; 79} 80 81/** 82 * @since 7 83 */ 84declare class ListItemAttribute extends CommonMethod<ListItemAttribute> { 85 /** 86 * Called when setting whether item is ceiling effect. 87 * @since 7 88 */ 89 sticky(value: Sticky): ListItemAttribute; 90 91 /** 92 * Called when judging whether it is editable. 93 * @since 7 94 */ 95 editable(value: boolean | EditMode): ListItemAttribute; 96 97 /** 98 * Called when judging whether it is selectable. 99 * @since 8 100 */ 101 selectable(value: boolean): ListItemAttribute; 102 103 /** 104 * Called when the listItem is selected. 105 * @since 8 106 */ 107 onSelect(event: (isSelected: boolean) => void): ListItemAttribute; 108} 109 110/** 111 * @since 7 112 */ 113declare const ListItemInstance: ListItemAttribute; 114declare const ListItem: ListItemInterface; 115