• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 * Defines delete text direction.
18 *
19 * @enum { number }
20 * @syscap SystemCapability.ArkUI.ArkUI.Full
21 * @since 10
22 */
23/**
24 * Defines delete text direction.
25 *
26 * @enum { number }
27 * @syscap SystemCapability.ArkUI.ArkUI.Full
28 * @crossplatform
29 * @atomicservice
30 * @since 11
31 */
32declare enum RichEditorDeleteDirection {
33  /**
34   * Delete backward.
35   *
36   * @syscap SystemCapability.ArkUI.ArkUI.Full
37   * @since 10
38   */
39  /**
40   * Delete backward.
41   *
42   * @syscap SystemCapability.ArkUI.ArkUI.Full
43   * @crossplatform
44   * @atomicservice
45   * @since 11
46   */
47  BACKWARD,
48
49  /**
50   * Delete forward.
51   *
52   * @syscap SystemCapability.ArkUI.ArkUI.Full
53   * @since 10
54   */
55  /**
56   * Delete forward.
57   *
58   * @syscap SystemCapability.ArkUI.ArkUI.Full
59   * @crossplatform
60   * @atomicservice
61   * @since 11
62   */
63  FORWARD,
64}
65
66/**
67 * Defines span type.
68 *
69 * @enum { number }
70 * @syscap SystemCapability.ArkUI.ArkUI.Full
71 * @since 10
72 */
73/**
74 * Defines span type.
75 *
76 * @enum { number }
77 * @syscap SystemCapability.ArkUI.ArkUI.Full
78 * @crossplatform
79 * @atomicservice
80 * @since 11
81 */
82declare enum RichEditorSpanType {
83  /**
84   * text.
85   *
86   * @syscap SystemCapability.ArkUI.ArkUI.Full
87   * @since 10
88   */
89  /**
90   * text.
91   *
92   * @syscap SystemCapability.ArkUI.ArkUI.Full
93   * @crossplatform
94   * @atomicservice
95   * @since 11
96   */
97  TEXT = 0,
98
99  /**
100   * image.
101   *
102   * @syscap SystemCapability.ArkUI.ArkUI.Full
103   * @since 10
104   */
105  /**
106   * image.
107   *
108   * @syscap SystemCapability.ArkUI.ArkUI.Full
109   * @crossplatform
110   * @atomicservice
111   * @since 11
112   */
113  IMAGE = 1,
114
115  /**
116   * mixed.
117   *
118   * @syscap SystemCapability.ArkUI.ArkUI.Full
119   * @since 10
120   */
121  /**
122   * mixed.
123   *
124   * @syscap SystemCapability.ArkUI.ArkUI.Full
125   * @crossplatform
126   * @atomicservice
127   * @since 11
128   */
129  MIXED = 2,
130}
131
132/**
133 * ResponseType for contextMenu
134 *
135 * @enum { number }
136 * @syscap SystemCapability.ArkUI.ArkUI.Full
137 * @crossplatform
138 * @since 11
139 */
140declare enum RichEditorResponseType {
141  /**
142   * Right click.
143   *
144   * @syscap SystemCapability.ArkUI.ArkUI.Full
145   * @crossplatform
146   * @since 11
147   */
148  RIGHT_CLICK = 0,
149
150  /**
151   * Long press.
152   *
153   * @syscap SystemCapability.ArkUI.ArkUI.Full
154   * @crossplatform
155   * @since 11
156   */
157  LONG_PRESS = 1,
158
159  /**
160   * Selected by mouse.
161   *
162   * @syscap SystemCapability.ArkUI.ArkUI.Full
163   * @crossplatform
164   * @since 11
165   */
166  SELECT = 2,
167}
168
169/**
170 * Defines the span position.
171 *
172 * @interface RichEditorSpanPosition
173 * @syscap SystemCapability.ArkUI.ArkUI.Full
174 * @since 10
175 */
176/**
177 * Defines the span position.
178 *
179 * @interface RichEditorSpanPosition
180 * @syscap SystemCapability.ArkUI.ArkUI.Full
181 * @crossplatform
182 * @atomicservice
183 * @since 11
184 */
185declare interface RichEditorSpanPosition {
186  /**
187   * Define the index of span.
188   *
189   * @type { number }
190   * @syscap SystemCapability.ArkUI.ArkUI.Full
191   * @since 10
192   */
193  /**
194   * Define the index of span.
195   *
196   * @type { number }
197   * @syscap SystemCapability.ArkUI.ArkUI.Full
198   * @crossplatform
199   * @atomicservice
200   * @since 11
201   */
202  spanIndex: number;
203
204  /**
205   * The range of span.
206   *
207   * @type { [number, number] }
208   * @syscap SystemCapability.ArkUI.ArkUI.Full
209   * @since 10
210   */
211  /**
212   * The range of span.
213   *
214   * @type { [number, number] }
215   * @syscap SystemCapability.ArkUI.ArkUI.Full
216   * @crossplatform
217   * @atomicservice
218   * @since 11
219   */
220  spanRange: [number, number];
221}
222
223/**
224 * Defines the span text style.
225 *
226 * @interface RichEditorTextStyle
227 * @syscap SystemCapability.ArkUI.ArkUI.Full
228 * @since 10
229 */
230/**
231 * Defines the span text style.
232 *
233 * @interface RichEditorTextStyle
234 * @syscap SystemCapability.ArkUI.ArkUI.Full
235 * @crossplatform
236 * @atomicservice
237 * @since 11
238 */
239declare interface RichEditorTextStyle {
240  /**
241   * font color.
242   *
243   * @type { ?ResourceColor }
244   * @syscap SystemCapability.ArkUI.ArkUI.Full
245   * @since 10
246   */
247  /**
248   * font color.
249   *
250   * @type { ?ResourceColor }
251   * @syscap SystemCapability.ArkUI.ArkUI.Full
252   * @crossplatform
253   * @atomicservice
254   * @since 11
255   */
256  fontColor?: ResourceColor;
257
258  /**
259   * font size.
260   *
261   * @type { ?(Length | number) }
262   * @syscap SystemCapability.ArkUI.ArkUI.Full
263   * @since 10
264   */
265  /**
266   * font size.
267   *
268   * @type { ?(Length | number) }
269   * @syscap SystemCapability.ArkUI.ArkUI.Full
270   * @crossplatform
271   * @atomicservice
272   * @since 11
273   */
274  fontSize?: Length | number;
275
276  /**
277   * font style.
278   *
279   * @type { ?FontStyle }
280   * @syscap SystemCapability.ArkUI.ArkUI.Full
281   * @since 10
282   */
283  /**
284   * font style.
285   *
286   * @type { ?FontStyle }
287   * @syscap SystemCapability.ArkUI.ArkUI.Full
288   * @crossplatform
289   * @atomicservice
290   * @since 11
291   */
292  fontStyle?: FontStyle;
293
294  /**
295   * font weight.
296   *
297   * @type { ?(number | FontWeight | string) }
298   * @syscap SystemCapability.ArkUI.ArkUI.Full
299   * @since 10
300   */
301  /**
302   * font weight.
303   *
304   * @type { ?(number | FontWeight | string) }
305   * @syscap SystemCapability.ArkUI.ArkUI.Full
306   * @crossplatform
307   * @atomicservice
308   * @since 11
309   */
310  fontWeight?: number | FontWeight | string;
311
312  /**
313   * font family.
314   *
315   * @type { ?ResourceStr }
316   * @syscap SystemCapability.ArkUI.ArkUI.Full
317   * @since 10
318   */
319  /**
320   * font family.
321   *
322   * @type { ?ResourceStr }
323   * @syscap SystemCapability.ArkUI.ArkUI.Full
324   * @crossplatform
325   * @atomicservice
326   * @since 11
327   */
328  fontFamily?: ResourceStr;
329
330  /**
331   * font decoration.
332   *
333   * @type { ?object }
334   * @syscap SystemCapability.ArkUI.ArkUI.Full
335   * @since 10
336   */
337  /**
338   * font decoration.
339   *
340   * @type { ?object }
341   * @syscap SystemCapability.ArkUI.ArkUI.Full
342   * @crossplatform
343   * @atomicservice
344   * @since 11
345   */
346  decoration?: { type: TextDecorationType; color?: ResourceColor; };
347
348  /**
349   * Text shadow
350   *
351   * @type { ?(ShadowOptions | Array<ShadowOptions>) }
352   * @syscap SystemCapability.ArkUI.ArkUI.Full
353   * @crossplatform
354   * @since 11
355   */
356  textShadow?: ShadowOptions | Array<ShadowOptions>;
357}
358
359
360/**
361 * Defines the leading margin placeholder of a paragraph.
362 *
363 * @interface LeadingMarginPlaceholder
364 * @syscap SystemCapability.ArkUI.ArkUI.Full
365 * @crossplatform
366 * @since 11
367 */
368declare interface LeadingMarginPlaceholder {
369  /**
370   * Placeholder pixelMap.
371   *
372   * @type { PixelMap }
373   * @syscap SystemCapability.ArkUI.ArkUI.Full
374   * @crossplatform
375   * @since 11
376   */
377  pixelMap: PixelMap;
378
379  /**
380   * Placeholder size.
381   *
382   * @type { [Dimension, Dimension] }
383   * @syscap SystemCapability.ArkUI.ArkUI.Full
384   * @crossplatform
385   * @since 11
386   */
387  size: [Dimension, Dimension];
388}
389
390/**
391 * Defines the paragraph style.
392 *
393 * @interface RichEditorParagraphStyle
394 * @syscap SystemCapability.ArkUI.ArkUI.Full
395 * @crossplatform
396 * @since 11
397 */
398declare interface RichEditorParagraphStyle {
399  /**
400   * Text alignment.
401   *
402   * @type { ?TextAlign }
403   * @syscap SystemCapability.ArkUI.ArkUI.Full
404   * @crossplatform
405   * @since 11
406   */
407  textAlign?: TextAlign;
408
409  /**
410   * Leading margin.
411   *
412   * @type { ?(Dimension | LeadingMarginPlaceholder) }
413   * @syscap SystemCapability.ArkUI.ArkUI.Full
414   * @crossplatform
415   * @since 11
416   */
417  leadingMargin?: Dimension | LeadingMarginPlaceholder;
418}
419
420/**
421 * Defines the paste event.
422 *
423 * @interface PasteEvent
424 * @syscap SystemCapability.ArkUI.ArkUI.Full
425 * @crossplatform
426 * @atomicservice
427 * @since 11
428 */
429declare interface PasteEvent {
430  /**
431   * Override system paste event.
432   *
433   * @type { ?function }
434   * @syscap SystemCapability.ArkUI.ArkUI.Full
435   * @crossplatform
436   * @atomicservice
437   * @since 11
438   */
439  preventDefault?: () => void;
440}
441
442/**
443 * Defines the text span.
444 *
445 * @interface RichEditorTextSpan
446 * @syscap SystemCapability.ArkUI.ArkUI.Full
447 * @since 10
448 */
449/**
450 * Defines the text span.
451 *
452 * @interface RichEditorTextSpan
453 * @syscap SystemCapability.ArkUI.ArkUI.Full
454 * @crossplatform
455 * @atomicservice
456 * @since 11
457 */
458declare interface RichEditorTextSpan {
459  /**
460   * The position of the text span.
461   *
462   * @type { RichEditorSpanPosition }
463   * @syscap SystemCapability.ArkUI.ArkUI.Full
464   * @since 10
465   */
466  /**
467   * The position of the text span.
468   *
469   * @type { RichEditorSpanPosition }
470   * @syscap SystemCapability.ArkUI.ArkUI.Full
471   * @crossplatform
472   * @atomicservice
473   * @since 11
474   */
475  spanPosition: RichEditorSpanPosition;
476
477  /**
478   * The content of the text span.
479   *
480   * @type { string }
481   * @syscap SystemCapability.ArkUI.ArkUI.Full
482   * @since 10
483   */
484  /**
485   * The content of the text span.
486   *
487   * @type { string }
488   * @syscap SystemCapability.ArkUI.ArkUI.Full
489   * @crossplatform
490   * @atomicservice
491   * @since 11
492   */
493  value: string;
494
495  /**
496   * text style.
497   *
498   * @type { ?RichEditorTextStyle }
499   * @syscap SystemCapability.ArkUI.ArkUI.Full
500   * @since 10
501   */
502  /**
503   * text style.
504   *
505   * @type { ?RichEditorTextStyle }
506   * @syscap SystemCapability.ArkUI.ArkUI.Full
507   * @crossplatform
508   * @atomicservice
509   * @since 11
510   */
511  textStyle?: RichEditorTextStyle;
512}
513
514/**
515 * Defines the richEditor Image Layout Style.
516 *
517 * @interface RichEditorLayoutStyle
518 * @syscap SystemCapability.ArkUI.ArkUI.Full
519 * @crossplatform
520 * @since 11
521 */
522interface RichEditorLayoutStyle {
523  /**
524   * Outer Margin.
525   *
526   * @type { ?(Dimension | Margin) }
527   * @syscap SystemCapability.ArkUI.ArkUI.Full
528   * @crossplatform
529   * @since 11
530   */
531  margin?: Dimension | Margin;
532
533  /**
534   * Border radius.
535   *
536   * @type { ?(Dimension | BorderRadiuses) }
537   * @syscap SystemCapability.ArkUI.ArkUI.Full
538   * @crossplatform
539   * @since 11
540   */
541  borderRadius?: Dimension | BorderRadiuses;
542}
543
544/**
545 * Defines the span image style.
546 *
547 * @interface RichEditorImageSpanStyle
548 * @syscap SystemCapability.ArkUI.ArkUI.Full
549 * @since 10
550 */
551/**
552 * Defines the span image style.
553 *
554 * @interface RichEditorImageSpanStyle
555 * @syscap SystemCapability.ArkUI.ArkUI.Full
556 * @crossplatform
557 * @atomicservice
558 * @since 11
559 */
560declare interface RichEditorImageSpanStyle {
561  /**
562   * image size.
563   *
564   * @type { ?[Dimension, Dimension] }
565   * @syscap SystemCapability.ArkUI.ArkUI.Full
566   * @since 10
567   */
568  /**
569   * image size.
570   *
571   * @type { ?[Dimension, Dimension] }
572   * @syscap SystemCapability.ArkUI.ArkUI.Full
573   * @crossplatform
574   * @atomicservice
575   * @since 11
576   */
577  size?: [Dimension, Dimension];
578
579  /**
580   * image vertical align.
581   *
582   * @type { ?ImageSpanAlignment }
583   * @syscap SystemCapability.ArkUI.ArkUI.Full
584   * @since 10
585   */
586  /**
587   * image vertical align.
588   *
589   * @type { ?ImageSpanAlignment }
590   * @syscap SystemCapability.ArkUI.ArkUI.Full
591   * @crossplatform
592   * @atomicservice
593   * @since 11
594   */
595  verticalAlign?: ImageSpanAlignment;
596
597  /**
598   * image fit.
599   *
600   * @type { ?ImageFit }
601   * @syscap SystemCapability.ArkUI.ArkUI.Full
602   * @since 10
603   */
604  /**
605   * image fit.
606   *
607   * @type { ?ImageFit }
608   * @syscap SystemCapability.ArkUI.ArkUI.Full
609   * @crossplatform
610   * @atomicservice
611   * @since 11
612   */
613  objectFit?: ImageFit;
614
615  /**
616   * RichEditor ImageSpan Layout Style.
617   *
618   * @type { ?RichEditorLayoutStyle }
619   * @syscap SystemCapability.ArkUI.ArkUI.Full
620   * @crossplatform
621   * @since 11
622   */
623  layoutStyle?: RichEditorLayoutStyle;
624}
625
626/**
627 * Defines the symbol span style.
628 *
629 * @interface RichEditorSymbolSpanStyle
630 * @syscap SystemCapability.ArkUI.ArkUI.Full
631 * @crossplatform
632 * @since 11
633 */
634declare interface RichEditorSymbolSpanStyle {
635  /**
636   * The font size.
637   *
638   * @type { ?(number | string | Resource) }
639   * @syscap SystemCapability.ArkUI.ArkUI.Full
640   * @crossplatform
641   * @since 11
642   */
643  fontSize?: number | string | Resource;
644
645  /**
646   * The font color.
647   *
648   * @type { ?Array<ResourceColor> }
649   * @syscap SystemCapability.ArkUI.ArkUI.Full
650   * @crossplatform
651   * @since 11
652   */
653  fontColor?: Array<ResourceColor>;
654
655  /**
656   * The font weight.
657   *
658   * @type { ?(number | FontWeight | string) }
659   * @syscap SystemCapability.ArkUI.ArkUI.Full
660   * @crossplatform
661   * @since 11
662   */
663  fontWeight?: number | FontWeight | string;
664
665  /**
666   * The symbol span effect strategy.
667   *
668   * @type { ?SymbolEffectStrategy }
669   * @syscap SystemCapability.ArkUI.ArkUI.Full
670   * @crossplatform
671   * @since 11
672   */
673  effectStrategy?: SymbolEffectStrategy;
674
675  /**
676   * The symbol span rendering strategy.
677   *
678   * @type { ?SymbolRenderingStrategy }
679   * @syscap SystemCapability.ArkUI.ArkUI.Full
680   * @crossplatform
681   * @since 11
682   */
683  renderingStrategy?: SymbolRenderingStrategy;
684}
685
686/**
687 * Defines the text style result.
688 *
689 * @interface RichEditorTextStyleResult
690 * @syscap SystemCapability.ArkUI.ArkUI.Full
691 * @since 10
692 */
693/**
694 * Defines the text style result.
695 *
696 * @interface RichEditorTextStyleResult
697 * @syscap SystemCapability.ArkUI.ArkUI.Full
698 * @crossplatform
699 * @atomicservice
700 * @since 11
701 */
702declare interface RichEditorTextStyleResult {
703  /**
704   * font color.
705   *
706   * @type { ResourceColor }
707   * @syscap SystemCapability.ArkUI.ArkUI.Full
708   * @since 10
709   */
710  /**
711   * font color.
712   *
713   * @type { ResourceColor }
714   * @syscap SystemCapability.ArkUI.ArkUI.Full
715   * @crossplatform
716   * @atomicservice
717   * @since 11
718   */
719  fontColor: ResourceColor;
720
721  /**
722   * font size.
723   *
724   * @type { number }
725   * @syscap SystemCapability.ArkUI.ArkUI.Full
726   * @since 10
727   */
728  /**
729   * font size.
730   *
731   * @type { number }
732   * @syscap SystemCapability.ArkUI.ArkUI.Full
733   * @crossplatform
734   * @atomicservice
735   * @since 11
736   */
737  fontSize: number;
738
739  /**
740   * font style.
741   *
742   * @type { FontStyle }
743   * @syscap SystemCapability.ArkUI.ArkUI.Full
744   * @since 10
745   */
746  /**
747   * font style.
748   *
749   * @type { FontStyle }
750   * @syscap SystemCapability.ArkUI.ArkUI.Full
751   * @crossplatform
752   * @atomicservice
753   * @since 11
754   */
755  fontStyle: FontStyle;
756
757  /**
758   * font weight.
759   *
760   * @type { number }
761   * @syscap SystemCapability.ArkUI.ArkUI.Full
762   * @since 10
763   */
764  /**
765   * font weight.
766   *
767   * @type { number }
768   * @syscap SystemCapability.ArkUI.ArkUI.Full
769   * @crossplatform
770   * @atomicservice
771   * @since 11
772   */
773  fontWeight: number;
774
775  /**
776   * font family.
777   *
778   * @type { string }
779   * @syscap SystemCapability.ArkUI.ArkUI.Full
780   * @since 10
781   */
782  /**
783   * font family.
784   *
785   * @type { string }
786   * @syscap SystemCapability.ArkUI.ArkUI.Full
787   * @crossplatform
788   * @atomicservice
789   * @since 11
790   */
791  fontFamily: string;
792
793  /**
794   * font decoration.
795   *
796   * @type { object }
797   * @syscap SystemCapability.ArkUI.ArkUI.Full
798   * @since 10
799   */
800  /**
801   * font decoration.
802   *
803   * @type { object }
804   * @syscap SystemCapability.ArkUI.ArkUI.Full
805   * @crossplatform
806   * @atomicservice
807   * @since 11
808   */
809  decoration: { type: TextDecorationType; color: ResourceColor; };
810}
811
812/**
813 * Defines the paragraph result.
814 *
815 * @interface RichEditorParagraphResult
816 * @syscap SystemCapability.ArkUI.ArkUI.Full
817 * @crossplatform
818 * @since 11
819 */
820declare interface RichEditorParagraphResult {
821  /**
822   * The paragraph style.
823   *
824   * @type { RichEditorParagraphStyle }
825   * @syscap SystemCapability.ArkUI.ArkUI.Full
826   * @crossplatform
827   * @since 11
828   */
829  style: RichEditorParagraphStyle;
830
831  /**
832   * The range of paragraph based on character indices.
833   *
834   * @type { [number, number] }
835   * @syscap SystemCapability.ArkUI.ArkUI.Full
836   * @crossplatform
837   * @since 11
838   */
839  range: [number, number];
840}
841
842/**
843 * Defines the symbol span style result.
844 *
845 * @interface RichEditorSymbolSpanStyleResult
846 * @syscap SystemCapability.ArkUI.ArkUI.Full
847 * @crossplatform
848 * @since 11
849 */
850declare interface RichEditorSymbolSpanStyleResult {
851  /**
852   * The font size.
853   *
854   * @type { number | string | Resource }
855   * @syscap SystemCapability.ArkUI.ArkUI.Full
856   * @crossplatform
857   * @since 11
858   */
859  fontSize: number | string | Resource;
860
861  /**
862   * The font color.
863   *
864   * @type { Array<ResourceColor> }
865   * @syscap SystemCapability.ArkUI.ArkUI.Full
866   * @crossplatform
867   * @since 11
868   */
869  fontColor: Array<ResourceColor>;
870
871  /**
872   * The font weight.
873   *
874   * @type { number | FontWeight | string }
875   * @syscap SystemCapability.ArkUI.ArkUI.Full
876   * @crossplatform
877   * @since 11
878   */
879  fontWeight: number | FontWeight | string;
880
881  /**
882   * The symbol span effect strategy.
883   *
884   * @type { SymbolEffectStrategy }
885   * @syscap SystemCapability.ArkUI.ArkUI.Full
886   * @crossplatform
887   * @since 11
888   */
889  effectStrategy: SymbolEffectStrategy;
890
891  /**
892   * The symbol span rendering strategy.
893   *
894   * @type { SymbolRenderingStrategy }
895   * @syscap SystemCapability.ArkUI.ArkUI.Full
896   * @crossplatform
897   * @since 11
898   */
899  renderingStrategy: SymbolRenderingStrategy;
900}
901
902/**
903 * Defines the text span result.
904 *
905 * @interface RichEditorTextSpanResult
906 * @syscap SystemCapability.ArkUI.ArkUI.Full
907 * @since 10
908 */
909/**
910 * Defines the text span result.
911 *
912 * @interface RichEditorTextSpanResult
913 * @syscap SystemCapability.ArkUI.ArkUI.Full
914 * @crossplatform
915 * @atomicservice
916 * @since 11
917 */
918declare interface RichEditorTextSpanResult {
919  /**
920   * The position of the text span.
921   *
922   * @type { RichEditorSpanPosition }
923   * @syscap SystemCapability.ArkUI.ArkUI.Full
924   * @since 10
925   */
926  /**
927   * The position of the text span.
928   *
929   * @type { RichEditorSpanPosition }
930   * @syscap SystemCapability.ArkUI.ArkUI.Full
931   * @crossplatform
932   * @atomicservice
933   * @since 11
934   */
935  spanPosition: RichEditorSpanPosition;
936
937  /**
938   * The content of the text span.
939   *
940   * @type { string }
941   * @syscap SystemCapability.ArkUI.ArkUI.Full
942   * @since 10
943   */
944  /**
945   * The content of the text span.
946   *
947   * @type { string }
948   * @syscap SystemCapability.ArkUI.ArkUI.Full
949   * @crossplatform
950   * @atomicservice
951   * @since 11
952   */
953  value: string;
954
955  /**
956   * text style.
957   *
958   * @type { RichEditorTextStyleResult }
959   * @syscap SystemCapability.ArkUI.ArkUI.Full
960   * @since 10
961   */
962  /**
963   * text style.
964   *
965   * @type { RichEditorTextStyleResult }
966   * @syscap SystemCapability.ArkUI.ArkUI.Full
967   * @crossplatform
968   * @atomicservice
969   * @since 11
970   */
971  textStyle: RichEditorTextStyleResult;
972
973  /**
974   * get offset in span.
975   *
976   * @type { [number, number] }
977   * @syscap SystemCapability.ArkUI.ArkUI.Full
978   * @since 10
979   */
980  /**
981   * get offset in span.
982   *
983   * @type { [number, number] }
984   * @syscap SystemCapability.ArkUI.ArkUI.Full
985   * @crossplatform
986   * @atomicservice
987   * @since 11
988   */
989  offsetInSpan: [number, number];
990
991  /**
992   * Symbol span style.
993   *
994   * @type { ?RichEditorSymbolSpanStyle }
995   * @syscap SystemCapability.ArkUI.ArkUI.Full
996   * @crossplatform
997   * @since 11
998   */
999  symbolSpanStyle?: RichEditorSymbolSpanStyle;
1000
1001  /**
1002   * The resource string of the symbol span.
1003   *
1004   * @type { ?Resource }
1005   * @syscap SystemCapability.ArkUI.ArkUI.Full
1006   * @crossplatform
1007   * @since 11
1008   */
1009  valueResource?: Resource;
1010}
1011
1012/**
1013 * Defines the span image style result.
1014 *
1015 * @interface RichEditorImageSpanStyleResult
1016 * @syscap SystemCapability.ArkUI.ArkUI.Full
1017 * @since 10
1018 */
1019/**
1020 * Defines the span image style result.
1021 *
1022 * @interface RichEditorImageSpanStyleResult
1023 * @syscap SystemCapability.ArkUI.ArkUI.Full
1024 * @crossplatform
1025 * @atomicservice
1026 * @since 11
1027 */
1028declare interface RichEditorImageSpanStyleResult {
1029  /**
1030   * image size.
1031   *
1032   * @type { [number, number] }
1033   * @syscap SystemCapability.ArkUI.ArkUI.Full
1034   * @since 10
1035   */
1036  /**
1037   * image size.
1038   *
1039   * @type { [number, number] }
1040   * @syscap SystemCapability.ArkUI.ArkUI.Full
1041   * @crossplatform
1042   * @atomicservice
1043   * @since 11
1044   */
1045  size: [number, number];
1046
1047  /**
1048   * image vertical align.
1049   *
1050   * @type { ImageSpanAlignment }
1051   * @syscap SystemCapability.ArkUI.ArkUI.Full
1052   * @since 10
1053   */
1054  /**
1055   * image vertical align.
1056   *
1057   * @type { ImageSpanAlignment }
1058   * @syscap SystemCapability.ArkUI.ArkUI.Full
1059   * @crossplatform
1060   * @atomicservice
1061   * @since 11
1062   */
1063  verticalAlign: ImageSpanAlignment;
1064
1065  /**
1066   * image fit.
1067   *
1068   * @type { ImageFit }
1069   * @syscap SystemCapability.ArkUI.ArkUI.Full
1070   * @since 10
1071   */
1072  /**
1073   * image fit.
1074   *
1075   * @type { ImageFit }
1076   * @syscap SystemCapability.ArkUI.ArkUI.Full
1077   * @crossplatform
1078   * @atomicservice
1079   * @since 11
1080   */
1081  objectFit: ImageFit;
1082}
1083
1084/**
1085 * Defines the image span.
1086 *
1087 * @interface RichEditorImageSpanResult
1088 * @syscap SystemCapability.ArkUI.ArkUI.Full
1089 * @since 10
1090 */
1091/**
1092 * Defines the image span.
1093 *
1094 * @interface RichEditorImageSpanResult
1095 * @syscap SystemCapability.ArkUI.ArkUI.Full
1096 * @crossplatform
1097 * @atomicservice
1098 * @since 11
1099 */
1100declare interface RichEditorImageSpanResult {
1101  /**
1102   * The position of the image span.
1103   *
1104   * @type { RichEditorSpanPosition }
1105   * @syscap SystemCapability.ArkUI.ArkUI.Full
1106   * @since 10
1107   */
1108  /**
1109   * The position of the image span.
1110   *
1111   * @type { RichEditorSpanPosition }
1112   * @syscap SystemCapability.ArkUI.ArkUI.Full
1113   * @crossplatform
1114   * @atomicservice
1115   * @since 11
1116   */
1117  spanPosition: RichEditorSpanPosition;
1118
1119  /**
1120   * The pixel map of the image span.
1121   *
1122   * @type { ?PixelMap }
1123   * @syscap SystemCapability.ArkUI.ArkUI.Full
1124   * @since 10
1125   */
1126  /**
1127   * The pixel map of the image span.
1128   *
1129   * @type { ?PixelMap }
1130   * @syscap SystemCapability.ArkUI.ArkUI.Full
1131   * @crossplatform
1132   * @atomicservice
1133   * @since 11
1134   */
1135  valuePixelMap?: PixelMap;
1136
1137  /**
1138   * The resource string of the image span.
1139   *
1140   * @type { ?ResourceStr }
1141   * @syscap SystemCapability.ArkUI.ArkUI.Full
1142   * @since 10
1143   */
1144  /**
1145   * The resource string of the image span.
1146   *
1147   * @type { ?ResourceStr }
1148   * @syscap SystemCapability.ArkUI.ArkUI.Full
1149   * @crossplatform
1150   * @atomicservice
1151   * @since 11
1152   */
1153  valueResourceStr?: ResourceStr;
1154
1155  /**
1156   * image attribute.
1157   *
1158   * @type { RichEditorImageSpanStyleResult }
1159   * @syscap SystemCapability.ArkUI.ArkUI.Full
1160   * @since 10
1161   */
1162  /**
1163   * image attribute.
1164   *
1165   * @type { RichEditorImageSpanStyleResult }
1166   * @syscap SystemCapability.ArkUI.ArkUI.Full
1167   * @crossplatform
1168   * @atomicservice
1169   * @since 11
1170   */
1171  imageStyle: RichEditorImageSpanStyleResult;
1172
1173  /**
1174   * get offset in span.
1175   *
1176   * @type { [number, number] }
1177   * @syscap SystemCapability.ArkUI.ArkUI.Full
1178   * @since 10
1179   */
1180  /**
1181   * get offset in span.
1182   *
1183   * @type { [number, number] }
1184   * @syscap SystemCapability.ArkUI.ArkUI.Full
1185   * @crossplatform
1186   * @atomicservice
1187   * @since 11
1188   */
1189  offsetInSpan: [number, number];
1190}
1191
1192/**
1193 * Defines the image span.
1194 *
1195 * @interface RichEditorImageSpan
1196 * @syscap SystemCapability.ArkUI.ArkUI.Full
1197 * @since 10
1198 */
1199/**
1200 * Defines the image span.
1201 *
1202 * @interface RichEditorImageSpan
1203 * @syscap SystemCapability.ArkUI.ArkUI.Full
1204 * @crossplatform
1205 * @atomicservice
1206 * @since 11
1207 */
1208declare interface RichEditorImageSpan {
1209  /**
1210   * The position of the image span.
1211   *
1212   * @type { RichEditorSpanPosition }
1213   * @syscap SystemCapability.ArkUI.ArkUI.Full
1214   * @since 10
1215   */
1216  /**
1217   * The position of the image span.
1218   *
1219   * @type { RichEditorSpanPosition }
1220   * @syscap SystemCapability.ArkUI.ArkUI.Full
1221   * @crossplatform
1222   * @atomicservice
1223   * @since 11
1224   */
1225  spanPosition: RichEditorSpanPosition;
1226
1227  /**
1228   * The content of the image span.
1229   *
1230   * @type { PixelMap | ResourceStr }
1231   * @syscap SystemCapability.ArkUI.ArkUI.Full
1232   * @since 10
1233   */
1234  /**
1235   * The content of the image span.
1236   *
1237   * @type { PixelMap | ResourceStr }
1238   * @syscap SystemCapability.ArkUI.ArkUI.Full
1239   * @crossplatform
1240   * @atomicservice
1241   * @since 11
1242   */
1243  value: PixelMap | ResourceStr;
1244
1245  /**
1246   * image style.
1247   *
1248   * @type { ?RichEditorImageSpanStyle }
1249   * @syscap SystemCapability.ArkUI.ArkUI.Full
1250   * @since 10
1251   */
1252  /**
1253   * image style.
1254   *
1255   * @type { ?RichEditorImageSpanStyle }
1256   * @syscap SystemCapability.ArkUI.ArkUI.Full
1257   * @crossplatform
1258   * @atomicservice
1259   * @since 11
1260   */
1261  imageStyle?: RichEditorImageSpanStyle;
1262}
1263
1264/**
1265 * Defines range of RichEditor.
1266 *
1267 * @interface RichEditorRange
1268 * @syscap SystemCapability.ArkUI.ArkUI.Full
1269 * @since 10
1270 */
1271/**
1272 * Defines range of RichEditor.
1273 *
1274 * @interface RichEditorRange
1275 * @syscap SystemCapability.ArkUI.ArkUI.Full
1276 * @crossplatform
1277 * @atomicservice
1278 * @since 11
1279 */
1280declare interface RichEditorRange {
1281  /**
1282   * start offset.
1283   *
1284   * @type { ?number }
1285   * @default 0
1286   * @syscap SystemCapability.ArkUI.ArkUI.Full
1287   * @since 10
1288   */
1289  /**
1290   * start offset.
1291   *
1292   * @type { ?number }
1293   * @default 0
1294   * @syscap SystemCapability.ArkUI.ArkUI.Full
1295   * @crossplatform
1296   * @atomicservice
1297   * @since 11
1298   */
1299  start?: number;
1300
1301  /**
1302   * end offset.
1303   *
1304   * @type { ?number }
1305   * @default text length
1306   * @syscap SystemCapability.ArkUI.ArkUI.Full
1307   * @since 10
1308   */
1309  /**
1310   * end offset.
1311   *
1312   * @type { ?number }
1313   * @default text length
1314   * @syscap SystemCapability.ArkUI.ArkUI.Full
1315   * @crossplatform
1316   * @atomicservice
1317   * @since 11
1318   */
1319  end?: number;
1320}
1321
1322/**
1323 * Defines the richEditor Gestures.
1324 *
1325 * @interface RichEditorGesture
1326 * @syscap SystemCapability.ArkUI.ArkUI.Full
1327 * @crossplatform
1328 * @since 11
1329 */
1330declare interface RichEditorGesture {
1331  /**
1332   * Trigger a click event when a click is clicked.
1333   *
1334   * @type { ?function }
1335   * @syscap SystemCapability.ArkUI.ArkUI.Full
1336   * @crossplatform
1337   * @since 11
1338   */
1339  onClick?: (event: ClickEvent) => void;
1340
1341  /**
1342   * Trigger a gesture event when long press event is complete.
1343   *
1344   * @type { ?function }
1345   * @syscap SystemCapability.ArkUI.ArkUI.Full
1346   * @crossplatform
1347   * @since 11
1348   */
1349  onLongPress?: (event: GestureEvent) => void;
1350}
1351
1352/**
1353 * Defines the span options of RichEditor.
1354 *
1355 * @interface RichEditorTextSpanOptions
1356 * @syscap SystemCapability.ArkUI.ArkUI.Full
1357 * @since 10
1358 */
1359/**
1360 * Defines the span options of RichEditor.
1361 *
1362 * @interface RichEditorTextSpanOptions
1363 * @syscap SystemCapability.ArkUI.ArkUI.Full
1364 * @crossplatform
1365 * @atomicservice
1366 * @since 11
1367 */
1368declare interface RichEditorTextSpanOptions {
1369  /**
1370   * the offset that add a text span at.
1371   *
1372   * @type { ?number }
1373   * @syscap SystemCapability.ArkUI.ArkUI.Full
1374   * @since 10
1375   */
1376  /**
1377   * the offset that add a text span at.
1378   *
1379   * @type { ?number }
1380   * @syscap SystemCapability.ArkUI.ArkUI.Full
1381   * @crossplatform
1382   * @atomicservice
1383   * @since 11
1384   */
1385  offset?: number;
1386
1387  /**
1388   * text style.
1389   *
1390   * @type { ?RichEditorTextStyle }
1391   * @syscap SystemCapability.ArkUI.ArkUI.Full
1392   * @since 10
1393   */
1394  /**
1395   * text style.
1396   *
1397   * @type { ?RichEditorTextStyle }
1398   * @syscap SystemCapability.ArkUI.ArkUI.Full
1399   * @crossplatform
1400   * @atomicservice
1401   * @since 11
1402   */
1403  style?: RichEditorTextStyle;
1404
1405  /**
1406   * Paragraph style.
1407   *
1408   * @type { ?RichEditorParagraphStyle }
1409   * @syscap SystemCapability.ArkUI.ArkUI.Full
1410   * @crossplatform
1411   * @since 11
1412   */
1413  paragraphStyle?: RichEditorParagraphStyle;
1414
1415  /**
1416   * RichEditor gesture.
1417   *
1418   * @type { ?RichEditorGesture }
1419   * @syscap SystemCapability.ArkUI.ArkUI.Full
1420   * @crossplatform
1421   * @since 11
1422   */
1423  gesture?: RichEditorGesture;
1424}
1425
1426/**
1427 * Defines the image span options of RichEditor.
1428 *
1429 * @interface RichEditorImageSpanOptions
1430 * @syscap SystemCapability.ArkUI.ArkUI.Full
1431 * @since 10
1432 */
1433/**
1434 * Defines the image span options of RichEditor.
1435 *
1436 * @interface RichEditorImageSpanOptions
1437 * @syscap SystemCapability.ArkUI.ArkUI.Full
1438 * @crossplatform
1439 * @atomicservice
1440 * @since 11
1441 */
1442declare interface RichEditorImageSpanOptions {
1443  /**
1444   * the offset that add image span at.
1445   *
1446   * @type { ?number }
1447   * @syscap SystemCapability.ArkUI.ArkUI.Full
1448   * @since 10
1449   */
1450  /**
1451   * the offset that add image span at.
1452   *
1453   * @type { ?number }
1454   * @syscap SystemCapability.ArkUI.ArkUI.Full
1455   * @crossplatform
1456   * @atomicservice
1457   * @since 11
1458   */
1459  offset?: number;
1460
1461  /**
1462   * image style.
1463   *
1464   * @type { ?RichEditorImageSpanStyle }
1465   * @syscap SystemCapability.ArkUI.ArkUI.Full
1466   * @since 10
1467   */
1468  /**
1469   * image style.
1470   *
1471   * @type { ?RichEditorImageSpanStyle }
1472   * @syscap SystemCapability.ArkUI.ArkUI.Full
1473   * @crossplatform
1474   * @atomicservice
1475   * @since 11
1476   */
1477  imageStyle?: RichEditorImageSpanStyle;
1478
1479  /**
1480   * RichEditor gesture.
1481   *
1482   * @type { ?RichEditorGesture }
1483   * @syscap SystemCapability.ArkUI.ArkUI.Full
1484   * @crossplatform
1485   * @since 11
1486   */
1487  gesture?: RichEditorGesture;
1488}
1489
1490/**
1491 * Defines the builder span options of RichEditor.
1492 *
1493 * @interface RichEditorBuilderSpanOptions
1494 * @syscap SystemCapability.ArkUI.ArkUI.Full
1495 * @crossplatform
1496 * @since 11
1497 */
1498declare interface RichEditorBuilderSpanOptions {
1499  /**
1500   * The offset that add custom builder span at.
1501   *
1502   * @type { ?number } Indicates the index where the builder will be inserted
1503   * @syscap SystemCapability.ArkUI.ArkUI.Full
1504   * @crossplatform
1505   * @since 11
1506   */
1507  offset?: number;
1508}
1509
1510/**
1511 * Defines span style option of RichEditor.
1512 *
1513 * @interface RichEditorSpanStyleOptions
1514 * @syscap SystemCapability.ArkUI.ArkUI.Full
1515 * @since 10
1516 */
1517/**
1518 * Defines span style option of RichEditor.
1519 *
1520 * @interface RichEditorSpanStyleOptions
1521 * @syscap SystemCapability.ArkUI.ArkUI.Full
1522 * @crossplatform
1523 * @atomicservice
1524 * @since 11
1525 */
1526declare interface RichEditorSpanStyleOptions extends RichEditorRange { }
1527
1528/**
1529 * Defines paragraph style option of RichEditor.
1530 *
1531 * @interface RichEditorParagraphStyleOptions
1532 * @syscap SystemCapability.ArkUI.ArkUI.Full
1533 * @crossplatform
1534 * @since 11
1535 */
1536declare interface RichEditorParagraphStyleOptions extends RichEditorRange {
1537  /**
1538   * Paragraph style.
1539   *
1540   * @type { RichEditorParagraphStyle }
1541   * @syscap SystemCapability.ArkUI.ArkUI.Full
1542   * @crossplatform
1543   * @since 11
1544   */
1545  style: RichEditorParagraphStyle;
1546}
1547
1548/**
1549 * Defines text span style option of RichEditor.
1550 *
1551 * @interface RichEditorUpdateTextSpanStyleOptions
1552 * @syscap SystemCapability.ArkUI.ArkUI.Full
1553 * @since 10
1554 */
1555/**
1556 * Defines text span style option of RichEditor.
1557 *
1558 * @interface RichEditorUpdateTextSpanStyleOptions
1559 * @syscap SystemCapability.ArkUI.ArkUI.Full
1560 * @crossplatform
1561 * @atomicservice
1562 * @since 11
1563 */
1564declare interface RichEditorUpdateTextSpanStyleOptions extends RichEditorSpanStyleOptions {
1565  /**
1566   * text style.
1567   *
1568   * @type { RichEditorTextStyle }
1569   * @syscap SystemCapability.ArkUI.ArkUI.Full
1570   * @since 10
1571   */
1572  /**
1573   * text style.
1574   *
1575   * @type { RichEditorTextStyle }
1576   * @syscap SystemCapability.ArkUI.ArkUI.Full
1577   * @crossplatform
1578   * @atomicservice
1579   * @since 11
1580   */
1581  textStyle: RichEditorTextStyle;
1582}
1583
1584/**
1585 * Defines image span style option of RichEditor.
1586 *
1587 * @interface RichEditorUpdateImageSpanStyleOptions
1588 * @syscap SystemCapability.ArkUI.ArkUI.Full
1589 * @since 10
1590 */
1591/**
1592 * Defines image span style option of RichEditor.
1593 *
1594 * @interface RichEditorUpdateImageSpanStyleOptions
1595 * @syscap SystemCapability.ArkUI.ArkUI.Full
1596 * @crossplatform
1597 * @atomicservice
1598 * @since 11
1599 */
1600declare interface RichEditorUpdateImageSpanStyleOptions extends RichEditorSpanStyleOptions {
1601  /**
1602   * image style.
1603   *
1604   * @type { RichEditorImageSpanStyle }
1605   * @syscap SystemCapability.ArkUI.ArkUI.Full
1606   * @since 10
1607   */
1608  /**
1609   * image style.
1610   *
1611   * @type { RichEditorImageSpanStyle }
1612   * @syscap SystemCapability.ArkUI.ArkUI.Full
1613   * @crossplatform
1614   * @atomicservice
1615   * @since 11
1616   */
1617  imageStyle: RichEditorImageSpanStyle;
1618}
1619
1620/**
1621 * Defines symbol span style option of RichEditor.
1622 *
1623 * @interface RichEditorUpdateSymbolSpanStyleOptions
1624 * @syscap SystemCapability.ArkUI.ArkUI.Full
1625 * @crossplatform
1626 * @since 11
1627 */
1628declare interface RichEditorUpdateSymbolSpanStyleOptions extends RichEditorSpanStyleOptions {
1629  /**
1630   * Update the symbol span style.
1631   *
1632   * @type { RichEditorSymbolSpanStyle }
1633   * @syscap SystemCapability.ArkUI.ArkUI.Full
1634   * @crossplatform
1635   * @since 11
1636   */
1637  symbolStyle: RichEditorSymbolSpanStyle;
1638}
1639
1640/**
1641 * Defines the symbol span options of RichEditor.
1642 *
1643 * @interface RichEditorSymbolSpanOptions
1644 * @syscap SystemCapability.ArkUI.ArkUI.Full
1645 * @crossplatform
1646 * @since 11
1647 */
1648declare interface RichEditorSymbolSpanOptions {
1649  /**
1650   * The offset that add custom symbol span at.
1651   *
1652   * @type { ?number }
1653   * @syscap SystemCapability.ArkUI.ArkUI.Full
1654   * @crossplatform
1655   * @since 11
1656   */
1657  offset?: number;
1658
1659  /**
1660   * The style that add custom symbol span at.
1661   *
1662   * @type { ?RichEditorSymbolSpanStyle }
1663   * @syscap SystemCapability.ArkUI.ArkUI.Full
1664   * @crossplatform
1665   * @since 11
1666   */
1667  style?: RichEditorSymbolSpanStyle;
1668}
1669
1670/**
1671 * Defines the text information for editing.
1672 *
1673 * @interface RichEditorSelection
1674 * @syscap SystemCapability.ArkUI.ArkUI.Full
1675 * @since 10
1676 */
1677/**
1678 * Defines the text information for editing.
1679 *
1680 * @interface RichEditorSelection
1681 * @syscap SystemCapability.ArkUI.ArkUI.Full
1682 * @crossplatform
1683 * @atomicservice
1684 * @since 11
1685 */
1686declare interface RichEditorSelection {
1687  /**
1688   * The location info.
1689   *
1690   * @type { [number, number] }
1691   * @syscap SystemCapability.ArkUI.ArkUI.Full
1692   * @since 10
1693   */
1694  /**
1695   * The location info.
1696   *
1697   * @type { [number, number] }
1698   * @syscap SystemCapability.ArkUI.ArkUI.Full
1699   * @crossplatform
1700   * @atomicservice
1701   * @since 11
1702   */
1703  selection: [number, number];
1704
1705  /**
1706   * The selected text content.
1707   *
1708   * @type { Array<RichEditorTextSpanResult | RichEditorImageSpanResult> }
1709   * @syscap SystemCapability.ArkUI.ArkUI.Full
1710   * @since 10
1711   */
1712  /**
1713   * The selected text content.
1714   *
1715   * @type { Array<RichEditorTextSpanResult | RichEditorImageSpanResult> }
1716   * @syscap SystemCapability.ArkUI.ArkUI.Full
1717   * @crossplatform
1718   * @atomicservice
1719   * @since 11
1720   */
1721  spans: Array<RichEditorTextSpanResult | RichEditorImageSpanResult>;
1722}
1723
1724/**
1725 * Defines the inserted text value info.
1726 *
1727 * @interface RichEditorInsertValue
1728 * @syscap SystemCapability.ArkUI.ArkUI.Full
1729 * @since 10
1730 */
1731/**
1732 * Defines the inserted text value info.
1733 *
1734 * @interface RichEditorInsertValue
1735 * @syscap SystemCapability.ArkUI.ArkUI.Full
1736 * @crossplatform
1737 * @atomicservice
1738 * @since 11
1739 */
1740declare interface RichEditorInsertValue {
1741  /**
1742   * The location info where the value will be inserted.
1743   *
1744   * @type { number }
1745   * @syscap SystemCapability.ArkUI.ArkUI.Full
1746   * @since 10
1747   */
1748  /**
1749   * The location info where the value will be inserted.
1750   *
1751   * @type { number }
1752   * @syscap SystemCapability.ArkUI.ArkUI.Full
1753   * @crossplatform
1754   * @atomicservice
1755   * @since 11
1756   */
1757  insertOffset: number;
1758
1759  /**
1760   * The inserted value.
1761   *
1762   * @type { string }
1763   * @syscap SystemCapability.ArkUI.ArkUI.Full
1764   * @since 10
1765   */
1766  /**
1767   * The inserted value.
1768   *
1769   * @type { string }
1770   * @syscap SystemCapability.ArkUI.ArkUI.Full
1771   * @crossplatform
1772   * @atomicservice
1773   * @since 11
1774   */
1775  insertValue: string;
1776}
1777
1778/**
1779 * Provides an interface for deleting value from text.
1780 *
1781 * @interface RichEditorDeleteValue
1782 * @syscap SystemCapability.ArkUI.ArkUI.Full
1783 * @since 10
1784 */
1785/**
1786 * Provides an interface for deleting value from text.
1787 *
1788 * @interface RichEditorDeleteValue
1789 * @syscap SystemCapability.ArkUI.ArkUI.Full
1790 * @crossplatform
1791 * @atomicservice
1792 * @since 11
1793 */
1794declare interface RichEditorDeleteValue {
1795  /**
1796   * The offset of deleting.
1797   *
1798   * @type { number }
1799   * @syscap SystemCapability.ArkUI.ArkUI.Full
1800   * @since 10
1801   */
1802  /**
1803   * The offset of deleting.
1804   *
1805   * @type { number }
1806   * @syscap SystemCapability.ArkUI.ArkUI.Full
1807   * @crossplatform
1808   * @atomicservice
1809   * @since 11
1810   */
1811  offset: number;
1812
1813  /**
1814   * The deleted direction.
1815   *
1816   * @type { RichEditorDeleteDirection }
1817   * @syscap SystemCapability.ArkUI.ArkUI.Full
1818   * @since 10
1819   */
1820  /**
1821   * The deleted direction.
1822   *
1823   * @type { RichEditorDeleteDirection }
1824   * @syscap SystemCapability.ArkUI.ArkUI.Full
1825   * @crossplatform
1826   * @atomicservice
1827   * @since 11
1828   */
1829  direction: RichEditorDeleteDirection;
1830
1831  /**
1832   * The deleted text length.
1833   *
1834   * @type { number }
1835   * @syscap SystemCapability.ArkUI.ArkUI.Full
1836   * @since 10
1837   */
1838  /**
1839   * The deleted text length.
1840   *
1841   * @type { number }
1842   * @syscap SystemCapability.ArkUI.ArkUI.Full
1843   * @crossplatform
1844   * @atomicservice
1845   * @since 11
1846   */
1847  length: number;
1848
1849  /**
1850   * The deleted span object.
1851   *
1852   * @type { Array<RichEditorTextSpanResult | RichEditorImageSpanResult> }
1853   * @syscap SystemCapability.ArkUI.ArkUI.Full
1854   * @since 10
1855   */
1856  /**
1857   * The deleted span object.
1858   *
1859   * @type { Array<RichEditorTextSpanResult | RichEditorImageSpanResult> }
1860   * @syscap SystemCapability.ArkUI.ArkUI.Full
1861   * @crossplatform
1862   * @atomicservice
1863   * @since 11
1864   */
1865  richEditorDeleteSpans: Array<RichEditorTextSpanResult | RichEditorImageSpanResult>;
1866}
1867/**
1868 * Defines the options of RichEditor.
1869 *
1870 * @interface RichEditorOptions
1871 * @syscap SystemCapability.ArkUI.ArkUI.Full
1872 * @since 10
1873 */
1874/**
1875 * Defines the options of RichEditor.
1876 *
1877 * @interface RichEditorOptions
1878 * @syscap SystemCapability.ArkUI.ArkUI.Full
1879 * @crossplatform
1880 * @atomicservice
1881 * @since 11
1882 */
1883declare interface RichEditorOptions {
1884  /**
1885   * RichEditor controller.
1886   *
1887   * @type { RichEditorController }
1888   * @syscap SystemCapability.ArkUI.ArkUI.Full
1889   * @since 10
1890   */
1891  /**
1892   * RichEditor controller.
1893   *
1894   * @type { RichEditorController }
1895   * @syscap SystemCapability.ArkUI.ArkUI.Full
1896   * @crossplatform
1897   * @atomicservice
1898   * @since 11
1899   */
1900  controller: RichEditorController;
1901}
1902
1903/**
1904 * Defines the selection menu options.
1905 *
1906 * @interface SelectionMenuOptions
1907 * @syscap SystemCapability.ArkUI.ArkUI.Full
1908 * @crossplatform
1909 * @since 10
1910 */
1911/**
1912 * Defines the selection menu options.
1913 *
1914 * @interface SelectionMenuOptions
1915 * @syscap SystemCapability.ArkUI.ArkUI.Full
1916 * @crossplatform
1917 * @atomicservice
1918 * @since 11
1919 */
1920declare interface SelectionMenuOptions {
1921  /**
1922   * Callback function when the selection menu appears.
1923   *
1924   * @type { ?function }
1925   * @syscap SystemCapability.ArkUI.ArkUI.Full
1926   * @crossplatform
1927   * @since 10
1928   */
1929  /**
1930   * Callback function when the selection menu appears.
1931   *
1932   * @type { ?function }
1933   * @syscap SystemCapability.ArkUI.ArkUI.Full
1934   * @crossplatform
1935   * @atomicservice
1936   * @since 11
1937   */
1938  onAppear?: () => void;
1939
1940  /**
1941   * Callback function when the selection menu disappears.
1942   *
1943   * @type { ?function }
1944   * @syscap SystemCapability.ArkUI.ArkUI.Full
1945   * @crossplatform
1946   * @since 10
1947   */
1948  /**
1949   * Callback function when the selection menu disappears.
1950   *
1951   * @type { ?function }
1952   * @syscap SystemCapability.ArkUI.ArkUI.Full
1953   * @crossplatform
1954   * @atomicservice
1955   * @since 11
1956   */
1957  onDisappear?: () => void;
1958}
1959
1960/**
1961 * Provides Controller for RichEditor.
1962 *
1963 * @syscap SystemCapability.ArkUI.ArkUI.Full
1964 * @since 10
1965 */
1966/**
1967 * Provides Controller for RichEditor.
1968 *
1969 * @syscap SystemCapability.ArkUI.ArkUI.Full
1970 * @crossplatform
1971 * @atomicservice
1972 * @since 11
1973 */
1974declare class RichEditorController {
1975  /**
1976   * Get caret offset from controller.
1977   *
1978   * @returns { number }
1979   * @syscap SystemCapability.ArkUI.ArkUI.Full
1980   * @since 10
1981   */
1982  /**
1983   * Get caret offset from controller.
1984   *
1985   * @returns { number }
1986   * @syscap SystemCapability.ArkUI.ArkUI.Full
1987   * @crossplatform
1988   * @atomicservice
1989   * @since 11
1990   */
1991  getCaretOffset(): number;
1992
1993  /**
1994   * Set caret offset.
1995   *
1996   * @param { number } offset - caret offset.
1997   * @returns { boolean }
1998   * @syscap SystemCapability.ArkUI.ArkUI.Full
1999   * @since 10
2000   */
2001  /**
2002   * Set caret offset.
2003   *
2004   * @param { number } offset - caret offset.
2005   * @returns { boolean }
2006   * @syscap SystemCapability.ArkUI.ArkUI.Full
2007   * @crossplatform
2008   * @atomicservice
2009   * @since 11
2010   */
2011  setCaretOffset(offset: number): boolean;
2012
2013  /**
2014   * Add a text span.
2015   *
2016   * @param { string } value - text value.
2017   * @param { RichEditorTextSpanOptions } [options] - span info.
2018   * @returns { number } span index
2019   * @syscap SystemCapability.ArkUI.ArkUI.Full
2020   * @since 10
2021   */
2022  /**
2023   * Add a text span.
2024   *
2025   * @param { string } value - text value.
2026   * @param { RichEditorTextSpanOptions } [options] - span info.
2027   * @returns { number } span index
2028   * @syscap SystemCapability.ArkUI.ArkUI.Full
2029   * @crossplatform
2030   * @atomicservice
2031   * @since 11
2032   */
2033  addTextSpan(value: string, options?: RichEditorTextSpanOptions): number;
2034
2035  /**
2036   * Add a image span.
2037   *
2038   * @param { PixelMap | ResourceStr } value - image value.
2039   * @param { RichEditorImageSpanOptions } [options] - image span info.
2040   * @returns { number } span index
2041   * @syscap SystemCapability.ArkUI.ArkUI.Full
2042   * @since 10
2043   */
2044  /**
2045   * Add a image span.
2046   *
2047   * @param { PixelMap | ResourceStr } value - image value.
2048   * @param { RichEditorImageSpanOptions } [options] - image span info.
2049   * @returns { number } span index
2050   * @syscap SystemCapability.ArkUI.ArkUI.Full
2051   * @crossplatform
2052   * @atomicservice
2053   * @since 11
2054   */
2055  addImageSpan(value: PixelMap | ResourceStr, options?: RichEditorImageSpanOptions): number;
2056
2057  /**
2058   * Add a builder span.
2059   *
2060   * @param { CustomBuilder } value - Indicates the custom builder node
2061   * @param { RichEditorBuilderSpanOptions } [options] - span option.
2062   * @returns { number } span index
2063   * @syscap SystemCapability.ArkUI.ArkUI.Full
2064   * @crossplatform
2065   * @since 11
2066   */
2067  addBuilderSpan(value: CustomBuilder, options?: RichEditorBuilderSpanOptions): number;
2068
2069  /**
2070   * Add a symbol span.
2071   *
2072   * @param { Resource } value - symbol span value
2073   * @param { RichEditorSymbolSpanOptions } [options] - symbol span option.
2074   * @returns { number } symbol span index
2075   * @syscap SystemCapability.ArkUI.ArkUI.Full
2076   * @crossplatform
2077   * @since 11
2078   */
2079  addSymbolSpan(value: Resource, options?: RichEditorSymbolSpanOptions ): number;
2080
2081  /**
2082   * Modify span style.
2083   *
2084   * @param { RichEditorUpdateTextSpanStyleOptions | RichEditorUpdateImageSpanStyleOptions } value
2085   * @syscap SystemCapability.ArkUI.ArkUI.Full
2086   * @since 10
2087   */
2088  /**
2089   * Modify span style.
2090   *
2091   * @param { RichEditorUpdateTextSpanStyleOptions | RichEditorUpdateImageSpanStyleOptions | RichEditorUpdateSymbolSpanStyleOptions } value
2092   * @syscap SystemCapability.ArkUI.ArkUI.Full
2093   * @crossplatform
2094   * @atomicservice
2095   * @since 11
2096   */
2097  updateSpanStyle(value: RichEditorUpdateTextSpanStyleOptions | RichEditorUpdateImageSpanStyleOptions | RichEditorUpdateSymbolSpanStyleOptions): void;
2098
2099  /**
2100   * Modify span style.
2101   *
2102   * @param { RichEditorParagraphStyleOptions } value
2103   * @syscap SystemCapability.ArkUI.ArkUI.Full
2104   * @crossplatform
2105   * @since 11
2106   */
2107  updateParagraphStyle(value: RichEditorParagraphStyleOptions): void;
2108
2109  /**
2110   * Delete span.
2111   *
2112   * @param { RichEditorRange } [value] - range for deleting.
2113   * @syscap SystemCapability.ArkUI.ArkUI.Full
2114   * @since 10
2115   */
2116  /**
2117   * Delete span.
2118   *
2119   * @param { RichEditorRange } [value] - range for deleting.
2120   * @syscap SystemCapability.ArkUI.ArkUI.Full
2121   * @crossplatform
2122   * @atomicservice
2123   * @since 11
2124   */
2125  deleteSpans(value?: RichEditorRange): void;
2126
2127  /**
2128   * Get span content.
2129   *
2130   * @param { RichEditorRange } [value] - range for getting span info.
2131   * @returns { Array<RichEditorImageSpanResult | RichEditorTextSpanResult> }
2132   * @syscap SystemCapability.ArkUI.ArkUI.Full
2133   * @since 10
2134   */
2135  /**
2136   * Get span content.
2137   *
2138   * @param { RichEditorRange } [value] - range for getting span info.
2139   * @returns { Array<RichEditorImageSpanResult | RichEditorTextSpanResult> }
2140   * @syscap SystemCapability.ArkUI.ArkUI.Full
2141   * @crossplatform
2142   * @atomicservice
2143   * @since 11
2144   */
2145  getSpans(value?: RichEditorRange): Array<RichEditorImageSpanResult | RichEditorTextSpanResult>;
2146
2147  /**
2148   * Get span content.
2149   *
2150   * @param { RichEditorRange } [value] - range for getting span info.
2151   * @returns { Array<RichEditorParagraphResult> }
2152   * @syscap SystemCapability.ArkUI.ArkUI.Full
2153   * @crossplatform
2154   * @since 11
2155   */
2156  getParagraphs(value?: RichEditorRange): Array<RichEditorParagraphResult>;
2157
2158  /**
2159   * close the select menu when menu is on.
2160   *
2161   * @syscap SystemCapability.ArkUI.ArkUI.Full
2162   * @since 10
2163   */
2164  /**
2165   * close the select menu when menu is on.
2166   *
2167   * @syscap SystemCapability.ArkUI.ArkUI.Full
2168   * @crossplatform
2169   * @atomicservice
2170   * @since 11
2171   */
2172  closeSelectionMenu(): void;
2173
2174  /**
2175   * Get the typing text style.
2176   *
2177   * @returns { RichEditorTextStyle }
2178   * @syscap SystemCapability.ArkUI.ArkUI.Full
2179   * @crossplatform
2180   * @since 11
2181   */
2182  getTypingStyle(): RichEditorTextStyle;
2183
2184  /**
2185   * Set the typing text style.
2186   *
2187   * @param { RichEditorTextStyle } value - set the typing text style.
2188   * @syscap SystemCapability.ArkUI.ArkUI.Full
2189   * @crossplatform
2190   * @since 11
2191   */
2192  setTypingStyle(value: RichEditorTextStyle): void;
2193
2194  /**
2195   * Text selection is achieved by specifying the start and end positions of the rich editor.
2196   *
2197   * @param { number } selectionStart - The start position of the selected text.
2198   * @param { number } selectionEnd - The end position of the selected text.
2199   * @syscap SystemCapability.ArkUI.ArkUI.Full
2200   * @crossplatform
2201   * @since 11
2202   */
2203  setSelection(selectionStart: number, selectionEnd: number): void;
2204
2205  /**
2206   * Called when the content is selected.
2207   *
2208   * @returns { RichEditorSelection }
2209   * @syscap SystemCapability.ArkUI.ArkUI.Full
2210   * @crossplatform
2211   * @since 11
2212   */
2213  getSelection(): RichEditorSelection;
2214}
2215
2216/**
2217 * Provides attribute for RichEditor.
2218 *
2219 * @extends CommonMethod<RichEditorAttribute>
2220 * @syscap SystemCapability.ArkUI.ArkUI.Full
2221 * @since 10
2222 */
2223/**
2224 * Provides attribute for RichEditor.
2225 *
2226 * @extends CommonMethod<RichEditorAttribute>
2227 * @syscap SystemCapability.ArkUI.ArkUI.Full
2228 * @crossplatform
2229 * @atomicservice
2230 * @since 11
2231 */
2232declare class RichEditorAttribute extends CommonMethod<RichEditorAttribute> {
2233  /**
2234   * Called when on ready.
2235   *
2236   * @param { function } callback - The triggered function when rich editor is ready.
2237   * @returns { RichEditorAttribute }
2238   * @syscap SystemCapability.ArkUI.ArkUI.Full
2239   * @since 10
2240   */
2241  /**
2242   * Called when on ready.
2243   *
2244   * @param { function } callback - The triggered function when rich editor is ready.
2245   * @returns { RichEditorAttribute }
2246   * @syscap SystemCapability.ArkUI.ArkUI.Full
2247   * @crossplatform
2248   * @atomicservice
2249   * @since 11
2250   */
2251  onReady(callback: () => void): RichEditorAttribute;
2252
2253  /**
2254   * Called when the content is selected.
2255   *
2256   * @param { function } callback - The triggered function when select text.
2257   * @returns { RichEditorAttribute }
2258   * @syscap SystemCapability.ArkUI.ArkUI.Full
2259   * @since 10
2260   */
2261  /**
2262   * Called when the content is selected.
2263   *
2264   * @param { function } callback - The triggered function when select text.
2265   * @returns { RichEditorAttribute }
2266   * @syscap SystemCapability.ArkUI.ArkUI.Full
2267   * @crossplatform
2268   * @atomicservice
2269   * @since 11
2270   */
2271  onSelect(callback: (value: RichEditorSelection) => void): RichEditorAttribute;
2272
2273  /**
2274   * Get text value information when about to input.
2275   *
2276   * @param { function } callback - The triggered function when text content is about to insert.
2277   * @returns { RichEditorAttribute }
2278   * @syscap SystemCapability.ArkUI.ArkUI.Full
2279   * @since 10
2280   */
2281  /**
2282   * Get text value information when about to input.
2283   *
2284   * @param { function } callback - The triggered function when text content is about to insert.
2285   * @returns { RichEditorAttribute }
2286   * @syscap SystemCapability.ArkUI.ArkUI.Full
2287   * @crossplatform
2288   * @atomicservice
2289   * @since 11
2290   */
2291  aboutToIMEInput(callback: (value: RichEditorInsertValue) => boolean): RichEditorAttribute;
2292
2293  /**
2294   * Get text value information when completed input.
2295   *
2296   * @param { function } callback - The triggered function when text content has been inserted.
2297   * @returns { RichEditorAttribute }
2298   * @syscap SystemCapability.ArkUI.ArkUI.Full
2299   * @since 10
2300   */
2301  /**
2302   * Get text value information when completed input.
2303   *
2304   * @param { function } callback - The triggered function when text content has been inserted.
2305   * @returns { RichEditorAttribute }
2306   * @syscap SystemCapability.ArkUI.ArkUI.Full
2307   * @crossplatform
2308   * @atomicservice
2309   * @since 11
2310   */
2311  onIMEInputComplete(callback: (value: RichEditorTextSpanResult) => void): RichEditorAttribute;
2312
2313  /**
2314   * Get text value information when about to delete.
2315   *
2316   * @param { function } callback - The triggered function when text content is about to delete.
2317   * @returns { RichEditorAttribute }
2318   * @syscap SystemCapability.ArkUI.ArkUI.Full
2319   * @since 10
2320   */
2321  /**
2322   * Get text value information when about to delete.
2323   *
2324   * @param { function } callback - The triggered function when text content is about to delete.
2325   * @returns { RichEditorAttribute }
2326   * @syscap SystemCapability.ArkUI.ArkUI.Full
2327   * @crossplatform
2328   * @atomicservice
2329   * @since 11
2330   */
2331  aboutToDelete(callback: (value: RichEditorDeleteValue) => boolean): RichEditorAttribute;
2332
2333  /**
2334   * Notify that the deletion has been completed
2335   *
2336   * @param { function } callback - The triggered function when text content has been deleted.
2337   * @returns { RichEditorAttribute }
2338   * @syscap SystemCapability.ArkUI.ArkUI.Full
2339   * @since 10
2340   */
2341  /**
2342   * Notify that the deletion has been completed
2343   *
2344   * @param { function } callback - The triggered function when text content has been deleted.
2345   * @returns { RichEditorAttribute }
2346   * @syscap SystemCapability.ArkUI.ArkUI.Full
2347   * @crossplatform
2348   * @atomicservice
2349   * @since 11
2350   */
2351  onDeleteComplete(callback: () => void): RichEditorAttribute;
2352
2353  /**
2354   * Allow replication.
2355   *
2356   * @param { CopyOptions } value - Indicates the type of copy option.
2357   * @returns { RichEditorAttribute }
2358   * @syscap SystemCapability.ArkUI.ArkUI.Full
2359   * @crossplatform
2360   * @since 10
2361   * @form
2362   */
2363  /**
2364   * Allow replication.
2365   *
2366   * @param { CopyOptions } value - Indicates the type of copy option.
2367   * @returns { RichEditorAttribute }
2368   * @syscap SystemCapability.ArkUI.ArkUI.Full
2369   * @crossplatform
2370   * @atomicservice
2371   * @since 11
2372   * @form
2373   */
2374  copyOptions(value: CopyOptions): RichEditorAttribute;
2375
2376  /**
2377   * Bind to the selection menu.
2378   *
2379   * @param { RichEditorSpanType } spanType - Indicates the type of selection menu.
2380   * @param { CustomBuilder } content - Indicates the content of selection menu.
2381   * @param { ResponseType } responseType - Indicates response type of selection menu.
2382   * @param { SelectionMenuOptions } [options] - Indicates the options of selection menu.
2383   * @returns { RichEditorAttribute }
2384   * @syscap SystemCapability.ArkUI.ArkUI.Full
2385   * @crossplatform
2386   * @since 10
2387   */
2388  /**
2389   * Bind to the selection menu.
2390   *
2391   * @param { RichEditorSpanType } spanType - Indicates the type of selection menu.
2392   * @param { CustomBuilder } content - Indicates the content of selection menu.
2393   * @param { ResponseType | RichEditorResponseType } responseType - Indicates response type of selection menu.
2394   * @param { SelectionMenuOptions } [options] - Indicates the options of selection menu.
2395   * @returns { RichEditorAttribute }
2396   * @syscap SystemCapability.ArkUI.ArkUI.Full
2397   * @crossplatform
2398   * @atomicservice
2399   * @since 11
2400   */
2401  bindSelectionMenu(spanType: RichEditorSpanType, content: CustomBuilder, responseType: ResponseType | RichEditorResponseType,
2402    options?: SelectionMenuOptions): RichEditorAttribute;
2403
2404  /**
2405   * Define custom keyboard.
2406   *
2407   * @param { CustomBuilder } value
2408   * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute.
2409   * @syscap SystemCapability.ArkUI.ArkUI.Full
2410   * @since 10
2411   */
2412  /**
2413   * Define custom keyboard.
2414   *
2415   * @param { CustomBuilder } value
2416   * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute.
2417   * @syscap SystemCapability.ArkUI.ArkUI.Full
2418   * @crossplatform
2419   * @atomicservice
2420   * @since 11
2421   */
2422  customKeyboard(value: CustomBuilder): RichEditorAttribute;
2423
2424  /**
2425    * Defines onPaste callback.
2426    *
2427    * @param { function } callback Executed when a paste operation is performed.
2428    * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute.
2429    * @syscap SystemCapability.ArkUI.ArkUI.Full
2430    * @crossplatform
2431    * @since 11
2432    */
2433  onPaste(callback: (event?: PasteEvent) => void): RichEditorAttribute;
2434
2435  /**
2436   * Enable data detector.
2437   *
2438   * @param { boolean } enable - Enable data detector.
2439   * @returns { RichEditorAttribute } The attribute of the rich editor.
2440   * @syscap SystemCapability.ArkUI.ArkUI.Full
2441   * @crossplatform
2442   * @since 11
2443   */
2444  enableDataDetector(enable: boolean): RichEditorAttribute;
2445
2446  /**
2447   * Data detector with config.
2448   *
2449   * @param { TextDataDetectorConfig } config - The config of text data detector.
2450   * @returns { RichEditorAttribute } The attribute of the rich editor.
2451   * @syscap SystemCapability.ArkUI.ArkUI.Full
2452   * @crossplatform
2453   * @since 11
2454   */
2455  dataDetectorConfig(config: TextDataDetectorConfig): RichEditorAttribute;
2456}
2457
2458/**
2459 * Provides an interface for writing texts.
2460 *
2461 * @interface RichEditorInterface
2462 * @syscap SystemCapability.ArkUI.ArkUI.Full
2463 * @since 10
2464 */
2465/**
2466 * Provides an interface for writing texts.
2467 *
2468 * @interface RichEditorInterface
2469 * @syscap SystemCapability.ArkUI.ArkUI.Full
2470 * @crossplatform
2471 * @atomicservice
2472 * @since 11
2473 */
2474interface RichEditorInterface {
2475  /**
2476   * Called when create RichEditor.
2477   *
2478   * @param { RichEditorOptions } value
2479   * @returns { RichEditorAttribute }
2480   * @syscap SystemCapability.ArkUI.ArkUI.Full
2481   * @since 10
2482   */
2483  /**
2484   * Called when create RichEditor.
2485   *
2486   * @param { RichEditorOptions } value
2487   * @returns { RichEditorAttribute }
2488   * @syscap SystemCapability.ArkUI.ArkUI.Full
2489   * @crossplatform
2490   * @atomicservice
2491   * @since 11
2492   */
2493  (value: RichEditorOptions): RichEditorAttribute;
2494}
2495
2496/**
2497 * Defines RichEditor Component instance.
2498 *
2499 * @syscap SystemCapability.ArkUI.ArkUI.Full
2500 * @since 10
2501 */
2502/**
2503 * Defines RichEditor Component instance.
2504 *
2505 * @syscap SystemCapability.ArkUI.ArkUI.Full
2506 * @crossplatform
2507 * @atomicservice
2508 * @since 11
2509 */
2510declare const RichEditorInstance: RichEditorAttribute;
2511
2512/**
2513 * Defines RichEditor Component.
2514 *
2515 * @syscap SystemCapability.ArkUI.ArkUI.Full
2516 * @since 10
2517 */
2518/**
2519 * Defines RichEditor Component.
2520 *
2521 * @syscap SystemCapability.ArkUI.ArkUI.Full
2522 * @crossplatform
2523 * @atomicservice
2524 * @since 11
2525 */
2526declare const RichEditor: RichEditorInterface;
2527