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 * Provide text decoration. 18 * 19 * @interface SpanInterface 20 * @syscap SystemCapability.ArkUI.ArkUI.Full 21 * @since 7 22 */ 23/** 24 * Provide text decoration. 25 * 26 * @interface SpanInterface 27 * @syscap SystemCapability.ArkUI.ArkUI.Full 28 * @since 9 29 * @form 30 */ 31/** 32 * Provide text decoration. 33 * 34 * @interface SpanInterface 35 * @syscap SystemCapability.ArkUI.ArkUI.Full 36 * @crossplatform 37 * @since 10 38 * @form 39 */ 40interface SpanInterface { 41 /** 42 * Called when text is entered in span. 43 * 44 * @param { string | Resource } value 45 * @returns { SpanAttribute } 46 * @syscap SystemCapability.ArkUI.ArkUI.Full 47 * @since 7 48 */ 49 /** 50 * Called when text is entered in span. 51 * 52 * @param { string | Resource } value 53 * @returns { SpanAttribute } 54 * @syscap SystemCapability.ArkUI.ArkUI.Full 55 * @since 9 56 * @form 57 */ 58 /** 59 * Called when text is entered in span. 60 * 61 * @param { string | Resource } value 62 * @returns { SpanAttribute } 63 * @syscap SystemCapability.ArkUI.ArkUI.Full 64 * @crossplatform 65 * @since 10 66 * @form 67 */ 68 (value: string | Resource): SpanAttribute; 69} 70 71/** 72 * @extends CommonMethod 73 * @syscap SystemCapability.ArkUI.ArkUI.Full 74 * @since 7 75 */ 76/** 77 * @extends CommonMethod 78 * @syscap SystemCapability.ArkUI.ArkUI.Full 79 * @since 9 80 * @form 81 */ 82/** 83 * @extends CommonMethod 84 * @syscap SystemCapability.ArkUI.ArkUI.Full 85 * @crossplatform 86 * @since 10 87 * @form 88 */ 89declare class SpanAttribute extends CommonMethod<SpanAttribute> { 90 /** 91 * Called when the font is set. 92 * 93 * @param { Font } value - the span font size and weight and family and style. 94 * @returns { SpanAttribute } The attribute of the span. 95 * @syscap SystemCapability.ArkUI.ArkUI.Full 96 * @since 10 97 */ 98 font(value: Font): SpanAttribute; 99 100 /** 101 * Called when the font color is set. 102 * 103 * @param { ResourceColor } value 104 * @returns { SpanAttribute } 105 * @syscap SystemCapability.ArkUI.ArkUI.Full 106 * @since 7 107 */ 108 /** 109 * Called when the font color is set. 110 * 111 * @param { ResourceColor } value 112 * @returns { SpanAttribute } 113 * @syscap SystemCapability.ArkUI.ArkUI.Full 114 * @since 9 115 * @form 116 */ 117 /** 118 * Called when the font color is set. 119 * 120 * @param { ResourceColor } value 121 * @returns { SpanAttribute } 122 * @syscap SystemCapability.ArkUI.ArkUI.Full 123 * @crossplatform 124 * @since 10 125 * @form 126 */ 127 fontColor(value: ResourceColor): SpanAttribute; 128 129 /** 130 * Called when the font size is set. 131 * 132 * @param { number | string | Resource } value 133 * @returns { SpanAttribute } 134 * @syscap SystemCapability.ArkUI.ArkUI.Full 135 * @since 7 136 */ 137 /** 138 * Called when the font size is set. 139 * 140 * @param { number | string | Resource } value 141 * @returns { SpanAttribute } 142 * @syscap SystemCapability.ArkUI.ArkUI.Full 143 * @since 9 144 * @form 145 */ 146 /** 147 * Called when the font size is set. 148 * 149 * @param { number | string | Resource } value 150 * @returns { SpanAttribute } 151 * @syscap SystemCapability.ArkUI.ArkUI.Full 152 * @crossplatform 153 * @since 10 154 * @form 155 */ 156 fontSize(value: number | string | Resource): SpanAttribute; 157 158 /** 159 * Called when the font style of a font is set. 160 * 161 * @param { FontStyle } value 162 * @returns { SpanAttribute } 163 * @syscap SystemCapability.ArkUI.ArkUI.Full 164 * @since 7 165 */ 166 /** 167 * Called when the font style of a font is set. 168 * 169 * @param { FontStyle } value 170 * @returns { SpanAttribute } 171 * @syscap SystemCapability.ArkUI.ArkUI.Full 172 * @since 9 173 * @form 174 */ 175 /** 176 * Called when the font style of a font is set. 177 * 178 * @param { FontStyle } value 179 * @returns { SpanAttribute } 180 * @syscap SystemCapability.ArkUI.ArkUI.Full 181 * @crossplatform 182 * @since 10 183 * @form 184 */ 185 fontStyle(value: FontStyle): SpanAttribute; 186 187 /** 188 * Called when the font weight is set. 189 * 190 * @param { number | FontWeight | string } value 191 * @returns { SpanAttribute } 192 * @syscap SystemCapability.ArkUI.ArkUI.Full 193 * @since 7 194 */ 195 /** 196 * Called when the font weight is set. 197 * 198 * @param { number | FontWeight | string } value 199 * @returns { SpanAttribute } 200 * @syscap SystemCapability.ArkUI.ArkUI.Full 201 * @since 9 202 * @form 203 */ 204 /** 205 * Called when the font weight is set. 206 * 207 * @param { number | FontWeight | string } value 208 * @returns { SpanAttribute } 209 * @syscap SystemCapability.ArkUI.ArkUI.Full 210 * @crossplatform 211 * @since 10 212 * @form 213 */ 214 fontWeight(value: number | FontWeight | string): SpanAttribute; 215 216 /** 217 * Called when the font list of text is set. 218 * 219 * @param { string | Resource } value 220 * @returns { SpanAttribute } 221 * @syscap SystemCapability.ArkUI.ArkUI.Full 222 * @since 7 223 */ 224 /** 225 * Called when the font list of text is set. 226 * 227 * @param { string | Resource } value 228 * @returns { SpanAttribute } 229 * @syscap SystemCapability.ArkUI.ArkUI.Full 230 * @since 9 231 * @form 232 */ 233 /** 234 * Called when the font list of text is set. 235 * 236 * @param { string | Resource } value 237 * @returns { SpanAttribute } 238 * @syscap SystemCapability.ArkUI.ArkUI.Full 239 * @crossplatform 240 * @since 10 241 * @form 242 */ 243 fontFamily(value: string | Resource): SpanAttribute; 244 245 /** 246 * Called when the text decoration of the text is set. 247 * 248 * @param { object } value 249 * @returns { SpanAttribute } 250 * @syscap SystemCapability.ArkUI.ArkUI.Full 251 * @since 7 252 */ 253 /** 254 * Called when the text decoration of the text is set. 255 * 256 * @param { object } value 257 * @returns { SpanAttribute } 258 * @syscap SystemCapability.ArkUI.ArkUI.Full 259 * @since 9 260 * @form 261 */ 262 /** 263 * Called when the text decoration of the text is set. 264 * 265 * @param { object } value 266 * @returns { SpanAttribute } 267 * @syscap SystemCapability.ArkUI.ArkUI.Full 268 * @crossplatform 269 * @since 10 270 * @form 271 */ 272 decoration(value: { type: TextDecorationType; color?: ResourceColor }): SpanAttribute; 273 274 /** 275 * Called when the distance between text fonts is set. 276 * 277 * @param { number | string } value 278 * @returns { SpanAttribute } 279 * @syscap SystemCapability.ArkUI.ArkUI.Full 280 * @since 7 281 */ 282 /** 283 * Called when the distance between text fonts is set. 284 * 285 * @param { number | string } value 286 * @returns { SpanAttribute } 287 * @syscap SystemCapability.ArkUI.ArkUI.Full 288 * @since 9 289 * @form 290 */ 291 /** 292 * Called when the distance between text fonts is set. 293 * 294 * @param { number | string } value 295 * @returns { SpanAttribute } 296 * @syscap SystemCapability.ArkUI.ArkUI.Full 297 * @crossplatform 298 * @since 10 299 * @form 300 */ 301 letterSpacing(value: number | string): SpanAttribute; 302 303 /** 304 * Called when the type of letter in the text font is set. 305 * 306 * @param { TextCase } value 307 * @returns { SpanAttribute } 308 * @syscap SystemCapability.ArkUI.ArkUI.Full 309 * @since 7 310 */ 311 /** 312 * Called when the type of letter in the text font is set. 313 * 314 * @param { TextCase } value 315 * @returns { SpanAttribute } 316 * @syscap SystemCapability.ArkUI.ArkUI.Full 317 * @since 9 318 * @form 319 */ 320 /** 321 * Called when the type of letter in the text font is set. 322 * 323 * @param { TextCase } value 324 * @returns { SpanAttribute } 325 * @syscap SystemCapability.ArkUI.ArkUI.Full 326 * @crossplatform 327 * @since 10 328 * @form 329 */ 330 textCase(value: TextCase): SpanAttribute; 331 332 /** 333 * Called when the line height of the span is set. 334 * 335 * @param { Length } value - The line height of the span. 336 * @returns { SpanAttribute } The attribute of the span. 337 * @syscap SystemCapability.ArkUI.ArkUI.Full 338 * @since 10 339 */ 340 lineHeight(value: Length): SpanAttribute; 341} 342 343/** 344 * Defines Span Component. 345 * 346 * @syscap SystemCapability.ArkUI.ArkUI.Full 347 * @since 7 348 */ 349/** 350 * Defines Span Component. 351 * 352 * @syscap SystemCapability.ArkUI.ArkUI.Full 353 * @since 9 354 * @form 355 */ 356/** 357 * Defines Span Component. 358 * 359 * @syscap SystemCapability.ArkUI.ArkUI.Full 360 * @crossplatform 361 * @since 10 362 * @form 363 */ 364declare const Span: SpanInterface; 365 366/** 367 * Defines Span Component instance. 368 * 369 * @syscap SystemCapability.ArkUI.ArkUI.Full 370 * @since 7 371 */ 372/** 373 * Defines Span Component instance. 374 * 375 * @syscap SystemCapability.ArkUI.ArkUI.Full 376 * @since 9 377 * @form 378 */ 379/** 380 * Defines Span Component instance. 381 * 382 * @syscap SystemCapability.ArkUI.ArkUI.Full 383 * @crossplatform 384 * @since 10 385 * @form 386 */ 387declare const SpanInstance: SpanAttribute; 388