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