• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-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 * Provides an interface for writing texts.
18 * @since 7
19 */
20/**
21 * Provides an interface for writing texts.
22 * @form
23 * @since 9
24 */
25interface TextInterface {
26  /**
27   * Called when writing text.
28   * @since 7
29   */
30  /**
31   * Called when writing text.
32   * @form
33   * @since 9
34   */
35  (content?: string | Resource): TextAttribute;
36}
37
38/**
39 * @since 7
40 */
41/**
42 * @form
43 * @since 9
44 */
45declare class TextAttribute extends CommonMethod<TextAttribute> {
46  /**
47   * Called when the font color is set.
48   * @since 7
49   */
50  /**
51   * Called when the font color is set.
52   * @form
53   * @since 9
54   */
55  fontColor(value: ResourceColor): TextAttribute;
56
57  /**
58   * Called when the font size is set.
59   * @since 7
60   */
61  /**
62   * Called when the font size is set.
63   * @form
64   * @since 9
65   */
66  fontSize(value: number | string | Resource): TextAttribute;
67
68  /**
69   * Called when the minimum font size of the font is set.
70   * @since 7
71   */
72  /**
73   * Called when the minimum font size of the font is set.
74   * @form
75   * @since 9
76   */
77  minFontSize(value: number | string | Resource): TextAttribute;
78
79  /**
80   * Called when the maximum font size of the font is set.
81   * @since 7
82   */
83  /**
84   * Called when the maximum font size of the font is set.
85   * @form
86   * @since 9
87   */
88  maxFontSize(value: number | string | Resource): TextAttribute;
89
90  /**
91   * Called when the font style of a font is set.
92   * @since 7
93   */
94  /**
95   * Called when the font style of a font is set.
96   * @form
97   * @since 9
98   */
99  fontStyle(value: FontStyle): TextAttribute;
100
101  /**
102   * Called when the font weight is set.
103   * @since 7
104   */
105  /**
106   * Called when the font weight is set.
107   * @form
108   * @since 9
109   */
110  fontWeight(value: number | FontWeight | string): TextAttribute;
111
112  /**
113   * Called when the horizontal center mode of the font is set.
114   * @since 7
115   */
116  /**
117   * Called when the horizontal center mode of the font is set.
118   * @form
119   * @since 9
120   */
121  textAlign(value: TextAlign): TextAttribute;
122
123  /**
124   * Called when the vertical center mode of the font is set.
125   * @since 7
126   */
127  /**
128   * Called when the vertical center mode of the font is set.
129   * @form
130   * @since 9
131   */
132  lineHeight(value: number | string | Resource): TextAttribute;
133
134  /**
135   * Called when the overflow mode of the font is set.
136   * @since 7
137   */
138  /**
139   * Called when the overflow mode of the font is set.
140   * @form
141   * @since 9
142   */
143  textOverflow(value: { overflow: TextOverflow }): TextAttribute;
144
145  /**
146   * Called when the font list of text is set.
147   * @since 7
148   */
149  /**
150   * Called when the font list of text is set.
151   * @form
152   * @since 9
153   */
154  fontFamily(value: string | Resource): TextAttribute;
155
156  /**
157   * Called when the maximum number of lines of text is set.
158   * @since 7
159   */
160  /**
161   * Called when the maximum number of lines of text is set.
162   * @form
163   * @since 9
164   */
165  maxLines(value: number): TextAttribute;
166
167  /**
168   * Called when the text decoration of the text is set.
169   * @since 7
170   */
171  /**
172   * Called when the text decoration of the text is set.
173   * @form
174   * @since 9
175   */
176  decoration(value: { type: TextDecorationType; color?: ResourceColor }): TextAttribute;
177
178  /**
179   * Called when the distance between text fonts is set.
180   * @since 7
181   */
182  /**
183   * Called when the distance between text fonts is set.
184   * @form
185   * @since 9
186   */
187  letterSpacing(value: number | string): TextAttribute;
188
189  /**
190   * Called when the type of letter in the text font is set.
191   * @since 7
192   */
193  /**
194   * Called when the type of letter in the text font is set.
195   * @form
196   * @since 9
197   */
198  textCase(value: TextCase): TextAttribute;
199
200  /**
201   * Called when the baseline offset is set.
202   * @since 7
203   */
204  /**
205   * Called when the baseline offset is set.
206   * @form
207   * @since 9
208   */
209  baselineOffset(value: number | string): TextAttribute;
210
211  /**
212   * Allow replication.
213   * @form
214   * @since 9
215   */
216  copyOption(value: CopyOptions): TextAttribute;
217}
218
219/**
220 * Defines Text Component instance.
221 * @since 7
222 */
223/**
224 * Defines Text Component instance.
225 * @form
226 * @since 9
227 */
228declare const TextInstance: TextAttribute;
229
230/**
231 * Defines Text Component.
232 * @since 7
233 */
234/**
235 * Defines Text Component.
236 * @form
237 * @since 9
238 */
239declare const Text: TextInterface;
240