1/* 2 * Copyright (c) 2021-2023 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 * 19 * @enum { number } 20 * @syscap SystemCapability.ArkUI.ArkUI.Full 21 * @since 7 22 */ 23/** 24 * indexer align property. 25 * 26 * @enum { number } 27 * @syscap SystemCapability.ArkUI.ArkUI.Full 28 * @crossplatform 29 * @since 10 30 */ 31 declare enum IndexerAlign { 32 /** 33 * A dialog box is displayed on the right of the index bar. 34 * 35 * @syscap SystemCapability.ArkUI.ArkUI.Full 36 * @since 7 37 */ 38 /** 39 * A dialog box is displayed on the right of the index bar. 40 * 41 * @syscap SystemCapability.ArkUI.ArkUI.Full 42 * @crossplatform 43 * @since 10 44 */ 45 Left, 46 47 /** 48 * A dialog box is displayed on the left of the index bar. 49 * 50 * @syscap SystemCapability.ArkUI.ArkUI.Full 51 * @since 7 52 */ 53 /** 54 * A dialog box is displayed on the left of the index bar. 55 * 56 * @syscap SystemCapability.ArkUI.ArkUI.Full 57 * @crossplatform 58 * @since 10 59 */ 60 Right, 61} 62 63/** 64 * Alphabet index bar. 65 * 66 * @interface AlphabetIndexerInterface 67 * @syscap SystemCapability.ArkUI.ArkUI.Full 68 * @since 7 69 */ 70/** 71 * Alphabet index bar. 72 * 73 * @interface AlphabetIndexerInterface 74 * @syscap SystemCapability.ArkUI.ArkUI.Full 75 * @crossplatform 76 * @since 10 77 */ 78interface AlphabetIndexerInterface { 79 /** 80 * ArrayValue: Alphabetical index string array. 81 * selected: ID of the selected item. 82 * 83 * @param { object } value 84 * @returns { AlphabetIndexerAttribute } 85 * @syscap SystemCapability.ArkUI.ArkUI.Full 86 * @since 7 87 */ 88 /** 89 * ArrayValue: Alphabetical index string array. 90 * selected: ID of the selected item. 91 * 92 * @param { object } value 93 * @returns { AlphabetIndexerAttribute } 94 * @syscap SystemCapability.ArkUI.ArkUI.Full 95 * @crossplatform 96 * @since 10 97 */ 98 (value: { arrayValue: Array<string>; selected: number }): AlphabetIndexerAttribute; 99} 100 101/** 102 * Defines the alphabet index bar attribute functions. 103 * 104 * @extends CommonMethod 105 * @syscap SystemCapability.ArkUI.ArkUI.Full 106 * @since 7 107 */ 108/** 109 * Defines the alphabet index bar attribute functions. 110 * 111 * @extends CommonMethod 112 * @syscap SystemCapability.ArkUI.ArkUI.Full 113 * @crossplatform 114 * @since 10 115 */ 116declare class AlphabetIndexerAttribute extends CommonMethod<AlphabetIndexerAttribute> { 117 /** 118 * Index bar selection callback. 119 * 120 * @param { function } callback 121 * @returns { AlphabetIndexerAttribute } 122 * @syscap SystemCapability.ArkUI.ArkUI.Full 123 * @since 7 124 * @deprecated since 8 125 * @useinstead onSelect 126 */ 127 onSelected(callback: (index: number) => void): AlphabetIndexerAttribute; 128 129 /** 130 * Definitions color. 131 * 132 * @param { ResourceColor } value 133 * @returns { AlphabetIndexerAttribute } 134 * @syscap SystemCapability.ArkUI.ArkUI.Full 135 * @since 7 136 */ 137 /** 138 * Definitions color. 139 * 140 * @param { ResourceColor } value 141 * @returns { AlphabetIndexerAttribute } 142 * @syscap SystemCapability.ArkUI.ArkUI.Full 143 * @crossplatform 144 * @since 10 145 */ 146 color(value: ResourceColor): AlphabetIndexerAttribute; 147 148 /** 149 * Select the text color. 150 * 151 * @param { ResourceColor } value 152 * @returns { AlphabetIndexerAttribute } 153 * @syscap SystemCapability.ArkUI.ArkUI.Full 154 * @since 7 155 */ 156 /** 157 * Select the text color. 158 * 159 * @param { ResourceColor } value 160 * @returns { AlphabetIndexerAttribute } 161 * @syscap SystemCapability.ArkUI.ArkUI.Full 162 * @crossplatform 163 * @since 10 164 */ 165 selectedColor(value: ResourceColor): AlphabetIndexerAttribute; 166 167 /** 168 * Font color of the pop-up prompt text. 169 * 170 * @param { ResourceColor } value 171 * @returns { AlphabetIndexerAttribute } 172 * @syscap SystemCapability.ArkUI.ArkUI.Full 173 * @since 7 174 */ 175 /** 176 * Font color of the pop-up prompt text. 177 * 178 * @param { ResourceColor } value 179 * @returns { AlphabetIndexerAttribute } 180 * @syscap SystemCapability.ArkUI.ArkUI.Full 181 * @crossplatform 182 * @since 10 183 */ 184 popupColor(value: ResourceColor): AlphabetIndexerAttribute; 185 186 /** 187 * Select the text background color. 188 * 189 * @param { ResourceColor } value 190 * @returns { AlphabetIndexerAttribute } 191 * @syscap SystemCapability.ArkUI.ArkUI.Full 192 * @since 7 193 */ 194 /** 195 * Select the text background color. 196 * 197 * @param { ResourceColor } value 198 * @returns { AlphabetIndexerAttribute } 199 * @syscap SystemCapability.ArkUI.ArkUI.Full 200 * @crossplatform 201 * @since 10 202 */ 203 selectedBackgroundColor(value: ResourceColor): AlphabetIndexerAttribute; 204 205 /** 206 * Background color of the pop-up window index. 207 * 208 * @param { ResourceColor } value 209 * @returns { AlphabetIndexerAttribute } 210 * @syscap SystemCapability.ArkUI.ArkUI.Full 211 * @since 7 212 */ 213 /** 214 * Background color of the pop-up window index. 215 * 216 * @param { ResourceColor } value 217 * @returns { AlphabetIndexerAttribute } 218 * @syscap SystemCapability.ArkUI.ArkUI.Full 219 * @crossplatform 220 * @since 10 221 */ 222 popupBackground(value: ResourceColor): AlphabetIndexerAttribute; 223 224 /** 225 * Set the selected font color of non-alphabetic part of the pop-up window. 226 * 227 * @param { ResourceColor } value - indicates the color of the selected font. 228 * @returns { AlphabetIndexerAttribute } 229 * @syscap SystemCapability.ArkUI.ArkUI.Full 230 * @since 10 231 */ 232 /** 233 * Set the selected font color of non-alphabetic part of the pop-up window. 234 * 235 * @param { ResourceColor } value - indicates the color of the selected font. 236 * @returns { AlphabetIndexerAttribute } 237 * @syscap SystemCapability.ArkUI.ArkUI.Full 238 * @crossplatform 239 * @since 10 240 */ 241 popupSelectedColor(value: ResourceColor): AlphabetIndexerAttribute; 242 243 /** 244 * Set the unselected font color of non-alphabetic part of the pop-up window. 245 * 246 * @param { ResourceColor } value - indicates the color of the unselected font. 247 * @returns { AlphabetIndexerAttribute } 248 * @syscap SystemCapability.ArkUI.ArkUI.Full 249 * @crossplatform 250 * @since 10 251 */ 252 popupUnselectedColor(value: ResourceColor): AlphabetIndexerAttribute; 253 254 /** 255 * Set the background color of non-alphabetic part of the pop-up window. 256 * 257 * @param { ResourceColor } value - indicates the color of background. 258 * @returns { AlphabetIndexerAttribute } 259 * @syscap SystemCapability.ArkUI.ArkUI.Full 260 * @crossplatform 261 * @since 10 262 */ 263 popupItemBackgroundColor(value: ResourceColor): AlphabetIndexerAttribute; 264 265 /** 266 * Whether to use pop-up index hints. 267 * 268 * @param { boolean } value 269 * @returns { AlphabetIndexerAttribute } 270 * @syscap SystemCapability.ArkUI.ArkUI.Full 271 * @since 7 272 */ 273 /** 274 * Whether to use pop-up index hints. 275 * 276 * @param { boolean } value 277 * @returns { AlphabetIndexerAttribute } 278 * @syscap SystemCapability.ArkUI.ArkUI.Full 279 * @crossplatform 280 * @since 10 281 */ 282 usingPopup(value: boolean): AlphabetIndexerAttribute; 283 284 /** 285 * Select the text text style, 286 * 287 * @param { Font } value 288 * @returns { AlphabetIndexerAttribute } 289 * @syscap SystemCapability.ArkUI.ArkUI.Full 290 * @since 7 291 */ 292 /** 293 * Select the text text style, 294 * 295 * @param { Font } value 296 * @returns { AlphabetIndexerAttribute } 297 * @syscap SystemCapability.ArkUI.ArkUI.Full 298 * @crossplatform 299 * @since 10 300 */ 301 selectedFont(value: Font): AlphabetIndexerAttribute; 302 303 /** 304 * Select the text background color. 305 * 306 * @param { Font } value 307 * @returns { AlphabetIndexerAttribute } 308 * @syscap SystemCapability.ArkUI.ArkUI.Full 309 * @since 7 310 */ 311 /** 312 * Select the text background color. 313 * 314 * @param { Font } value 315 * @returns { AlphabetIndexerAttribute } 316 * @syscap SystemCapability.ArkUI.ArkUI.Full 317 * @crossplatform 318 * @since 10 319 */ 320 popupFont(value: Font): AlphabetIndexerAttribute; 321 322 /** 323 * Set the font style of non-alphabetic part of the prompt pop-up window. 324 * Family and style are not supported currently and will be fixed in future. 325 * 326 * @param { Font } value - indicates the style of the font. 327 * @returns { AlphabetIndexerAttribute } 328 * @syscap SystemCapability.ArkUI.ArkUI.Full 329 * @crossplatform 330 * @since 10 331 */ 332 popupItemFont(value: Font): AlphabetIndexerAttribute; 333 334 /** 335 * Size of the letter area on the letter index bar. The letter area is a square. Set the length of the square side. 336 * 337 * @param { string | number } value 338 * @returns { AlphabetIndexerAttribute } 339 * @syscap SystemCapability.ArkUI.ArkUI.Full 340 * @since 7 341 */ 342 /** 343 * Size of the letter area on the letter index bar. The letter area is a square. Set the length of the square side. 344 * 345 * @param { string | number } value 346 * @returns { AlphabetIndexerAttribute } 347 * @syscap SystemCapability.ArkUI.ArkUI.Full 348 * @crossplatform 349 * @since 10 350 */ 351 itemSize(value: string | number): AlphabetIndexerAttribute; 352 353 /** 354 * Definitions fonts. 355 * 356 * @param { Font } value 357 * @returns { AlphabetIndexerAttribute } 358 * @syscap SystemCapability.ArkUI.ArkUI.Full 359 * @since 7 360 */ 361 /** 362 * Definitions fonts. 363 * 364 * @param { Font } value 365 * @returns { AlphabetIndexerAttribute } 366 * @syscap SystemCapability.ArkUI.ArkUI.Full 367 * @crossplatform 368 * @since 10 369 */ 370 font(value: Font): AlphabetIndexerAttribute; 371 372 /** 373 * Alphabet index bar alignment style. The left and right alignment styles are supported, 374 * which affects the pop-up position of the pop-up window. 375 * 376 * @param { IndexerAlign } value - indicates the alignment style of Alphabet index. 377 * @param { Length } offset 378 * @returns { AlphabetIndexerAttribute } 379 * @syscap SystemCapability.ArkUI.ArkUI.Full 380 * @since 7 381 */ 382 /** 383 * Alphabet index bar alignment style. The left and right alignment styles are supported, 384 * which affects the pop-up position of the pop-up window. 385 * 386 * @param { IndexerAlign } value - indicates the alignment style of Alphabet index. 387 * @param { Length } offset - indicates the horizontal space between pop-up window and indexer bar. 388 * @returns { AlphabetIndexerAttribute } 389 * @syscap SystemCapability.ArkUI.ArkUI.Full 390 * @crossplatform 391 * @since 10 392 */ 393 alignStyle(value: IndexerAlign, offset?: Length): AlphabetIndexerAttribute; 394 395 /** 396 * Index bar selection callback. 397 * 398 * @param { function } callback 399 * @returns { AlphabetIndexerAttribute } 400 * @syscap SystemCapability.ArkUI.ArkUI.Full 401 * @since 8 402 */ 403 /** 404 * Index bar selection callback. 405 * 406 * @param { function } callback 407 * @returns { AlphabetIndexerAttribute } 408 * @syscap SystemCapability.ArkUI.ArkUI.Full 409 * @crossplatform 410 * @since 10 411 */ 412 onSelect(callback: (index: number) => void): AlphabetIndexerAttribute; 413 414 /** 415 * Index bar selection callback and return the strings which display on pop-up. 416 * 417 * @param { function } callback 418 * @returns { AlphabetIndexerAttribute } 419 * @syscap SystemCapability.ArkUI.ArkUI.Full 420 * @since 8 421 */ 422 /** 423 * Index bar selection callback and return the strings which display on pop-up. 424 * 425 * @param { function } callback 426 * @returns { AlphabetIndexerAttribute } 427 * @syscap SystemCapability.ArkUI.ArkUI.Full 428 * @crossplatform 429 * @since 10 430 */ 431 onRequestPopupData(callback: (index: number) => Array<string>): AlphabetIndexerAttribute; 432 433 /** 434 * Pop-up selection callback. 435 * 436 * @param { function } callback 437 * @returns { AlphabetIndexerAttribute } 438 * @syscap SystemCapability.ArkUI.ArkUI.Full 439 * @since 8 440 */ 441 /** 442 * Pop-up selection callback. 443 * 444 * @param { function } callback 445 * @returns { AlphabetIndexerAttribute } 446 * @syscap SystemCapability.ArkUI.ArkUI.Full 447 * @crossplatform 448 * @since 10 449 */ 450 onPopupSelect(callback: (index: number) => void): AlphabetIndexerAttribute; 451 452 /** 453 * Sets the selected index. 454 * 455 * @param { number } index 456 * @returns { AlphabetIndexerAttribute } 457 * @syscap SystemCapability.ArkUI.ArkUI.Full 458 * @since 8 459 */ 460 /** 461 * Sets the selected index. 462 * 463 * @param { number } index 464 * @returns { AlphabetIndexerAttribute } 465 * @syscap SystemCapability.ArkUI.ArkUI.Full 466 * @crossplatform 467 * @since 10 468 */ 469 selected(index: number): AlphabetIndexerAttribute; 470 471 /** 472 * Position of the pop-up windows, relative to the midpoint of the top border of the indexer bar. 473 * 474 * @param { Position } value 475 * @returns { AlphabetIndexerAttribute } 476 * @syscap SystemCapability.ArkUI.ArkUI.Full 477 * @since 8 478 */ 479 /** 480 * Position of the pop-up windows, relative to the midpoint of the top border of the indexer bar. 481 * 482 * @param { Position } value 483 * @returns { AlphabetIndexerAttribute } 484 * @syscap SystemCapability.ArkUI.ArkUI.Full 485 * @crossplatform 486 * @since 10 487 */ 488 popupPosition(value: Position): AlphabetIndexerAttribute; 489} 490 491/** 492 * Defines AlphabetIndexer Component. 493 * 494 * @syscap SystemCapability.ArkUI.ArkUI.Full 495 * @since 7 496 */ 497/** 498 * Defines AlphabetIndexer Component. 499 * 500 * @syscap SystemCapability.ArkUI.ArkUI.Full 501 * @crossplatform 502 * @since 10 503 */ 504declare const AlphabetIndexer: AlphabetIndexerInterface; 505 506/** 507 * Defines AlphabetIndexer Component instance. 508 * 509 * @syscap SystemCapability.ArkUI.ArkUI.Full 510 * @since 7 511 */ 512/** 513 * Defines AlphabetIndexer Component instance. 514 * 515 * @syscap SystemCapability.ArkUI.ArkUI.Full 516 * @crossplatform 517 * @since 10 518 */ 519declare const AlphabetIndexerInstance: AlphabetIndexerAttribute; 520