1/* 2 * Copyright (c) 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 * @file 18 * @kit ArkUI 19 */ 20 21/** 22 * Enumerates the layout direction of the icon and text. 23 * 24 * @enum { number } 25 * @syscap SystemCapability.ArkUI.ArkUI.Full 26 * @since 10 27 */ 28/** 29 * Enumerates the layout direction of the icon and text. 30 * 31 * @enum { number } 32 * @syscap SystemCapability.ArkUI.ArkUI.Full 33 * @atomicservice 34 * @since 11 35 */ 36declare enum SecurityComponentLayoutDirection { 37 /** 38 * Horizontal layout. 39 * 40 * @syscap SystemCapability.ArkUI.ArkUI.Full 41 * @since 10 42 */ 43 /** 44 * Horizontal layout. 45 * 46 * @syscap SystemCapability.ArkUI.ArkUI.Full 47 * @atomicservice 48 * @since 11 49 */ 50 HORIZONTAL = 0, 51 52 /** 53 * Vertical layout. 54 * 55 * @syscap SystemCapability.ArkUI.ArkUI.Full 56 * @since 10 57 */ 58 /** 59 * Vertical layout. 60 * 61 * @syscap SystemCapability.ArkUI.ArkUI.Full 62 * @atomicservice 63 * @since 11 64 */ 65 VERTICAL = 1 66} 67 68/** 69 * Defines the method of a security component. 70 * 71 * @syscap SystemCapability.ArkUI.ArkUI.Full 72 * @since 10 73 */ 74/** 75 * Defines the method of a security component. 76 * 77 * @syscap SystemCapability.ArkUI.ArkUI.Full 78 * @atomicservice 79 * @since 11 80 */ 81declare class SecurityComponentMethod<T> { 82 /** 83 * Icon size. 84 * 85 * @param { Dimension } value - Indicates the size of the icon. 86 * @returns { T } Returns the attribute of the security component. 87 * @syscap SystemCapability.ArkUI.ArkUI.Full 88 * @since 10 89 */ 90 /** 91 * Icon size. 92 * 93 * @param { Dimension } value - Indicates the size of the icon. 94 * @returns { T } Returns the attribute of the security component. 95 * @syscap SystemCapability.ArkUI.ArkUI.Full 96 * @atomicservice 97 * @since 11 98 */ 99 iconSize(value: Dimension): T; 100 101 /** 102 * Layout direction of the icon and text. 103 * 104 * @param { SecurityComponentLayoutDirection } value - Indicates the layout direction of the icon and text. 105 * @returns { T } Returns the attribute of the security component. 106 * @syscap SystemCapability.ArkUI.ArkUI.Full 107 * @since 10 108 */ 109 /** 110 * Layout direction of the icon and text. 111 * 112 * @param { SecurityComponentLayoutDirection } value - Indicates the layout direction of the icon and text. 113 * @returns { T } Returns the attribute of the security component. 114 * @syscap SystemCapability.ArkUI.ArkUI.Full 115 * @atomicservice 116 * @since 11 117 */ 118 layoutDirection(value: SecurityComponentLayoutDirection): T; 119 120 /** 121 * Position of the security component. 122 * 123 * @param { Position } value - Indicates the position of the security component. 124 * @returns { T } Returns the attribute of the security component. 125 * @syscap SystemCapability.ArkUI.ArkUI.Full 126 * @since 10 127 */ 128 /** 129 * Position of the security component. 130 * 131 * @param { Position } value - Indicates the position of the security component. 132 * @returns { T } Returns the attribute of the security component. 133 * @syscap SystemCapability.ArkUI.ArkUI.Full 134 * @atomicservice 135 * @since 11 136 */ 137 position(value: Position): T; 138 139 /** 140 * Anchor of the security component for positioning. The top start edge of the component is used as 141 * the reference point for offset. 142 * 143 * @param { Position } value - Indicates the anchor of the component when it is positioned. 144 * @returns { T } Returns the attribute of the security component. 145 * @syscap SystemCapability.ArkUI.ArkUI.Full 146 * @since 10 147 */ 148 /** 149 * Anchor of the security component for positioning. The top start edge of the component is used as 150 * the reference point for offset. 151 * 152 * @param { Position } value - Indicates the anchor of the component when it is positioned. 153 * @returns { T } Returns the attribute of the security component. 154 * @syscap SystemCapability.ArkUI.ArkUI.Full 155 * @atomicservice 156 * @since 11 157 */ 158 markAnchor(value: Position): T; 159 160 /** 161 * Coordinate offset relative to the layout position. 162 * Setting this attribute does not affect the layout of the parent container. 163 * The position is adjusted only during drawing. 164 * 165 * @param { Position } value - Indicates the offset value. 166 * @returns { T } Returns the attribute of the security component. 167 * @syscap SystemCapability.ArkUI.ArkUI.Full 168 * @since 10 169 */ 170 /** 171 * Coordinate offset relative to the layout position. 172 * Setting this attribute does not affect the layout of the parent container. 173 * The position is adjusted only during drawing. 174 * 175 * @param { Position } value - Indicates the offset value. 176 * @returns { T } Returns the attribute of the security component. 177 * @syscap SystemCapability.ArkUI.ArkUI.Full 178 * @atomicservice 179 * @since 11 180 */ 181 /** 182 * Coordinate offset relative to the layout completion position. 183 * Setting this attribute does not affect the layout of the parent container. 184 * The position is adjusted only during drawing. 185 * 186 * @param { Position | Edges | LocalizedEdges } value 187 * @returns { T } 188 * @syscap SystemCapability.ArkUI.ArkUI.Full 189 * @atomicservice 190 * @since 12 191 */ 192 offset(value: Position | Edges | LocalizedEdges): T; 193 194 /** 195 * Font size of the inner text. 196 * 197 * @param { Dimension } value - Indicates the font size of the text in the security component. 198 * @returns { T } Returns the attribute of the security component. 199 * @syscap SystemCapability.ArkUI.ArkUI.Full 200 * @since 10 201 */ 202 /** 203 * Font size of the inner text. 204 * 205 * @param { Dimension } value - Indicates the font size of the text in the security component. 206 * @returns { T } Returns the attribute of the security component. 207 * @syscap SystemCapability.ArkUI.ArkUI.Full 208 * @atomicservice 209 * @since 11 210 */ 211 fontSize(value: Dimension): T; 212 213 /** 214 * Font style of the inner text. 215 * 216 * @param { FontStyle } value - Indicates the font style of the text in the security component. 217 * @returns { T } Returns the attribute of the security component. 218 * @syscap SystemCapability.ArkUI.ArkUI.Full 219 * @since 10 220 */ 221 /** 222 * Font style of the inner text. 223 * 224 * @param { FontStyle } value - Indicates the font style of the text in the security component. 225 * @returns { T } Returns the attribute of the security component. 226 * @syscap SystemCapability.ArkUI.ArkUI.Full 227 * @atomicservice 228 * @since 11 229 */ 230 fontStyle(value: FontStyle): T; 231 232 /** 233 * Font weight of the inner text. 234 * 235 * @param { number | FontWeight | string } value - Indicates the font weight of the text in the security component. 236 * @returns { T } Returns the attribute of the security component. 237 * @syscap SystemCapability.ArkUI.ArkUI.Full 238 * @since 10 239 */ 240 /** 241 * Font weight of the inner text. 242 * 243 * @param { number | FontWeight | string } value - Indicates the font weight of the text in the security component. 244 * @returns { T } Returns the attribute of the security component. 245 * @syscap SystemCapability.ArkUI.ArkUI.Full 246 * @atomicservice 247 * @since 11 248 */ 249 /** 250 * Font weight of the inner text. 251 * 252 * @param { number | FontWeight | string | Resource } value - Indicates the font weight of the text in the security component. 253 * @returns { T } Returns the attribute of the security component. 254 * @syscap SystemCapability.ArkUI.ArkUI.Full 255 * @atomicservice 256 * @since 20 257 */ 258 fontWeight(value: number | FontWeight | string | Resource): T; 259 260 /** 261 * Font family of the inner text. 262 * 263 * @param { string | Resource } value - Indicates the font family of the text in the security component. 264 * @returns { T } Returns the attribute of the security component. 265 * @syscap SystemCapability.ArkUI.ArkUI.Full 266 * @since 10 267 */ 268 /** 269 * Font family of the inner text. 270 * 271 * @param { string | Resource } value - Indicates the font family of the text in the security component. 272 * @returns { T } Returns the attribute of the security component. 273 * @syscap SystemCapability.ArkUI.ArkUI.Full 274 * @atomicservice 275 * @since 11 276 */ 277 fontFamily(value: string | Resource): T; 278 279 /** 280 * Font color of the inner text. 281 * 282 * @param { ResourceColor } value - Indicates the font color of the text in the security component. 283 * @returns { T } Returns the attribute of the security component. 284 * @syscap SystemCapability.ArkUI.ArkUI.Full 285 * @since 10 286 */ 287 /** 288 * Font color of the inner text. 289 * 290 * @param { ResourceColor } value - Indicates the font color of the text in the security component. 291 * @returns { T } Returns the attribute of the security component. 292 * @syscap SystemCapability.ArkUI.ArkUI.Full 293 * @atomicservice 294 * @since 11 295 */ 296 fontColor(value: ResourceColor): T; 297 298 /** 299 * Color of the icon. 300 * 301 * @param { ResourceColor } value - Indicates the icon color in the security component. 302 * @returns { T } Returns the attribute of the security component. 303 * @syscap SystemCapability.ArkUI.ArkUI.Full 304 * @since 10 305 */ 306 /** 307 * Color of the icon. 308 * 309 * @param { ResourceColor } value - Indicates the icon color in the security component. 310 * @returns { T } Returns the attribute of the security component. 311 * @syscap SystemCapability.ArkUI.ArkUI.Full 312 * @atomicservice 313 * @since 11 314 */ 315 iconColor(value: ResourceColor): T; 316 317 /** 318 * Background color. 319 * 320 * @param { ResourceColor } value - Indicates the background color of the security component. 321 * @returns { T } Returns the attribute of the security component. 322 * @syscap SystemCapability.ArkUI.ArkUI.Full 323 * @since 10 324 */ 325 /** 326 * Background color. 327 * 328 * @param { ResourceColor } value - Indicates the background color of the security component. 329 * @returns { T } Returns the attribute of the security component. 330 * @syscap SystemCapability.ArkUI.ArkUI.Full 331 * @atomicservice 332 * @since 11 333 */ 334 backgroundColor(value: ResourceColor): T; 335 336 /** 337 * Style of the border. 338 * 339 * @param { BorderStyle } value - Indicates the border style of the security component. 340 * @returns { T } Returns the attribute of the security component. 341 * @syscap SystemCapability.ArkUI.ArkUI.Full 342 * @since 10 343 */ 344 /** 345 * Style of the border. 346 * 347 * @param { BorderStyle } value - Indicates the border style of the security component. 348 * @returns { T } Returns the attribute of the security component. 349 * @syscap SystemCapability.ArkUI.ArkUI.Full 350 * @atomicservice 351 * @since 11 352 */ 353 borderStyle(value: BorderStyle): T; 354 355 /** 356 * Width of the border. 357 * 358 * @param { Dimension } value - Indicates the border width of the security component. 359 * @returns { T } Returns the attribute of the security component. 360 * @syscap SystemCapability.ArkUI.ArkUI.Full 361 * @since 10 362 */ 363 /** 364 * Width of the border. 365 * 366 * @param { Dimension } value - Indicates the border width of the security component. 367 * @returns { T } Returns the attribute of the security component. 368 * @syscap SystemCapability.ArkUI.ArkUI.Full 369 * @atomicservice 370 * @since 11 371 */ 372 borderWidth(value: Dimension): T; 373 374 /** 375 * Color of the border. 376 * 377 * @param { ResourceColor } value - Indicates the border color of the security component. 378 * @returns { T } Returns the attribute of the security component. 379 * @syscap SystemCapability.ArkUI.ArkUI.Full 380 * @since 10 381 */ 382 /** 383 * Color of the border. 384 * 385 * @param { ResourceColor } value - Indicates the border color of the security component. 386 * @returns { T } Returns the attribute of the security component. 387 * @syscap SystemCapability.ArkUI.ArkUI.Full 388 * @atomicservice 389 * @since 11 390 */ 391 borderColor(value: ResourceColor): T; 392 393 /** 394 * Radius of the border. 395 * 396 * @param { Dimension } value - Indicates the border radius of the security component. 397 * @returns { T } Returns the attribute of the security component. 398 * @syscap SystemCapability.ArkUI.ArkUI.Full 399 * @since 10 400 */ 401 /** 402 * Radius of the border. 403 * 404 * @param { Dimension } value - Indicates the border radius of the security component. 405 * @returns { T } Returns the attribute of the security component. 406 * @syscap SystemCapability.ArkUI.ArkUI.Full 407 * @atomicservice 408 * @since 11 409 */ 410 borderRadius(value: Dimension): T; 411 412 /** 413 * Radius of the border. 414 * 415 * @param { Dimension | BorderRadiuses } radius - Indicates the border radius of the security component. 416 * @returns { T } Returns the attribute of the security component. 417 * @syscap SystemCapability.ArkUI.ArkUI.Full 418 * @atomicservice 419 * @since 15 420 */ 421 borderRadius(radius: Dimension | BorderRadiuses): T; 422 423 /** 424 * Padding between the background border and icon/inner text. 425 * 426 * @param { Padding | Dimension } value - Indicates the padding of the security component. 427 * @returns { T } Returns the attribute of the security component. 428 * @syscap SystemCapability.ArkUI.ArkUI.Full 429 * @since 10 430 */ 431 /** 432 * Padding between the background border and icon/inner text. 433 * 434 * @param { Padding | Dimension } value - Indicates the padding of the security component. 435 * @returns { T } Returns the attribute of the security component. 436 * @syscap SystemCapability.ArkUI.ArkUI.Full 437 * @atomicservice 438 * @since 11 439 */ 440 padding(value: Padding | Dimension): T; 441 442 /** 443 * Space between the inner text and icon. 444 * 445 * @param { Dimension } value - Indicates the space between the inner text and icon. 446 * @returns { T } Returns the attribute of the security component. 447 * @syscap SystemCapability.ArkUI.ArkUI.Full 448 * @since 10 449 */ 450 /** 451 * Space between the inner text and icon. 452 * 453 * @param { Dimension } value - Indicates the space between the inner text and icon. 454 * @returns { T } Returns the attribute of the security component. 455 * @syscap SystemCapability.ArkUI.ArkUI.Full 456 * @atomicservice 457 * @since 11 458 */ 459 textIconSpace(value: Dimension): T; 460 461 /** 462 * Key. User can set an key to the component to identify it. 463 * 464 * @param { string } value - identify the key of the component. 465 * @returns { T } Returns the attribute of the security component. 466 * @syscap SystemCapability.ArkUI.ArkUI.Full 467 * @systemapi 468 * @since 10 469 * @test 470 */ 471 key(value: string): T; 472 473 /** 474 * Sets the width of the component. 475 * 476 * @param { Length } value - Indicates the width of the security component. 477 * @returns { T } Returns the attribute of the security component. 478 * @syscap SystemCapability.ArkUI.ArkUI.Full 479 * @since 11 480 */ 481 /** 482 * Sets the width of the component. 483 * 484 * @param { Length } value - Indicates the width of the security component. 485 * @returns { T } Returns the attribute of the security component. 486 * @syscap SystemCapability.ArkUI.ArkUI.Full 487 * @atomicservice 488 * @since 12 489 */ 490 width(value: Length): T; 491 492 /** 493 * Sets the height of the component. 494 * 495 * @param { Length } value - Indicates the height of the security component. 496 * @returns { T } Returns the attribute of the security component. 497 * @syscap SystemCapability.ArkUI.ArkUI.Full 498 * @since 11 499 */ 500 /** 501 * Sets the height of the component. 502 * 503 * @param { Length } value - Indicates the height of the security component. 504 * @returns { T } Returns the attribute of the security component. 505 * @syscap SystemCapability.ArkUI.ArkUI.Full 506 * @atomicservice 507 * @since 12 508 */ 509 height(value: Length): T; 510 511 /** 512 * The size of the component. 513 * 514 * @param { SizeOptions } value - Indicates the size of the security component. 515 * @returns { T } Returns the attribute of the security component. 516 * @syscap SystemCapability.ArkUI.ArkUI.Full 517 * @since 11 518 */ 519 /** 520 * The size of the component. 521 * 522 * @param { SizeOptions } value - Indicates the size of the security component. 523 * @returns { T } Returns the attribute of the security component. 524 * @syscap SystemCapability.ArkUI.ArkUI.Full 525 * @atomicservice 526 * @since 12 527 */ 528 size(value: SizeOptions): T; 529 530 /** 531 * constraint Size: 532 * minWidth: minimum Width, maxWidth: maximum Width, minHeight: minimum Height, maxHeight: maximum Height. 533 * 534 * @param { ConstraintSizeOptions } value - Indicates the constraint size of the security component. 535 * @returns { T } Returns the attribute of the security component. 536 * @syscap SystemCapability.ArkUI.ArkUI.Full 537 * @since 11 538 */ 539 /** 540 * constraint Size: 541 * minWidth: minimum Width, maxWidth: maximum Width, minHeight: minimum Height, maxHeight: maximum Height. 542 * 543 * @param { ConstraintSizeOptions } value - Indicates the constraint size of the security component. 544 * @returns { T } Returns the attribute of the security component. 545 * @syscap SystemCapability.ArkUI.ArkUI.Full 546 * @atomicservice 547 * @since 12 548 */ 549 constraintSize(value: ConstraintSizeOptions): T; 550 551 /** 552 * align 553 * 554 * @param { Alignment } alignType - Indicates the align type of the security component. 555 * @returns { T } Returns the attribute of the security component. 556 * @syscap SystemCapability.ArkUI.ArkUI.Full 557 * @atomicservice 558 * @since 15 559 */ 560 align(alignType: Alignment): T; 561 562 /** 563 * Specifies the alignRules of relative container 564 * 565 * @param { AlignRuleOption } alignRule 566 * @returns { T } Returns the attribute of the security component. 567 * @syscap SystemCapability.ArkUI.ArkUI.Full 568 * @atomicservice 569 * @since 15 570 */ 571 alignRules(alignRule: AlignRuleOption): T; 572 573 /** 574 * Specifies the localized alignRules of relative container 575 * 576 * @param { LocalizedAlignRuleOptions } alignRule 577 * @returns { T } Returns the attribute of the security component. 578 * @syscap SystemCapability.ArkUI.ArkUI.Full 579 * @atomicservice 580 * @since 15 581 */ 582 alignRules(alignRule: LocalizedAlignRuleOptions): T; 583 584 /** 585 * Id. User can set an id to the component to identify it. 586 * 587 * @param { string } description 588 * @returns { T } Returns the attribute of the security component. 589 * @syscap SystemCapability.ArkUI.ArkUI.Full 590 * @atomicservice 591 * @since 15 592 */ 593 id(description: string): T; 594 595 /** 596 * Specifies the direction and style of chain in relative container 597 * 598 * @param { Axis } direction - Indicates direction of the chain 599 * @param { ChainStyle } style - Indicates style of the chain 600 * @returns { T } Returns the attribute of the security component. 601 * @syscap SystemCapability.ArkUI.ArkUI.Full 602 * @atomicservice 603 * @since 15 604 */ 605 chainMode(direction: Axis, style: ChainStyle): T; 606 607 /** 608 * Sets the minimum font scale factor for text. 609 * 610 * @param { number | Resource } scale Minimum font scale factor to set. 611 * @returns { T } Returns the attributes of the security component. 612 * @syscap SystemCapability.ArkUI.ArkUI.Full 613 * @atomicservice 614 * @since 18 615 */ 616 minFontScale(scale: number | Resource): T; 617 618 /** 619 * Sets the maximum font scale factor for text. 620 * 621 * @param { number | Resource } scale Maximum font scale factor to set. 622 * @returns { T } Returns the attributes of the security component. 623 * @syscap SystemCapability.ArkUI.ArkUI.Full 624 * @atomicservice 625 * @since 18 626 */ 627 maxFontScale(scale: number | Resource): T; 628 629 /** 630 * Called when the maximum number of lines of text is set. 631 * 632 * @param { number } line 633 * @returns { T } Returns the attribute of the security component. 634 * @syscap SystemCapability.ArkUI.ArkUI.Full 635 * @atomicservice 636 * @since 18 637 */ 638 /** 639 * Called when the maximum number of lines of text is set. 640 * 641 * @param { number | Resource } line 642 * @returns { T } Returns the attribute of the security component. 643 * @syscap SystemCapability.ArkUI.ArkUI.Full 644 * @atomicservice 645 * @since 20 646 */ 647 maxLines(line: number | Resource): T; 648 649 /** 650 * Called when the minimum font size of the font is set. 651 * 652 * @param { number | string | Resource } minSize 653 * @returns { T } Returns the attribute of the security component. 654 * @syscap SystemCapability.ArkUI.ArkUI.Full 655 * @atomicservice 656 * @since 18 657 */ 658 minFontSize(minSize: number | string | Resource): T; 659 660 /** 661 * Called when the maximum font size of the font is set. 662 * 663 * @param { number | string | Resource } maxSize 664 * @returns { T } Returns the attribute of the security component. 665 * @syscap SystemCapability.ArkUI.ArkUI.Full 666 * @atomicservice 667 * @since 18 668 */ 669 maxFontSize(maxSize: number | string | Resource): T; 670 671 /** 672 * Called when the height adaptive policy is set. 673 * 674 * @param { TextHeightAdaptivePolicy } policy - The height adaptive policy. 675 * @returns { T } Returns the attribute of the security component. 676 * @syscap SystemCapability.ArkUI.ArkUI.Full 677 * @atomicservice 678 * @since 18 679 */ 680 heightAdaptivePolicy(policy: TextHeightAdaptivePolicy): T; 681 682 /** 683 * If the value is true, the component is available and can respond to operations such as clicking. 684 * If it is set to false, click operations are not responded. 685 * 686 * @param { boolean } respond - Indicates whether the button is responded to. 687 * @returns { T } Returns the attribute of the security component. 688 * @syscap SystemCapability.ArkUI.ArkUI.Full 689 * @atomicservice 690 * @since 18 691 */ 692 enabled(respond: boolean): T; 693} 694