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 * indexer align property. 18 * @since 7 19 */ 20declare enum IndexerAlign { 21 /** 22 * A dialog box is displayed on the right of the index bar. 23 * @since 7 24 */ 25 Left, 26 27 /** 28 * A dialog box is displayed on the left of the index bar. 29 * @since 7 30 */ 31 Right, 32} 33 34/** 35 * Alphabet index bar. 36 * @since 7 37 */ 38interface AlphabetIndexerInterface { 39 /** 40 * ArrayValue: Alphabetical index string array. 41 * selected: ID of the selected item. 42 * @since 7 43 */ 44 (value: { arrayValue: Array<string>; selected: number }): AlphabetIndexerAttribute; 45} 46 47/** 48 * Defines the alphabet index bar attribute functions. 49 * @since 7 50 */ 51declare class AlphabetIndexerAttribute extends CommonMethod<AlphabetIndexerAttribute> { 52 /** 53 * Index bar selection callback. 54 * @since 7 55 * @deprecated since 8 56 * @useinstead onSelect 57 */ 58 onSelected(callback: (index: number) => void): AlphabetIndexerAttribute; 59 60 /** 61 * Definitions color. 62 * @since 7 63 */ 64 color(value: ResourceColor): AlphabetIndexerAttribute; 65 66 /** 67 * Select the text color. 68 * @since 7 69 */ 70 selectedColor(value: ResourceColor): AlphabetIndexerAttribute; 71 72 /** 73 * Font color of the pop-up prompt text. 74 * @since 7 75 */ 76 popupColor(value: ResourceColor): AlphabetIndexerAttribute; 77 78 /** 79 * Select the text background color. 80 * @since 7 81 */ 82 selectedBackgroundColor(value: ResourceColor): AlphabetIndexerAttribute; 83 84 /** 85 * Background color of the pop-up window index. 86 * @since 7 87 */ 88 popupBackground(value: ResourceColor): AlphabetIndexerAttribute; 89 90 /** 91 * Whether to use pop-up index hints. 92 * @since 7 93 */ 94 usingPopup(value: boolean): AlphabetIndexerAttribute; 95 96 /** 97 * Select the text text style, 98 * @since 7 99 */ 100 selectedFont(value: Font): AlphabetIndexerAttribute; 101 102 /** 103 * Select the text background color. 104 * @since 7 105 */ 106 popupFont(value: Font): AlphabetIndexerAttribute; 107 108 /** 109 * Size of the letter area on the letter index bar. The letter area is a square. Set the length of the square side. 110 * @since 7 111 */ 112 itemSize(value: string | number): AlphabetIndexerAttribute; 113 114 /** 115 * Definitions fonts. 116 * @since 7 117 */ 118 font(value: Font): AlphabetIndexerAttribute; 119 120 /** 121 * Alphabet index bar alignment style. The left and right alignment styles are supported, which affects the pop-up position of the pop-up window. 122 * @since 7 123 */ 124 alignStyle(value: IndexerAlign): AlphabetIndexerAttribute; 125 126 /** 127 * Index bar selection callback. 128 * @since 8 129 */ 130 onSelect(callback: (index: number) => void): AlphabetIndexerAttribute; 131 132 /** 133 * Index bar selection callback and return the strings which display on pop-up. 134 * @since 8 135 */ 136 onRequestPopupData(callback: (index: number) => Array<string>): AlphabetIndexerAttribute; 137 138 /** 139 * Pop-up selection callback. 140 * @since 8 141 */ 142 onPopupSelect(callback: (index: number) => void): AlphabetIndexerAttribute; 143 144 /** 145 * Sets the selected index. 146 * @since 8 147 */ 148 selected(index: number): AlphabetIndexerAttribute; 149 150 /** 151 * Position of the pop-up windows, relative to the midpoint of the top border of the indexer bar. 152 * @since 8 153 */ 154 popupPosition(value: Position): AlphabetIndexerAttribute; 155} 156 157/** 158 * Defines AlphabetIndexer Component. 159 * @since 7 160 */ 161declare const AlphabetIndexer: AlphabetIndexerInterface; 162 163/** 164 * Defines AlphabetIndexer Component instance. 165 * @since 7 166 */ 167declare const AlphabetIndexerInstance: AlphabetIndexerAttribute; 168