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 * @file 18 * @kit ArkUI 19 */ 20 21/** 22 * Define the background style of span. 23 * 24 * @interface TextBackgroundStyle 25 * @syscap SystemCapability.ArkUI.ArkUI.Full 26 * @crossplatform 27 * @since 11 28 */ 29/** 30 * Define the background style of span. 31 * 32 * @interface TextBackgroundStyle 33 * @syscap SystemCapability.ArkUI.ArkUI.Full 34 * @crossplatform 35 * @atomicservice 36 * @since 12 37 */ 38declare interface TextBackgroundStyle { 39 /** 40 * Background color of span. 41 * 42 * @type { ?ResourceColor } 43 * @syscap SystemCapability.ArkUI.ArkUI.Full 44 * @crossplatform 45 * @since 11 46 */ 47 /** 48 * Background color of span. 49 * 50 * @type { ?ResourceColor } 51 * @syscap SystemCapability.ArkUI.ArkUI.Full 52 * @crossplatform 53 * @atomicservice 54 * @since 12 55 */ 56 color?: ResourceColor; 57 58 /** 59 * Background radius of span. 60 * 61 * @type { ?(Dimension | BorderRadiuses) } 62 * @syscap SystemCapability.ArkUI.ArkUI.Full 63 * @crossplatform 64 * @since 11 65 */ 66 /** 67 * Background radius of span. 68 * 69 * @type { ?(Dimension | BorderRadiuses) } 70 * @syscap SystemCapability.ArkUI.ArkUI.Full 71 * @crossplatform 72 * @atomicservice 73 * @since 12 74 */ 75 radius?: Dimension | BorderRadiuses; 76} 77 78/** 79 * Define the BaseSpan class, contains the common methods of span. 80 * 81 * @extends CommonMethod<T> 82 * @syscap SystemCapability.ArkUI.ArkUI.Full 83 * @crossplatform 84 * @since 11 85 */ 86/** 87 * Define the BaseSpan class, contains the common methods of span. 88 * 89 * @extends CommonMethod<T> 90 * @syscap SystemCapability.ArkUI.ArkUI.Full 91 * @crossplatform 92 * @atomicservice 93 * @since 12 94 */ 95declare class BaseSpan<T> extends CommonMethod<T> { 96 /** 97 * Span background style. 98 * 99 * @param { TextBackgroundStyle } style - The background style of span. 100 * @returns { T } 101 * @syscap SystemCapability.ArkUI.ArkUI.Full 102 * @crossplatform 103 * @since 11 104 */ 105 /** 106 * Span background style. 107 * 108 * @param { TextBackgroundStyle } style - The background style of span. 109 * @returns { T } 110 * @syscap SystemCapability.ArkUI.ArkUI.Full 111 * @crossplatform 112 * @atomicservice 113 * @since 12 114 */ 115 textBackgroundStyle(style: TextBackgroundStyle): T; 116 117 /** 118 * Base line offset of the Span. 119 * 120 * @param { LengthMetrics } value - The base line offset of the Span. 121 * @returns { T } The attribute of the Span. 122 * @syscap SystemCapability.ArkUI.ArkUI.Full 123 * @crossplatform 124 * @atomicservice 125 * @since 12 126 */ 127 baselineOffset(value: LengthMetrics): T; 128} 129 130/** 131 * Provide text decoration. 132 * 133 * @interface SpanInterface 134 * @syscap SystemCapability.ArkUI.ArkUI.Full 135 * @since 7 136 */ 137/** 138 * Provide text decoration. 139 * 140 * @interface SpanInterface 141 * @syscap SystemCapability.ArkUI.ArkUI.Full 142 * @form 143 * @since 9 144 */ 145/** 146 * Provide text decoration. 147 * 148 * @interface SpanInterface 149 * @syscap SystemCapability.ArkUI.ArkUI.Full 150 * @crossplatform 151 * @form 152 * @since 10 153 */ 154/** 155 * Provide text decoration. 156 * 157 * @interface SpanInterface 158 * @syscap SystemCapability.ArkUI.ArkUI.Full 159 * @crossplatform 160 * @form 161 * @atomicservice 162 * @since 11 163 */ 164interface SpanInterface { 165 /** 166 * Called when text is entered in span. 167 * 168 * @param { string | Resource } value 169 * @returns { SpanAttribute } 170 * @syscap SystemCapability.ArkUI.ArkUI.Full 171 * @since 7 172 */ 173 /** 174 * Called when text is entered in span. 175 * 176 * @param { string | Resource } value 177 * @returns { SpanAttribute } 178 * @syscap SystemCapability.ArkUI.ArkUI.Full 179 * @form 180 * @since 9 181 */ 182 /** 183 * Called when text is entered in span. 184 * 185 * @param { string | Resource } value 186 * @returns { SpanAttribute } 187 * @syscap SystemCapability.ArkUI.ArkUI.Full 188 * @crossplatform 189 * @form 190 * @since 10 191 */ 192 /** 193 * Called when text is entered in span. 194 * 195 * @param { string | Resource } value 196 * @returns { SpanAttribute } 197 * @syscap SystemCapability.ArkUI.ArkUI.Full 198 * @crossplatform 199 * @form 200 * @atomicservice 201 * @since 11 202 */ 203 (value: string | Resource): SpanAttribute; 204} 205 206/** 207 * @extends CommonMethod<SpanAttribute> 208 * @syscap SystemCapability.ArkUI.ArkUI.Full 209 * @since 7 210 */ 211/** 212 * @extends CommonMethod<SpanAttribute> 213 * @syscap SystemCapability.ArkUI.ArkUI.Full 214 * @form 215 * @since 9 216 */ 217/** 218 * @extends CommonMethod<SpanAttribute> 219 * @syscap SystemCapability.ArkUI.ArkUI.Full 220 * @crossplatform 221 * @form 222 * @since 10 223 */ 224/** 225 * @extends BaseSpan<SpanAttribute> 226 * @syscap SystemCapability.ArkUI.ArkUI.Full 227 * @crossplatform 228 * @form 229 * @atomicservice 230 * @since 11 231 */ 232declare class SpanAttribute extends BaseSpan<SpanAttribute> { 233 /** 234 * Called when the font is set. 235 * 236 * @param { Font } value - the span font size and weight and family and style. 237 * @returns { SpanAttribute } The attribute of the span. 238 * @syscap SystemCapability.ArkUI.ArkUI.Full 239 * @since 10 240 */ 241 /** 242 * Called when the font is set. 243 * 244 * @param { Font } value - the span font size and weight and family and style. 245 * @returns { SpanAttribute } The attribute of the span. 246 * @syscap SystemCapability.ArkUI.ArkUI.Full 247 * @crossplatform 248 * @atomicservice 249 * @since 11 250 */ 251 font(value: Font): SpanAttribute; 252 253 /** 254 * Called when the font color is set. 255 * 256 * @param { ResourceColor } value 257 * @returns { SpanAttribute } 258 * @syscap SystemCapability.ArkUI.ArkUI.Full 259 * @since 7 260 */ 261 /** 262 * Called when the font color is set. 263 * 264 * @param { ResourceColor } value 265 * @returns { SpanAttribute } 266 * @syscap SystemCapability.ArkUI.ArkUI.Full 267 * @form 268 * @since 9 269 */ 270 /** 271 * Called when the font color is set. 272 * 273 * @param { ResourceColor } value 274 * @returns { SpanAttribute } 275 * @syscap SystemCapability.ArkUI.ArkUI.Full 276 * @crossplatform 277 * @form 278 * @since 10 279 */ 280 /** 281 * Called when the font color is set. 282 * 283 * @param { ResourceColor } value 284 * @returns { SpanAttribute } 285 * @syscap SystemCapability.ArkUI.ArkUI.Full 286 * @crossplatform 287 * @form 288 * @atomicservice 289 * @since 11 290 */ 291 fontColor(value: ResourceColor): SpanAttribute; 292 293 /** 294 * Called when the font size is set. 295 * 296 * @param { number | string | Resource } value 297 * @returns { SpanAttribute } 298 * @syscap SystemCapability.ArkUI.ArkUI.Full 299 * @since 7 300 */ 301 /** 302 * Called when the font size is set. 303 * 304 * @param { number | string | Resource } value 305 * @returns { SpanAttribute } 306 * @syscap SystemCapability.ArkUI.ArkUI.Full 307 * @form 308 * @since 9 309 */ 310 /** 311 * Called when the font size is set. 312 * 313 * @param { number | string | Resource } value 314 * @returns { SpanAttribute } 315 * @syscap SystemCapability.ArkUI.ArkUI.Full 316 * @crossplatform 317 * @form 318 * @since 10 319 */ 320 /** 321 * Called when the font size is set. 322 * 323 * @param { number | string | Resource } value 324 * @returns { SpanAttribute } 325 * @syscap SystemCapability.ArkUI.ArkUI.Full 326 * @crossplatform 327 * @form 328 * @atomicservice 329 * @since 11 330 */ 331 fontSize(value: number | string | Resource): SpanAttribute; 332 333 /** 334 * Called when the font style of a font is set. 335 * 336 * @param { FontStyle } value 337 * @returns { SpanAttribute } 338 * @syscap SystemCapability.ArkUI.ArkUI.Full 339 * @since 7 340 */ 341 /** 342 * Called when the font style of a font is set. 343 * 344 * @param { FontStyle } value 345 * @returns { SpanAttribute } 346 * @syscap SystemCapability.ArkUI.ArkUI.Full 347 * @form 348 * @since 9 349 */ 350 /** 351 * Called when the font style of a font is set. 352 * 353 * @param { FontStyle } value 354 * @returns { SpanAttribute } 355 * @syscap SystemCapability.ArkUI.ArkUI.Full 356 * @crossplatform 357 * @form 358 * @since 10 359 */ 360 /** 361 * Called when the font style of a font is set. 362 * 363 * @param { FontStyle } value 364 * @returns { SpanAttribute } 365 * @syscap SystemCapability.ArkUI.ArkUI.Full 366 * @crossplatform 367 * @form 368 * @atomicservice 369 * @since 11 370 */ 371 fontStyle(value: FontStyle): SpanAttribute; 372 373 /** 374 * Called when the font weight is set. 375 * 376 * @param { number | FontWeight | string } value 377 * @returns { SpanAttribute } 378 * @syscap SystemCapability.ArkUI.ArkUI.Full 379 * @since 7 380 */ 381 /** 382 * Called when the font weight is set. 383 * 384 * @param { number | FontWeight | string } value 385 * @returns { SpanAttribute } 386 * @syscap SystemCapability.ArkUI.ArkUI.Full 387 * @form 388 * @since 9 389 */ 390 /** 391 * Called when the font weight is set. 392 * 393 * @param { number | FontWeight | string } value 394 * @returns { SpanAttribute } 395 * @syscap SystemCapability.ArkUI.ArkUI.Full 396 * @crossplatform 397 * @form 398 * @since 10 399 */ 400 /** 401 * Called when the font weight is set. 402 * 403 * @param { number | FontWeight | string } value 404 * @returns { SpanAttribute } 405 * @syscap SystemCapability.ArkUI.ArkUI.Full 406 * @crossplatform 407 * @form 408 * @atomicservice 409 * @since 11 410 */ 411 fontWeight(value: number | FontWeight | string): SpanAttribute; 412 413 /** 414 * Called when the font list of text is set. 415 * 416 * @param { string | Resource } value 417 * @returns { SpanAttribute } 418 * @syscap SystemCapability.ArkUI.ArkUI.Full 419 * @since 7 420 */ 421 /** 422 * Called when the font list of text is set. 423 * 424 * @param { string | Resource } value 425 * @returns { SpanAttribute } 426 * @syscap SystemCapability.ArkUI.ArkUI.Full 427 * @form 428 * @since 9 429 */ 430 /** 431 * Called when the font list of text is set. 432 * 433 * @param { string | Resource } value 434 * @returns { SpanAttribute } 435 * @syscap SystemCapability.ArkUI.ArkUI.Full 436 * @crossplatform 437 * @form 438 * @since 10 439 */ 440 /** 441 * Called when the font list of text is set. 442 * 443 * @param { string | Resource } value 444 * @returns { SpanAttribute } 445 * @syscap SystemCapability.ArkUI.ArkUI.Full 446 * @crossplatform 447 * @form 448 * @atomicservice 449 * @since 11 450 */ 451 fontFamily(value: string | Resource): SpanAttribute; 452 453 /** 454 * Called when the text decoration of the text is set. 455 * 456 * @param { object } value 457 * @returns { SpanAttribute } 458 * @syscap SystemCapability.ArkUI.ArkUI.Full 459 * @since 7 460 */ 461 /** 462 * Called when the text decoration of the text is set. 463 * 464 * @param { object } value 465 * @returns { SpanAttribute } 466 * @syscap SystemCapability.ArkUI.ArkUI.Full 467 * @form 468 * @since 9 469 */ 470 /** 471 * Called when the text decoration of the text is set. 472 * 473 * @param { object } value 474 * @returns { SpanAttribute } 475 * @syscap SystemCapability.ArkUI.ArkUI.Full 476 * @crossplatform 477 * @form 478 * @since 10 479 */ 480 /** 481 * Called when the text decoration of the text is set. 482 * 483 * @param { object } value 484 * @returns { SpanAttribute } 485 * @syscap SystemCapability.ArkUI.ArkUI.Full 486 * @crossplatform 487 * @form 488 * @atomicservice 489 * @since 11 490 */ 491 /** 492 * Called when the text decoration of the text is set. 493 * 494 * @param { DecorationStyleInterface } value 495 * @returns { SpanAttribute } 496 * @syscap SystemCapability.ArkUI.ArkUI.Full 497 * @crossplatform 498 * @form 499 * @atomicservice 500 * @since 12 501 */ 502 decoration(value: DecorationStyleInterface): SpanAttribute; 503 504 /** 505 * Called when the distance between text fonts is set. 506 * 507 * @param { number | string } value 508 * @returns { SpanAttribute } 509 * @syscap SystemCapability.ArkUI.ArkUI.Full 510 * @since 7 511 */ 512 /** 513 * Called when the distance between text fonts is set. 514 * 515 * @param { number | string } value 516 * @returns { SpanAttribute } 517 * @syscap SystemCapability.ArkUI.ArkUI.Full 518 * @form 519 * @since 9 520 */ 521 /** 522 * Called when the distance between text fonts is set. 523 * 524 * @param { number | string } value 525 * @returns { SpanAttribute } 526 * @syscap SystemCapability.ArkUI.ArkUI.Full 527 * @crossplatform 528 * @form 529 * @since 10 530 */ 531 /** 532 * Called when the distance between text fonts is set. 533 * 534 * @param { number | string } value 535 * @returns { SpanAttribute } 536 * @syscap SystemCapability.ArkUI.ArkUI.Full 537 * @crossplatform 538 * @form 539 * @atomicservice 540 * @since 11 541 */ 542 letterSpacing(value: number | string): SpanAttribute; 543 544 /** 545 * Called when the type of letter in the text font is set. 546 * 547 * @param { TextCase } value 548 * @returns { SpanAttribute } 549 * @syscap SystemCapability.ArkUI.ArkUI.Full 550 * @since 7 551 */ 552 /** 553 * Called when the type of letter in the text font is set. 554 * 555 * @param { TextCase } value 556 * @returns { SpanAttribute } 557 * @syscap SystemCapability.ArkUI.ArkUI.Full 558 * @form 559 * @since 9 560 */ 561 /** 562 * Called when the type of letter in the text font is set. 563 * 564 * @param { TextCase } value 565 * @returns { SpanAttribute } 566 * @syscap SystemCapability.ArkUI.ArkUI.Full 567 * @crossplatform 568 * @form 569 * @since 10 570 */ 571 /** 572 * Called when the type of letter in the text font is set. 573 * 574 * @param { TextCase } value 575 * @returns { SpanAttribute } 576 * @syscap SystemCapability.ArkUI.ArkUI.Full 577 * @crossplatform 578 * @form 579 * @atomicservice 580 * @since 11 581 */ 582 textCase(value: TextCase): SpanAttribute; 583 584 /** 585 * Called when the line height of the span is set. 586 * 587 * @param { Length } value - The line height of the span. 588 * @returns { SpanAttribute } The attribute of the span. 589 * @syscap SystemCapability.ArkUI.ArkUI.Full 590 * @since 10 591 */ 592 /** 593 * Called when the line height of the span is set. 594 * 595 * @param { Length } value - The line height of the span. 596 * @returns { SpanAttribute } The attribute of the span. 597 * @syscap SystemCapability.ArkUI.ArkUI.Full 598 * @crossplatform 599 * @atomicservice 600 * @since 11 601 */ 602 lineHeight(value: Length): SpanAttribute; 603 604 /** 605 * Called when the text shadow is set. 606 * 607 * @param { ShadowOptions | Array<ShadowOptions> } value - The shadow options. 608 * @returns { SpanAttribute } 609 * @syscap SystemCapability.ArkUI.ArkUI.Full 610 * @crossplatform 611 * @since 11 612 */ 613 /** 614 * Called when the text shadow is set. 615 * 616 * @param { ShadowOptions | Array<ShadowOptions> } value - The shadow options. 617 * @returns { SpanAttribute } 618 * @syscap SystemCapability.ArkUI.ArkUI.Full 619 * @crossplatform 620 * @atomicservice 621 * @since 12 622 */ 623 textShadow(value: ShadowOptions | Array<ShadowOptions>): SpanAttribute; 624} 625 626/** 627 * Defines Span Component. 628 * 629 * @syscap SystemCapability.ArkUI.ArkUI.Full 630 * @since 7 631 */ 632/** 633 * Defines Span Component. 634 * 635 * @syscap SystemCapability.ArkUI.ArkUI.Full 636 * @form 637 * @since 9 638 */ 639/** 640 * Defines Span Component. 641 * 642 * @syscap SystemCapability.ArkUI.ArkUI.Full 643 * @crossplatform 644 * @form 645 * @since 10 646 */ 647/** 648 * Defines Span Component. 649 * 650 * @syscap SystemCapability.ArkUI.ArkUI.Full 651 * @crossplatform 652 * @form 653 * @atomicservice 654 * @since 11 655 */ 656declare const Span: SpanInterface; 657 658/** 659 * Defines Span Component instance. 660 * 661 * @syscap SystemCapability.ArkUI.ArkUI.Full 662 * @since 7 663 */ 664/** 665 * Defines Span Component instance. 666 * 667 * @syscap SystemCapability.ArkUI.ArkUI.Full 668 * @form 669 * @since 9 670 */ 671/** 672 * Defines Span Component instance. 673 * 674 * @syscap SystemCapability.ArkUI.ArkUI.Full 675 * @crossplatform 676 * @form 677 * @since 10 678 */ 679/** 680 * Defines Span Component instance. 681 * 682 * @syscap SystemCapability.ArkUI.ArkUI.Full 683 * @crossplatform 684 * @form 685 * @atomicservice 686 * @since 11 687 */ 688declare const SpanInstance: SpanAttribute; 689