• 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 */
23declare enum RichEditorDeleteDirection {
24  /**
25   * Delete backward.
26   *
27   * @syscap SystemCapability.ArkUI.ArkUI.Full
28   * @since 10
29   */
30  BACKWARD,
31
32  /**
33   * Delete forward.
34   *
35   * @syscap SystemCapability.ArkUI.ArkUI.Full
36   * @since 10
37   */
38  FORWARD,
39}
40
41/**
42 * Defines span type.
43 *
44 * @enum { number }
45 * @syscap SystemCapability.ArkUI.ArkUI.Full
46 * @since 10
47 */
48declare enum RichEditorSpanType {
49  /**
50   * text.
51   *
52   * @syscap SystemCapability.ArkUI.ArkUI.Full
53   * @since 10
54   */
55  TEXT = 0,
56
57  /**
58   * image.
59   *
60   * @syscap SystemCapability.ArkUI.ArkUI.Full
61   * @since 10
62   */
63  IMAGE = 1,
64
65  /**
66   * mixed.
67   *
68   * @syscap SystemCapability.ArkUI.ArkUI.Full
69   * @since 10
70   */
71  MIXED = 2,
72}
73
74/**
75 * Defines the span position.
76 *
77 * @interface RichEditorSpanPosition
78 * @syscap SystemCapability.ArkUI.ArkUI.Full
79 * @since 10
80 */
81declare interface RichEditorSpanPosition {
82  /**
83   * Define the index of span.
84   *
85   * @type { number }
86   * @syscap SystemCapability.ArkUI.ArkUI.Full
87   * @since 10
88   */
89  spanIndex: number;
90
91  /**
92   * The range of span.
93   *
94   * @type { [number, number] }
95   * @syscap SystemCapability.ArkUI.ArkUI.Full
96   * @since 10
97   */
98  spanRange: [number, number];
99}
100
101/**
102 * Defines the span text style.
103 *
104 * @interface RichEditorTextStyle
105 * @syscap SystemCapability.ArkUI.ArkUI.Full
106 * @since 10
107 */
108declare interface RichEditorTextStyle {
109  /**
110   * font color.
111   *
112   * @type { ?ResourceColor }
113   * @syscap SystemCapability.ArkUI.ArkUI.Full
114   * @since 10
115   */
116  fontColor?: ResourceColor;
117
118  /**
119   * font size.
120   *
121   * @type { ?(Length | number) }
122   * @syscap SystemCapability.ArkUI.ArkUI.Full
123   * @since 10
124   */
125  fontSize?: Length | number;
126
127  /**
128   * font style.
129   *
130   * @type { ?FontStyle }
131   * @syscap SystemCapability.ArkUI.ArkUI.Full
132   * @since 10
133   */
134  fontStyle?: FontStyle;
135
136  /**
137   * font weight.
138   *
139   * @type { ?(number | FontWeight | string) }
140   * @syscap SystemCapability.ArkUI.ArkUI.Full
141   * @since 10
142   */
143  fontWeight?: number | FontWeight | string;
144
145  /**
146   * font family.
147   *
148   * @type { ?ResourceStr }
149   * @syscap SystemCapability.ArkUI.ArkUI.Full
150   * @since 10
151   */
152  fontFamily?: ResourceStr;
153
154  /**
155   * font decoration.
156   *
157   * @type { ?object }
158   * @syscap SystemCapability.ArkUI.ArkUI.Full
159   * @since 10
160   */
161  decoration?: { type: TextDecorationType; color?: ResourceColor; };
162}
163
164/**
165 * Defines the text span.
166 *
167 * @interface RichEditorTextSpan
168 * @syscap SystemCapability.ArkUI.ArkUI.Full
169 * @since 10
170 */
171declare interface RichEditorTextSpan {
172  /**
173   * The position of the text span.
174   *
175   * @type { RichEditorSpanPosition }
176   * @syscap SystemCapability.ArkUI.ArkUI.Full
177   * @since 10
178   */
179  spanPosition: RichEditorSpanPosition;
180
181  /**
182   * The content of the text span.
183   *
184   * @type { string }
185   * @syscap SystemCapability.ArkUI.ArkUI.Full
186   * @since 10
187   */
188  value: string;
189
190  /**
191   * text style.
192   *
193   * @type { ?RichEditorTextStyle }
194   * @syscap SystemCapability.ArkUI.ArkUI.Full
195   * @since 10
196   */
197  textStyle?: RichEditorTextStyle;
198}
199
200/**
201 * Defines the span image style.
202 *
203 * @interface RichEditorImageSpanStyle
204 * @syscap SystemCapability.ArkUI.ArkUI.Full
205 * @since 10
206 */
207declare interface RichEditorImageSpanStyle {
208  /**
209   * image size.
210   *
211   * @type { ?[Dimension, Dimension] }
212   * @syscap SystemCapability.ArkUI.ArkUI.Full
213   * @since 10
214   */
215  size?: [Dimension, Dimension];
216
217  /**
218   * image vertical align.
219   *
220   * @type { ?ImageSpanAlignment }
221   * @syscap SystemCapability.ArkUI.ArkUI.Full
222   * @since 10
223   */
224  verticalAlign?: ImageSpanAlignment;
225
226  /**
227   * image fit.
228   *
229   * @type { ?ImageFit }
230   * @syscap SystemCapability.ArkUI.ArkUI.Full
231   * @since 10
232   */
233  objectFit?: ImageFit;
234}
235
236/**
237 * Defines the text style result.
238 *
239 * @interface RichEditorTextStyleResult
240 * @syscap SystemCapability.ArkUI.ArkUI.Full
241 * @since 10
242 */
243declare interface RichEditorTextStyleResult {
244  /**
245   * font color.
246   *
247   * @type { ResourceColor }
248   * @syscap SystemCapability.ArkUI.ArkUI.Full
249   * @since 10
250   */
251  fontColor: ResourceColor;
252
253  /**
254   * font size.
255   *
256   * @type { number }
257   * @syscap SystemCapability.ArkUI.ArkUI.Full
258   * @since 10
259   */
260  fontSize: number;
261
262  /**
263   * font style.
264   *
265   * @type { FontStyle }
266   * @syscap SystemCapability.ArkUI.ArkUI.Full
267   * @since 10
268   */
269  fontStyle: FontStyle;
270
271  /**
272   * font weight.
273   *
274   * @type { number }
275   * @syscap SystemCapability.ArkUI.ArkUI.Full
276   * @since 10
277   */
278  fontWeight: number;
279
280  /**
281   * font family.
282   *
283   * @type { string }
284   * @syscap SystemCapability.ArkUI.ArkUI.Full
285   * @since 10
286   */
287  fontFamily: string;
288
289  /**
290   * font decoration.
291   *
292   * @type { object }
293   * @syscap SystemCapability.ArkUI.ArkUI.Full
294   * @since 10
295   */
296  decoration: { type: TextDecorationType; color: ResourceColor; };
297}
298
299/**
300 * Defines the text span result.
301 *
302 * @interface RichEditorTextSpanResult
303 * @syscap SystemCapability.ArkUI.ArkUI.Full
304 * @since 10
305 */
306declare interface RichEditorTextSpanResult {
307  /**
308   * The position of the text span.
309   *
310   * @type { RichEditorSpanPosition }
311   * @syscap SystemCapability.ArkUI.ArkUI.Full
312   * @since 10
313   */
314  spanPosition: RichEditorSpanPosition;
315
316  /**
317   * The content of the text span.
318   *
319   * @type { string }
320   * @syscap SystemCapability.ArkUI.ArkUI.Full
321   * @since 10
322   */
323  value: string;
324
325  /**
326   * text style.
327   *
328   * @type { RichEditorTextStyleResult }
329   * @syscap SystemCapability.ArkUI.ArkUI.Full
330   * @since 10
331   */
332  textStyle: RichEditorTextStyleResult;
333
334  /**
335   * get offset in span.
336   *
337   * @type { [number, number] }
338   * @syscap SystemCapability.ArkUI.ArkUI.Full
339   * @since 10
340   */
341  offsetInSpan: [number, number];
342}
343
344/**
345 * Defines the span image style result.
346 *
347 * @interface RichEditorImageSpanStyleResult
348 * @syscap SystemCapability.ArkUI.ArkUI.Full
349 * @since 10
350 */
351declare interface RichEditorImageSpanStyleResult {
352  /**
353   * image size.
354   *
355   * @type { [number, number] }
356   * @syscap SystemCapability.ArkUI.ArkUI.Full
357   * @since 10
358   */
359  size: [number, number];
360
361  /**
362   * image vertical align.
363   *
364   * @type { ImageSpanAlignment }
365   * @syscap SystemCapability.ArkUI.ArkUI.Full
366   * @since 10
367   */
368  verticalAlign: ImageSpanAlignment;
369
370  /**
371   * image fit.
372   *
373   * @type { ImageFit }
374   * @syscap SystemCapability.ArkUI.ArkUI.Full
375   * @since 10
376   */
377  objectFit: ImageFit;
378}
379
380/**
381 * Defines the image span.
382 *
383 * @interface RichEditorImageSpanResult
384 * @syscap SystemCapability.ArkUI.ArkUI.Full
385 * @since 10
386 */
387declare interface RichEditorImageSpanResult {
388  /**
389   * The position of the image span.
390   *
391   * @type { RichEditorSpanPosition }
392   * @syscap SystemCapability.ArkUI.ArkUI.Full
393   * @since 10
394   */
395  spanPosition: RichEditorSpanPosition;
396
397  /**
398   * The pixel map of the image span.
399   *
400   * @type { ?PixelMap }
401   * @syscap SystemCapability.ArkUI.ArkUI.Full
402   * @since 10
403   */
404  valuePixelMap?: PixelMap;
405
406  /**
407   * The resource string of the image span.
408   *
409   * @type { ?ResourceStr }
410   * @syscap SystemCapability.ArkUI.ArkUI.Full
411   * @since 10
412   */
413  valueResourceStr?: ResourceStr;
414
415  /**
416   * image attribute.
417   *
418   * @type { RichEditorImageSpanStyleResult }
419   * @syscap SystemCapability.ArkUI.ArkUI.Full
420   * @since 10
421   */
422  imageStyle: RichEditorImageSpanStyleResult;
423
424  /**
425   * get offset in span.
426   *
427   * @type { [number, number] }
428   * @syscap SystemCapability.ArkUI.ArkUI.Full
429   * @since 10
430   */
431  offsetInSpan: [number, number];
432}
433
434/**
435 * Defines the image span.
436 *
437 * @interface RichEditorImageSpan
438 * @syscap SystemCapability.ArkUI.ArkUI.Full
439 * @since 10
440 */
441declare interface RichEditorImageSpan {
442  /**
443   * The position of the image span.
444   *
445   * @type { RichEditorSpanPosition }
446   * @syscap SystemCapability.ArkUI.ArkUI.Full
447   * @since 10
448   */
449  spanPosition: RichEditorSpanPosition;
450
451  /**
452   * The content of the image span.
453   *
454   * @type { PixelMap | ResourceStr }
455   * @syscap SystemCapability.ArkUI.ArkUI.Full
456   * @since 10
457   */
458  value: PixelMap | ResourceStr;
459
460  /**
461   * image style.
462   *
463   * @type { ?RichEditorImageSpanStyle }
464   * @syscap SystemCapability.ArkUI.ArkUI.Full
465   * @since 10
466   */
467  imageStyle?: RichEditorImageSpanStyle;
468}
469
470/**
471 * Defines range of RichEditor.
472 *
473 * @interface RichEditorRange
474 * @syscap SystemCapability.ArkUI.ArkUI.Full
475 * @since 10
476 */
477declare interface RichEditorRange {
478  /**
479   * start offset.
480   *
481   * @type { ?number }
482   * @default 0
483   * @syscap SystemCapability.ArkUI.ArkUI.Full
484   * @since 10
485   */
486  start?: number;
487
488  /**
489   * end offset.
490   *
491   * @type { ?number }
492   * @default text length
493   * @syscap SystemCapability.ArkUI.ArkUI.Full
494   * @since 10
495   */
496  end?: number;
497}
498
499/**
500 * Defines the span options of RichEditor.
501 *
502 * @interface RichEditorTextSpanOptions
503 * @syscap SystemCapability.ArkUI.ArkUI.Full
504 * @since 10
505 */
506declare interface RichEditorTextSpanOptions {
507  /**
508   * the offset that add a text span at.
509   *
510   * @type { ?number }
511   * @syscap SystemCapability.ArkUI.ArkUI.Full
512   * @since 10
513   */
514  offset?: number;
515
516  /**
517   * text style.
518   *
519   * @type { ?RichEditorTextStyle }
520   * @syscap SystemCapability.ArkUI.ArkUI.Full
521   * @since 10
522   */
523  style?: RichEditorTextStyle;
524}
525
526/**
527 * Defines the image span options of RichEditor.
528 *
529 * @interface RichEditorImageSpanOptions
530 * @syscap SystemCapability.ArkUI.ArkUI.Full
531 * @since 10
532 */
533declare interface RichEditorImageSpanOptions {
534  /**
535   * the offset that add image span at.
536   *
537   * @type { ?number }
538   * @syscap SystemCapability.ArkUI.ArkUI.Full
539   * @since 10
540   */
541  offset?: number;
542
543  /**
544   * image style.
545   *
546   * @type { ?RichEditorImageSpanStyle }
547   * @syscap SystemCapability.ArkUI.ArkUI.Full
548   * @since 10
549   */
550  imageStyle?: RichEditorImageSpanStyle;
551}
552
553/**
554 * Defines span style option of RichEditor.
555 *
556 * @interface RichEditorSpanStyleOptions
557 * @syscap SystemCapability.ArkUI.ArkUI.Full
558 * @since 10
559 */
560declare interface RichEditorSpanStyleOptions extends RichEditorRange { }
561
562/**
563 * Defines text span style option of RichEditor.
564 *
565 * @interface RichEditorUpdateTextSpanStyleOptions
566 * @syscap SystemCapability.ArkUI.ArkUI.Full
567 * @since 10
568 */
569declare interface RichEditorUpdateTextSpanStyleOptions extends RichEditorSpanStyleOptions {
570  /**
571   * text style.
572   *
573   * @type { RichEditorTextStyle }
574   * @syscap SystemCapability.ArkUI.ArkUI.Full
575   * @since 10
576   */
577  textStyle: RichEditorTextStyle;
578}
579
580/**
581 * Defines image span style option of RichEditor.
582 *
583 * @interface RichEditorUpdateImageSpanStyleOptions
584 * @syscap SystemCapability.ArkUI.ArkUI.Full
585 * @since 10
586 */
587declare interface RichEditorUpdateImageSpanStyleOptions extends RichEditorSpanStyleOptions {
588  /**
589   * image style.
590   *
591   * @type { RichEditorImageSpanStyle }
592   * @syscap SystemCapability.ArkUI.ArkUI.Full
593   * @since 10
594   */
595  imageStyle: RichEditorImageSpanStyle;
596}
597
598/**
599 * Defines the text information for editing.
600 *
601 * @interface RichEditorSelection
602 * @syscap SystemCapability.ArkUI.ArkUI.Full
603 * @since 10
604 */
605declare interface RichEditorSelection {
606  /**
607   * The location info.
608   *
609   * @type { [number, number] }
610   * @syscap SystemCapability.ArkUI.ArkUI.Full
611   * @since 10
612   */
613  selection: [number, number];
614
615  /**
616   * The selected text content.
617   *
618   * @type { Array<RichEditorTextSpanResult | RichEditorImageSpanResult> }
619   * @syscap SystemCapability.ArkUI.ArkUI.Full
620   * @since 10
621   */
622  spans: Array<RichEditorTextSpanResult | RichEditorImageSpanResult>;
623}
624
625/**
626 * Defines the inserted text value info.
627 *
628 * @interface RichEditorInsertValue
629 * @syscap SystemCapability.ArkUI.ArkUI.Full
630 * @since 10
631 */
632declare interface RichEditorInsertValue {
633  /**
634   * The location info where the value will be inserted.
635   *
636   * @type { number }
637   * @syscap SystemCapability.ArkUI.ArkUI.Full
638   * @since 10
639   */
640  insertOffset: number;
641
642  /**
643   * The inserted value.
644   *
645   * @type { string }
646   * @syscap SystemCapability.ArkUI.ArkUI.Full
647   * @since 10
648   */
649  insertValue: string;
650}
651
652/**
653 * Provides an interface for deleting value from text.
654 *
655 * @interface RichEditorDeleteValue
656 * @syscap SystemCapability.ArkUI.ArkUI.Full
657 * @since 10
658 */
659declare interface RichEditorDeleteValue {
660  /**
661   * The offset of deleting.
662   *
663   * @type { number }
664   * @syscap SystemCapability.ArkUI.ArkUI.Full
665   * @since 10
666   */
667  offset: number;
668
669  /**
670   * The deleted direction.
671   *
672   * @type { RichEditorDeleteDirection }
673   * @syscap SystemCapability.ArkUI.ArkUI.Full
674   * @since 10
675   */
676  direction: RichEditorDeleteDirection;
677
678  /**
679   * The deleted text length.
680   *
681   * @type { number }
682   * @syscap SystemCapability.ArkUI.ArkUI.Full
683   * @since 10
684   */
685  length: number;
686
687  /**
688   * The deleted span object.
689   *
690   * @type { Array<RichEditorTextSpanResult | RichEditorImageSpanResult> }
691   * @syscap SystemCapability.ArkUI.ArkUI.Full
692   * @since 10
693   */
694  richEditorDeleteSpans: Array<RichEditorTextSpanResult | RichEditorImageSpanResult>;
695}
696/**
697 * Defines the options of RichEditor.
698 *
699 * @interface RichEditorOptions
700 * @syscap SystemCapability.ArkUI.ArkUI.Full
701 * @since 10
702 */
703declare interface RichEditorOptions {
704  /**
705   * RichEditor controller.
706   *
707   * @type { RichEditorController }
708   * @syscap SystemCapability.ArkUI.ArkUI.Full
709   * @since 10
710   */
711  controller: RichEditorController;
712}
713
714/**
715 * Defines the selection menu options.
716 *
717 * @interface SelectionMenuOptions
718 * @syscap SystemCapability.ArkUI.ArkUI.Full
719 * @crossplatform
720 * @since 10
721 */
722declare interface SelectionMenuOptions {
723  /**
724   * Callback function when the selection menu appears.
725   *
726   * @type { ?function }
727   * @syscap SystemCapability.ArkUI.ArkUI.Full
728   * @crossplatform
729   * @since 10
730   */
731  onAppear?: () => void;
732
733  /**
734   * Callback function when the selection menu disappears.
735   *
736   * @type { ?function }
737   * @syscap SystemCapability.ArkUI.ArkUI.Full
738   * @crossplatform
739   * @since 10
740   */
741  onDisappear?: () => void;
742}
743
744declare class RichEditorController {
745  /**
746   * Get caret offset from controller.
747   *
748   * @returns { number }
749   * @syscap SystemCapability.ArkUI.ArkUI.Full
750   * @since 10
751   */
752  getCaretOffset(): number;
753
754  /**
755   * Set caret offset.
756   *
757   * @param { number } offset - caret offset.
758   * @returns { boolean }
759   * @syscap SystemCapability.ArkUI.ArkUI.Full
760   * @since 10
761   */
762  setCaretOffset(offset: number): boolean;
763
764  /**
765   * Add a text span.
766   *
767   * @param { string } value - text value.
768   * @param { RichEditorTextSpanOptions } [options] - span info.
769   * @returns { number } span index
770   * @syscap SystemCapability.ArkUI.ArkUI.Full
771   * @since 10
772   */
773  addTextSpan(value: string, options?: RichEditorTextSpanOptions): number;
774
775  /**
776   * Add a image span.
777   *
778   * @param { PixelMap| ResourceStr } value - image value.
779   * @param { RichEditorImageSpanOptions } [options] - image span info.
780   * @returns { number } span index
781   * @syscap SystemCapability.ArkUI.ArkUI.Full
782   * @since 10
783   */
784  addImageSpan(value: PixelMap | ResourceStr, options?: RichEditorImageSpanOptions): number;
785
786  /**
787   * Modify span style.
788   *
789   * @param { RichEditorUpdateTextSpanStyleOptions | RichEditorUpdateImageSpanStyleOptions } value
790   * @syscap SystemCapability.ArkUI.ArkUI.Full
791   * @since 10
792   */
793  updateSpanStyle(value: RichEditorUpdateTextSpanStyleOptions | RichEditorUpdateImageSpanStyleOptions): void;
794
795  /**
796   * Delete span.
797   *
798   * @param { RichEditorRange } [value] - range for deleting.
799   * @syscap SystemCapability.ArkUI.ArkUI.Full
800   * @since 10
801   */
802  deleteSpans(value?: RichEditorRange): void;
803
804  /**
805   * Get span content.
806   *
807   * @param { RichEditorRange } [value] - range for getting span info.
808   * @returns { Array<RichEditorImageSpanResult | RichEditorTextSpanResult> }
809   * @syscap SystemCapability.ArkUI.ArkUI.Full
810   * @since 10
811   */
812  getSpans(value?: RichEditorRange): Array<RichEditorImageSpanResult | RichEditorTextSpanResult>;
813
814  /**
815   * close the select menu when menu is on.
816   *
817   * @syscap SystemCapability.ArkUI.ArkUI.Full
818   * @since 10
819   */
820  closeSelectionMenu(): void;
821}
822
823/**
824 * Provides attribute for RichEditor.
825 *
826 * @extends CommonMethod
827 * @syscap SystemCapability.ArkUI.ArkUI.Full
828 * @since 10
829 */
830declare class RichEditorAttribute extends CommonMethod<RichEditorAttribute> {
831  /**
832   * Called when on ready.
833   *
834   * @param { function } callback - The triggered function when rich editor is ready.
835   * @returns { RichEditorAttribute }
836   * @syscap SystemCapability.ArkUI.ArkUI.Full
837   * @since 10
838   */
839  onReady(callback: () => void): RichEditorAttribute;
840
841  /**
842   * Called when the content is selected.
843   *
844   * @param { function } callback - The triggered function when select text.
845   * @returns { RichEditorAttribute }
846   * @syscap SystemCapability.ArkUI.ArkUI.Full
847   * @since 10
848   */
849  onSelect(callback: (value: RichEditorSelection) => void): RichEditorAttribute;
850
851  /**
852   * Get text value information when about to input.
853   *
854   * @param { function } callback - The triggered function when text content is about to insert.
855   * @returns { RichEditorAttribute }
856   * @syscap SystemCapability.ArkUI.ArkUI.Full
857   * @since 10
858   */
859  aboutToIMEInput(callback: (value: RichEditorInsertValue) => boolean): RichEditorAttribute;
860
861  /**
862   * Get text value information when completed input.
863   *
864   * @param { function } callback - The triggered function when text content has been inserted.
865   * @returns { RichEditorAttribute }
866   * @syscap SystemCapability.ArkUI.ArkUI.Full
867   * @since 10
868   */
869  onIMEInputComplete(callback: (value: RichEditorTextSpanResult) => void): RichEditorAttribute;
870
871  /**
872   * Get text value information when about to delete.
873   *
874   * @param { function } callback - The triggered function when text content is about to delete.
875   * @returns { RichEditorAttribute }
876   * @syscap SystemCapability.ArkUI.ArkUI.Full
877   * @since 10
878   */
879  aboutToDelete(callback: (value: RichEditorDeleteValue) => boolean): RichEditorAttribute;
880
881  /**
882   * Notify that the deletion has been completed
883   *
884   * @param { function } callback - The triggered function when text content has been deleted.
885   * @returns { RichEditorAttribute }
886   * @syscap SystemCapability.ArkUI.ArkUI.Full
887   * @since 10
888   */
889  onDeleteComplete(callback: () => void): RichEditorAttribute;
890
891  /**
892   * Allow replication.
893   *
894   * @param { CopyOptions } value - Indicates the type of copy option.
895   * @returns { RichEditorAttribute }
896   * @syscap SystemCapability.ArkUI.ArkUI.Full
897   * @crossplatform
898   * @since 10
899   * @form
900   */
901  copyOptions(value: CopyOptions): RichEditorAttribute;
902
903  /**
904   * Bind to the selection menu.
905   *
906   * @param { RichEditorSpanType } spanType - Indicates the type of selection menu.
907   * @param { CustomBuilder } content - Indicates the content of selection menu.
908   * @param { ResponseType } responseType - Indicates response type of selection menu.
909   * @param { SelectionMenuOptions } options - Indicates the options of selection menu.
910   * @returns { RichEditorAttribute }
911   * @syscap SystemCapability.ArkUI.ArkUI.Full
912   * @crossplatform
913   * @since 10
914   */
915  bindSelectionMenu(spanType: RichEditorSpanType, content: CustomBuilder, responseType: ResponseType, options?: SelectionMenuOptions): RichEditorAttribute;
916
917  /**
918   * Define custom keyboard.
919   *
920   * @param { CustomBuilder } value
921   * @returns { RichEditorAttribute } returns the instance of the RichEditorAttribute.
922   * @syscap SystemCapability.ArkUI.ArkUI.Full
923   * @since 10
924   */
925  customKeyboard(value: CustomBuilder): RichEditorAttribute;
926}
927
928/**
929 * Provides an interface for writing texts.
930 *
931 * @interface RichEditorInterface
932 * @syscap SystemCapability.ArkUI.ArkUI.Full
933 * @since 10
934 */
935interface RichEditorInterface {
936  /**
937   * Called when create RichEditor.
938   *
939   * @param { RichEditorOptions } value
940   * @returns { RichEditorAttribute }
941   * @syscap SystemCapability.ArkUI.ArkUI.Full
942   * @since 10
943   */
944  (value: RichEditorOptions): RichEditorAttribute;
945}
946
947/**
948 * Defines RichEditor Component instance.
949 *
950 * @syscap SystemCapability.ArkUI.ArkUI.Full
951 * @since 10
952 */
953declare const RichEditorInstance: RichEditorAttribute;
954
955/**
956 * Defines RichEditor Component.
957 *
958 * @syscap SystemCapability.ArkUI.ArkUI.Full
959 * @since 10
960 */
961declare const RichEditor: RichEditorInterface;
962