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 * Defines delete text direction. 23 * 24 * @enum { number } 25 * @syscap SystemCapability.ArkUI.ArkUI.Full 26 * @since 10 27 */ 28/** 29 * Defines delete text direction. 30 * 31 * @enum { number } 32 * @syscap SystemCapability.ArkUI.ArkUI.Full 33 * @crossplatform 34 * @atomicservice 35 * @since 11 36 */ 37declare enum RichEditorDeleteDirection { 38 /** 39 * Delete backward. 40 * 41 * @syscap SystemCapability.ArkUI.ArkUI.Full 42 * @since 10 43 */ 44 /** 45 * Delete backward. 46 * 47 * @syscap SystemCapability.ArkUI.ArkUI.Full 48 * @crossplatform 49 * @atomicservice 50 * @since 11 51 */ 52 BACKWARD, 53 54 /** 55 * Delete forward. 56 * 57 * @syscap SystemCapability.ArkUI.ArkUI.Full 58 * @since 10 59 */ 60 /** 61 * Delete forward. 62 * 63 * @syscap SystemCapability.ArkUI.ArkUI.Full 64 * @crossplatform 65 * @atomicservice 66 * @since 11 67 */ 68 FORWARD, 69} 70 71/** 72 * Defines span type. 73 * 74 * @enum { number } 75 * @syscap SystemCapability.ArkUI.ArkUI.Full 76 * @since 10 77 */ 78/** 79 * Defines span type. 80 * 81 * @enum { number } 82 * @syscap SystemCapability.ArkUI.ArkUI.Full 83 * @crossplatform 84 * @atomicservice 85 * @since 11 86 */ 87declare enum RichEditorSpanType { 88 /** 89 * Text,corresponding textSpan type. 90 * 91 * @syscap SystemCapability.ArkUI.ArkUI.Full 92 * @since 10 93 */ 94 /** 95 * Text,corresponding textSpan type. 96 * 97 * @syscap SystemCapability.ArkUI.ArkUI.Full 98 * @crossplatform 99 * @atomicservice 100 * @since 11 101 */ 102 TEXT = 0, 103 104 /** 105 * Image,corresponding imageSpan type. 106 * 107 * @syscap SystemCapability.ArkUI.ArkUI.Full 108 * @since 10 109 */ 110 /** 111 * Image,corresponding imageSpan type. 112 * 113 * @syscap SystemCapability.ArkUI.ArkUI.Full 114 * @crossplatform 115 * @atomicservice 116 * @since 11 117 */ 118 IMAGE = 1, 119 120 /** 121 * Mixed,corresponding mixed span type. 122 * 123 * @syscap SystemCapability.ArkUI.ArkUI.Full 124 * @since 10 125 */ 126 /** 127 * Mixed,corresponding mixed span type. 128 * 129 * @syscap SystemCapability.ArkUI.ArkUI.Full 130 * @crossplatform 131 * @atomicservice 132 * @since 11 133 */ 134 MIXED = 2, 135 136 /** 137 * Builder,corresponding builderSpan type. 138 * 139 * @syscap SystemCapability.ArkUI.ArkUI.Full 140 * @crossplatform 141 * @atomicservice 142 * @since 12 143 */ 144 BUILDER = 3, 145} 146 147/** 148 * ResponseType for contextMenu 149 * 150 * @enum { number } 151 * @syscap SystemCapability.ArkUI.ArkUI.Full 152 * @crossplatform 153 * @since 11 154 */ 155/** 156 * ResponseType for contextMenu 157 * 158 * @enum { number } 159 * @syscap SystemCapability.ArkUI.ArkUI.Full 160 * @crossplatform 161 * @atomicservice 162 * @since 12 163 */ 164declare enum RichEditorResponseType { 165 /** 166 * Right click. 167 * 168 * @syscap SystemCapability.ArkUI.ArkUI.Full 169 * @crossplatform 170 * @since 11 171 */ 172 /** 173 * Right click. 174 * 175 * @syscap SystemCapability.ArkUI.ArkUI.Full 176 * @crossplatform 177 * @atomicservice 178 * @since 12 179 */ 180 RIGHT_CLICK = 0, 181 182 /** 183 * Long press. 184 * 185 * @syscap SystemCapability.ArkUI.ArkUI.Full 186 * @crossplatform 187 * @since 11 188 */ 189 /** 190 * Long press. 191 * 192 * @syscap SystemCapability.ArkUI.ArkUI.Full 193 * @crossplatform 194 * @atomicservice 195 * @since 12 196 */ 197 LONG_PRESS = 1, 198 199 /** 200 * Selected by mouse. 201 * 202 * @syscap SystemCapability.ArkUI.ArkUI.Full 203 * @crossplatform 204 * @since 11 205 */ 206 /** 207 * Selected by mouse. 208 * 209 * @syscap SystemCapability.ArkUI.ArkUI.Full 210 * @crossplatform 211 * @atomicservice 212 * @since 12 213 */ 214 SELECT = 2, 215} 216 217/** 218 * Defines the span position. 219 * 220 * @interface RichEditorSpanPosition 221 * @syscap SystemCapability.ArkUI.ArkUI.Full 222 * @since 10 223 */ 224/** 225 * Defines the span position. 226 * 227 * @interface RichEditorSpanPosition 228 * @syscap SystemCapability.ArkUI.ArkUI.Full 229 * @crossplatform 230 * @atomicservice 231 * @since 11 232 */ 233declare interface RichEditorSpanPosition { 234 /** 235 * Define the index of span. 236 * 237 * @type { number } 238 * @syscap SystemCapability.ArkUI.ArkUI.Full 239 * @since 10 240 */ 241 /** 242 * Define the index of span. 243 * 244 * @type { number } 245 * @syscap SystemCapability.ArkUI.ArkUI.Full 246 * @crossplatform 247 * @atomicservice 248 * @since 11 249 */ 250 spanIndex: number; 251 252 /** 253 * The range of span. 254 * 255 * @type { [number, number] } 256 * @syscap SystemCapability.ArkUI.ArkUI.Full 257 * @since 10 258 */ 259 /** 260 * The range of span. 261 * 262 * @type { [number, number] } 263 * @syscap SystemCapability.ArkUI.ArkUI.Full 264 * @crossplatform 265 * @atomicservice 266 * @since 11 267 */ 268 spanRange: [number, number]; 269} 270 271/** 272 * Defines the span text style. 273 * 274 * @interface RichEditorTextStyle 275 * @syscap SystemCapability.ArkUI.ArkUI.Full 276 * @since 10 277 */ 278/** 279 * Defines the span text style. 280 * 281 * @interface RichEditorTextStyle 282 * @syscap SystemCapability.ArkUI.ArkUI.Full 283 * @crossplatform 284 * @atomicservice 285 * @since 11 286 */ 287declare interface RichEditorTextStyle { 288 /** 289 * font color. 290 * 291 * @type { ?ResourceColor } 292 * @syscap SystemCapability.ArkUI.ArkUI.Full 293 * @since 10 294 */ 295 /** 296 * font color. 297 * 298 * @type { ?ResourceColor } 299 * @syscap SystemCapability.ArkUI.ArkUI.Full 300 * @crossplatform 301 * @atomicservice 302 * @since 11 303 */ 304 fontColor?: ResourceColor; 305 306 /** 307 * font size. 308 * 309 * @type { ?(Length | number) } 310 * @syscap SystemCapability.ArkUI.ArkUI.Full 311 * @since 10 312 */ 313 /** 314 * font size. 315 * 316 * @type { ?(Length | number) } 317 * @syscap SystemCapability.ArkUI.ArkUI.Full 318 * @crossplatform 319 * @atomicservice 320 * @since 11 321 */ 322 fontSize?: Length | number; 323 324 /** 325 * font style. 326 * 327 * @type { ?FontStyle } 328 * @syscap SystemCapability.ArkUI.ArkUI.Full 329 * @since 10 330 */ 331 /** 332 * font style. 333 * 334 * @type { ?FontStyle } 335 * @syscap SystemCapability.ArkUI.ArkUI.Full 336 * @crossplatform 337 * @atomicservice 338 * @since 11 339 */ 340 fontStyle?: FontStyle; 341 342 /** 343 * font weight. 344 * 345 * @type { ?(number | FontWeight | string) } 346 * @syscap SystemCapability.ArkUI.ArkUI.Full 347 * @since 10 348 */ 349 /** 350 * font weight. 351 * 352 * @type { ?(number | FontWeight | string) } 353 * @syscap SystemCapability.ArkUI.ArkUI.Full 354 * @crossplatform 355 * @atomicservice 356 * @since 11 357 */ 358 fontWeight?: number | FontWeight | string; 359 360 /** 361 * font family. 362 * 363 * @type { ?ResourceStr } 364 * @syscap SystemCapability.ArkUI.ArkUI.Full 365 * @since 10 366 */ 367 /** 368 * font family. 369 * 370 * @type { ?ResourceStr } 371 * @syscap SystemCapability.ArkUI.ArkUI.Full 372 * @crossplatform 373 * @atomicservice 374 * @since 11 375 */ 376 fontFamily?: ResourceStr; 377 378 /** 379 * font decoration. 380 * 381 * @type { ?object } 382 * @syscap SystemCapability.ArkUI.ArkUI.Full 383 * @since 10 384 */ 385 /** 386 * font decoration. 387 * 388 * @type { ?object } 389 * @syscap SystemCapability.ArkUI.ArkUI.Full 390 * @crossplatform 391 * @atomicservice 392 * @since 11 393 */ 394 /** 395 * Font decoration. 396 * 397 * @type { ?DecorationStyleInterface } 398 * @syscap SystemCapability.ArkUI.ArkUI.Full 399 * @crossplatform 400 * @atomicservice 401 * @since 12 402 */ 403 decoration?: DecorationStyleInterface; 404 405 /** 406 * Text shadow 407 * 408 * @type { ?(ShadowOptions | Array<ShadowOptions>) } 409 * @syscap SystemCapability.ArkUI.ArkUI.Full 410 * @crossplatform 411 * @since 11 412 */ 413 /** 414 * Text shadow 415 * 416 * @type { ?(ShadowOptions | Array<ShadowOptions>) } 417 * @syscap SystemCapability.ArkUI.ArkUI.Full 418 * @crossplatform 419 * @atomicservice 420 * @since 12 421 */ 422 textShadow?: ShadowOptions | Array<ShadowOptions>; 423 424 /** 425 * letter spacing. 426 * 427 * @type { ?(number | string) } 428 * @syscap SystemCapability.ArkUI.ArkUI.Full 429 * @crossplatform 430 * @atomicservice 431 * @since 12 432 */ 433 letterSpacing?: number | string; 434 435 /** 436 * line height. 437 * 438 * @type { ? (number | string | Resource) } 439 * @syscap SystemCapability.ArkUI.ArkUI.Full 440 * @crossplatform 441 * @atomicservice 442 * @since 12 443 */ 444 lineHeight?: number | string | Resource; 445 446 /** 447 * Set font feature, advanced text styles and effects as designed by the font author. 448 * The format is the like the CSS font-feature-settings attribute. 449 * 450 * @type { ?string } 451 * normal | <feature-tag-value>, 452 * where <feature-tag-value> = <string> [ <integer> | on | off ], like: "ss01" 0 453 * the values of <feature-tag-value> reference to doc of RichEditor component 454 * number of <feature-tag-value> can be single or multiple, and separated by comma ','. 455 * @syscap SystemCapability.ArkUI.ArkUI.Full 456 * @crossplatform 457 * @atomicservice 458 * @since 12 459 */ 460 fontFeature?: string; 461} 462 463 464/** 465 * Defines the leading margin placeholder of a paragraph. 466 * 467 * @interface LeadingMarginPlaceholder 468 * @syscap SystemCapability.ArkUI.ArkUI.Full 469 * @crossplatform 470 * @since 11 471 */ 472/** 473 * Defines the leading margin placeholder of a paragraph. 474 * 475 * @interface LeadingMarginPlaceholder 476 * @syscap SystemCapability.ArkUI.ArkUI.Full 477 * @crossplatform 478 * @atomicservice 479 * @since 12 480 */ 481declare interface LeadingMarginPlaceholder { 482 /** 483 * Placeholder pixelMap. 484 * 485 * @type { PixelMap } 486 * @syscap SystemCapability.ArkUI.ArkUI.Full 487 * @crossplatform 488 * @since 11 489 */ 490 /** 491 * Placeholder pixelMap. 492 * 493 * @type { PixelMap } 494 * @syscap SystemCapability.ArkUI.ArkUI.Full 495 * @crossplatform 496 * @atomicservice 497 * @since 12 498 */ 499 pixelMap: PixelMap; 500 501 /** 502 * Placeholder size. 503 * 504 * @type { [Dimension, Dimension] } 505 * @syscap SystemCapability.ArkUI.ArkUI.Full 506 * @crossplatform 507 * @since 11 508 */ 509 /** 510 * Placeholder size. 511 * 512 * @type { [Dimension, Dimension] } 513 * @syscap SystemCapability.ArkUI.ArkUI.Full 514 * @crossplatform 515 * @atomicservice 516 * @since 12 517 */ 518 size: [Dimension, Dimension]; 519} 520 521/** 522 * Defines the paragraph style. 523 * 524 * @interface RichEditorParagraphStyle 525 * @syscap SystemCapability.ArkUI.ArkUI.Full 526 * @crossplatform 527 * @since 11 528 */ 529/** 530 * Defines the paragraph style. 531 * 532 * @interface RichEditorParagraphStyle 533 * @syscap SystemCapability.ArkUI.ArkUI.Full 534 * @crossplatform 535 * @atomicservice 536 * @since 12 537 */ 538declare interface RichEditorParagraphStyle { 539 /** 540 * Text alignment. 541 * 542 * @type { ?TextAlign } 543 * @syscap SystemCapability.ArkUI.ArkUI.Full 544 * @crossplatform 545 * @since 11 546 */ 547 /** 548 * Text alignment. 549 * 550 * @type { ?TextAlign } 551 * @syscap SystemCapability.ArkUI.ArkUI.Full 552 * @crossplatform 553 * @atomicservice 554 * @since 12 555 */ 556 textAlign?: TextAlign; 557 558 /** 559 * Leading margin. 560 * 561 * @type { ?(Dimension | LeadingMarginPlaceholder) } 562 * @syscap SystemCapability.ArkUI.ArkUI.Full 563 * @crossplatform 564 * @since 11 565 */ 566 /** 567 * Leading margin. 568 * 569 * @type { ?(Dimension | LeadingMarginPlaceholder) } 570 * @syscap SystemCapability.ArkUI.ArkUI.Full 571 * @crossplatform 572 * @atomicservice 573 * @since 12 574 */ 575 leadingMargin?: Dimension | LeadingMarginPlaceholder; 576 577 /** 578 * Set word break type. 579 * 580 * @type { ?WordBreak } 581 * @syscap SystemCapability.ArkUI.ArkUI.Full 582 * @crossplatform 583 * @atomicservice 584 * @since 12 585 */ 586 wordBreak?: WordBreak; 587 588 /** 589 * Set line break strategy type. 590 * 591 * @type { ?LineBreakStrategy } 592 * @syscap SystemCapability.ArkUI.ArkUI.Full 593 * @crossplatform 594 * @atomicservice 595 * @since 12 596 */ 597 lineBreakStrategy?: LineBreakStrategy; 598} 599 600/** 601 * Defines the paste event. 602 * 603 * @interface PasteEvent 604 * @syscap SystemCapability.ArkUI.ArkUI.Full 605 * @crossplatform 606 * @atomicservice 607 * @since 11 608 */ 609declare interface PasteEvent { 610 /** 611 * Override system paste event. 612 * 613 * @type { ?function } 614 * @syscap SystemCapability.ArkUI.ArkUI.Full 615 * @crossplatform 616 * @atomicservice 617 * @since 11 618 */ 619 /** 620 * Override system paste event. 621 * 622 * @type { ?Callback<void> } 623 * @syscap SystemCapability.ArkUI.ArkUI.Full 624 * @crossplatform 625 * @atomicservice 626 * @since 12 627 */ 628 preventDefault?: Callback<void>; 629} 630 631/** 632 * Defines the text span. 633 * 634 * @interface RichEditorTextSpan 635 * @syscap SystemCapability.ArkUI.ArkUI.Full 636 * @since 10 637 */ 638/** 639 * Defines the text span. 640 * 641 * @interface RichEditorTextSpan 642 * @syscap SystemCapability.ArkUI.ArkUI.Full 643 * @crossplatform 644 * @atomicservice 645 * @since 11 646 */ 647declare interface RichEditorTextSpan { 648 /** 649 * The position of the text span. 650 * 651 * @type { RichEditorSpanPosition } 652 * @syscap SystemCapability.ArkUI.ArkUI.Full 653 * @since 10 654 */ 655 /** 656 * The position of the text span. 657 * 658 * @type { RichEditorSpanPosition } 659 * @syscap SystemCapability.ArkUI.ArkUI.Full 660 * @crossplatform 661 * @atomicservice 662 * @since 11 663 */ 664 spanPosition: RichEditorSpanPosition; 665 666 /** 667 * The content of the text span. 668 * 669 * @type { string } 670 * @syscap SystemCapability.ArkUI.ArkUI.Full 671 * @since 10 672 */ 673 /** 674 * The content of the text span. 675 * 676 * @type { string } 677 * @syscap SystemCapability.ArkUI.ArkUI.Full 678 * @crossplatform 679 * @atomicservice 680 * @since 11 681 */ 682 value: string; 683 684 /** 685 * text style. 686 * 687 * @type { ?RichEditorTextStyle } 688 * @syscap SystemCapability.ArkUI.ArkUI.Full 689 * @since 10 690 */ 691 /** 692 * text style. 693 * 694 * @type { ?RichEditorTextStyle } 695 * @syscap SystemCapability.ArkUI.ArkUI.Full 696 * @crossplatform 697 * @atomicservice 698 * @since 11 699 */ 700 textStyle?: RichEditorTextStyle; 701} 702 703/** 704 * Defines the richEditor Image Layout Style. 705 * 706 * @interface RichEditorLayoutStyle 707 * @syscap SystemCapability.ArkUI.ArkUI.Full 708 * @crossplatform 709 * @since 11 710 */ 711/** 712 * Defines the richEditor Image Layout Style. 713 * 714 * @interface RichEditorLayoutStyle 715 * @syscap SystemCapability.ArkUI.ArkUI.Full 716 * @crossplatform 717 * @atomicservice 718 * @since 12 719 */ 720interface RichEditorLayoutStyle { 721 /** 722 * Outer Margin. 723 * 724 * @type { ?(Dimension | Margin) } 725 * @syscap SystemCapability.ArkUI.ArkUI.Full 726 * @crossplatform 727 * @since 11 728 */ 729 /** 730 * Outer Margin. 731 * 732 * @type { ?(Dimension | Margin) } 733 * @syscap SystemCapability.ArkUI.ArkUI.Full 734 * @crossplatform 735 * @atomicservice 736 * @since 12 737 */ 738 margin?: Dimension | Margin; 739 740 /** 741 * Border radius. 742 * 743 * @type { ?(Dimension | BorderRadiuses) } 744 * @syscap SystemCapability.ArkUI.ArkUI.Full 745 * @crossplatform 746 * @since 11 747 */ 748 /** 749 * Border radius. 750 * 751 * @type { ?(Dimension | BorderRadiuses) } 752 * @syscap SystemCapability.ArkUI.ArkUI.Full 753 * @crossplatform 754 * @atomicservice 755 * @since 12 756 */ 757 borderRadius?: Dimension | BorderRadiuses; 758} 759 760/** 761 * Defines the span image style. 762 * 763 * @interface RichEditorImageSpanStyle 764 * @syscap SystemCapability.ArkUI.ArkUI.Full 765 * @since 10 766 */ 767/** 768 * Defines the span image style. 769 * 770 * @interface RichEditorImageSpanStyle 771 * @syscap SystemCapability.ArkUI.ArkUI.Full 772 * @crossplatform 773 * @atomicservice 774 * @since 11 775 */ 776declare interface RichEditorImageSpanStyle { 777 /** 778 * image size. 779 * 780 * @type { ?[Dimension, Dimension] } 781 * @syscap SystemCapability.ArkUI.ArkUI.Full 782 * @since 10 783 */ 784 /** 785 * image size. 786 * 787 * @type { ?[Dimension, Dimension] } 788 * @syscap SystemCapability.ArkUI.ArkUI.Full 789 * @crossplatform 790 * @atomicservice 791 * @since 11 792 */ 793 size?: [Dimension, Dimension]; 794 795 /** 796 * image vertical align. 797 * 798 * @type { ?ImageSpanAlignment } 799 * @syscap SystemCapability.ArkUI.ArkUI.Full 800 * @since 10 801 */ 802 /** 803 * image vertical align. 804 * 805 * @type { ?ImageSpanAlignment } 806 * @syscap SystemCapability.ArkUI.ArkUI.Full 807 * @crossplatform 808 * @atomicservice 809 * @since 11 810 */ 811 verticalAlign?: ImageSpanAlignment; 812 813 /** 814 * image fit. 815 * 816 * @type { ?ImageFit } 817 * @syscap SystemCapability.ArkUI.ArkUI.Full 818 * @since 10 819 */ 820 /** 821 * image fit. 822 * 823 * @type { ?ImageFit } 824 * @syscap SystemCapability.ArkUI.ArkUI.Full 825 * @crossplatform 826 * @atomicservice 827 * @since 11 828 */ 829 objectFit?: ImageFit; 830 831 /** 832 * RichEditor ImageSpan Layout Style. 833 * 834 * @type { ?RichEditorLayoutStyle } 835 * @syscap SystemCapability.ArkUI.ArkUI.Full 836 * @crossplatform 837 * @since 11 838 */ 839 /** 840 * RichEditor ImageSpan Layout Style. 841 * 842 * @type { ?RichEditorLayoutStyle } 843 * @syscap SystemCapability.ArkUI.ArkUI.Full 844 * @crossplatform 845 * @atomicservice 846 * @since 12 847 */ 848 layoutStyle?: RichEditorLayoutStyle; 849} 850 851/** 852 * Defines the symbol span style. 853 * 854 * @interface RichEditorSymbolSpanStyle 855 * @syscap SystemCapability.ArkUI.ArkUI.Full 856 * @crossplatform 857 * @since 11 858 */ 859/** 860 * Defines the symbol span style. 861 * 862 * @interface RichEditorSymbolSpanStyle 863 * @syscap SystemCapability.ArkUI.ArkUI.Full 864 * @crossplatform 865 * @atomicservice 866 * @since 12 867 */ 868declare interface RichEditorSymbolSpanStyle { 869 /** 870 * The font size. 871 * 872 * @type { ?(number | string | Resource) } 873 * @syscap SystemCapability.ArkUI.ArkUI.Full 874 * @crossplatform 875 * @since 11 876 */ 877 /** 878 * The font size. 879 * 880 * @type { ?(number | string | Resource) } 881 * @syscap SystemCapability.ArkUI.ArkUI.Full 882 * @crossplatform 883 * @atomicservice 884 * @since 12 885 */ 886 fontSize?: number | string | Resource; 887 888 /** 889 * The font color. 890 * 891 * @type { ?Array<ResourceColor> } 892 * @syscap SystemCapability.ArkUI.ArkUI.Full 893 * @crossplatform 894 * @since 11 895 */ 896 /** 897 * The font color. 898 * 899 * @type { ?Array<ResourceColor> } 900 * @syscap SystemCapability.ArkUI.ArkUI.Full 901 * @crossplatform 902 * @atomicservice 903 * @since 12 904 */ 905 fontColor?: Array<ResourceColor>; 906 907 /** 908 * The font weight. 909 * 910 * @type { ?(number | FontWeight | string) } 911 * @syscap SystemCapability.ArkUI.ArkUI.Full 912 * @crossplatform 913 * @since 11 914 */ 915 /** 916 * The font weight. 917 * 918 * @type { ?(number | FontWeight | string) } 919 * @syscap SystemCapability.ArkUI.ArkUI.Full 920 * @crossplatform 921 * @atomicservice 922 * @since 12 923 */ 924 fontWeight?: number | FontWeight | string; 925 926 /** 927 * The symbol span effect strategy. 928 * 929 * @type { ?SymbolEffectStrategy } 930 * @syscap SystemCapability.ArkUI.ArkUI.Full 931 * @crossplatform 932 * @since 11 933 */ 934 /** 935 * The symbol span effect strategy. 936 * 937 * @type { ?SymbolEffectStrategy } 938 * @syscap SystemCapability.ArkUI.ArkUI.Full 939 * @crossplatform 940 * @atomicservice 941 * @since 12 942 */ 943 effectStrategy?: SymbolEffectStrategy; 944 945 /** 946 * The symbol span rendering strategy. 947 * 948 * @type { ?SymbolRenderingStrategy } 949 * @syscap SystemCapability.ArkUI.ArkUI.Full 950 * @crossplatform 951 * @since 11 952 */ 953 /** 954 * The symbol span rendering strategy. 955 * 956 * @type { ?SymbolRenderingStrategy } 957 * @syscap SystemCapability.ArkUI.ArkUI.Full 958 * @crossplatform 959 * @atomicservice 960 * @since 12 961 */ 962 renderingStrategy?: SymbolRenderingStrategy; 963} 964 965/** 966 * Defines the text style result. 967 * 968 * @interface RichEditorTextStyleResult 969 * @syscap SystemCapability.ArkUI.ArkUI.Full 970 * @since 10 971 */ 972/** 973 * Defines the text style result. 974 * 975 * @interface RichEditorTextStyleResult 976 * @syscap SystemCapability.ArkUI.ArkUI.Full 977 * @crossplatform 978 * @atomicservice 979 * @since 11 980 */ 981declare interface RichEditorTextStyleResult { 982 /** 983 * font color. 984 * 985 * @type { ResourceColor } 986 * @syscap SystemCapability.ArkUI.ArkUI.Full 987 * @since 10 988 */ 989 /** 990 * font color. 991 * 992 * @type { ResourceColor } 993 * @syscap SystemCapability.ArkUI.ArkUI.Full 994 * @crossplatform 995 * @atomicservice 996 * @since 11 997 */ 998 fontColor: ResourceColor; 999 1000 /** 1001 * font size. 1002 * 1003 * @type { number } 1004 * @syscap SystemCapability.ArkUI.ArkUI.Full 1005 * @since 10 1006 */ 1007 /** 1008 * font size. 1009 * 1010 * @type { number } 1011 * @syscap SystemCapability.ArkUI.ArkUI.Full 1012 * @crossplatform 1013 * @atomicservice 1014 * @since 11 1015 */ 1016 fontSize: number; 1017 1018 /** 1019 * font style. 1020 * 1021 * @type { FontStyle } 1022 * @syscap SystemCapability.ArkUI.ArkUI.Full 1023 * @since 10 1024 */ 1025 /** 1026 * font style. 1027 * 1028 * @type { FontStyle } 1029 * @syscap SystemCapability.ArkUI.ArkUI.Full 1030 * @crossplatform 1031 * @atomicservice 1032 * @since 11 1033 */ 1034 fontStyle: FontStyle; 1035 1036 /** 1037 * font weight. 1038 * 1039 * @type { number } 1040 * @syscap SystemCapability.ArkUI.ArkUI.Full 1041 * @since 10 1042 */ 1043 /** 1044 * font weight. 1045 * 1046 * @type { number } 1047 * @syscap SystemCapability.ArkUI.ArkUI.Full 1048 * @crossplatform 1049 * @atomicservice 1050 * @since 11 1051 */ 1052 fontWeight: number; 1053 1054 /** 1055 * font family. 1056 * 1057 * @type { string } 1058 * @syscap SystemCapability.ArkUI.ArkUI.Full 1059 * @since 10 1060 */ 1061 /** 1062 * font family. 1063 * 1064 * @type { string } 1065 * @syscap SystemCapability.ArkUI.ArkUI.Full 1066 * @crossplatform 1067 * @atomicservice 1068 * @since 11 1069 */ 1070 fontFamily: string; 1071 1072 /** 1073 * font decoration. 1074 * 1075 * @type { object } 1076 * @syscap SystemCapability.ArkUI.ArkUI.Full 1077 * @since 10 1078 */ 1079 /** 1080 * font decoration. 1081 * 1082 * @type { object } 1083 * @syscap SystemCapability.ArkUI.ArkUI.Full 1084 * @crossplatform 1085 * @atomicservice 1086 * @since 11 1087 */ 1088 /** 1089 * Font decoration. 1090 * 1091 * @type { DecorationStyleResult } 1092 * @syscap SystemCapability.ArkUI.ArkUI.Full 1093 * @crossplatform 1094 * @atomicservice 1095 * @since 12 1096 */ 1097 decoration: DecorationStyleResult; 1098 1099 /** 1100 * Text shadow 1101 * 1102 * @type { ?Array<ShadowOptions> } 1103 * @syscap SystemCapability.ArkUI.ArkUI.Full 1104 * @crossplatform 1105 * @atomicservice 1106 * @since 12 1107 */ 1108 textShadow?: Array<ShadowOptions>; 1109 1110 /** 1111 * letter spacing. 1112 * 1113 * @type { ?number } 1114 * @syscap SystemCapability.ArkUI.ArkUI.Full 1115 * @crossplatform 1116 * @atomicservice 1117 * @since 12 1118 */ 1119 letterSpacing?: number; 1120 1121 /** 1122 * line height. 1123 * 1124 * @type { ?number } 1125 * @syscap SystemCapability.ArkUI.ArkUI.Full 1126 * @crossplatform 1127 * @atomicservice 1128 * @since 12 1129 */ 1130 lineHeight?: number; 1131 1132 /** 1133 * Set font feature, advanced text styles and effects as designed by the font author. 1134 * The format is the like the CSS font-feature-settings attribute. 1135 * 1136 * @type { ?string } 1137 * normal | <feature-tag-value>, 1138 * where <feature-tag-value> = <string> [ <integer> | on | off ], like: "ss01" 0 1139 * the values of <feature-tag-value> reference to doc of RichEditor component 1140 * number of <feature-tag-value> can be single or multiple, and separated by comma ','. 1141 * @syscap SystemCapability.ArkUI.ArkUI.Full 1142 * @crossplatform 1143 * @atomicservice 1144 * @since 12 1145 */ 1146 fontFeature?: string; 1147} 1148 1149/** 1150 * Defines the paragraph result. 1151 * 1152 * @interface RichEditorParagraphResult 1153 * @syscap SystemCapability.ArkUI.ArkUI.Full 1154 * @crossplatform 1155 * @since 11 1156 */ 1157/** 1158 * Defines the paragraph result. 1159 * 1160 * @interface RichEditorParagraphResult 1161 * @syscap SystemCapability.ArkUI.ArkUI.Full 1162 * @crossplatform 1163 * @atomicservice 1164 * @since 12 1165 */ 1166declare interface RichEditorParagraphResult { 1167 /** 1168 * The paragraph style. 1169 * 1170 * @type { RichEditorParagraphStyle } 1171 * @syscap SystemCapability.ArkUI.ArkUI.Full 1172 * @crossplatform 1173 * @since 11 1174 */ 1175 /** 1176 * The paragraph style. 1177 * 1178 * @type { RichEditorParagraphStyle } 1179 * @syscap SystemCapability.ArkUI.ArkUI.Full 1180 * @crossplatform 1181 * @atomicservice 1182 * @since 12 1183 */ 1184 style: RichEditorParagraphStyle; 1185 1186 /** 1187 * The range of paragraph based on character indices. 1188 * 1189 * @type { [number, number] } 1190 * @syscap SystemCapability.ArkUI.ArkUI.Full 1191 * @crossplatform 1192 * @since 11 1193 */ 1194 /** 1195 * The range of paragraph based on character indices. 1196 * 1197 * @type { [number, number] } 1198 * @syscap SystemCapability.ArkUI.ArkUI.Full 1199 * @crossplatform 1200 * @atomicservice 1201 * @since 12 1202 */ 1203 range: [number, number]; 1204} 1205 1206/** 1207 * Defines the symbol span style result. 1208 * 1209 * @interface RichEditorSymbolSpanStyleResult 1210 * @syscap SystemCapability.ArkUI.ArkUI.Full 1211 * @crossplatform 1212 * @since 11 1213 */ 1214/** 1215 * Defines the symbol span style result. 1216 * 1217 * @interface RichEditorSymbolSpanStyleResult 1218 * @syscap SystemCapability.ArkUI.ArkUI.Full 1219 * @crossplatform 1220 * @atomicservice 1221 * @since 12 1222 */ 1223declare interface RichEditorSymbolSpanStyleResult { 1224 /** 1225 * The font size. 1226 * 1227 * @type { number | string | Resource } 1228 * @syscap SystemCapability.ArkUI.ArkUI.Full 1229 * @crossplatform 1230 * @since 11 1231 */ 1232 /** 1233 * The font size. 1234 * 1235 * @type { number | string | Resource } 1236 * @syscap SystemCapability.ArkUI.ArkUI.Full 1237 * @crossplatform 1238 * @atomicservice 1239 * @since 12 1240 */ 1241 fontSize: number | string | Resource; 1242 1243 /** 1244 * The font color. 1245 * 1246 * @type { Array<ResourceColor> } 1247 * @syscap SystemCapability.ArkUI.ArkUI.Full 1248 * @crossplatform 1249 * @since 11 1250 */ 1251 /** 1252 * The font color. 1253 * 1254 * @type { Array<ResourceColor> } 1255 * @syscap SystemCapability.ArkUI.ArkUI.Full 1256 * @crossplatform 1257 * @atomicservice 1258 * @since 12 1259 */ 1260 fontColor: Array<ResourceColor>; 1261 1262 /** 1263 * The font weight. 1264 * 1265 * @type { number | FontWeight | string } 1266 * @syscap SystemCapability.ArkUI.ArkUI.Full 1267 * @crossplatform 1268 * @since 11 1269 */ 1270 /** 1271 * The font weight. 1272 * 1273 * @type { number | FontWeight | string } 1274 * @syscap SystemCapability.ArkUI.ArkUI.Full 1275 * @crossplatform 1276 * @atomicservice 1277 * @since 12 1278 */ 1279 fontWeight: number | FontWeight | string; 1280 1281 /** 1282 * The symbol span effect strategy. 1283 * 1284 * @type { SymbolEffectStrategy } 1285 * @syscap SystemCapability.ArkUI.ArkUI.Full 1286 * @crossplatform 1287 * @since 11 1288 */ 1289 /** 1290 * The symbol span effect strategy. 1291 * 1292 * @type { SymbolEffectStrategy } 1293 * @syscap SystemCapability.ArkUI.ArkUI.Full 1294 * @crossplatform 1295 * @atomicservice 1296 * @since 12 1297 */ 1298 effectStrategy: SymbolEffectStrategy; 1299 1300 /** 1301 * The symbol span rendering strategy. 1302 * 1303 * @type { SymbolRenderingStrategy } 1304 * @syscap SystemCapability.ArkUI.ArkUI.Full 1305 * @crossplatform 1306 * @since 11 1307 */ 1308 /** 1309 * The symbol span rendering strategy. 1310 * 1311 * @type { SymbolRenderingStrategy } 1312 * @syscap SystemCapability.ArkUI.ArkUI.Full 1313 * @crossplatform 1314 * @atomicservice 1315 * @since 12 1316 */ 1317 renderingStrategy: SymbolRenderingStrategy; 1318} 1319 1320/** 1321 * Defines the text span result. 1322 * 1323 * @interface RichEditorTextSpanResult 1324 * @syscap SystemCapability.ArkUI.ArkUI.Full 1325 * @since 10 1326 */ 1327/** 1328 * Defines the text span result. 1329 * 1330 * @interface RichEditorTextSpanResult 1331 * @syscap SystemCapability.ArkUI.ArkUI.Full 1332 * @crossplatform 1333 * @atomicservice 1334 * @since 11 1335 */ 1336declare interface RichEditorTextSpanResult { 1337 /** 1338 * The position of the text span. 1339 * 1340 * @type { RichEditorSpanPosition } 1341 * @syscap SystemCapability.ArkUI.ArkUI.Full 1342 * @since 10 1343 */ 1344 /** 1345 * The position of the text span. 1346 * 1347 * @type { RichEditorSpanPosition } 1348 * @syscap SystemCapability.ArkUI.ArkUI.Full 1349 * @crossplatform 1350 * @atomicservice 1351 * @since 11 1352 */ 1353 spanPosition: RichEditorSpanPosition; 1354 1355 /** 1356 * The content of the text span. 1357 * 1358 * @type { string } 1359 * @syscap SystemCapability.ArkUI.ArkUI.Full 1360 * @since 10 1361 */ 1362 /** 1363 * The content of the text span. 1364 * 1365 * @type { string } 1366 * @syscap SystemCapability.ArkUI.ArkUI.Full 1367 * @crossplatform 1368 * @atomicservice 1369 * @since 11 1370 */ 1371 value: string; 1372 1373 /** 1374 * text style. 1375 * 1376 * @type { RichEditorTextStyleResult } 1377 * @syscap SystemCapability.ArkUI.ArkUI.Full 1378 * @since 10 1379 */ 1380 /** 1381 * text style. 1382 * 1383 * @type { RichEditorTextStyleResult } 1384 * @syscap SystemCapability.ArkUI.ArkUI.Full 1385 * @crossplatform 1386 * @atomicservice 1387 * @since 11 1388 */ 1389 textStyle: RichEditorTextStyleResult; 1390 1391 /** 1392 * get offset in span. 1393 * 1394 * @type { [number, number] } 1395 * @syscap SystemCapability.ArkUI.ArkUI.Full 1396 * @since 10 1397 */ 1398 /** 1399 * get offset in span. 1400 * 1401 * @type { [number, number] } 1402 * @syscap SystemCapability.ArkUI.ArkUI.Full 1403 * @crossplatform 1404 * @atomicservice 1405 * @since 11 1406 */ 1407 offsetInSpan: [number, number]; 1408 1409 /** 1410 * Symbol span style. 1411 * 1412 * @type { ?RichEditorSymbolSpanStyle } 1413 * @syscap SystemCapability.ArkUI.ArkUI.Full 1414 * @crossplatform 1415 * @since 11 1416 */ 1417 /** 1418 * Symbol span style. 1419 * 1420 * @type { ?RichEditorSymbolSpanStyle } 1421 * @syscap SystemCapability.ArkUI.ArkUI.Full 1422 * @crossplatform 1423 * @atomicservice 1424 * @since 12 1425 */ 1426 symbolSpanStyle?: RichEditorSymbolSpanStyle; 1427 1428 /** 1429 * The resource string of the symbol span. 1430 * 1431 * @type { ?Resource } 1432 * @syscap SystemCapability.ArkUI.ArkUI.Full 1433 * @crossplatform 1434 * @since 11 1435 */ 1436 /** 1437 * The resource string of the symbol span. 1438 * 1439 * @type { ?Resource } 1440 * @syscap SystemCapability.ArkUI.ArkUI.Full 1441 * @crossplatform 1442 * @atomicservice 1443 * @since 12 1444 */ 1445 valueResource?: Resource; 1446 1447 /** 1448 * The Style of paragraph. 1449 * 1450 * @type { ?RichEditorParagraphStyle } 1451 * @syscap SystemCapability.ArkUI.ArkUI.Full 1452 * @crossplatform 1453 * @atomicservice 1454 * @since 12 1455 */ 1456 paragraphStyle?: RichEditorParagraphStyle; 1457 1458 /** 1459 * The preview text. 1460 * 1461 * @type { ?string } 1462 * @syscap SystemCapability.ArkUI.ArkUI.Full 1463 * @crossplatform 1464 * @atomicservice 1465 * @since 12 1466 */ 1467 previewText?: string; 1468} 1469 1470/** 1471 * Defines the span image style result. 1472 * 1473 * @interface RichEditorImageSpanStyleResult 1474 * @syscap SystemCapability.ArkUI.ArkUI.Full 1475 * @since 10 1476 */ 1477/** 1478 * Defines the span image style result. 1479 * 1480 * @interface RichEditorImageSpanStyleResult 1481 * @syscap SystemCapability.ArkUI.ArkUI.Full 1482 * @crossplatform 1483 * @atomicservice 1484 * @since 11 1485 */ 1486declare interface RichEditorImageSpanStyleResult { 1487 /** 1488 * image size. 1489 * 1490 * @type { [number, number] } 1491 * @syscap SystemCapability.ArkUI.ArkUI.Full 1492 * @since 10 1493 */ 1494 /** 1495 * image size. 1496 * 1497 * @type { [number, number] } 1498 * @syscap SystemCapability.ArkUI.ArkUI.Full 1499 * @crossplatform 1500 * @atomicservice 1501 * @since 11 1502 */ 1503 size: [number, number]; 1504 1505 /** 1506 * image vertical align. 1507 * 1508 * @type { ImageSpanAlignment } 1509 * @syscap SystemCapability.ArkUI.ArkUI.Full 1510 * @since 10 1511 */ 1512 /** 1513 * image vertical align. 1514 * 1515 * @type { ImageSpanAlignment } 1516 * @syscap SystemCapability.ArkUI.ArkUI.Full 1517 * @crossplatform 1518 * @atomicservice 1519 * @since 11 1520 */ 1521 verticalAlign: ImageSpanAlignment; 1522 1523 /** 1524 * image fit. 1525 * 1526 * @type { ImageFit } 1527 * @syscap SystemCapability.ArkUI.ArkUI.Full 1528 * @since 10 1529 */ 1530 /** 1531 * image fit. 1532 * 1533 * @type { ImageFit } 1534 * @syscap SystemCapability.ArkUI.ArkUI.Full 1535 * @crossplatform 1536 * @atomicservice 1537 * @since 11 1538 */ 1539 objectFit: ImageFit; 1540 1541 /** 1542 * RichEditor ImageSpan Layout Style. 1543 * 1544 * @type { ?RichEditorLayoutStyle } 1545 * @syscap SystemCapability.ArkUI.ArkUI.Full 1546 * @crossplatform 1547 * @atomicservice 1548 * @since 12 1549 */ 1550 layoutStyle?: RichEditorLayoutStyle; 1551} 1552 1553/** 1554 * Defines the image span. 1555 * 1556 * @interface RichEditorImageSpanResult 1557 * @syscap SystemCapability.ArkUI.ArkUI.Full 1558 * @since 10 1559 */ 1560/** 1561 * Defines the image span. 1562 * 1563 * @interface RichEditorImageSpanResult 1564 * @syscap SystemCapability.ArkUI.ArkUI.Full 1565 * @crossplatform 1566 * @atomicservice 1567 * @since 11 1568 */ 1569declare interface RichEditorImageSpanResult { 1570 /** 1571 * The position of the image span. 1572 * 1573 * @type { RichEditorSpanPosition } 1574 * @syscap SystemCapability.ArkUI.ArkUI.Full 1575 * @since 10 1576 */ 1577 /** 1578 * The position of the image span. 1579 * 1580 * @type { RichEditorSpanPosition } 1581 * @syscap SystemCapability.ArkUI.ArkUI.Full 1582 * @crossplatform 1583 * @atomicservice 1584 * @since 11 1585 */ 1586 spanPosition: RichEditorSpanPosition; 1587 1588 /** 1589 * The pixel map of the image span. 1590 * 1591 * @type { ?PixelMap } 1592 * @syscap SystemCapability.ArkUI.ArkUI.Full 1593 * @since 10 1594 */ 1595 /** 1596 * The pixel map of the image span. 1597 * 1598 * @type { ?PixelMap } 1599 * @syscap SystemCapability.ArkUI.ArkUI.Full 1600 * @crossplatform 1601 * @atomicservice 1602 * @since 11 1603 */ 1604 valuePixelMap?: PixelMap; 1605 1606 /** 1607 * The resource string of the image span. 1608 * 1609 * @type { ?ResourceStr } 1610 * @syscap SystemCapability.ArkUI.ArkUI.Full 1611 * @since 10 1612 */ 1613 /** 1614 * The resource string of the image span. 1615 * 1616 * @type { ?ResourceStr } 1617 * @syscap SystemCapability.ArkUI.ArkUI.Full 1618 * @crossplatform 1619 * @atomicservice 1620 * @since 11 1621 */ 1622 valueResourceStr?: ResourceStr; 1623 1624 /** 1625 * image attribute. 1626 * 1627 * @type { RichEditorImageSpanStyleResult } 1628 * @syscap SystemCapability.ArkUI.ArkUI.Full 1629 * @since 10 1630 */ 1631 /** 1632 * image attribute. 1633 * 1634 * @type { RichEditorImageSpanStyleResult } 1635 * @syscap SystemCapability.ArkUI.ArkUI.Full 1636 * @crossplatform 1637 * @atomicservice 1638 * @since 11 1639 */ 1640 imageStyle: RichEditorImageSpanStyleResult; 1641 1642 /** 1643 * get offset in span. 1644 * 1645 * @type { [number, number] } 1646 * @syscap SystemCapability.ArkUI.ArkUI.Full 1647 * @since 10 1648 */ 1649 /** 1650 * get offset in span. 1651 * 1652 * @type { [number, number] } 1653 * @syscap SystemCapability.ArkUI.ArkUI.Full 1654 * @crossplatform 1655 * @atomicservice 1656 * @since 11 1657 */ 1658 offsetInSpan: [number, number]; 1659} 1660 1661/** 1662 * Defines the image span. 1663 * 1664 * @interface RichEditorImageSpan 1665 * @syscap SystemCapability.ArkUI.ArkUI.Full 1666 * @since 10 1667 */ 1668/** 1669 * Defines the image span. 1670 * 1671 * @interface RichEditorImageSpan 1672 * @syscap SystemCapability.ArkUI.ArkUI.Full 1673 * @crossplatform 1674 * @atomicservice 1675 * @since 11 1676 */ 1677declare interface RichEditorImageSpan { 1678 /** 1679 * The position of the image span. 1680 * 1681 * @type { RichEditorSpanPosition } 1682 * @syscap SystemCapability.ArkUI.ArkUI.Full 1683 * @since 10 1684 */ 1685 /** 1686 * The position of the image span. 1687 * 1688 * @type { RichEditorSpanPosition } 1689 * @syscap SystemCapability.ArkUI.ArkUI.Full 1690 * @crossplatform 1691 * @atomicservice 1692 * @since 11 1693 */ 1694 spanPosition: RichEditorSpanPosition; 1695 1696 /** 1697 * The content of the image span. 1698 * 1699 * @type { PixelMap | ResourceStr } 1700 * @syscap SystemCapability.ArkUI.ArkUI.Full 1701 * @since 10 1702 */ 1703 /** 1704 * The content of the image span. 1705 * 1706 * @type { PixelMap | ResourceStr } 1707 * @syscap SystemCapability.ArkUI.ArkUI.Full 1708 * @crossplatform 1709 * @atomicservice 1710 * @since 11 1711 */ 1712 value: PixelMap | ResourceStr; 1713 1714 /** 1715 * image style. 1716 * 1717 * @type { ?RichEditorImageSpanStyle } 1718 * @syscap SystemCapability.ArkUI.ArkUI.Full 1719 * @since 10 1720 */ 1721 /** 1722 * image style. 1723 * 1724 * @type { ?RichEditorImageSpanStyle } 1725 * @syscap SystemCapability.ArkUI.ArkUI.Full 1726 * @crossplatform 1727 * @atomicservice 1728 * @since 11 1729 */ 1730 imageStyle?: RichEditorImageSpanStyle; 1731} 1732 1733/** 1734 * Defines range of RichEditor. 1735 * 1736 * @interface RichEditorRange 1737 * @syscap SystemCapability.ArkUI.ArkUI.Full 1738 * @since 10 1739 */ 1740/** 1741 * Defines range of RichEditor. 1742 * 1743 * @interface RichEditorRange 1744 * @syscap SystemCapability.ArkUI.ArkUI.Full 1745 * @crossplatform 1746 * @atomicservice 1747 * @since 11 1748 */ 1749declare interface RichEditorRange { 1750 /** 1751 * start offset. 1752 * 1753 * @type { ?number } 1754 * @default 0 1755 * @syscap SystemCapability.ArkUI.ArkUI.Full 1756 * @since 10 1757 */ 1758 /** 1759 * start offset. 1760 * 1761 * @type { ?number } 1762 * @default 0 1763 * @syscap SystemCapability.ArkUI.ArkUI.Full 1764 * @crossplatform 1765 * @atomicservice 1766 * @since 11 1767 */ 1768 start?: number; 1769 1770 /** 1771 * end offset. 1772 * 1773 * @type { ?number } 1774 * @default text length 1775 * @syscap SystemCapability.ArkUI.ArkUI.Full 1776 * @since 10 1777 */ 1778 /** 1779 * end offset. 1780 * 1781 * @type { ?number } 1782 * @default text length 1783 * @syscap SystemCapability.ArkUI.ArkUI.Full 1784 * @crossplatform 1785 * @atomicservice 1786 * @since 11 1787 */ 1788 end?: number; 1789} 1790 1791/** 1792 * Defines the richEditor Gestures. 1793 * 1794 * @interface RichEditorGesture 1795 * @syscap SystemCapability.ArkUI.ArkUI.Full 1796 * @crossplatform 1797 * @since 11 1798 */ 1799/** 1800 * Defines the richEditor Gestures. 1801 * 1802 * @interface RichEditorGesture 1803 * @syscap SystemCapability.ArkUI.ArkUI.Full 1804 * @crossplatform 1805 * @atomicservice 1806 * @since 12 1807 */ 1808declare interface RichEditorGesture { 1809 /** 1810 * Trigger a click event when a click is clicked. 1811 * 1812 * @type { ?function } 1813 * @syscap SystemCapability.ArkUI.ArkUI.Full 1814 * @crossplatform 1815 * @since 11 1816 */ 1817 /** 1818 * Trigger a click event when a click is clicked. 1819 * 1820 * @type { ?Callback<ClickEvent> } 1821 * @syscap SystemCapability.ArkUI.ArkUI.Full 1822 * @crossplatform 1823 * @atomicservice 1824 * @since 12 1825 */ 1826 onClick?: Callback<ClickEvent>; 1827 1828 /** 1829 * Trigger a gesture event when long press event is complete. 1830 * 1831 * @type { ?function } 1832 * @syscap SystemCapability.ArkUI.ArkUI.Full 1833 * @crossplatform 1834 * @since 11 1835 */ 1836 /** 1837 * Trigger a gesture event when long press event is complete. 1838 * 1839 * @type { ?Callback<GestureEvent> } 1840 * @syscap SystemCapability.ArkUI.ArkUI.Full 1841 * @crossplatform 1842 * @atomicservice 1843 * @since 12 1844 */ 1845 onLongPress?: Callback<GestureEvent>; 1846 1847 /** 1848 * Trigger a gesture event when a double click event is complete. 1849 * 1850 * @type { ?Callback<GestureEvent> } 1851 * @syscap SystemCapability.ArkUI.ArkUI.Full 1852 * @crossplatform 1853 * @systemapi 1854 * @since 14 1855 */ 1856 onDoubleClick?: Callback<GestureEvent>; 1857} 1858 1859/** 1860 * Defines the span options of RichEditor. 1861 * 1862 * @interface RichEditorTextSpanOptions 1863 * @syscap SystemCapability.ArkUI.ArkUI.Full 1864 * @since 10 1865 */ 1866/** 1867 * Defines the span options of RichEditor. 1868 * 1869 * @interface RichEditorTextSpanOptions 1870 * @syscap SystemCapability.ArkUI.ArkUI.Full 1871 * @crossplatform 1872 * @atomicservice 1873 * @since 11 1874 */ 1875declare interface RichEditorTextSpanOptions { 1876 /** 1877 * the offset that add a text span at. 1878 * 1879 * @type { ?number } 1880 * @syscap SystemCapability.ArkUI.ArkUI.Full 1881 * @since 10 1882 */ 1883 /** 1884 * the offset that add a text span at. 1885 * 1886 * @type { ?number } 1887 * @syscap SystemCapability.ArkUI.ArkUI.Full 1888 * @crossplatform 1889 * @atomicservice 1890 * @since 11 1891 */ 1892 offset?: number; 1893 1894 /** 1895 * text style. 1896 * 1897 * @type { ?RichEditorTextStyle } 1898 * @syscap SystemCapability.ArkUI.ArkUI.Full 1899 * @since 10 1900 */ 1901 /** 1902 * text style. 1903 * 1904 * @type { ?RichEditorTextStyle } 1905 * @syscap SystemCapability.ArkUI.ArkUI.Full 1906 * @crossplatform 1907 * @atomicservice 1908 * @since 11 1909 */ 1910 style?: RichEditorTextStyle; 1911 1912 /** 1913 * Paragraph style. 1914 * 1915 * @type { ?RichEditorParagraphStyle } 1916 * @syscap SystemCapability.ArkUI.ArkUI.Full 1917 * @crossplatform 1918 * @since 11 1919 */ 1920 /** 1921 * Paragraph style. 1922 * 1923 * @type { ?RichEditorParagraphStyle } 1924 * @syscap SystemCapability.ArkUI.ArkUI.Full 1925 * @crossplatform 1926 * @atomicservice 1927 * @since 12 1928 */ 1929 paragraphStyle?: RichEditorParagraphStyle; 1930 1931 /** 1932 * RichEditor gesture. 1933 * 1934 * @type { ?RichEditorGesture } 1935 * @syscap SystemCapability.ArkUI.ArkUI.Full 1936 * @crossplatform 1937 * @since 11 1938 */ 1939 /** 1940 * RichEditor gesture. 1941 * 1942 * @type { ?RichEditorGesture } 1943 * @syscap SystemCapability.ArkUI.ArkUI.Full 1944 * @crossplatform 1945 * @atomicservice 1946 * @since 12 1947 */ 1948 gesture?: RichEditorGesture; 1949} 1950/** 1951 * Defines the custom keyboard options of RichEditor. 1952 * 1953 * @interface KeyboardOptions 1954 * @syscap SystemCapability.ArkUI.ArkUI.Full 1955 * @crossplatform 1956 * @atomicservice 1957 * @since 12 1958 */ 1959 declare interface KeyboardOptions { 1960 /** 1961 * Indicates whether to support custom keyboard avoidance. 1962 * 1963 * @type { ?boolean } 1964 * @syscap SystemCapability.ArkUI.ArkUI.Full 1965 * @crossplatform 1966 * @atomicservice 1967 * @since 12 1968 */ 1969 supportAvoidance?: boolean; 1970} 1971 1972/** 1973 * Defines the image span options of RichEditor. 1974 * 1975 * @interface RichEditorImageSpanOptions 1976 * @syscap SystemCapability.ArkUI.ArkUI.Full 1977 * @since 10 1978 */ 1979/** 1980 * Defines the image span options of RichEditor. 1981 * 1982 * @interface RichEditorImageSpanOptions 1983 * @syscap SystemCapability.ArkUI.ArkUI.Full 1984 * @crossplatform 1985 * @atomicservice 1986 * @since 11 1987 */ 1988declare interface RichEditorImageSpanOptions { 1989 /** 1990 * the offset that add image span at. 1991 * 1992 * @type { ?number } 1993 * @syscap SystemCapability.ArkUI.ArkUI.Full 1994 * @since 10 1995 */ 1996 /** 1997 * the offset that add image span at. 1998 * 1999 * @type { ?number } 2000 * @syscap SystemCapability.ArkUI.ArkUI.Full 2001 * @crossplatform 2002 * @atomicservice 2003 * @since 11 2004 */ 2005 offset?: number; 2006 2007 /** 2008 * image style. 2009 * 2010 * @type { ?RichEditorImageSpanStyle } 2011 * @syscap SystemCapability.ArkUI.ArkUI.Full 2012 * @since 10 2013 */ 2014 /** 2015 * image style. 2016 * 2017 * @type { ?RichEditorImageSpanStyle } 2018 * @syscap SystemCapability.ArkUI.ArkUI.Full 2019 * @crossplatform 2020 * @atomicservice 2021 * @since 11 2022 */ 2023 imageStyle?: RichEditorImageSpanStyle; 2024 2025 /** 2026 * RichEditor gesture. 2027 * 2028 * @type { ?RichEditorGesture } 2029 * @syscap SystemCapability.ArkUI.ArkUI.Full 2030 * @crossplatform 2031 * @since 11 2032 */ 2033 /** 2034 * RichEditor gesture. 2035 * 2036 * @type { ?RichEditorGesture } 2037 * @syscap SystemCapability.ArkUI.ArkUI.Full 2038 * @crossplatform 2039 * @atomicservice 2040 * @since 12 2041 */ 2042 gesture?: RichEditorGesture; 2043 2044 /** 2045 * RichEditor onHover. 2046 * 2047 * @type { ?OnHoverCallback } 2048 * @syscap SystemCapability.ArkUI.ArkUI.Full 2049 * @crossplatform 2050 * @atomicservice 2051 * @since 14 2052 */ 2053 onHover?: OnHoverCallback; 2054} 2055 2056/** 2057 * Defines the builder span options of RichEditor. 2058 * 2059 * @interface RichEditorBuilderSpanOptions 2060 * @syscap SystemCapability.ArkUI.ArkUI.Full 2061 * @crossplatform 2062 * @since 11 2063 */ 2064/** 2065 * Defines the builder span options of RichEditor. 2066 * 2067 * @interface RichEditorBuilderSpanOptions 2068 * @syscap SystemCapability.ArkUI.ArkUI.Full 2069 * @crossplatform 2070 * @atomicservice 2071 * @since 12 2072 */ 2073declare interface RichEditorBuilderSpanOptions { 2074 /** 2075 * The offset that add custom builder span at. 2076 * 2077 * @type { ?number } Indicates the index where the builder will be inserted 2078 * @syscap SystemCapability.ArkUI.ArkUI.Full 2079 * @crossplatform 2080 * @since 11 2081 */ 2082 /** 2083 * The offset that add custom builder span at. 2084 * 2085 * @type { ?number } Indicates the index where the builder will be inserted 2086 * @syscap SystemCapability.ArkUI.ArkUI.Full 2087 * @crossplatform 2088 * @atomicservice 2089 * @since 12 2090 */ 2091 offset?: number; 2092} 2093 2094/** 2095 * Defines the placeholder style. 2096 * 2097 * @interface PlaceholderStyle 2098 * @syscap SystemCapability.ArkUI.ArkUI.Full 2099 * @crossplatform 2100 * @atomicservice 2101 * @since 12 2102 */ 2103declare interface PlaceholderStyle { 2104 /** 2105 * font. 2106 * 2107 * @type { ?Font } 2108 * @syscap SystemCapability.ArkUI.ArkUI.Full 2109 * @crossplatform 2110 * @atomicservice 2111 * @since 12 2112 */ 2113 font?: Font; 2114 2115 /** 2116 * fontColor. 2117 * 2118 * @type { ?ResourceColor } 2119 * @syscap SystemCapability.ArkUI.ArkUI.Full 2120 * @crossplatform 2121 * @atomicservice 2122 * @since 12 2123 */ 2124 fontColor?: ResourceColor; 2125} 2126 2127/** 2128 * Defines span style option of RichEditor. 2129 * 2130 * @extends RichEditorRange 2131 * @interface RichEditorSpanStyleOptions 2132 * @syscap SystemCapability.ArkUI.ArkUI.Full 2133 * @since 10 2134 */ 2135/** 2136 * Defines span style option of RichEditor. 2137 * 2138 * @extends RichEditorRange 2139 * @interface RichEditorSpanStyleOptions 2140 * @syscap SystemCapability.ArkUI.ArkUI.Full 2141 * @crossplatform 2142 * @atomicservice 2143 * @since 11 2144 */ 2145declare interface RichEditorSpanStyleOptions extends RichEditorRange { } 2146 2147/** 2148 * Defines paragraph style option of RichEditor. 2149 * 2150 * @extends RichEditorRange 2151 * @interface RichEditorParagraphStyleOptions 2152 * @syscap SystemCapability.ArkUI.ArkUI.Full 2153 * @crossplatform 2154 * @since 11 2155 */ 2156/** 2157 * Defines paragraph style option of RichEditor. 2158 * 2159 * @extends RichEditorRange 2160 * @interface RichEditorParagraphStyleOptions 2161 * @syscap SystemCapability.ArkUI.ArkUI.Full 2162 * @crossplatform 2163 * @atomicservice 2164 * @since 12 2165 */ 2166declare interface RichEditorParagraphStyleOptions extends RichEditorRange { 2167 /** 2168 * Paragraph style. 2169 * 2170 * @type { RichEditorParagraphStyle } 2171 * @syscap SystemCapability.ArkUI.ArkUI.Full 2172 * @crossplatform 2173 * @since 11 2174 */ 2175 /** 2176 * Paragraph style. 2177 * 2178 * @type { RichEditorParagraphStyle } 2179 * @syscap SystemCapability.ArkUI.ArkUI.Full 2180 * @crossplatform 2181 * @atomicservice 2182 * @since 12 2183 */ 2184 style: RichEditorParagraphStyle; 2185} 2186 2187/** 2188 * Defines text span style option of RichEditor. 2189 * 2190 * @extends RichEditorSpanStyleOptions 2191 * @interface RichEditorUpdateTextSpanStyleOptions 2192 * @syscap SystemCapability.ArkUI.ArkUI.Full 2193 * @since 10 2194 */ 2195/** 2196 * Defines text span style option of RichEditor. 2197 * 2198 * @extends RichEditorSpanStyleOptions 2199 * @interface RichEditorUpdateTextSpanStyleOptions 2200 * @syscap SystemCapability.ArkUI.ArkUI.Full 2201 * @crossplatform 2202 * @atomicservice 2203 * @since 11 2204 */ 2205declare interface RichEditorUpdateTextSpanStyleOptions extends RichEditorSpanStyleOptions { 2206 /** 2207 * text style. 2208 * 2209 * @type { RichEditorTextStyle } 2210 * @syscap SystemCapability.ArkUI.ArkUI.Full 2211 * @since 10 2212 */ 2213 /** 2214 * text style. 2215 * 2216 * @type { RichEditorTextStyle } 2217 * @syscap SystemCapability.ArkUI.ArkUI.Full 2218 * @crossplatform 2219 * @atomicservice 2220 * @since 11 2221 */ 2222 textStyle: RichEditorTextStyle; 2223} 2224 2225/** 2226 * Defines image span style option of RichEditor. 2227 * 2228 * @extends RichEditorSpanStyleOptions 2229 * @interface RichEditorUpdateImageSpanStyleOptions 2230 * @syscap SystemCapability.ArkUI.ArkUI.Full 2231 * @since 10 2232 */ 2233/** 2234 * Defines image span style option of RichEditor. 2235 * 2236 * @extends RichEditorSpanStyleOptions 2237 * @interface RichEditorUpdateImageSpanStyleOptions 2238 * @syscap SystemCapability.ArkUI.ArkUI.Full 2239 * @crossplatform 2240 * @atomicservice 2241 * @since 11 2242 */ 2243declare interface RichEditorUpdateImageSpanStyleOptions extends RichEditorSpanStyleOptions { 2244 /** 2245 * image style. 2246 * 2247 * @type { RichEditorImageSpanStyle } 2248 * @syscap SystemCapability.ArkUI.ArkUI.Full 2249 * @since 10 2250 */ 2251 /** 2252 * image style. 2253 * 2254 * @type { RichEditorImageSpanStyle } 2255 * @syscap SystemCapability.ArkUI.ArkUI.Full 2256 * @crossplatform 2257 * @atomicservice 2258 * @since 11 2259 */ 2260 imageStyle: RichEditorImageSpanStyle; 2261} 2262 2263/** 2264 * Defines symbol span style option of RichEditor. 2265 * 2266 * @extends RichEditorSpanStyleOptions 2267 * @interface RichEditorUpdateSymbolSpanStyleOptions 2268 * @syscap SystemCapability.ArkUI.ArkUI.Full 2269 * @crossplatform 2270 * @since 11 2271 */ 2272/** 2273 * Defines symbol span style option of RichEditor. 2274 * 2275 * @extends RichEditorSpanStyleOptions 2276 * @interface RichEditorUpdateSymbolSpanStyleOptions 2277 * @syscap SystemCapability.ArkUI.ArkUI.Full 2278 * @crossplatform 2279 * @atomicservice 2280 * @since 12 2281 */ 2282declare interface RichEditorUpdateSymbolSpanStyleOptions extends RichEditorSpanStyleOptions { 2283 /** 2284 * Update the symbol span style. 2285 * 2286 * @type { RichEditorSymbolSpanStyle } 2287 * @syscap SystemCapability.ArkUI.ArkUI.Full 2288 * @crossplatform 2289 * @since 11 2290 */ 2291 /** 2292 * Update the symbol span style. 2293 * 2294 * @type { RichEditorSymbolSpanStyle } 2295 * @syscap SystemCapability.ArkUI.ArkUI.Full 2296 * @crossplatform 2297 * @atomicservice 2298 * @since 12 2299 */ 2300 symbolStyle: RichEditorSymbolSpanStyle; 2301} 2302 2303/** 2304 * Defines the symbol span options of RichEditor. 2305 * 2306 * @interface RichEditorSymbolSpanOptions 2307 * @syscap SystemCapability.ArkUI.ArkUI.Full 2308 * @crossplatform 2309 * @since 11 2310 */ 2311/** 2312 * Defines the symbol span options of RichEditor. 2313 * 2314 * @interface RichEditorSymbolSpanOptions 2315 * @syscap SystemCapability.ArkUI.ArkUI.Full 2316 * @crossplatform 2317 * @atomicservice 2318 * @since 12 2319 */ 2320declare interface RichEditorSymbolSpanOptions { 2321 /** 2322 * The offset that add custom symbol span at. 2323 * 2324 * @type { ?number } 2325 * @syscap SystemCapability.ArkUI.ArkUI.Full 2326 * @crossplatform 2327 * @since 11 2328 */ 2329 /** 2330 * The offset that add custom symbol span at. 2331 * 2332 * @type { ?number } 2333 * @syscap SystemCapability.ArkUI.ArkUI.Full 2334 * @crossplatform 2335 * @atomicservice 2336 * @since 12 2337 */ 2338 offset?: number; 2339 2340 /** 2341 * The style that add custom symbol span at. 2342 * 2343 * @type { ?RichEditorSymbolSpanStyle } 2344 * @syscap SystemCapability.ArkUI.ArkUI.Full 2345 * @crossplatform 2346 * @since 11 2347 */ 2348 /** 2349 * The style that add custom symbol span at. 2350 * 2351 * @type { ?RichEditorSymbolSpanStyle } 2352 * @syscap SystemCapability.ArkUI.ArkUI.Full 2353 * @crossplatform 2354 * @atomicservice 2355 * @since 12 2356 */ 2357 style?: RichEditorSymbolSpanStyle; 2358} 2359 2360/** 2361 * Defines the text information for editing. 2362 * 2363 * @interface RichEditorSelection 2364 * @syscap SystemCapability.ArkUI.ArkUI.Full 2365 * @since 10 2366 */ 2367/** 2368 * Defines the text information for editing. 2369 * 2370 * @interface RichEditorSelection 2371 * @syscap SystemCapability.ArkUI.ArkUI.Full 2372 * @crossplatform 2373 * @atomicservice 2374 * @since 11 2375 */ 2376declare interface RichEditorSelection { 2377 /** 2378 * The location info. 2379 * 2380 * @type { [number, number] } 2381 * @syscap SystemCapability.ArkUI.ArkUI.Full 2382 * @since 10 2383 */ 2384 /** 2385 * The location info. 2386 * 2387 * @type { [number, number] } 2388 * @syscap SystemCapability.ArkUI.ArkUI.Full 2389 * @crossplatform 2390 * @atomicservice 2391 * @since 11 2392 */ 2393 selection: [number, number]; 2394 2395 /** 2396 * The selected text content. 2397 * 2398 * @type { Array<RichEditorTextSpanResult | RichEditorImageSpanResult> } 2399 * @syscap SystemCapability.ArkUI.ArkUI.Full 2400 * @since 10 2401 */ 2402 /** 2403 * The selected text content. 2404 * 2405 * @type { Array<RichEditorTextSpanResult | RichEditorImageSpanResult> } 2406 * @syscap SystemCapability.ArkUI.ArkUI.Full 2407 * @crossplatform 2408 * @atomicservice 2409 * @since 11 2410 */ 2411 spans: Array<RichEditorTextSpanResult | RichEditorImageSpanResult>; 2412} 2413 2414/** 2415 * Defines the inserted text value info. 2416 * 2417 * @interface RichEditorInsertValue 2418 * @syscap SystemCapability.ArkUI.ArkUI.Full 2419 * @since 10 2420 */ 2421/** 2422 * Defines the inserted text value info. 2423 * 2424 * @interface RichEditorInsertValue 2425 * @syscap SystemCapability.ArkUI.ArkUI.Full 2426 * @crossplatform 2427 * @atomicservice 2428 * @since 11 2429 */ 2430declare interface RichEditorInsertValue { 2431 /** 2432 * The location info where the value will be inserted. 2433 * 2434 * @type { number } 2435 * @syscap SystemCapability.ArkUI.ArkUI.Full 2436 * @since 10 2437 */ 2438 /** 2439 * The location info where the value will be inserted. 2440 * 2441 * @type { number } 2442 * @syscap SystemCapability.ArkUI.ArkUI.Full 2443 * @crossplatform 2444 * @atomicservice 2445 * @since 11 2446 */ 2447 insertOffset: number; 2448 2449 /** 2450 * The inserted value. 2451 * 2452 * @type { string } 2453 * @syscap SystemCapability.ArkUI.ArkUI.Full 2454 * @since 10 2455 */ 2456 /** 2457 * The inserted value. 2458 * 2459 * @type { string } 2460 * @syscap SystemCapability.ArkUI.ArkUI.Full 2461 * @crossplatform 2462 * @atomicservice 2463 * @since 11 2464 */ 2465 insertValue: string; 2466 2467 /** 2468 * The preview text. 2469 * 2470 * @type { ?string } 2471 * @syscap SystemCapability.ArkUI.ArkUI.Full 2472 * @crossplatform 2473 * @atomicservice 2474 * @since 12 2475 */ 2476 previewText?: string; 2477} 2478 2479/** 2480 * Provides an interface for deleting value from text. 2481 * 2482 * @interface RichEditorDeleteValue 2483 * @syscap SystemCapability.ArkUI.ArkUI.Full 2484 * @since 10 2485 */ 2486/** 2487 * Provides an interface for deleting value from text. 2488 * 2489 * @interface RichEditorDeleteValue 2490 * @syscap SystemCapability.ArkUI.ArkUI.Full 2491 * @crossplatform 2492 * @atomicservice 2493 * @since 11 2494 */ 2495declare interface RichEditorDeleteValue { 2496 /** 2497 * The offset of deleting. 2498 * 2499 * @type { number } 2500 * @syscap SystemCapability.ArkUI.ArkUI.Full 2501 * @since 10 2502 */ 2503 /** 2504 * The offset of deleting. 2505 * 2506 * @type { number } 2507 * @syscap SystemCapability.ArkUI.ArkUI.Full 2508 * @crossplatform 2509 * @atomicservice 2510 * @since 11 2511 */ 2512 offset: number; 2513 2514 /** 2515 * The deleted direction. 2516 * 2517 * @type { RichEditorDeleteDirection } 2518 * @syscap SystemCapability.ArkUI.ArkUI.Full 2519 * @since 10 2520 */ 2521 /** 2522 * The deleted direction. 2523 * 2524 * @type { RichEditorDeleteDirection } 2525 * @syscap SystemCapability.ArkUI.ArkUI.Full 2526 * @crossplatform 2527 * @atomicservice 2528 * @since 11 2529 */ 2530 direction: RichEditorDeleteDirection; 2531 2532 /** 2533 * The deleted text length. 2534 * 2535 * @type { number } 2536 * @syscap SystemCapability.ArkUI.ArkUI.Full 2537 * @since 10 2538 */ 2539 /** 2540 * The deleted text length. 2541 * 2542 * @type { number } 2543 * @syscap SystemCapability.ArkUI.ArkUI.Full 2544 * @crossplatform 2545 * @atomicservice 2546 * @since 11 2547 */ 2548 length: number; 2549 2550 /** 2551 * The deleted span object. 2552 * 2553 * @type { Array<RichEditorTextSpanResult | RichEditorImageSpanResult> } 2554 * @syscap SystemCapability.ArkUI.ArkUI.Full 2555 * @since 10 2556 */ 2557 /** 2558 * The deleted span object. 2559 * 2560 * @type { Array<RichEditorTextSpanResult | RichEditorImageSpanResult> } 2561 * @syscap SystemCapability.ArkUI.ArkUI.Full 2562 * @crossplatform 2563 * @atomicservice 2564 * @since 11 2565 */ 2566 richEditorDeleteSpans: Array<RichEditorTextSpanResult | RichEditorImageSpanResult>; 2567} 2568 2569/** 2570 * Provides an interface for changes in the text. 2571 * 2572 * @interface RichEditorChangeValue 2573 * @syscap SystemCapability.ArkUI.ArkUI.Full 2574 * @crossplatform 2575 * @atomicservice 2576 * @since 12 2577 */ 2578declare interface RichEditorChangeValue { 2579 /** 2580 * Range of content that will be replaced. 2581 * 2582 * @type { TextRange } 2583 * @syscap SystemCapability.ArkUI.ArkUI.Full 2584 * @crossplatform 2585 * @atomicservice 2586 * @since 12 2587 */ 2588 rangeBefore: TextRange; 2589 2590 /** 2591 * Text spans to replace. 2592 * 2593 * @type { Array<RichEditorTextSpanResult> } 2594 * @syscap SystemCapability.ArkUI.ArkUI.Full 2595 * @crossplatform 2596 * @atomicservice 2597 * @since 12 2598 */ 2599 replacedSpans: Array<RichEditorTextSpanResult>; 2600 2601 /** 2602 * Image spans to replace. 2603 * 2604 * @type { Array<RichEditorImageSpanResult> } 2605 * @syscap SystemCapability.ArkUI.ArkUI.Full 2606 * @crossplatform 2607 * @atomicservice 2608 * @since 12 2609 */ 2610 replacedImageSpans: Array<RichEditorImageSpanResult>; 2611 2612 /** 2613 * Symbol spans to replace. 2614 * 2615 * @type { Array<RichEditorTextSpanResult> } 2616 * @syscap SystemCapability.ArkUI.ArkUI.Full 2617 * @crossplatform 2618 * @atomicservice 2619 * @since 12 2620 */ 2621 replacedSymbolSpans: Array<RichEditorTextSpanResult>; 2622} 2623 2624/** 2625 * Defines the options of RichEditor. 2626 * 2627 * @interface RichEditorOptions 2628 * @syscap SystemCapability.ArkUI.ArkUI.Full 2629 * @since 10 2630 */ 2631/** 2632 * Defines the options of RichEditor. 2633 * 2634 * @interface RichEditorOptions 2635 * @syscap SystemCapability.ArkUI.ArkUI.Full 2636 * @crossplatform 2637 * @atomicservice 2638 * @since 11 2639 */ 2640declare interface RichEditorOptions { 2641 /** 2642 * RichEditor controller. 2643 * 2644 * @type { RichEditorController } 2645 * @syscap SystemCapability.ArkUI.ArkUI.Full 2646 * @since 10 2647 */ 2648 /** 2649 * RichEditor controller. 2650 * 2651 * @type { RichEditorController } 2652 * @syscap SystemCapability.ArkUI.ArkUI.Full 2653 * @crossplatform 2654 * @atomicservice 2655 * @since 11 2656 */ 2657 controller: RichEditorController; 2658} 2659 2660/** 2661 * Defines the options of RichEditor with StyledString. 2662 * 2663 * @interface RichEditorStyledStringOptions 2664 * @syscap SystemCapability.ArkUI.ArkUI.Full 2665 * @crossplatform 2666 * @atomicservice 2667 * @since 12 2668 */ 2669declare interface RichEditorStyledStringOptions { 2670 /** 2671 * RichEditor controller. 2672 * 2673 * @type { RichEditorStyledStringController } 2674 * @syscap SystemCapability.ArkUI.ArkUI.Full 2675 * @crossplatform 2676 * @atomicservice 2677 * @since 12 2678 */ 2679 controller: RichEditorStyledStringController; 2680} 2681 2682/** 2683 * Defines the selection menu options. 2684 * 2685 * @interface SelectionMenuOptions 2686 * @syscap SystemCapability.ArkUI.ArkUI.Full 2687 * @crossplatform 2688 * @since 10 2689 */ 2690/** 2691 * Defines the selection menu options. 2692 * 2693 * @interface SelectionMenuOptions 2694 * @syscap SystemCapability.ArkUI.ArkUI.Full 2695 * @crossplatform 2696 * @atomicservice 2697 * @since 11 2698 */ 2699declare interface SelectionMenuOptions { 2700 /** 2701 * Callback function when the selection menu appears. 2702 * 2703 * @type { ?function } 2704 * @syscap SystemCapability.ArkUI.ArkUI.Full 2705 * @crossplatform 2706 * @since 10 2707 */ 2708 /** 2709 * Callback function when the selection menu appears. 2710 * 2711 * @type { ?function } 2712 * @syscap SystemCapability.ArkUI.ArkUI.Full 2713 * @crossplatform 2714 * @atomicservice 2715 * @since 11 2716 */ 2717 /** 2718 * Callback function when the selection menu appears. 2719 * 2720 * @type { ?MenuOnAppearCallback } 2721 * @syscap SystemCapability.ArkUI.ArkUI.Full 2722 * @crossplatform 2723 * @atomicservice 2724 * @since 12 2725 */ 2726 onAppear?: MenuOnAppearCallback; 2727 2728 /** 2729 * Callback function when the selection menu disappears. 2730 * 2731 * @type { ?function } 2732 * @syscap SystemCapability.ArkUI.ArkUI.Full 2733 * @crossplatform 2734 * @since 10 2735 */ 2736 /** 2737 * Callback function when the selection menu disappears. 2738 * 2739 * @type { ?function } 2740 * @syscap SystemCapability.ArkUI.ArkUI.Full 2741 * @crossplatform 2742 * @atomicservice 2743 * @since 11 2744 */ 2745 /** 2746 * Callback function when the selection menu disappears. 2747 * 2748 * @type { ?Callback<void> } 2749 * @syscap SystemCapability.ArkUI.ArkUI.Full 2750 * @crossplatform 2751 * @atomicservice 2752 * @since 12 2753 */ 2754 onDisappear?: Callback<void>; 2755 2756 /** 2757 * Menu type, default value is MenuType.SELECTION_MENU. 2758 * 2759 * @type { ?MenuType } 2760 * @syscap SystemCapability.ArkUI.ArkUI.Full 2761 * @crossplatform 2762 * @atomicservice 2763 * @since 13 2764 */ 2765 menuType?: MenuType; 2766} 2767 2768/** 2769 * Provides Base Controller for RichEditor. 2770 * 2771 * @implements TextEditControllerEx 2772 * @syscap SystemCapability.ArkUI.ArkUI.Full 2773 * @crossplatform 2774 * @atomicservice 2775 * @since 12 2776 */ 2777declare class RichEditorBaseController implements TextEditControllerEx { 2778 /** 2779 * Get caret offset from controller. 2780 * 2781 * @returns { number } 2782 * @syscap SystemCapability.ArkUI.ArkUI.Full 2783 * @since 10 2784 */ 2785 /** 2786 * Get caret offset from controller. 2787 * 2788 * @returns { number } 2789 * @syscap SystemCapability.ArkUI.ArkUI.Full 2790 * @crossplatform 2791 * @atomicservice 2792 * @since 11 2793 */ 2794 getCaretOffset(): number; 2795 2796 /** 2797 * Set caret offset. 2798 * 2799 * @param { number } offset - caret offset. 2800 * @returns { boolean } 2801 * @syscap SystemCapability.ArkUI.ArkUI.Full 2802 * @since 10 2803 */ 2804 /** 2805 * Set caret offset. 2806 * 2807 * @param { number } offset - caret offset. 2808 * @returns { boolean } 2809 * @syscap SystemCapability.ArkUI.ArkUI.Full 2810 * @crossplatform 2811 * @atomicservice 2812 * @since 11 2813 */ 2814 setCaretOffset(offset: number): boolean; 2815 2816 /** 2817 * close the select menu when menu is on. 2818 * 2819 * @syscap SystemCapability.ArkUI.ArkUI.Full 2820 * @since 10 2821 */ 2822 /** 2823 * close the select menu when menu is on. 2824 * 2825 * @syscap SystemCapability.ArkUI.ArkUI.Full 2826 * @crossplatform 2827 * @atomicservice 2828 * @since 11 2829 */ 2830 closeSelectionMenu(): void; 2831 2832 /** 2833 * Get the typing text style. 2834 * 2835 * @returns { RichEditorTextStyle } 2836 * @syscap SystemCapability.ArkUI.ArkUI.Full 2837 * @crossplatform 2838 * @since 11 2839 */ 2840 /** 2841 * Get the typing text style. 2842 * 2843 * @returns { RichEditorTextStyle } 2844 * @syscap SystemCapability.ArkUI.ArkUI.Full 2845 * @crossplatform 2846 * @atomicservice 2847 * @since 12 2848 */ 2849 getTypingStyle(): RichEditorTextStyle; 2850 2851 /** 2852 * Set the typing text style. 2853 * 2854 * @param { RichEditorTextStyle } value - set the typing text style. 2855 * @syscap SystemCapability.ArkUI.ArkUI.Full 2856 * @crossplatform 2857 * @since 11 2858 */ 2859 /** 2860 * Set the typing text style. 2861 * 2862 * @param { RichEditorTextStyle } value - set the typing text style. 2863 * @syscap SystemCapability.ArkUI.ArkUI.Full 2864 * @crossplatform 2865 * @atomicservice 2866 * @since 12 2867 */ 2868 setTypingStyle(value: RichEditorTextStyle): void; 2869 2870 /** 2871 * Text selection is achieved by specifying the start and end positions of the rich editor. 2872 * 2873 * @param { number } selectionStart - The start position of the selected text. 2874 * @param { number } selectionEnd - The end position of the selected text. 2875 * @syscap SystemCapability.ArkUI.ArkUI.Full 2876 * @crossplatform 2877 * @since 11 2878 */ 2879 /** 2880 * Specify the start and end positions to select a range of content. 2881 * 2882 * @param { number } selectionStart - The start position of the selected text. 2883 * @param { number } selectionEnd - The end position of the selected text. 2884 * @param { SelectionOptions } [options] - Indicates the options of selection. 2885 * @syscap SystemCapability.ArkUI.ArkUI.Full 2886 * @crossplatform 2887 * @atomicservice 2888 * @since 12 2889 */ 2890 setSelection(selectionStart: number, selectionEnd: number, options?: SelectionOptions): void; 2891 2892 /** 2893 * Judge whether is in editing state 2894 * 2895 * @returns { boolean } - true is editing state, false is non editing status 2896 * @syscap SystemCapability.ArkUI.ArkUI.Full 2897 * @crossplatform 2898 * @atomicservice 2899 * @since 12 2900 */ 2901 isEditing(): boolean; 2902 2903 /** 2904 * Stop editing state. 2905 * 2906 * @syscap SystemCapability.ArkUI.ArkUI.Full 2907 * @crossplatform 2908 * @atomicservice 2909 * @since 12 2910 */ 2911 stopEditing(): void; 2912 2913 /** 2914 * Get LayoutManager. 2915 * 2916 * @returns { LayoutManager } - Return the LayoutManager. 2917 * @syscap SystemCapability.ArkUI.ArkUI.Full 2918 * @crossplatform 2919 * @atomicservice 2920 * @since 12 2921 */ 2922 getLayoutManager(): LayoutManager; 2923 2924 /** 2925 * Get PreviewText. 2926 * 2927 * @returns { PreviewText } - Return the PreviewText. 2928 * @syscap SystemCapability.ArkUI.ArkUI.Full 2929 * @crossplatform 2930 * @atomicservice 2931 * @since 12 2932 */ 2933 getPreviewText(): PreviewText; 2934} 2935 2936/** 2937 * Provides Controller for RichEditor. 2938 * 2939 * @syscap SystemCapability.ArkUI.ArkUI.Full 2940 * @since 10 2941 */ 2942/** 2943 * Provides Controller for RichEditor. 2944 * 2945 * @syscap SystemCapability.ArkUI.ArkUI.Full 2946 * @crossplatform 2947 * @atomicservice 2948 * @since 11 2949 */ 2950/** 2951 * Provides Controller for RichEditor. 2952 * 2953 * @extends RichEditorBaseController 2954 * @syscap SystemCapability.ArkUI.ArkUI.Full 2955 * @crossplatform 2956 * @atomicservice 2957 * @since 12 2958 */ 2959declare class RichEditorController extends RichEditorBaseController { 2960 /** 2961 * Add a text span. 2962 * 2963 * @param { string } value - text value. 2964 * @param { RichEditorTextSpanOptions } [options] - span info. 2965 * @returns { number } span index 2966 * @syscap SystemCapability.ArkUI.ArkUI.Full 2967 * @since 10 2968 */ 2969 /** 2970 * Add a text span. 2971 * 2972 * @param { string } value - text value. 2973 * @param { RichEditorTextSpanOptions } [options] - span info. 2974 * @returns { number } span index 2975 * @syscap SystemCapability.ArkUI.ArkUI.Full 2976 * @crossplatform 2977 * @atomicservice 2978 * @since 11 2979 */ 2980 addTextSpan(value: string, options?: RichEditorTextSpanOptions): number; 2981 2982 /** 2983 * Add a image span. 2984 * 2985 * @param { PixelMap | ResourceStr } value - image value. 2986 * @param { RichEditorImageSpanOptions } [options] - image span info. 2987 * @returns { number } span index 2988 * @syscap SystemCapability.ArkUI.ArkUI.Full 2989 * @since 10 2990 */ 2991 /** 2992 * Add a image span. 2993 * 2994 * @param { PixelMap | ResourceStr } value - image value. 2995 * @param { RichEditorImageSpanOptions } [options] - image span info. 2996 * @returns { number } span index 2997 * @syscap SystemCapability.ArkUI.ArkUI.Full 2998 * @crossplatform 2999 * @atomicservice 3000 * @since 11 3001 */ 3002 addImageSpan(value: PixelMap | ResourceStr, options?: RichEditorImageSpanOptions): number; 3003 3004 /** 3005 * Add a builder span. 3006 * 3007 * @param { CustomBuilder } value - Indicates the custom builder node 3008 * @param { RichEditorBuilderSpanOptions } [options] - span option. 3009 * @returns { number } span index 3010 * @syscap SystemCapability.ArkUI.ArkUI.Full 3011 * @crossplatform 3012 * @since 11 3013 */ 3014 /** 3015 * Add a builder span. 3016 * 3017 * @param { CustomBuilder } value - Indicates the custom builder node 3018 * @param { RichEditorBuilderSpanOptions } [options] - span option. 3019 * @returns { number } span index 3020 * @syscap SystemCapability.ArkUI.ArkUI.Full 3021 * @crossplatform 3022 * @atomicservice 3023 * @since 12 3024 */ 3025 addBuilderSpan(value: CustomBuilder, options?: RichEditorBuilderSpanOptions): number; 3026 3027 /** 3028 * Add a symbol span. 3029 * 3030 * @param { Resource } value - symbol span value 3031 * @param { RichEditorSymbolSpanOptions } [options] - symbol span option. 3032 * @returns { number } symbol span index 3033 * @syscap SystemCapability.ArkUI.ArkUI.Full 3034 * @crossplatform 3035 * @since 11 3036 */ 3037 /** 3038 * Add a symbol span. 3039 * 3040 * @param { Resource } value - symbol span value 3041 * @param { RichEditorSymbolSpanOptions } [options] - symbol span option. 3042 * @returns { number } symbol span index 3043 * @syscap SystemCapability.ArkUI.ArkUI.Full 3044 * @crossplatform 3045 * @atomicservice 3046 * @since 12 3047 */ 3048 addSymbolSpan(value: Resource, options?: RichEditorSymbolSpanOptions ): number; 3049 3050 /** 3051 * Modify span style. 3052 * 3053 * @param { RichEditorUpdateTextSpanStyleOptions | RichEditorUpdateImageSpanStyleOptions } value 3054 * @syscap SystemCapability.ArkUI.ArkUI.Full 3055 * @since 10 3056 */ 3057 /** 3058 * Modify span style. 3059 * 3060 * @param { RichEditorUpdateTextSpanStyleOptions | RichEditorUpdateImageSpanStyleOptions | RichEditorUpdateSymbolSpanStyleOptions } value 3061 * @syscap SystemCapability.ArkUI.ArkUI.Full 3062 * @crossplatform 3063 * @atomicservice 3064 * @since 11 3065 */ 3066 updateSpanStyle(value: RichEditorUpdateTextSpanStyleOptions | RichEditorUpdateImageSpanStyleOptions | RichEditorUpdateSymbolSpanStyleOptions): void; 3067 3068 /** 3069 * Modify span style. 3070 * 3071 * @param { RichEditorParagraphStyleOptions } value 3072 * @syscap SystemCapability.ArkUI.ArkUI.Full 3073 * @crossplatform 3074 * @since 11 3075 */ 3076 /** 3077 * Modify span style. 3078 * 3079 * @param { RichEditorParagraphStyleOptions } value 3080 * @syscap SystemCapability.ArkUI.ArkUI.Full 3081 * @crossplatform 3082 * @atomicservice 3083 * @since 12 3084 */ 3085 updateParagraphStyle(value: RichEditorParagraphStyleOptions): void; 3086 3087 /** 3088 * Delete span. 3089 * 3090 * @param { RichEditorRange } [value] - range for deleting. 3091 * @syscap SystemCapability.ArkUI.ArkUI.Full 3092 * @since 10 3093 */ 3094 /** 3095 * Delete span. 3096 * 3097 * @param { RichEditorRange } [value] - range for deleting. 3098 * @syscap SystemCapability.ArkUI.ArkUI.Full 3099 * @crossplatform 3100 * @atomicservice 3101 * @since 11 3102 */ 3103 deleteSpans(value?: RichEditorRange): void; 3104 3105 /** 3106 * Get span content. 3107 * 3108 * @param { RichEditorRange } [value] - range for getting span info. 3109 * @returns { Array<RichEditorImageSpanResult | RichEditorTextSpanResult> } 3110 * @syscap SystemCapability.ArkUI.ArkUI.Full 3111 * @since 10 3112 */ 3113 /** 3114 * Get span content. 3115 * 3116 * @param { RichEditorRange } [value] - range for getting span info. 3117 * @returns { Array<RichEditorImageSpanResult | RichEditorTextSpanResult> } 3118 * @syscap SystemCapability.ArkUI.ArkUI.Full 3119 * @crossplatform 3120 * @atomicservice 3121 * @since 11 3122 */ 3123 getSpans(value?: RichEditorRange): Array<RichEditorImageSpanResult | RichEditorTextSpanResult>; 3124 3125 /** 3126 * Get span content. 3127 * 3128 * @param { RichEditorRange } [value] - range for getting span info. 3129 * @returns { Array<RichEditorParagraphResult> } 3130 * @syscap SystemCapability.ArkUI.ArkUI.Full 3131 * @crossplatform 3132 * @since 11 3133 */ 3134 /** 3135 * Get span content. 3136 * 3137 * @param { RichEditorRange } [value] - range for getting span info. 3138 * @returns { Array<RichEditorParagraphResult> } 3139 * @syscap SystemCapability.ArkUI.ArkUI.Full 3140 * @crossplatform 3141 * @atomicservice 3142 * @since 12 3143 */ 3144 getParagraphs(value?: RichEditorRange): Array<RichEditorParagraphResult>; 3145 3146 /** 3147 * Called when the content is selected. 3148 * 3149 * @returns { RichEditorSelection } 3150 * @syscap SystemCapability.ArkUI.ArkUI.Full 3151 * @crossplatform 3152 * @since 11 3153 */ 3154 /** 3155 * Called when the content is selected. 3156 * 3157 * @returns { RichEditorSelection } 3158 * @syscap SystemCapability.ArkUI.ArkUI.Full 3159 * @crossplatform 3160 * @atomicservice 3161 * @since 12 3162 */ 3163 getSelection(): RichEditorSelection; 3164 3165 /** 3166 * Convert StyledString to spans in rich editor. 3167 * return a empty Array<RichEditorSpan> if convert failed 3168 * 3169 * @param { StyledString } value - StyledString. 3170 * @returns { Array<RichEditorSpan> } 3171 * @throws { BusinessError } 401 - The parameter check failed. 3172 * @syscap SystemCapability.ArkUI.ArkUI.Full 3173 * @crossplatform 3174 * @atomicservice 3175 * @since 12 3176 */ 3177 fromStyledString(value: StyledString): Array<RichEditorSpan>; 3178 3179 /** 3180 * Convert spans to StyledString in rich editor. 3181 * return a empty StyledString if convert failed 3182 * 3183 * @param { RichEditorRange } value - range of spans in rich editor 3184 * @returns { StyledString } 3185 * @throws { BusinessError } 401 - The parameter check failed. 3186 * @syscap SystemCapability.ArkUI.ArkUI.Full 3187 * @crossplatform 3188 * @atomicservice 3189 * @since 12 3190 */ 3191 toStyledString(value: RichEditorRange): StyledString; 3192} 3193 3194/** 3195 * Defines the types of spans in rich editor. 3196 * 3197 * @typedef { RichEditorImageSpanResult | RichEditorTextSpanResult } RichEditorSpan 3198 * @syscap SystemCapability.ArkUI.ArkUI.Full 3199 * @crossplatform 3200 * @atomicservice 3201 * @since 12 3202 */ 3203declare type RichEditorSpan = RichEditorImageSpanResult | RichEditorTextSpanResult; 3204 3205/** 3206 * Provides Controller for RichEditor with StyledString. 3207 * 3208 * @extends RichEditorBaseController 3209 * @implements StyledStringController 3210 * @syscap SystemCapability.ArkUI.ArkUI.Full 3211 * @crossplatform 3212 * @atomicservice 3213 * @since 12 3214 */ 3215declare class RichEditorStyledStringController extends RichEditorBaseController implements StyledStringController { 3216 /** 3217 * Set the StyledString of the RichEditor. 3218 * 3219 * @param { StyledString } styledString - StyledString. 3220 * @syscap SystemCapability.ArkUI.ArkUI.Full 3221 * @crossplatform 3222 * @atomicservice 3223 * @since 12 3224 */ 3225 setStyledString(styledString: StyledString): void; 3226 3227 /** 3228 * Get the StyledString of the RichEditor. 3229 * 3230 * @returns { MutableStyledString } 3231 * @syscap SystemCapability.ArkUI.ArkUI.Full 3232 * @atomicservice 3233 * @since 12 3234 */ 3235 getStyledString(): MutableStyledString; 3236 3237 /** 3238 * Get the selection in the StyledString of the RichEditor. 3239 * 3240 * @returns { RichEditorRange } 3241 * @syscap SystemCapability.ArkUI.ArkUI.Full 3242 * @crossplatform 3243 * @atomicservice 3244 * @since 12 3245 */ 3246 getSelection(): RichEditorRange; 3247 3248 /** 3249 * Register content changed listener 3250 * 3251 * @param { StyledStringChangedListener } listener - content changed listener. 3252 * @syscap SystemCapability.ArkUI.ArkUI.Full 3253 * @crossplatform 3254 * @atomicservice 3255 * @since 12 3256 */ 3257 onContentChanged(listener: StyledStringChangedListener): void; 3258} 3259 3260/** 3261 * Provides attribute for RichEditor. 3262 * 3263 * @extends CommonMethod<RichEditorAttribute> 3264 * @syscap SystemCapability.ArkUI.ArkUI.Full 3265 * @since 10 3266 */ 3267/** 3268 * Provides attribute for RichEditor. 3269 * 3270 * @extends CommonMethod<RichEditorAttribute> 3271 * @syscap SystemCapability.ArkUI.ArkUI.Full 3272 * @crossplatform 3273 * @atomicservice 3274 * @since 11 3275 */ 3276declare class RichEditorAttribute extends CommonMethod<RichEditorAttribute> { 3277 /** 3278 * Called when on ready. 3279 * 3280 * @param { function } callback - The triggered function when rich editor is ready. 3281 * @returns { RichEditorAttribute } 3282 * @syscap SystemCapability.ArkUI.ArkUI.Full 3283 * @since 10 3284 */ 3285 /** 3286 * Called when on ready. 3287 * 3288 * @param { function } callback - The triggered function when rich editor is ready. 3289 * @returns { RichEditorAttribute } 3290 * @syscap SystemCapability.ArkUI.ArkUI.Full 3291 * @crossplatform 3292 * @atomicservice 3293 * @since 11 3294 */ 3295 /** 3296 * Called when on ready. 3297 * 3298 * @param { Callback<void> } callback - The triggered function when rich editor is ready. 3299 * @returns { RichEditorAttribute } 3300 * @syscap SystemCapability.ArkUI.ArkUI.Full 3301 * @crossplatform 3302 * @atomicservice 3303 * @since 12 3304 */ 3305 onReady(callback: Callback<void>): RichEditorAttribute; 3306 3307 /** 3308 * Called when the content is selected. 3309 * 3310 * @param { function } callback - The triggered function when select text. 3311 * @returns { RichEditorAttribute } 3312 * @syscap SystemCapability.ArkUI.ArkUI.Full 3313 * @since 10 3314 */ 3315 /** 3316 * Called when the content is selected. 3317 * 3318 * @param { function } callback - The triggered function when select text. 3319 * @returns { RichEditorAttribute } 3320 * @syscap SystemCapability.ArkUI.ArkUI.Full 3321 * @crossplatform 3322 * @atomicservice 3323 * @since 11 3324 */ 3325 /** 3326 * Called when the content is selected. 3327 * 3328 * @param { Callback<RichEditorSelection> } callback - The triggered function when select text. 3329 * @returns { RichEditorAttribute } 3330 * @syscap SystemCapability.ArkUI.ArkUI.Full 3331 * @crossplatform 3332 * @atomicservice 3333 * @since 12 3334 */ 3335 onSelect(callback: Callback<RichEditorSelection>): RichEditorAttribute; 3336 3337 /** 3338 * Called when selection range or caret position is changed. 3339 * 3340 * @param { Callback<RichEditorRange> } callback - The triggered function when change selection range or caret position. 3341 * @returns { RichEditorAttribute } 3342 * @syscap SystemCapability.ArkUI.ArkUI.Full 3343 * @crossplatform 3344 * @atomicservice 3345 * @since 12 3346 */ 3347 onSelectionChange(callback: Callback<RichEditorRange>): RichEditorAttribute; 3348 3349 /** 3350 * Get text value information when about to input. 3351 * 3352 * @param { function } callback - The triggered function when text content is about to insert. 3353 * @returns { RichEditorAttribute } 3354 * @syscap SystemCapability.ArkUI.ArkUI.Full 3355 * @since 10 3356 */ 3357 /** 3358 * Get text value information when about to input. 3359 * 3360 * @param { function } callback - The triggered function when text content is about to insert. 3361 * @returns { RichEditorAttribute } 3362 * @syscap SystemCapability.ArkUI.ArkUI.Full 3363 * @crossplatform 3364 * @atomicservice 3365 * @since 11 3366 */ 3367 /** 3368 * Get text value information when about to input. 3369 * 3370 * @param { Callback<RichEditorInsertValue, boolean> } callback - The triggered function when text content is about to insert. 3371 * @returns { RichEditorAttribute } 3372 * @syscap SystemCapability.ArkUI.ArkUI.Full 3373 * @crossplatform 3374 * @atomicservice 3375 * @since 12 3376 */ 3377 aboutToIMEInput(callback: Callback<RichEditorInsertValue, boolean>): RichEditorAttribute; 3378 3379 /** 3380 * Get text value information when completed input. 3381 * 3382 * @param { function } callback - The triggered function when text content has been inserted. 3383 * @returns { RichEditorAttribute } 3384 * @syscap SystemCapability.ArkUI.ArkUI.Full 3385 * @since 10 3386 */ 3387 /** 3388 * Get text value information when completed input. 3389 * 3390 * @param { function } callback - The triggered function when text content has been inserted. 3391 * @returns { RichEditorAttribute } 3392 * @syscap SystemCapability.ArkUI.ArkUI.Full 3393 * @crossplatform 3394 * @atomicservice 3395 * @since 11 3396 */ 3397 /** 3398 * Get text value information when completed input. 3399 * 3400 * @param { Callback<RichEditorTextSpanResult> } callback - The triggered function when text content has been inserted. 3401 * @returns { RichEditorAttribute } 3402 * @syscap SystemCapability.ArkUI.ArkUI.Full 3403 * @crossplatform 3404 * @atomicservice 3405 * @since 12 3406 */ 3407 onIMEInputComplete(callback: Callback<RichEditorTextSpanResult>): RichEditorAttribute; 3408 3409 /** 3410 * Called when ime input complete. 3411 * 3412 * @param { Callback<TextRange> } callback - The triggered function when text content has been inserted. 3413 * @returns { RichEditorAttribute } 3414 * @syscap SystemCapability.ArkUI.ArkUI.Full 3415 * @crossplatform 3416 * @atomicservice 3417 * @since 12 3418 */ 3419 onDidIMEInput(callback: Callback<TextRange>): RichEditorAttribute; 3420 3421 /** 3422 * Get text value information when about to delete. 3423 * 3424 * @param { function } callback - The triggered function when text content is about to delete. 3425 * @returns { RichEditorAttribute } 3426 * @syscap SystemCapability.ArkUI.ArkUI.Full 3427 * @since 10 3428 */ 3429 /** 3430 * Get text value information when about to delete. 3431 * 3432 * @param { function } callback - The triggered function when text content is about to delete. 3433 * @returns { RichEditorAttribute } 3434 * @syscap SystemCapability.ArkUI.ArkUI.Full 3435 * @crossplatform 3436 * @atomicservice 3437 * @since 11 3438 */ 3439 /** 3440 * Get text value information when about to delete. 3441 * 3442 * @param { Callback<RichEditorDeleteValue, boolean> } callback - The triggered function when text content is about to delete. 3443 * @returns { RichEditorAttribute } 3444 * @syscap SystemCapability.ArkUI.ArkUI.Full 3445 * @crossplatform 3446 * @atomicservice 3447 * @since 12 3448 */ 3449 aboutToDelete(callback: Callback<RichEditorDeleteValue, boolean>): RichEditorAttribute; 3450 3451 /** 3452 * Notify that the deletion has been completed 3453 * 3454 * @param { function } callback - The triggered function when text content has been deleted. 3455 * @returns { RichEditorAttribute } 3456 * @syscap SystemCapability.ArkUI.ArkUI.Full 3457 * @since 10 3458 */ 3459 /** 3460 * Notify that the deletion has been completed 3461 * 3462 * @param { function } callback - The triggered function when text content has been deleted. 3463 * @returns { RichEditorAttribute } 3464 * @syscap SystemCapability.ArkUI.ArkUI.Full 3465 * @crossplatform 3466 * @atomicservice 3467 * @since 11 3468 */ 3469 /** 3470 * Notify that the deletion has been completed 3471 * 3472 * @param { Callback<void> } callback - The triggered function when text content has been deleted. 3473 * @returns { RichEditorAttribute } 3474 * @syscap SystemCapability.ArkUI.ArkUI.Full 3475 * @crossplatform 3476 * @atomicservice 3477 * @since 12 3478 */ 3479 onDeleteComplete(callback: Callback<void>): RichEditorAttribute; 3480 3481 /** 3482 * Allow replication. 3483 * 3484 * @param { CopyOptions } value - Indicates the type of copy option. 3485 * @returns { RichEditorAttribute } 3486 * @syscap SystemCapability.ArkUI.ArkUI.Full 3487 * @crossplatform 3488 * @since 10 3489 */ 3490 /** 3491 * Allow replication. 3492 * 3493 * @param { CopyOptions } value - Indicates the type of copy option. 3494 * @returns { RichEditorAttribute } 3495 * @syscap SystemCapability.ArkUI.ArkUI.Full 3496 * @crossplatform 3497 * @atomicservice 3498 * @since 11 3499 */ 3500 copyOptions(value: CopyOptions): RichEditorAttribute; 3501 3502 /** 3503 * Bind to the selection menu. 3504 * 3505 * @param { RichEditorSpanType } spanType - Indicates the type of selection menu. 3506 * @param { CustomBuilder } content - Indicates the content of selection menu. 3507 * @param { ResponseType } responseType - Indicates response type of selection menu. 3508 * @param { SelectionMenuOptions } [options] - Indicates the options of selection menu. 3509 * @returns { RichEditorAttribute } 3510 * @syscap SystemCapability.ArkUI.ArkUI.Full 3511 * @crossplatform 3512 * @since 10 3513 */ 3514 /** 3515 * Bind to the selection menu. 3516 * 3517 * @param { RichEditorSpanType } spanType - Indicates the type of selection menu. 3518 * @param { CustomBuilder } content - Indicates the content of selection menu. 3519 * @param { ResponseType | RichEditorResponseType } responseType - Indicates response type of selection menu. 3520 * @param { SelectionMenuOptions } [options] - Indicates the options of selection menu. 3521 * @returns { RichEditorAttribute } 3522 * @syscap SystemCapability.ArkUI.ArkUI.Full 3523 * @crossplatform 3524 * @atomicservice 3525 * @since 11 3526 */ 3527 bindSelectionMenu(spanType: RichEditorSpanType, content: CustomBuilder, responseType: ResponseType | RichEditorResponseType, 3528 options?: SelectionMenuOptions): RichEditorAttribute; 3529 3530 /** 3531 * Define custom keyboard. 3532 * 3533 * @param { CustomBuilder } value 3534 * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. 3535 * @syscap SystemCapability.ArkUI.ArkUI.Full 3536 * @since 10 3537 */ 3538 /** 3539 * Define custom keyboard. 3540 * 3541 * @param { CustomBuilder } value 3542 * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. 3543 * @syscap SystemCapability.ArkUI.ArkUI.Full 3544 * @crossplatform 3545 * @atomicservice 3546 * @since 11 3547 */ 3548 /** 3549 * Define custom keyboard. 3550 * 3551 * @param { CustomBuilder } value - Set up a custom keyboard of RichEditor 3552 * @param { KeyboardOptions } [options] - Indicates the custom keyboard options of RichEditor 3553 * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. 3554 * @syscap SystemCapability.ArkUI.ArkUI.Full 3555 * @crossplatform 3556 * @atomicservice 3557 * @since 12 3558 */ 3559 customKeyboard(value: CustomBuilder, options?: KeyboardOptions): RichEditorAttribute; 3560 3561 /** 3562 * Defines onPaste callback. 3563 * 3564 * @param { function } callback Executed when a paste operation is performed. 3565 * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. 3566 * @syscap SystemCapability.ArkUI.ArkUI.Full 3567 * @crossplatform 3568 * @since 11 3569 */ 3570 /** 3571 * Defines onPaste callback. 3572 * 3573 * @param { PasteEventCallback } callback Executed when a paste operation is performed. 3574 * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. 3575 * @syscap SystemCapability.ArkUI.ArkUI.Full 3576 * @crossplatform 3577 * @atomicservice 3578 * @since 12 3579 */ 3580 onPaste(callback: PasteEventCallback): RichEditorAttribute; 3581 3582 /** 3583 * Enable data detector. 3584 * 3585 * @param { boolean } enable - Enable data detector. 3586 * @returns { RichEditorAttribute } The attribute of the rich editor. 3587 * @syscap SystemCapability.ArkUI.ArkUI.Full 3588 * @crossplatform 3589 * @since 11 3590 */ 3591 /** 3592 * Enable data detector. 3593 * 3594 * @param { boolean } enable - Enable data detector. 3595 * @returns { RichEditorAttribute } The attribute of the rich editor. 3596 * @syscap SystemCapability.ArkUI.ArkUI.Full 3597 * @crossplatform 3598 * @atomicservice 3599 * @since 12 3600 */ 3601 enableDataDetector(enable: boolean): RichEditorAttribute; 3602 3603 /** 3604 * Enable preview text. 3605 * 3606 * @param { boolean } enable - Enable preview text. 3607 * @returns { RichEditorAttribute } The attribute of the rich editor. 3608 * @syscap SystemCapability.ArkUI.ArkUI.Full 3609 * @crossplatform 3610 * @atomicservice 3611 * @since 12 3612 */ 3613 enablePreviewText(enable: boolean): RichEditorAttribute; 3614 3615 /** 3616 * Data detector with config. 3617 * 3618 * @param { TextDataDetectorConfig } config - The config of text data detector. 3619 * @returns { RichEditorAttribute } The attribute of the rich editor. 3620 * @syscap SystemCapability.ArkUI.ArkUI.Full 3621 * @crossplatform 3622 * @since 11 3623 */ 3624 /** 3625 * Data detector with config. 3626 * 3627 * @param { TextDataDetectorConfig } config - The config of text data detector. 3628 * @returns { RichEditorAttribute } The attribute of the rich editor. 3629 * @syscap SystemCapability.ArkUI.ArkUI.Full 3630 * @crossplatform 3631 * @atomicservice 3632 * @since 12 3633 */ 3634 dataDetectorConfig(config: TextDataDetectorConfig): RichEditorAttribute; 3635 3636 /** 3637 * Set richEditor placeholder. 3638 * 3639 * @param { ResourceStr } value - The value of placeholder. 3640 * @param { PlaceholderStyle } [style] - The style of placeholder. 3641 * @returns { RichEditorAttribute } The attribute of the rich editor. 3642 * @syscap SystemCapability.ArkUI.ArkUI.Full 3643 * @crossplatform 3644 * @atomicservice 3645 * @since 12 3646 */ 3647 placeholder(value: ResourceStr, style?: PlaceholderStyle): RichEditorAttribute; 3648 3649 /** 3650 * Set caret color of rich editor. 3651 * 3652 * @param { ResourceColor } value - Custom color types. 3653 * @returns { RichEditorAttribute } The attribute of the rich editor. 3654 * @syscap SystemCapability.ArkUI.ArkUI.Full 3655 * @crossplatform 3656 * @atomicservice 3657 * @since 12 3658 */ 3659 caretColor(value: ResourceColor): RichEditorAttribute; 3660 3661 /** 3662 * Set background color of selected text in rich editor. 3663 * 3664 * @param { ResourceColor } value - Custom color types. 3665 * @returns { RichEditorAttribute } The attribute of the rich editor. 3666 * @syscap SystemCapability.ArkUI.ArkUI.Full 3667 * @crossplatform 3668 * @atomicservice 3669 * @since 12 3670 */ 3671 selectedBackgroundColor(value: ResourceColor): RichEditorAttribute; 3672 3673 /** 3674 * Called when edit status is changed 3675 * 3676 * @param { Callback<boolean> } callback - when edit status is changed 3677 * @returns { RichEditorAttribute } returns The attribute of the rich editor. 3678 * @syscap SystemCapability.ArkUI.ArkUI.Full 3679 * @crossplatform 3680 * @atomicservice 3681 * @since 12 3682 */ 3683 onEditingChange(callback: Callback<boolean>): RichEditorAttribute; 3684 3685 /** 3686 * Set enter key type of soft keyboard. 3687 * 3688 * @param { EnterKeyType } value - the enter key type of soft keyboard 3689 * @returns { RichEditorAttribute } 3690 * @syscap SystemCapability.ArkUI.ArkUI.Full 3691 * @crossplatform 3692 * @atomicservice 3693 * @since 12 3694 */ 3695 enterKeyType(value: EnterKeyType): RichEditorAttribute; 3696 3697 /** 3698 * Called when submitted. 3699 * 3700 * @param { SubmitCallback } callback - callback of the listened event. 3701 * @returns { RichEditorAttribute } 3702 * @syscap SystemCapability.ArkUI.ArkUI.Full 3703 * @crossplatform 3704 * @atomicservice 3705 * @since 12 3706 */ 3707 onSubmit(callback: SubmitCallback): RichEditorAttribute; 3708 3709 /** 3710 * Called before text changed. 3711 * 3712 * @param { Callback<RichEditorChangeValue, boolean> } callback - The triggered function before text content is about to change. 3713 * @returns { RichEditorAttribute } 3714 * @syscap SystemCapability.ArkUI.ArkUI.Full 3715 * @crossplatform 3716 * @atomicservice 3717 * @since 12 3718 */ 3719 onWillChange(callback: Callback<RichEditorChangeValue, boolean>) : RichEditorAttribute; 3720 3721 /** 3722 * Called after text changed. 3723 * 3724 * @param { OnDidChangeCallback } callback - The triggered function after content changed. 3725 * @returns { RichEditorAttribute } 3726 * @syscap SystemCapability.ArkUI.ArkUI.Full 3727 * @crossplatform 3728 * @atomicservice 3729 * @since 12 3730 */ 3731 onDidChange(callback: OnDidChangeCallback) : RichEditorAttribute; 3732 3733 /** 3734 * Called before the cut event. 3735 * 3736 * @param { Callback<CutEvent> } callback - Called before the cut event. 3737 * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. 3738 * @syscap SystemCapability.ArkUI.ArkUI.Full 3739 * @crossplatform 3740 * @atomicservice 3741 * @since 12 3742 */ 3743 onCut(callback: Callback<CutEvent>): RichEditorAttribute; 3744 3745 /** 3746 * Called before the copy event. 3747 * 3748 * @param { Callback<CopyEvent> } callback - Called before the copy event. 3749 * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. 3750 * @syscap SystemCapability.ArkUI.ArkUI.Full 3751 * @crossplatform 3752 * @atomicservice 3753 * @since 12 3754 */ 3755 onCopy(callback: Callback<CopyEvent>): RichEditorAttribute; 3756 3757 /** 3758 * Set the custom text menu. 3759 * 3760 * @param { EditMenuOptions } editMenu - Customize text menu options. 3761 * @returns { RichEditorAttribute } 3762 * @syscap SystemCapability.ArkUI.ArkUI.Full 3763 * @crossplatform 3764 * @atomicservice 3765 * @since 12 3766 */ 3767 editMenuOptions(editMenu: EditMenuOptions): RichEditorAttribute; 3768 3769 /** 3770 * Sets whether request keyboard or not when on focus. 3771 * 3772 * @param { boolean } isEnabled - Whether enable request keyboard when on focus. 3773 * @returns { RichEditorAttribute } Returns the instance of the RichEditorAttribute. 3774 * @syscap SystemCapability.ArkUI.ArkUI.Full 3775 * @crossplatform 3776 * @atomicservice 3777 * @since 12 3778 */ 3779 enableKeyboardOnFocus(isEnabled: boolean): RichEditorAttribute; 3780 3781 /** 3782 * Enable or disable haptic feedback. 3783 * 3784 * @param { boolean } isEnabled - Default value is true, set false to disable haptic feedback. 3785 * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. 3786 * @syscap SystemCapability.ArkUI.ArkUI.Full 3787 * @crossplatform 3788 * @atomicservice 3789 * @since 13 3790 */ 3791 enableHapticFeedback(isEnabled: boolean): RichEditorAttribute; 3792 3793 /** 3794 * Define bar state of the RichEditor. 3795 * 3796 * @param { BarState } state - bar state. 3797 * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute. 3798 * @syscap SystemCapability.ArkUI.ArkUI.Full 3799 * @crossplatform 3800 * @atomicservice 3801 * @since 13 3802 */ 3803 barState(state: BarState): RichEditorAttribute; 3804} 3805 3806/** 3807 * the callback of cut event. 3808 * @interface CutEvent 3809 * @syscap SystemCapability.ArkUI.ArkUI.Full 3810 * @crossplatform 3811 * @atomicservice 3812 * @since 12 3813 */ 3814declare interface CutEvent { 3815 /** 3816 * Prevent system cut event. 3817 * 3818 * @type { ?Callback<void> } 3819 * @syscap SystemCapability.ArkUI.ArkUI.Full 3820 * @crossplatform 3821 * @atomicservice 3822 * @since 12 3823 */ 3824 preventDefault?: Callback<void>; 3825} 3826 3827/** 3828 * the callback of copy event. 3829 * @interface CopyEvent 3830 * @syscap SystemCapability.ArkUI.ArkUI.Full 3831 * @crossplatform 3832 * @atomicservice 3833 * @since 12 3834 */ 3835declare interface CopyEvent { 3836 /** 3837 * Prevent system cut event. 3838 * 3839 * @type { ?Callback<void> } 3840 * @syscap SystemCapability.ArkUI.ArkUI.Full 3841 * @crossplatform 3842 * @atomicservice 3843 * @since 12 3844 */ 3845 preventDefault?: Callback<void>; 3846} 3847 3848/** 3849 * callback of the listened enter key event. 3850 * 3851 * @typedef { function } SubmitCallback 3852 * @param { EnterKeyType } enterKey - the enter key type of soft keyboard. 3853 * @param { SubmitEvent } event - Provides the method of keeping RichEditor editable state when submitted. 3854 * @syscap SystemCapability.ArkUI.ArkUI.Full 3855 * @crossplatform 3856 * @atomicservice 3857 * @since 12 3858 */ 3859declare type SubmitCallback = (enterKey: EnterKeyType, event: SubmitEvent) => void; 3860 3861/** 3862 * Callback function when the selection menu appears. 3863 * 3864 * @typedef { function } MenuOnAppearCallback 3865 * @param { number } start - Start offset of the selected content in rich editor. 3866 * @param { number } end - End offset of the selected content in rich editor. 3867 * @syscap SystemCapability.ArkUI.ArkUI.Full 3868 * @crossplatform 3869 * @atomicservice 3870 * @since 12 3871 */ 3872declare type MenuOnAppearCallback = (start: number, end: number) => void; 3873 3874/** 3875 * Callback function when a paste operation is performed. 3876 * 3877 * @typedef { function } PasteEventCallback 3878 * @param { PasteEvent } [event] - The paste event. 3879 * @syscap SystemCapability.ArkUI.ArkUI.Full 3880 * @crossplatform 3881 * @atomicservice 3882 * @since 12 3883 */ 3884declare type PasteEventCallback = (event?: PasteEvent) => void; 3885 3886/** 3887 * callback of the on hover event. 3888 * 3889 * @typedef { function } OnHoverCallback 3890 * @param { boolean } status - The hover status 3891 * @param { HoverEvent } event - The event info for hover. 3892 * @syscap SystemCapability.ArkUI.ArkUI.Full 3893 * @crossplatform 3894 * @atomicservice 3895 * @since 14 3896 */ 3897declare type OnHoverCallback = (status: boolean, event: HoverEvent) => void; 3898 3899/** 3900 * Provides an interface for writing texts. 3901 * 3902 * @interface RichEditorInterface 3903 * @syscap SystemCapability.ArkUI.ArkUI.Full 3904 * @since 10 3905 */ 3906/** 3907 * Provides an interface for writing texts. 3908 * 3909 * @interface RichEditorInterface 3910 * @syscap SystemCapability.ArkUI.ArkUI.Full 3911 * @crossplatform 3912 * @atomicservice 3913 * @since 11 3914 */ 3915interface RichEditorInterface { 3916 /** 3917 * Called when create RichEditor. 3918 * 3919 * @param { RichEditorOptions } value 3920 * @returns { RichEditorAttribute } 3921 * @syscap SystemCapability.ArkUI.ArkUI.Full 3922 * @since 10 3923 */ 3924 /** 3925 * Called when create RichEditor. 3926 * 3927 * @param { RichEditorOptions } value 3928 * @returns { RichEditorAttribute } 3929 * @syscap SystemCapability.ArkUI.ArkUI.Full 3930 * @crossplatform 3931 * @atomicservice 3932 * @since 11 3933 */ 3934 (value: RichEditorOptions): RichEditorAttribute; 3935 3936 /** 3937 * Called when create RichEditor with StyledString. 3938 * 3939 * @param { RichEditorStyledStringOptions} options 3940 * @returns { RichEditorAttribute } 3941 * @syscap SystemCapability.ArkUI.ArkUI.Full 3942 * @crossplatform 3943 * @atomicservice 3944 * @since 12 3945 */ 3946 (options: RichEditorStyledStringOptions): RichEditorAttribute; 3947} 3948 3949/** 3950 * Defines RichEditor Component instance. 3951 * 3952 * @syscap SystemCapability.ArkUI.ArkUI.Full 3953 * @since 10 3954 */ 3955/** 3956 * Defines RichEditor Component instance. 3957 * 3958 * @syscap SystemCapability.ArkUI.ArkUI.Full 3959 * @crossplatform 3960 * @atomicservice 3961 * @since 11 3962 */ 3963declare const RichEditorInstance: RichEditorAttribute; 3964 3965/** 3966 * Defines RichEditor Component. 3967 * 3968 * @syscap SystemCapability.ArkUI.ArkUI.Full 3969 * @since 10 3970 */ 3971/** 3972 * Defines RichEditor Component. 3973 * 3974 * @syscap SystemCapability.ArkUI.ArkUI.Full 3975 * @crossplatform 3976 * @atomicservice 3977 * @since 11 3978 */ 3979declare const RichEditor: RichEditorInterface; 3980