1/* 2 * Copyright (c) 2024 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 * StyledString 23 * 24 * @syscap SystemCapability.ArkUI.ArkUI.Full 25 * @crossplatform 26 * @atomicservice 27 * @since 12 28 */ 29declare class StyledString { 30 /** 31 * constructor. 32 * 33 * @param { string | ImageAttachment | CustomSpan } value - indicates the current object value of the StyledString. 34 * @param { Array<StyleOptions> } [styles] - indicates the SpanStyle objects. 35 * @syscap SystemCapability.ArkUI.ArkUI.Full 36 * @crossplatform 37 * @atomicservice 38 * @since 12 39 */ 40 constructor(value: string | ImageAttachment | CustomSpan, styles?: Array<StyleOptions>); 41 42 /** 43 * Get the length of the StyledString's characters. 44 * 45 * @type { number } - the length of the StyledString's characters. 46 * @readonly 47 * @syscap SystemCapability.ArkUI.ArkUI.Full 48 * @crossplatform 49 * @atomicservice 50 * @since 12 51 */ 52 readonly length: number; 53 54 /** 55 * Get the literal content of the StyledString. 56 * 57 * @returns { string } - the literal content of the StyledString 58 * @syscap SystemCapability.ArkUI.ArkUI.Full 59 * @crossplatform 60 * @atomicservice 61 * @since 12 62 */ 63 getString(): string; 64 65 /** 66 * Get the attribute objects of the subStyledString. 67 * 68 * @param { number } start - the start position of the subStyledString. 69 * @param { number } length - the length of the subStyledString's characters. 70 * @param { StyledStringKey } [styledKey] - the specified type. 71 * @returns { Array<SpanStyle> } 72 * @throws { BusinessError } 401 - Parameter error. Possible causes: 73 * <br> 1. Mandatory parameters are left unspecified. 74 * <br> 2. Incorrect parameters types. 75 * <br> 3. Parameter verification failed. 76 * @syscap SystemCapability.ArkUI.ArkUI.Full 77 * @crossplatform 78 * @atomicservice 79 * @since 12 80 */ 81 getStyles(start: number, length: number, styledKey?: StyledStringKey): Array<SpanStyle>; 82 83 /** 84 * Judge if two attribute strings are equal. 85 * 86 * @param { StyledString } other - another StyledString. 87 * @returns { boolean } 88 * @syscap SystemCapability.ArkUI.ArkUI.Full 89 * @crossplatform 90 * @atomicservice 91 * @since 12 92 */ 93 equals(other: StyledString): boolean; 94 95 /** 96 * Get the substring of the StyledString. 97 * 98 * @param { number } start - the start position of the subStyledString. 99 * @param { number } [length] - the length of the subStyledString's characters. 100 * @returns { StyledString } 101 * @throws { BusinessError } 401 - Parameter error. Possible causes: 102 * <br> 1. Mandatory parameters are left unspecified. 103 * <br> 2. Incorrect parameters types. 104 * <br> 3. Parameter verification failed. 105 * @syscap SystemCapability.ArkUI.ArkUI.Full 106 * @crossplatform 107 * @atomicservice 108 * @since 12 109 */ 110 subStyledString(start: number, length?: number): StyledString; 111 112 /** 113 * Returns StyledString from the provided HTML string. 114 * 115 * @param { string } html - the html text will be converted to a StyledString. 116 * @returns { Promise<StyledString> } 117 * @throws { BusinessError } 401 - Parameter error. Possible causes: 118 * <br> 1. Mandatory parameters are left unspecified. 119 * <br> 2. Incorrect parameters types. 120 * <br> 3. Parameter verification failed. 121 * @syscap SystemCapability.ArkUI.ArkUI.Full 122 * @atomicservice 123 * @since 12 124 */ 125 static fromHtml(html: string): Promise<StyledString>; 126 127 /** 128 * Returns HTML string from the provided StyledString. 129 * 130 * @param { StyledString } styledString - the StyledString will be converted to a HTML string. 131 * @returns { string } 132 * @throws { BusinessError } 401 - Parameter error. Possible causes: 133 * <br> 1. Mandatory parameters are left unspecified. 134 * <br> 2. Incorrect parameters types. 135 * <br> 3. Parameter verification failed. 136 * @syscap SystemCapability.ArkUI.ArkUI.Full 137 * @crossplatform 138 * @atomicservice 139 * @since 14 140 */ 141 static toHtml(styledString: StyledString): string; 142 143 /** 144 * Returns ArrayBuffer from the serialized styled string. 145 * 146 * @param { StyledString } styledString - StyledString parameter. 147 * @returns { ArrayBuffer } 148 * @syscap SystemCapability.ArkUI.ArkUI.Full 149 * @systemapi 150 * @since 13 151 */ 152 static marshalling(styledString: StyledString): ArrayBuffer; 153 154 /** 155 * Returns StyledString from the deserialized ArrayBuffer. 156 * 157 * @param { ArrayBuffer } buffer - The buffer will be deserialized to a StyledString. 158 * @returns { Promise<StyledString> } 159 * @throws { BusinessError } 401 - Parameter error. Possible causes: 160 * <br> 1. Mandatory parameters are left unspecified. 161 * <br> 2. Incorrect parameters types. 162 * <br> 3. Parameter verification failed. 163 * @syscap SystemCapability.ArkUI.ArkUI.Full 164 * @systemapi 165 * @since 13 166 */ 167 static unmarshalling(buffer: ArrayBuffer): Promise<StyledString>; 168} 169 170/** 171 * StyleOptions 172 * 173 * @interface StyleOptions 174 * @syscap SystemCapability.ArkUI.ArkUI.Full 175 * @crossplatform 176 * @atomicservice 177 * @since 12 178 */ 179declare interface StyleOptions { 180 /** 181 * The start position of the StyleOptions. 182 * 183 * @type { ?number } 184 * @syscap SystemCapability.ArkUI.ArkUI.Full 185 * @crossplatform 186 * @atomicservice 187 * @since 12 188 */ 189 start?: number; 190 191 /** 192 * The length of the modifiedStyledString's characters. 193 * 194 * @type { ?number } 195 * @syscap SystemCapability.ArkUI.ArkUI.Full 196 * @crossplatform 197 * @atomicservice 198 * @since 12 199 */ 200 length?: number; 201 202 /** 203 * The attribute key of the StyleOptions. 204 * 205 * @type { StyledStringKey } 206 * @syscap SystemCapability.ArkUI.ArkUI.Full 207 * @crossplatform 208 * @atomicservice 209 * @since 12 210 */ 211 styledKey: StyledStringKey; 212 213 /** 214 * The attribute value of the StyleOptions. 215 * 216 * @type { StyledStringValue } 217 * @syscap SystemCapability.ArkUI.ArkUI.Full 218 * @crossplatform 219 * @atomicservice 220 * @since 12 221 */ 222 styledValue: StyledStringValue; 223} 224 225/** 226 * SpanStyle 227 * 228 * @interface SpanStyle 229 * @syscap SystemCapability.ArkUI.ArkUI.Full 230 * @crossplatform 231 * @atomicservice 232 * @since 12 233 */ 234declare interface SpanStyle { 235 /** 236 * The start position of the SpanStyle. 237 * 238 * @type { number } 239 * @syscap SystemCapability.ArkUI.ArkUI.Full 240 * @crossplatform 241 * @atomicservice 242 * @since 12 243 */ 244 start: number; 245 246 /** 247 * The length of the modifiedStyledString's characters. 248 * 249 * @type { number } 250 * @syscap SystemCapability.ArkUI.ArkUI.Full 251 * @crossplatform 252 * @atomicservice 253 * @since 12 254 */ 255 length: number; 256 257 /** 258 * The attribute key of the SpanStyle. 259 * 260 * @type { StyledStringKey } 261 * @syscap SystemCapability.ArkUI.ArkUI.Full 262 * @crossplatform 263 * @atomicservice 264 * @since 12 265 */ 266 styledKey: StyledStringKey; 267 268 /** 269 * The attribute value of the SpanStyle. 270 * 271 * @type { StyledStringValue } 272 * @syscap SystemCapability.ArkUI.ArkUI.Full 273 * @crossplatform 274 * @atomicservice 275 * @since 12 276 */ 277 styledValue: StyledStringValue; 278} 279 280/** 281 * Defines TextStyle. 282 * 283 * @syscap SystemCapability.ArkUI.ArkUI.Full 284 * @crossplatform 285 * @atomicservice 286 * @since 12 287 */ 288declare class TextStyle { 289 290 /** 291 * constructor. 292 * 293 * @param { TextStyleInterface } [value] - font property object. 294 * @syscap SystemCapability.ArkUI.ArkUI.Full 295 * @crossplatform 296 * @atomicservice 297 * @since 12 298 */ 299 constructor(value?: TextStyleInterface); 300 301 /** 302 * Get the fontColor of the StyledString. 303 * 304 * @type { ?ResourceColor } - the set fontColor of the StyledString or undefined 305 * @readonly 306 * @syscap SystemCapability.ArkUI.ArkUI.Full 307 * @crossplatform 308 * @atomicservice 309 * @since 12 310 */ 311 readonly fontColor?: ResourceColor; 312 313 /** 314 * Get the fontFamily of the StyledString. 315 * 316 * @type { ?string } - the fontFamily of the StyledString or undefined 317 * @readonly 318 * @syscap SystemCapability.ArkUI.ArkUI.Full 319 * @crossplatform 320 * @atomicservice 321 * @since 12 322 */ 323 readonly fontFamily?: string; 324 325 /** 326 * Get the fontSize of the StyledString. 327 * If not undefined, the unit is vp. 328 * 329 * @type { ?number } - the fontSize of the StyledString or undefined 330 * @readonly 331 * @syscap SystemCapability.ArkUI.ArkUI.Full 332 * @crossplatform 333 * @atomicservice 334 * @since 12 335 */ 336 readonly fontSize?: number; 337 338 /** 339 * Get the fontWeight of the StyledString. 340 * 341 * @type { ?number } - the fontWeight of the StyledString or undefined 342 * @readonly 343 * @syscap SystemCapability.ArkUI.ArkUI.Full 344 * @crossplatform 345 * @atomicservice 346 * @since 12 347 */ 348 readonly fontWeight?: number; 349 350 /** 351 * Get the fontStyle of the StyledString. 352 * 353 * @type { ?FontStyle } - the fontStyle of the StyledString or undefined 354 * @readonly 355 * @syscap SystemCapability.ArkUI.ArkUI.Full 356 * @crossplatform 357 * @atomicservice 358 * @since 12 359 */ 360 readonly fontStyle?: FontStyle; 361} 362 363/** 364 * TextStyleInterface 365 * 366 * @interface TextStyleInterface 367 * @syscap SystemCapability.ArkUI.ArkUI.Full 368 * @crossplatform 369 * @atomicservice 370 * @since 12 371 */ 372declare interface TextStyleInterface { 373 /** 374 * The fontColor value of the font property object. 375 * 376 * @type { ?ResourceColor } 377 * @syscap SystemCapability.ArkUI.ArkUI.Full 378 * @crossplatform 379 * @atomicservice 380 * @since 12 381 */ 382 fontColor?: ResourceColor; 383 384 /** 385 * The fontFamily value of the font property object. 386 * 387 * @type { ?ResourceStr } 388 * @syscap SystemCapability.ArkUI.ArkUI.Full 389 * @crossplatform 390 * @atomicservice 391 * @since 12 392 */ 393 fontFamily?: ResourceStr; 394 395 /** 396 * The fontSize value of the font property object. 397 * 398 * @type { ?LengthMetrics } 399 * @syscap SystemCapability.ArkUI.ArkUI.Full 400 * @crossplatform 401 * @atomicservice 402 * @since 12 403 */ 404 fontSize?: LengthMetrics; 405 406 /** 407 * The fontWeight value of the font property object. 408 * 409 * @type { ?(number | FontWeight | string) } 410 * @syscap SystemCapability.ArkUI.ArkUI.Full 411 * @crossplatform 412 * @atomicservice 413 * @since 12 414 */ 415 fontWeight?: number | FontWeight | string; 416 417 /** 418 * The fontStyle value of the font property object. 419 * 420 * @type { ?FontStyle } 421 * @syscap SystemCapability.ArkUI.ArkUI.Full 422 * @crossplatform 423 * @atomicservice 424 * @since 12 425 */ 426 fontStyle?: FontStyle; 427} 428 429/** 430 * Defines DecorationStyle. 431 * 432 * @syscap SystemCapability.ArkUI.ArkUI.Full 433 * @crossplatform 434 * @atomicservice 435 * @since 12 436 */ 437declare class DecorationStyle { 438 439 /** 440 * constructor. 441 * 442 * @param { DecorationStyleInterface } value - text decoration value. 443 * @syscap SystemCapability.ArkUI.ArkUI.Full 444 * @crossplatform 445 * @atomicservice 446 * @since 12 447 */ 448 constructor(value: DecorationStyleInterface); 449 450 /** 451 * Get the text decoration type of the StyledString. 452 * 453 * @type { TextDecorationType } - the decoration type of the StyledString 454 * @readonly 455 * @syscap SystemCapability.ArkUI.ArkUI.Full 456 * @crossplatform 457 * @atomicservice 458 * @since 12 459 */ 460 readonly type: TextDecorationType; 461 462 /** 463 * Get the decorationColor of the StyledString. 464 * 465 * @type { ?ResourceColor } - the decorationColor of the StyledString or undefined 466 * @readonly 467 * @syscap SystemCapability.ArkUI.ArkUI.Full 468 * @crossplatform 469 * @atomicservice 470 * @since 12 471 */ 472 readonly color?: ResourceColor; 473 474 /** 475 * Get the decorationStyle of the StyledString. 476 * 477 * @type { ?TextDecorationStyle } - the decorationStyle of the StyledString or undefined 478 * @readonly 479 * @syscap SystemCapability.ArkUI.ArkUI.Full 480 * @crossplatform 481 * @atomicservice 482 * @since 12 483 */ 484 readonly style?: TextDecorationStyle; 485} 486 487/** 488 * DecorationStyleInterface 489 * 490 * @interface DecorationStyleInterface 491 * @syscap SystemCapability.ArkUI.ArkUI.Full 492 * @crossplatform 493 * @atomicservice 494 * @since 12 495 */ 496declare interface DecorationStyleInterface { 497 /** 498 * The type value of the decoration property object. 499 * 500 * @type { TextDecorationType } 501 * @syscap SystemCapability.ArkUI.ArkUI.Full 502 * @crossplatform 503 * @atomicservice 504 * @since 12 505 */ 506 type: TextDecorationType; 507 508 /** 509 * The color value of the decoration property object. 510 * 511 * @type { ?ResourceColor } 512 * @syscap SystemCapability.ArkUI.ArkUI.Full 513 * @crossplatform 514 * @atomicservice 515 * @since 12 516 */ 517 color?: ResourceColor; 518 519 /** 520 * The style value of the decoration property object. 521 * 522 * @type { ?TextDecorationStyle } 523 * @syscap SystemCapability.ArkUI.ArkUI.Full 524 * @crossplatform 525 * @atomicservice 526 * @since 12 527 */ 528 style?: TextDecorationStyle; 529} 530 531/** 532 * Defines BaselineOffsetStyle. 533 * 534 * @syscap SystemCapability.ArkUI.ArkUI.Full 535 * @crossplatform 536 * @atomicservice 537 * @since 12 538 */ 539declare class BaselineOffsetStyle { 540 541 /** 542 * constructor. 543 * 544 * @param { LengthMetrics } value - baseline offset value. 545 * @syscap SystemCapability.ArkUI.ArkUI.Full 546 * @crossplatform 547 * @atomicservice 548 * @since 12 549 */ 550 constructor(value: LengthMetrics); 551 552 /** 553 * Get the baselineOffset value of the StyledString. 554 * The unit is vp. 555 * 556 * @type { number } - the baselineOffset value of the StyledString 557 * @readonly 558 * @syscap SystemCapability.ArkUI.ArkUI.Full 559 * @crossplatform 560 * @atomicservice 561 * @since 12 562 */ 563 readonly baselineOffset: number; 564} 565 566/** 567 * Defines LetterSpacingStyle. 568 * 569 * @syscap SystemCapability.ArkUI.ArkUI.Full 570 * @crossplatform 571 * @atomicservice 572 * @since 12 573 */ 574declare class LetterSpacingStyle { 575 576 /** 577 * constructor. 578 * 579 * @param { LengthMetrics } value - letter space value. 580 * @syscap SystemCapability.ArkUI.ArkUI.Full 581 * @crossplatform 582 * @atomicservice 583 * @since 12 584 */ 585 constructor(value: LengthMetrics); 586 587 /** 588 * Get the letterSpacing value of the StyledString. 589 * The unit is vp. 590 * 591 * @type { number } - the letterSpacing value of the StyledString 592 * @readonly 593 * @syscap SystemCapability.ArkUI.ArkUI.Full 594 * @crossplatform 595 * @atomicservice 596 * @since 12 597 */ 598 readonly letterSpacing: number; 599} 600 601/** 602 * Defines TextShadowStyle. 603 * 604 * @syscap SystemCapability.ArkUI.ArkUI.Full 605 * @crossplatform 606 * @atomicservice 607 * @since 12 608 */ 609declare class TextShadowStyle { 610 611 /** 612 * constructor. 613 * 614 * @param { ShadowOptions | Array<ShadowOptions> } value - text shadow value. 615 * @syscap SystemCapability.ArkUI.ArkUI.Full 616 * @crossplatform 617 * @atomicservice 618 * @since 12 619 */ 620 constructor(value: ShadowOptions | Array<ShadowOptions>); 621 622 /** 623 * Get the textShadow value of the StyledString. 624 * 625 * @type { Array<ShadowOptions> } - the textShadow value of the StyledString 626 * @readonly 627 * @syscap SystemCapability.ArkUI.ArkUI.Full 628 * @crossplatform 629 * @atomicservice 630 * @since 12 631 */ 632 readonly textShadow: Array<ShadowOptions>; 633} 634 635/** 636 * Defines Sets the property string background color. 637 * 638 * @syscap SystemCapability.ArkUI.ArkUI.Full 639 * @crossplatform 640 * @atomicservice 641 * @since 14 642 */ 643declare class BackgroundColorStyle { 644 645 /** 646 * constructor. 647 * 648 * @param { TextBackgroundStyle } textBackgroundStyle - textBackgroundStyle value. 649 * @syscap SystemCapability.ArkUI.ArkUI.Full 650 * @crossplatform 651 * @atomicservice 652 * @since 14 653 */ 654 constructor(textBackgroundStyle: TextBackgroundStyle); 655 656 /** 657 * Get the textBackgroundStyle value of the StyledString. 658 * 659 * @type { TextBackgroundStyle } - the textBackgroundStyle value of the StyledString 660 * @readonly 661 * @syscap SystemCapability.ArkUI.ArkUI.Full 662 * @crossplatform 663 * @atomicservice 664 * @since 14 665 */ 666 readonly textBackgroundStyle: TextBackgroundStyle; 667} 668 669/** 670 * Defines GestureStyle. 671 * 672 * @syscap SystemCapability.ArkUI.ArkUI.Full 673 * @crossplatform 674 * @atomicservice 675 * @since 12 676 */ 677declare class GestureStyle { 678 679 /** 680 * constructor. 681 * 682 * @param { GestureStyleInterface } [value] - gesture event object. 683 * @syscap SystemCapability.ArkUI.ArkUI.Full 684 * @crossplatform 685 * @atomicservice 686 * @since 12 687 */ 688 constructor(value?: GestureStyleInterface); 689} 690 691/** 692 * Defines the Gesture Events. 693 * 694 * @interface GestureStyleInterface 695 * @syscap SystemCapability.ArkUI.ArkUI.Full 696 * @crossplatform 697 * @atomicservice 698 * @since 12 699 */ 700declare interface GestureStyleInterface { 701 /** 702 * Trigger a click event when a click is clicked. 703 * 704 * @type { ?Callback<ClickEvent> } 705 * @syscap SystemCapability.ArkUI.ArkUI.Full 706 * @crossplatform 707 * @atomicservice 708 * @since 12 709 */ 710 onClick?: Callback<ClickEvent>; 711 712 /** 713 * Trigger a gesture event when long press event is complete. 714 * 715 * @type { ?Callback<GestureEvent> } 716 * @syscap SystemCapability.ArkUI.ArkUI.Full 717 * @crossplatform 718 * @atomicservice 719 * @since 12 720 */ 721 onLongPress?: Callback<GestureEvent>; 722} 723 724/** 725 * Defines ParagraphStyle. 726 * 727 * @syscap SystemCapability.ArkUI.ArkUI.Full 728 * @crossplatform 729 * @atomicservice 730 * @since 12 731 */ 732declare class ParagraphStyle { 733 734 /** 735 * constructor. 736 * 737 * @param { ParagraphStyleInterface } [value] - paragraph property object. 738 * @syscap SystemCapability.ArkUI.ArkUI.Full 739 * @crossplatform 740 * @atomicservice 741 * @since 12 742 */ 743 constructor(value?: ParagraphStyleInterface); 744 745 /** 746 * Get the text alignment of the StyledString. 747 * 748 * @type { ?TextAlign } - the text alignment of the StyledString or undefined 749 * @readonly 750 * @syscap SystemCapability.ArkUI.ArkUI.Full 751 * @crossplatform 752 * @atomicservice 753 * @since 12 754 */ 755 readonly textAlign?: TextAlign; 756 757 /** 758 * Get the first line indentation of the StyledString. 759 * The unit is vp. 760 * 761 * @type { ?number } - the first line indentation of the StyledString or undefined 762 * @readonly 763 * @syscap SystemCapability.ArkUI.ArkUI.Full 764 * @crossplatform 765 * @atomicservice 766 * @since 12 767 */ 768 readonly textIndent?: number; 769 770 /** 771 * Get the maximum number of lines of the StyledString. 772 * 773 * @type { ?number } - the maximum number of the StyledString or undefined 774 * @readonly 775 * @syscap SystemCapability.ArkUI.ArkUI.Full 776 * @crossplatform 777 * @atomicservice 778 * @since 12 779 */ 780 readonly maxLines?: number; 781 782 /** 783 * Get the overflow mode of the StyledString. 784 * 785 * @type { ?TextOverflow } - the overflow mode of the StyledString or undefined 786 * @readonly 787 * @syscap SystemCapability.ArkUI.ArkUI.Full 788 * @crossplatform 789 * @atomicservice 790 * @since 12 791 */ 792 readonly overflow?: TextOverflow; 793 794 /** 795 * Get the wordBreak mode of the StyledString. 796 * 797 * @type { ?WordBreak } - the wordBreak mode of the StyledString or undefined 798 * @readonly 799 * @syscap SystemCapability.ArkUI.ArkUI.Full 800 * @crossplatform 801 * @atomicservice 802 * @since 12 803 */ 804 readonly wordBreak?: WordBreak; 805 806 /** 807 * Get the leading margin of the StyledString. 808 * 809 * @type { ?(number | LeadingMarginPlaceholder) } - the leading margin of the StyledString or undefined 810 * @readonly 811 * @syscap SystemCapability.ArkUI.ArkUI.Full 812 * @crossplatform 813 * @atomicservice 814 * @since 12 815 */ 816 readonly leadingMargin?: number | LeadingMarginPlaceholder; 817} 818 819/** 820 * ParagraphStyleInterface 821 * 822 * @interface ParagraphStyleInterface 823 * @syscap SystemCapability.ArkUI.ArkUI.Full 824 * @crossplatform 825 * @atomicservice 826 * @since 12 827 */ 828declare interface ParagraphStyleInterface { 829 /** 830 * Alignment of text. 831 * 832 * @type { ?TextAlign } 833 * @syscap SystemCapability.ArkUI.ArkUI.Full 834 * @crossplatform 835 * @atomicservice 836 * @since 12 837 */ 838 textAlign?: TextAlign; 839 840 /** 841 * Set the first line indentation. 842 * 843 * @type { ?LengthMetrics } 844 * @syscap SystemCapability.ArkUI.ArkUI.Full 845 * @crossplatform 846 * @atomicservice 847 * @since 12 848 */ 849 textIndent?: LengthMetrics; 850 851 /** 852 * The maximum number of lines of content. 853 * 854 * @type { ?number } 855 * @syscap SystemCapability.ArkUI.ArkUI.Full 856 * @crossplatform 857 * @atomicservice 858 * @since 12 859 */ 860 maxLines?: number; 861 862 /** 863 * The overflow mode of the content. 864 * 865 * @type { ?TextOverflow } 866 * @syscap SystemCapability.ArkUI.ArkUI.Full 867 * @crossplatform 868 * @atomicservice 869 * @since 12 870 */ 871 overflow?: TextOverflow; 872 873 /** 874 * Set word break type. 875 * 876 * @type { ?WordBreak } 877 * @syscap SystemCapability.ArkUI.ArkUI.Full 878 * @crossplatform 879 * @atomicservice 880 * @since 12 881 */ 882 wordBreak?: WordBreak; 883 884 /** 885 * Leading margin. 886 * 887 * @type { ?(LengthMetrics | LeadingMarginPlaceholder) } 888 * @syscap SystemCapability.ArkUI.ArkUI.Full 889 * @crossplatform 890 * @atomicservice 891 * @since 12 892 */ 893 leadingMargin?: LengthMetrics | LeadingMarginPlaceholder; 894} 895 896/** 897 * Defines LineHeightStyle. 898 * 899 * @syscap SystemCapability.ArkUI.ArkUI.Full 900 * @crossplatform 901 * @atomicservice 902 * @since 12 903 */ 904declare class LineHeightStyle { 905 906 /** 907 * constructor. 908 * 909 * @param { LengthMetrics } lineHeight - line height value. 910 * @syscap SystemCapability.ArkUI.ArkUI.Full 911 * @crossplatform 912 * @atomicservice 913 * @since 12 914 */ 915 constructor(lineHeight: LengthMetrics); 916 917 /** 918 * Get the lineHeight value of the StyledString. 919 * The unit is vp. 920 * 921 * @type { number } - the lineHeight value of the StyledString 922 * @readonly 923 * @syscap SystemCapability.ArkUI.ArkUI.Full 924 * @crossplatform 925 * @atomicservice 926 * @since 12 927 */ 928 readonly lineHeight: number; 929} 930 931/** 932 * Defines the URLStyle hyperlink that allows setting a URL string. When clicking on the text to 933 * which the span is attached, the URLStyle will try to open the URL. 934 * 935 * @syscap SystemCapability.ArkUI.ArkUI.Full 936 * @crossplatform 937 * @atomicservice 938 * @since 14 939 */ 940declare class UrlStyle { 941 942 /** 943 * Constructor. 944 * 945 * @param { string } url - URL value. 946 * @syscap SystemCapability.ArkUI.ArkUI.Full 947 * @crossplatform 948 * @atomicservice 949 * @since 14 950 */ 951 constructor(url: string); 952 953 /** 954 * Get the URL value of the StyledString. 955 * 956 * @type { string } - the URL value of the StyledString 957 * @readonly 958 * @syscap SystemCapability.ArkUI.ArkUI.Full 959 * @crossplatform 960 * @atomicservice 961 * @since 14 962 */ 963 readonly url: string; 964} 965 966/** 967 * Defines the Span Type. 968 * 969 * @typedef { TextStyle | DecorationStyle | BaselineOffsetStyle | LetterSpacingStyle | TextShadowStyle | 970 * GestureStyle | ImageAttachment | ParagraphStyle | LineHeightStyle | CustomSpan | 971 * UserDataSpan } StyledStringValue 972 * @syscap SystemCapability.ArkUI.ArkUI.Full 973 * @crossplatform 974 * @atomicservice 975 * @since 12 976 */ 977 978/** 979 * Defines the Span Type. 980 * 981 * @typedef { TextStyle | DecorationStyle | BaselineOffsetStyle | LetterSpacingStyle | TextShadowStyle | 982 * GestureStyle | ImageAttachment | ParagraphStyle | LineHeightStyle | UrlStyle | CustomSpan | 983 * UserDataSpan | BackgroundColorStyle } StyledStringValue 984 * @syscap SystemCapability.ArkUI.ArkUI.Full 985 * @crossplatform 986 * @atomicservice 987 * @since 14 988 */ 989declare type StyledStringValue = TextStyle | DecorationStyle | BaselineOffsetStyle | LetterSpacingStyle | 990TextShadowStyle | GestureStyle | ImageAttachment | ParagraphStyle | LineHeightStyle | UrlStyle | CustomSpan | 991UserDataSpan | BackgroundColorStyle; 992 993/** 994 * MutableStyledString 995 * 996 * @extends StyledString 997 * @syscap SystemCapability.ArkUI.ArkUI.Full 998 * @crossplatform 999 * @atomicservice 1000 * @since 12 1001 */ 1002declare class MutableStyledString extends StyledString { 1003 /** 1004 * Replace the string of the specified range. 1005 * 1006 * @param { number } start - the start position of the replacedString. 1007 * @param { number } length - the length of the replacedString's characters. 1008 * @param { string } other - must be unicode string. 1009 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1010 * <br> 1. Mandatory parameters are left unspecified. 1011 * <br> 2. Incorrect parameters types. 1012 * <br> 3. Parameter verification failed. 1013 * @syscap SystemCapability.ArkUI.ArkUI.Full 1014 * @crossplatform 1015 * @atomicservice 1016 * @since 12 1017 */ 1018 replaceString(start: number, length: number, other: string): void; 1019 1020 /** 1021 * Insert the string at the specified location. 1022 * 1023 * @param { number } start - the start position of the insertedString. 1024 * @param { string } other - must be unicode string. 1025 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1026 * <br> 1. Mandatory parameters are left unspecified. 1027 * <br> 2. Incorrect parameters types. 1028 * <br> 3. Parameter verification failed. 1029 * @syscap SystemCapability.ArkUI.ArkUI.Full 1030 * @crossplatform 1031 * @atomicservice 1032 * @since 12 1033 */ 1034 insertString(start: number, other: string): void; 1035 1036 /** 1037 * Remove the string of the specified range. 1038 * 1039 * @param { number } start - the start position of the removedString. 1040 * @param { number } length - the length of the removedString's characters. 1041 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1042 * <br> 1. Mandatory parameters are left unspecified. 1043 * <br> 2. Incorrect parameters types. 1044 * <br> 3. Parameter verification failed. 1045 * @syscap SystemCapability.ArkUI.ArkUI.Full 1046 * @crossplatform 1047 * @atomicservice 1048 * @since 12 1049 */ 1050 removeString(start: number, length: number): void; 1051 1052 /** 1053 * Replace the specified range string attribute. 1054 * 1055 * @param { SpanStyle } spanStyle - the SpanStyle Object. 1056 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1057 * <br> 1. Mandatory parameters are left unspecified. 1058 * <br> 2. Incorrect parameters types. 1059 * <br> 3. Parameter verification failed. 1060 * @syscap SystemCapability.ArkUI.ArkUI.Full 1061 * @crossplatform 1062 * @atomicservice 1063 * @since 12 1064 */ 1065 replaceStyle(spanStyle: SpanStyle): void; 1066 1067 /** 1068 * Add attributes to the specified range string. 1069 * 1070 * @param { SpanStyle } spanStyle - the SpanStyle Object. 1071 * @throws { BusinessError } 401 - The parameter check failed. 1072 * @syscap SystemCapability.ArkUI.ArkUI.Full 1073 * @crossplatform 1074 * @atomicservice 1075 * @since 12 1076 */ 1077 setStyle(spanStyle: SpanStyle): void; 1078 1079 /** 1080 * Delete the specified type attributes for the specified range string. 1081 * 1082 * @param { number } start - the start position of the removedAttributeStyledString. 1083 * @param { number } length - the length of the removedAttributeStyledString's characters. 1084 * @param { StyledStringKey } styledKey - the specified attribute type's key. 1085 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1086 * <br> 1. Mandatory parameters are left unspecified. 1087 * <br> 2. Incorrect parameters types. 1088 * <br> 3. Parameter verification failed. 1089 * @syscap SystemCapability.ArkUI.ArkUI.Full 1090 * @crossplatform 1091 * @atomicservice 1092 * @since 12 1093 */ 1094 removeStyle(start: number, length: number, styledKey: StyledStringKey): void; 1095 1096 /** 1097 * Delete all attributes for the specified range styledString. 1098 * 1099 * @param { number } start - the start position of the attributeRemovedStyledString's characters. 1100 * @param { number } length - the length of the attributeRemovedStyledString's characters. 1101 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1102 * <br> 1. Mandatory parameters are left unspecified. 1103 * <br> 2. Incorrect parameters types. 1104 * <br> 3. Parameter verification failed. 1105 * @syscap SystemCapability.ArkUI.ArkUI.Full 1106 * @crossplatform 1107 * @atomicservice 1108 * @since 12 1109 */ 1110 removeStyles(start: number, length: number): void; 1111 1112 /** 1113 * Delete all attributes. 1114 * 1115 * @syscap SystemCapability.ArkUI.ArkUI.Full 1116 * @crossplatform 1117 * @atomicservice 1118 * @since 12 1119 */ 1120 clearStyles(): void; 1121 1122 /** 1123 * Replace the StyledString of the specified range. 1124 * 1125 * @param { number } start - the start position of the replacedStyledString. 1126 * @param { number } length - the length of the replacedStyledString's characters. 1127 * @param { StyledString } other - new StyledString. 1128 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1129 * <br> 1. Mandatory parameters are left unspecified. 1130 * <br> 2. Incorrect parameters types. 1131 * <br> 3. Parameter verification failed. 1132 * @syscap SystemCapability.ArkUI.ArkUI.Full 1133 * @crossplatform 1134 * @atomicservice 1135 * @since 12 1136 */ 1137 replaceStyledString(start: number, length: number, other: StyledString): void; 1138 1139 /** 1140 * Insert new StyledString at the specified location. 1141 * 1142 * @param { number } start - the start position of the insertedStyledString. 1143 * @param { StyledString } other - new StyledString. 1144 * @throws { BusinessError } 401 - Parameter error. Possible causes: 1145 * <br> 1. Mandatory parameters are left unspecified. 1146 * <br> 2. Incorrect parameters types. 1147 * <br> 3. Parameter verification failed. 1148 * @syscap SystemCapability.ArkUI.ArkUI.Full 1149 * @crossplatform 1150 * @atomicservice 1151 * @since 12 1152 */ 1153 insertStyledString(start: number, other: StyledString): void; 1154 1155 /** 1156 * Append new StyledString at the end. 1157 * 1158 * @param { StyledString } other - new StyledString. 1159 * @syscap SystemCapability.ArkUI.ArkUI.Full 1160 * @crossplatform 1161 * @atomicservice 1162 * @since 12 1163 */ 1164 appendStyledString(other: StyledString): void; 1165} 1166 1167 1168/** 1169 * the attribute type of the StyledString 1170 * 1171 * @enum { number } 1172 * @syscap SystemCapability.ArkUI.ArkUI.Full 1173 * @crossplatform 1174 * @atomicservice 1175 * @since 12 1176 */ 1177declare enum StyledStringKey { 1178 /** 1179 * The key of TextStyle. 1180 * 1181 * @syscap SystemCapability.ArkUI.ArkUI.Full 1182 * @crossplatform 1183 * @atomicservice 1184 * @since 12 1185 */ 1186 FONT = 0, 1187 1188 /** 1189 * The key of DecorationStyle. 1190 * 1191 * @syscap SystemCapability.ArkUI.ArkUI.Full 1192 * @crossplatform 1193 * @atomicservice 1194 * @since 12 1195 */ 1196 DECORATION = 1, 1197 1198 /** 1199 * The key of BaselineOffsetStyle. 1200 * 1201 * @syscap SystemCapability.ArkUI.ArkUI.Full 1202 * @crossplatform 1203 * @atomicservice 1204 * @since 12 1205 */ 1206 BASELINE_OFFSET = 2, 1207 1208 /** 1209 * The key of LetterSpacingStyle. 1210 * 1211 * @syscap SystemCapability.ArkUI.ArkUI.Full 1212 * @crossplatform 1213 * @atomicservice 1214 * @since 12 1215 */ 1216 LETTER_SPACING = 3, 1217 1218 /** 1219 * The key of TextShadowStyle. 1220 * 1221 * @syscap SystemCapability.ArkUI.ArkUI.Full 1222 * @crossplatform 1223 * @atomicservice 1224 * @since 12 1225 */ 1226 TEXT_SHADOW = 4, 1227 1228 /** 1229 * The key of LineHeightStyle. 1230 * 1231 * @syscap SystemCapability.ArkUI.ArkUI.Full 1232 * @crossplatform 1233 * @atomicservice 1234 * @since 12 1235 */ 1236 LINE_HEIGHT = 5, 1237 1238 /** 1239 * The key of BackgroundColorStyle. 1240 * 1241 * @syscap SystemCapability.ArkUI.ArkUI.Full 1242 * @crossplatform 1243 * @atomicservice 1244 * @since 14 1245 */ 1246 BACKGROUND_COLOR = 6, 1247 1248 /** 1249 * The key of UrlStyle. 1250 * 1251 * @syscap SystemCapability.ArkUI.ArkUI.Full 1252 * @crossplatform 1253 * @atomicservice 1254 * @since 14 1255 */ 1256 URL = 7, 1257 1258 /** 1259 * The key of GestureStyle. 1260 * 1261 * @syscap SystemCapability.ArkUI.ArkUI.Full 1262 * @crossplatform 1263 * @atomicservice 1264 * @since 12 1265 */ 1266 GESTURE = 100, 1267 1268 /** 1269 * The key of ParagraphStyle. 1270 * 1271 * @syscap SystemCapability.ArkUI.ArkUI.Full 1272 * @crossplatform 1273 * @atomicservice 1274 * @since 12 1275 */ 1276 PARAGRAPH_STYLE = 200, 1277 1278 /** 1279 * The key of ImageAttachment. 1280 * 1281 * @syscap SystemCapability.ArkUI.ArkUI.Full 1282 * @crossplatform 1283 * @atomicservice 1284 * @since 12 1285 */ 1286 IMAGE = 300, 1287 1288 /** 1289 * The key of CustomSpan. 1290 * 1291 * @syscap SystemCapability.ArkUI.ArkUI.Full 1292 * @crossplatform 1293 * @atomicservice 1294 * @since 12 1295 */ 1296 CUSTOM_SPAN = 400, 1297 1298 /** 1299 * The key of UserDataSpan. 1300 * 1301 * @syscap SystemCapability.ArkUI.ArkUI.Full 1302 * @crossplatform 1303 * @atomicservice 1304 * @since 12 1305 */ 1306 USER_DATA = 500, 1307} 1308 1309/** 1310 * Defines ImageAttachment. 1311 * 1312 * @syscap SystemCapability.ArkUI.ArkUI.Full 1313 * @crossplatform 1314 * @atomicservice 1315 * @since 12 1316 */ 1317declare class ImageAttachment { 1318 1319 /** 1320 * constructor. 1321 * 1322 * @param { ImageAttachmentInterface } value - image attachment object. 1323 * @syscap SystemCapability.ArkUI.ArkUI.Full 1324 * @crossplatform 1325 * @atomicservice 1326 * @since 12 1327 */ 1328 constructor(value: ImageAttachmentInterface); 1329 1330 /** 1331 * Get the image content of the StyledString. 1332 * 1333 * @type { PixelMap } - the image content of the StyledString or undefined 1334 * @readonly 1335 * @syscap SystemCapability.ArkUI.ArkUI.Full 1336 * @crossplatform 1337 * @atomicservice 1338 * @since 12 1339 */ 1340 readonly value: PixelMap; 1341 1342 /** 1343 * Get the imageSize of the StyledString. 1344 * 1345 * @type { ?SizeOptions } - the imageSize of the StyledString or undefined 1346 * @readonly 1347 * @syscap SystemCapability.ArkUI.ArkUI.Full 1348 * @crossplatform 1349 * @atomicservice 1350 * @since 12 1351 */ 1352 readonly size?: SizeOptions; 1353 1354 /** 1355 * Get the ImageSpanAlignment of the StyledString. 1356 * 1357 * @type { ?ImageSpanAlignment } - the ImageSpanAlignment of the StyledString or undefined 1358 * @readonly 1359 * @syscap SystemCapability.ArkUI.ArkUI.Full 1360 * @crossplatform 1361 * @atomicservice 1362 * @since 12 1363 */ 1364 readonly verticalAlign?: ImageSpanAlignment; 1365 1366 /** 1367 * Get the imageFit of the StyledString. 1368 * 1369 * @type { ?ImageFit } - the imageFit of the StyledString or undefined 1370 * @readonly 1371 * @syscap SystemCapability.ArkUI.ArkUI.Full 1372 * @crossplatform 1373 * @atomicservice 1374 * @since 12 1375 */ 1376 readonly objectFit?: ImageFit; 1377 1378 /** 1379 * Get the imageAttachmentLayoutStyle of the StyledString. 1380 * 1381 * @type { ?ImageAttachmentLayoutStyle } - the imageAttachmentLayoutStyle of the StyledString or undefined 1382 * @readonly 1383 * @syscap SystemCapability.ArkUI.ArkUI.Full 1384 * @crossplatform 1385 * @atomicservice 1386 * @since 12 1387 */ 1388 readonly layoutStyle?: ImageAttachmentLayoutStyle; 1389} 1390 1391/** 1392 * Defines the ImageAttachmentInterface. 1393 * 1394 * @interface ImageAttachmentInterface 1395 * @syscap SystemCapability.ArkUI.ArkUI.Full 1396 * @crossplatform 1397 * @atomicservice 1398 * @since 12 1399 */ 1400declare interface ImageAttachmentInterface { 1401 /** 1402 * The content of the ImageAttachment. 1403 * 1404 * @type { PixelMap } 1405 * @syscap SystemCapability.ArkUI.ArkUI.Full 1406 * @crossplatform 1407 * @atomicservice 1408 * @since 12 1409 */ 1410 value: PixelMap; 1411 1412 /** 1413 * Image size. 1414 * 1415 * @type { ?SizeOptions } 1416 * @syscap SystemCapability.ArkUI.ArkUI.Full 1417 * @crossplatform 1418 * @atomicservice 1419 * @since 12 1420 */ 1421 size?: SizeOptions; 1422 1423 /** 1424 * Image vertical align. 1425 * 1426 * @type { ?ImageSpanAlignment } 1427 * @syscap SystemCapability.ArkUI.ArkUI.Full 1428 * @crossplatform 1429 * @atomicservice 1430 * @since 12 1431 */ 1432 verticalAlign?: ImageSpanAlignment; 1433 1434 /** 1435 * Image fit. 1436 * 1437 * @type { ?ImageFit } 1438 * @syscap SystemCapability.ArkUI.ArkUI.Full 1439 * @crossplatform 1440 * @atomicservice 1441 * @since 12 1442 */ 1443 objectFit?: ImageFit; 1444 1445 /** 1446 * The Image Layout Style. 1447 * 1448 * @type { ?ImageAttachmentLayoutStyle } 1449 * @syscap SystemCapability.ArkUI.ArkUI.Full 1450 * @crossplatform 1451 * @atomicservice 1452 * @since 12 1453 */ 1454 layoutStyle?: ImageAttachmentLayoutStyle; 1455} 1456 1457/** 1458 * Defines the ImageAttachment Layout Style. 1459 * 1460 * @interface ImageAttachmentLayoutStyle 1461 * @syscap SystemCapability.ArkUI.ArkUI.Full 1462 * @crossplatform 1463 * @atomicservice 1464 * @since 12 1465 */ 1466declare interface ImageAttachmentLayoutStyle { 1467 /** 1468 * Outer Margin. 1469 * 1470 * @type { ?(LengthMetrics | Margin) } 1471 * @syscap SystemCapability.ArkUI.ArkUI.Full 1472 * @crossplatform 1473 * @atomicservice 1474 * @since 12 1475 */ 1476 margin?: LengthMetrics | Margin; 1477 1478 /** 1479 * Inner margin. 1480 * 1481 * @type { ?(LengthMetrics | Padding) } 1482 * @syscap SystemCapability.ArkUI.ArkUI.Full 1483 * @crossplatform 1484 * @atomicservice 1485 * @since 12 1486 */ 1487 padding?: LengthMetrics | Padding; 1488 1489 /** 1490 * Border radius. 1491 * 1492 * @type { ?(LengthMetrics | BorderRadiuses) } 1493 * @syscap SystemCapability.ArkUI.ArkUI.Full 1494 * @crossplatform 1495 * @atomicservice 1496 * @since 12 1497 */ 1498 borderRadius?: LengthMetrics | BorderRadiuses; 1499} 1500 1501/** 1502 * Defines the CustomSpanMetrics interface. 1503 * 1504 * @interface CustomSpanMetrics 1505 * @syscap SystemCapability.ArkUI.ArkUI.Full 1506 * @crossplatform 1507 * @atomicservice 1508 * @since 12 1509 */ 1510declare interface CustomSpanMetrics { 1511 /** 1512 * CustomSpan Width. 1513 * The unit is vp. 1514 * 1515 * @type { number } 1516 * @default 0 1517 * @syscap SystemCapability.ArkUI.ArkUI.Full 1518 * @crossplatform 1519 * @atomicservice 1520 * @since 12 1521 */ 1522 width: number; 1523 1524 /** 1525 * CustomSpan Height. 1526 * The unit is vp. 1527 * 1528 * @type { ?number } 1529 * @syscap SystemCapability.ArkUI.ArkUI.Full 1530 * @crossplatform 1531 * @atomicservice 1532 * @since 12 1533 */ 1534 height?: number; 1535} 1536 1537/** 1538 * Defines the CustomSpanDrawInfo interface. 1539 * 1540 * @interface CustomSpanDrawInfo 1541 * @syscap SystemCapability.ArkUI.ArkUI.Full 1542 * @crossplatform 1543 * @atomicservice 1544 * @since 12 1545 */ 1546declare interface CustomSpanDrawInfo { 1547 /** 1548 * CustomSpan's offset relative to the parent component. 1549 * The unit is px. 1550 * 1551 * @type { number } 1552 * @syscap SystemCapability.ArkUI.ArkUI.Full 1553 * @crossplatform 1554 * @atomicservice 1555 * @since 12 1556 */ 1557 x: number; 1558 1559 /** 1560 * The top position of the line where customSpan is located. 1561 * The unit is px. 1562 * 1563 * @type { number } 1564 * @syscap SystemCapability.ArkUI.ArkUI.Full 1565 * @crossplatform 1566 * @atomicservice 1567 * @since 12 1568 */ 1569 lineTop: number; 1570 1571 /** 1572 * The bottom position of the line where customSpan is located. 1573 * The unit is px. 1574 * 1575 * @type { number } 1576 * @syscap SystemCapability.ArkUI.ArkUI.Full 1577 * @crossplatform 1578 * @atomicservice 1579 * @since 12 1580 */ 1581 lineBottom: number; 1582 1583 /** 1584 * The baseline offset of the line where customSpan is located. 1585 * The unit is px. 1586 * 1587 * @type { number } 1588 * @syscap SystemCapability.ArkUI.ArkUI.Full 1589 * @crossplatform 1590 * @atomicservice 1591 * @since 12 1592 */ 1593 baseline: number; 1594} 1595 1596/** 1597 * Defines the CustomSpanMeasureInfo interface. 1598 * 1599 * @interface CustomSpanMeasureInfo 1600 * @syscap SystemCapability.ArkUI.ArkUI.Full 1601 * @crossplatform 1602 * @atomicservice 1603 * @since 12 1604 */ 1605declare interface CustomSpanMeasureInfo { 1606 /** 1607 * Current component's fontSize value. 1608 * The unit is fp. 1609 * 1610 * @type { number } 1611 * @syscap SystemCapability.ArkUI.ArkUI.Full 1612 * @crossplatform 1613 * @atomicservice 1614 * @since 12 1615 */ 1616 fontSize: number; 1617} 1618 1619/** 1620 * Defines CustomSpan. 1621 * 1622 * @syscap SystemCapability.ArkUI.ArkUI.Full 1623 * @crossplatform 1624 * @atomicservice 1625 * @since 12 1626 */ 1627declare abstract class CustomSpan { 1628 /** 1629 * Measure the size of custom span. 1630 * 1631 * @param { CustomSpanMeasureInfo } measureInfo 1632 * @returns { CustomSpanMetrics } - CustomSpan Size 1633 * @syscap SystemCapability.ArkUI.ArkUI.Full 1634 * @crossplatform 1635 * @atomicservice 1636 * @since 12 1637 */ 1638 abstract onMeasure(measureInfo: CustomSpanMeasureInfo) : CustomSpanMetrics; 1639 1640 /** 1641 * Draw the custom span. 1642 * 1643 * @param { DrawContext } context 1644 * @param { CustomSpanDrawInfo } drawInfo 1645 * @syscap SystemCapability.ArkUI.ArkUI.Full 1646 * @crossplatform 1647 * @atomicservice 1648 * @since 12 1649 */ 1650 abstract onDraw(context: DrawContext, drawInfo: CustomSpanDrawInfo): void; 1651 1652 /** 1653 * Invalidate all components that use the object, which will cause a re-render of all components. 1654 * 1655 * @syscap SystemCapability.ArkUI.ArkUI.Full 1656 * @crossplatform 1657 * @atomicservice 1658 * @since 13 1659 */ 1660 invalidate(): void; 1661} 1662 1663/** 1664 * Defines UserDataSpan. Used to store and obtain user data. 1665 * 1666 * @syscap SystemCapability.ArkUI.ArkUI.Full 1667 * @crossplatform 1668 * @atomicservice 1669 * @since 12 1670 */ 1671declare abstract class UserDataSpan {}