• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021 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/*** if arkts 1.2 */
22import { CommonMethod} from './common';
23/*** endif */
24
25/**
26 * Provides an interface for RichText component.
27 *
28 * @interface RichTextInterface
29 * @syscap SystemCapability.ArkUI.ArkUI.Full
30 * @since 8
31 */
32/**
33 * Provides an interface for RichText component.
34 *
35 * @interface RichTextInterface
36 * @syscap SystemCapability.ArkUI.ArkUI.Full
37 * @crossplatform
38 * @atomicservice
39 * @since 11
40 */
41/**
42 * Provides an interface for RichText component.
43 *
44 * @interface RichTextInterface
45 * @syscap SystemCapability.ArkUI.ArkUI.Full
46 * @crossplatform
47 * @since arkts {'1.1':'12','1.2':'20'}
48 * @arkts 1.1&1.2
49 */
50interface RichTextInterface {
51  /**
52   * Set value.
53   *
54   * @param { string } content
55   * @returns { RichTextAttribute }
56   * @syscap SystemCapability.ArkUI.ArkUI.Full
57   * @since 8
58   */
59  /**
60   * Set value.
61   *
62   * @param { string } content
63   * @returns { RichTextAttribute }
64   * @syscap SystemCapability.ArkUI.ArkUI.Full
65   * @crossplatform
66   * @atomicservice
67   * @since 11
68   */
69  /**
70   * Set value.
71   *
72   * @param { string } content
73   * @returns { RichTextAttribute }
74   * @syscap SystemCapability.ArkUI.ArkUI.Full
75   * @crossplatform
76   * @since 12
77   */
78  /**
79   * Set value.
80   *
81   * @param { string | Resource} content
82   * @returns { RichTextAttribute }
83   * @syscap SystemCapability.ArkUI.ArkUI.Full
84   * @crossplatform
85   * @since 20
86   */
87  (content: string | Resource): RichTextAttribute;
88
89  /**
90   * Set value.
91   *
92   * @param { string } content
93   * @returns { RichTextAttribute }
94   * @syscap SystemCapability.ArkUI.ArkUI.Full
95   * @crossplatform
96   * @since 20
97   * @arkts 1.2
98   */
99  (content: string): RichTextAttribute;
100}
101
102/**
103 * Defines the RichText attribute functions.
104 *
105 * @extends CommonMethod<RichTextAttribute>
106 * @syscap SystemCapability.ArkUI.ArkUI.Full
107 * @since 8
108 */
109/**
110 * Defines the RichText attribute functions.
111 *
112 * @extends CommonMethod<RichTextAttribute>
113 * @syscap SystemCapability.ArkUI.ArkUI.Full
114 * @crossplatform
115 * @atomicservice
116 * @since 11
117 */
118/**
119 * Defines the RichText attribute functions.
120 *
121 * @extends CommonMethod<RichTextAttribute>
122 * @syscap SystemCapability.ArkUI.ArkUI.Full
123 * @crossplatform
124 * @since arkts {'1.1':'12','1.2':'20'}
125 * @arkts 1.1&1.2
126 */
127declare class RichTextAttribute extends CommonMethod<RichTextAttribute> {
128  /**
129   * Triggered when the RichText loading starts.
130   *
131   * @param { function } callback
132   * @returns { RichTextAttribute }
133   * @syscap SystemCapability.ArkUI.ArkUI.Full
134   * @since 8
135   */
136  /**
137   * Triggered when the RichText loading starts.
138   *
139   * @param { function } callback
140   * @returns { RichTextAttribute }
141   * @syscap SystemCapability.ArkUI.ArkUI.Full
142   * @crossplatform
143   * @atomicservice
144   * @since 11
145   */
146  /**
147   * Triggered when the RichText loading starts.
148   *
149   * @param { function } callback
150   * @returns { RichTextAttribute }
151   * @syscap SystemCapability.ArkUI.ArkUI.Full
152   * @crossplatform
153   * @since arkts {'1.1':'12','1.2':'20'}
154   * @arkts 1.1&1.2
155   */
156  onStart(callback: () => void): RichTextAttribute;
157
158  /**
159   * Triggered when the RichText loading ends.
160   *
161   * @param { function } callback
162   * @returns { RichTextAttribute }
163   * @syscap SystemCapability.ArkUI.ArkUI.Full
164   * @since 8
165   */
166  /**
167   * Triggered when the RichText loading ends.
168   *
169   * @param { function } callback
170   * @returns { RichTextAttribute }
171   * @syscap SystemCapability.ArkUI.ArkUI.Full
172   * @crossplatform
173   * @atomicservice
174   * @since 11
175   */
176  /**
177   * Triggered when the RichText loading ends.
178   *
179   * @param { function } callback
180   * @returns { RichTextAttribute }
181   * @syscap SystemCapability.ArkUI.ArkUI.Full
182   * @crossplatform
183   * @since arkts {'1.1':'12','1.2':'20'}
184   * @arkts 1.1&1.2
185   */
186  onComplete(callback: () => void): RichTextAttribute;
187}
188
189/**
190 * Defines RichText Component.
191 *
192 * @syscap SystemCapability.ArkUI.ArkUI.Full
193 * @since 8
194 */
195/**
196 * Defines RichText Component.
197 *
198 * @syscap SystemCapability.ArkUI.ArkUI.Full
199 * @crossplatform
200 * @atomicservice
201 * @since 11
202 */
203/**
204 * Defines RichText Component.
205 *
206 * @syscap SystemCapability.ArkUI.ArkUI.Full
207 * @crossplatform
208 * @since 12
209 */
210declare const RichText: RichTextInterface;
211
212/**
213 * Defines RichText Component instance.
214 *
215 * @syscap SystemCapability.ArkUI.ArkUI.Full
216 * @since 8
217 */
218/**
219 * Defines RichText Component instance.
220 *
221 * @syscap SystemCapability.ArkUI.ArkUI.Full
222 * @crossplatform
223 * @atomicservice
224 * @since 11
225 */
226/**
227 * Defines RichText Component instance.
228 *
229 * @syscap SystemCapability.ArkUI.ArkUI.Full
230 * @crossplatform
231 * @since 12
232 */
233declare const RichTextInstance: RichTextAttribute;
234