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 * Provides interfaces for drawing components. 23 * 24 * @interface ShapeInterface 25 * @syscap SystemCapability.ArkUI.ArkUI.Full 26 * @since 7 27 */ 28/** 29 * Provides interfaces for drawing components. 30 * 31 * @interface ShapeInterface 32 * @syscap SystemCapability.ArkUI.ArkUI.Full 33 * @form 34 * @since 9 35 */ 36/** 37 * Provides interfaces for drawing components. 38 * 39 * @interface ShapeInterface 40 * @syscap SystemCapability.ArkUI.ArkUI.Full 41 * @crossplatform 42 * @form 43 * @since 10 44 */ 45/** 46 * Provides interfaces for drawing components. 47 * 48 * @interface ShapeInterface 49 * @syscap SystemCapability.ArkUI.ArkUI.Full 50 * @crossplatform 51 * @form 52 * @atomicservice 53 * @since 11 54 */ 55interface ShapeInterface { 56 /** 57 * Use the new function to create Shape. 58 * 59 * @syscap SystemCapability.ArkUI.ArkUI.Full 60 * @since 7 61 */ 62 /** 63 * Use the new function to create Shape. 64 * 65 * @syscap SystemCapability.ArkUI.ArkUI.Full 66 * @crossplatform 67 * @since 10 68 */ 69 /** 70 * Use the new function to create Shape. 71 * 72 * @syscap SystemCapability.ArkUI.ArkUI.Full 73 * @crossplatform 74 * @atomicservice 75 * @since 11 76 */ 77 new (value?: PixelMap): ShapeAttribute; 78 79 /** 80 * Called when a component is drawn. 81 * 82 * @param { PixelMap } value 83 * @returns { ShapeAttribute } 84 * @syscap SystemCapability.ArkUI.ArkUI.Full 85 * @since 7 86 */ 87 /** 88 * Called when a component is drawn. 89 * 90 * @param { PixelMap } value 91 * @returns { ShapeAttribute } 92 * @syscap SystemCapability.ArkUI.ArkUI.Full 93 * @crossplatform 94 * @since 10 95 */ 96 /** 97 * Called when a component is drawn. 98 * 99 * @param { PixelMap } value 100 * @returns { ShapeAttribute } 101 * @syscap SystemCapability.ArkUI.ArkUI.Full 102 * @crossplatform 103 * @atomicservice 104 * @since 11 105 */ 106 (value: PixelMap): ShapeAttribute; 107 108 /** 109 * Called when a component is drawn. 110 * 111 * @returns { ShapeAttribute } 112 * @syscap SystemCapability.ArkUI.ArkUI.Full 113 * @since 7 114 */ 115 /** 116 * Called when a component is drawn. 117 * 118 * @returns { ShapeAttribute } 119 * @syscap SystemCapability.ArkUI.ArkUI.Full 120 * @form 121 * @since 9 122 */ 123 /** 124 * Called when a component is drawn. 125 * 126 * @returns { ShapeAttribute } 127 * @syscap SystemCapability.ArkUI.ArkUI.Full 128 * @crossplatform 129 * @form 130 * @since 10 131 */ 132 /** 133 * Called when a component is drawn. 134 * 135 * @returns { ShapeAttribute } 136 * @syscap SystemCapability.ArkUI.ArkUI.Full 137 * @crossplatform 138 * @form 139 * @atomicservice 140 * @since 11 141 */ 142 (): ShapeAttribute; 143} 144 145/** 146 * @extends CommonMethod<ShapeAttribute> 147 * @syscap SystemCapability.ArkUI.ArkUI.Full 148 * @since 7 149 */ 150/** 151 * @extends CommonMethod<ShapeAttribute> 152 * @syscap SystemCapability.ArkUI.ArkUI.Full 153 * @form 154 * @since 9 155 */ 156/** 157 * @extends CommonMethod<ShapeAttribute> 158 * @syscap SystemCapability.ArkUI.ArkUI.Full 159 * @crossplatform 160 * @form 161 * @since 10 162 */ 163/** 164 * @extends CommonMethod<ShapeAttribute> 165 * @syscap SystemCapability.ArkUI.ArkUI.Full 166 * @crossplatform 167 * @form 168 * @atomicservice 169 * @since 11 170 */ 171declare class ShapeAttribute extends CommonMethod<ShapeAttribute> { 172 /** 173 * Viewport of shape 174 * 175 * @param { object } value 176 * @returns { ShapeAttribute } 177 * @syscap SystemCapability.ArkUI.ArkUI.Full 178 * @since 7 179 */ 180 /** 181 * Viewport of shape 182 * 183 * @param { object } value 184 * @returns { ShapeAttribute } 185 * @syscap SystemCapability.ArkUI.ArkUI.Full 186 * @form 187 * @since 9 188 */ 189 /** 190 * Viewport of shape 191 * 192 * @param { object } value 193 * @returns { ShapeAttribute } 194 * @syscap SystemCapability.ArkUI.ArkUI.Full 195 * @crossplatform 196 * @form 197 * @since 10 198 */ 199 /** 200 * Viewport of shape 201 * 202 * @param { object } value 203 * @returns { ShapeAttribute } 204 * @syscap SystemCapability.ArkUI.ArkUI.Full 205 * @crossplatform 206 * @form 207 * @atomicservice 208 * @since 11 209 */ 210 viewPort(value: { x?: number | string; y?: number | string; width?: number | string; height?: number | string }): ShapeAttribute; 211 212 /** 213 * Called when the border color is set. 214 * 215 * @param { ResourceColor } value 216 * @returns { ShapeAttribute } 217 * @syscap SystemCapability.ArkUI.ArkUI.Full 218 * @since 7 219 */ 220 /** 221 * Called when the border color is set. 222 * 223 * @param { ResourceColor } value 224 * @returns { ShapeAttribute } 225 * @syscap SystemCapability.ArkUI.ArkUI.Full 226 * @form 227 * @since 9 228 */ 229 /** 230 * Called when the border color is set. 231 * 232 * @param { ResourceColor } value 233 * @returns { ShapeAttribute } 234 * @syscap SystemCapability.ArkUI.ArkUI.Full 235 * @crossplatform 236 * @form 237 * @since 10 238 */ 239 /** 240 * Called when the border color is set. 241 * 242 * @param { ResourceColor } value 243 * @returns { ShapeAttribute } 244 * @syscap SystemCapability.ArkUI.ArkUI.Full 245 * @crossplatform 246 * @form 247 * @atomicservice 248 * @since 11 249 */ 250 stroke(value: ResourceColor): ShapeAttribute; 251 252 /** 253 * Called when the fill color is set. 254 * 255 * @param { ResourceColor } value 256 * @returns { ShapeAttribute } 257 * @syscap SystemCapability.ArkUI.ArkUI.Full 258 * @since 7 259 */ 260 /** 261 * Called when the fill color is set. 262 * 263 * @param { ResourceColor } value 264 * @returns { ShapeAttribute } 265 * @syscap SystemCapability.ArkUI.ArkUI.Full 266 * @form 267 * @since 9 268 */ 269 /** 270 * Called when the fill color is set. 271 * 272 * @param { ResourceColor } value 273 * @returns { ShapeAttribute } 274 * @syscap SystemCapability.ArkUI.ArkUI.Full 275 * @crossplatform 276 * @form 277 * @since 10 278 */ 279 /** 280 * Called when the fill color is set. 281 * 282 * @param { ResourceColor } value 283 * @returns { ShapeAttribute } 284 * @syscap SystemCapability.ArkUI.ArkUI.Full 285 * @crossplatform 286 * @form 287 * @atomicservice 288 * @since 11 289 */ 290 fill(value: ResourceColor): ShapeAttribute; 291 292 /** 293 * Called when the offset of the starting point of border drawing is set. 294 * 295 * @param { number | string } value 296 * @returns { ShapeAttribute } 297 * @syscap SystemCapability.ArkUI.ArkUI.Full 298 * @since 7 299 */ 300 /** 301 * Called when the offset of the starting point of border drawing is set. 302 * 303 * @param { number | string } value 304 * @returns { ShapeAttribute } 305 * @syscap SystemCapability.ArkUI.ArkUI.Full 306 * @form 307 * @since 9 308 */ 309 /** 310 * Called when the offset of the starting point of border drawing is set. 311 * 312 * @param { number | string } value 313 * @returns { ShapeAttribute } 314 * @syscap SystemCapability.ArkUI.ArkUI.Full 315 * @crossplatform 316 * @form 317 * @since 10 318 */ 319 /** 320 * Called when the offset of the starting point of border drawing is set. 321 * 322 * @param { number | string } value 323 * @returns { ShapeAttribute } 324 * @syscap SystemCapability.ArkUI.ArkUI.Full 325 * @crossplatform 326 * @form 327 * @atomicservice 328 * @since 11 329 */ 330 strokeDashOffset(value: number | string): ShapeAttribute; 331 332 /** 333 * Called when the gap of the border is set. 334 * 335 * @param { Array<any> } value 336 * @returns { ShapeAttribute } 337 * @syscap SystemCapability.ArkUI.ArkUI.Full 338 * @since 7 339 */ 340 /** 341 * Called when the gap of the border is set. 342 * 343 * @param { Array<any> } value 344 * @returns { ShapeAttribute } 345 * @syscap SystemCapability.ArkUI.ArkUI.Full 346 * @form 347 * @since 9 348 */ 349 /** 350 * Called when the gap of the border is set. 351 * 352 * @param { Array<any> } value 353 * @returns { ShapeAttribute } 354 * @syscap SystemCapability.ArkUI.ArkUI.Full 355 * @crossplatform 356 * @form 357 * @since 10 358 */ 359 /** 360 * Called when the gap of the border is set. 361 * 362 * @param { Array<any> } value 363 * @returns { ShapeAttribute } 364 * @syscap SystemCapability.ArkUI.ArkUI.Full 365 * @crossplatform 366 * @form 367 * @atomicservice 368 * @since 11 369 */ 370 strokeDashArray(value: Array<any>): ShapeAttribute; 371 372 /** 373 * Called when the path endpoint drawing style is set. 374 * 375 * @param { LineCapStyle } value 376 * @returns { ShapeAttribute } 377 * @syscap SystemCapability.ArkUI.ArkUI.Full 378 * @since 7 379 */ 380 /** 381 * Called when the path endpoint drawing style is set. 382 * 383 * @param { LineCapStyle } value 384 * @returns { ShapeAttribute } 385 * @syscap SystemCapability.ArkUI.ArkUI.Full 386 * @form 387 * @since 9 388 */ 389 /** 390 * Called when the path endpoint drawing style is set. 391 * 392 * @param { LineCapStyle } value 393 * @returns { ShapeAttribute } 394 * @syscap SystemCapability.ArkUI.ArkUI.Full 395 * @crossplatform 396 * @form 397 * @since 10 398 */ 399 /** 400 * Called when the path endpoint drawing style is set. 401 * 402 * @param { LineCapStyle } value 403 * @returns { ShapeAttribute } 404 * @syscap SystemCapability.ArkUI.ArkUI.Full 405 * @crossplatform 406 * @form 407 * @atomicservice 408 * @since 11 409 */ 410 strokeLineCap(value: LineCapStyle): ShapeAttribute; 411 412 /** 413 * Called when the border corner drawing style is set. 414 * 415 * @param { LineJoinStyle } value 416 * @returns { ShapeAttribute } 417 * @syscap SystemCapability.ArkUI.ArkUI.Full 418 * @since 7 419 */ 420 /** 421 * Called when the border corner drawing style is set. 422 * 423 * @param { LineJoinStyle } value 424 * @returns { ShapeAttribute } 425 * @syscap SystemCapability.ArkUI.ArkUI.Full 426 * @form 427 * @since 9 428 */ 429 /** 430 * Called when the border corner drawing style is set. 431 * 432 * @param { LineJoinStyle } value 433 * @returns { ShapeAttribute } 434 * @syscap SystemCapability.ArkUI.ArkUI.Full 435 * @crossplatform 436 * @form 437 * @since 10 438 */ 439 /** 440 * Called when the border corner drawing style is set. 441 * 442 * @param { LineJoinStyle } value 443 * @returns { ShapeAttribute } 444 * @syscap SystemCapability.ArkUI.ArkUI.Full 445 * @crossplatform 446 * @form 447 * @atomicservice 448 * @since 11 449 */ 450 strokeLineJoin(value: LineJoinStyle): ShapeAttribute; 451 452 /** 453 * Called when the limit value for drawing acute angles as oblique angles is set. 454 * 455 * @param { number | string } value 456 * @returns { ShapeAttribute } 457 * @syscap SystemCapability.ArkUI.ArkUI.Full 458 * @since 7 459 */ 460 /** 461 * Called when the limit value for drawing acute angles as oblique angles is set. 462 * 463 * @param { number | string } value 464 * @returns { ShapeAttribute } 465 * @syscap SystemCapability.ArkUI.ArkUI.Full 466 * @form 467 * @since 9 468 */ 469 /** 470 * Called when the limit value for drawing acute angles as oblique angles is set. 471 * 472 * @param { number | string } value 473 * @returns { ShapeAttribute } 474 * @syscap SystemCapability.ArkUI.ArkUI.Full 475 * @crossplatform 476 * @form 477 * @since 10 478 */ 479 /** 480 * Called when the limit value for drawing acute angles as oblique angles is set. 481 * 482 * @param { number | string } value 483 * @returns { ShapeAttribute } 484 * @syscap SystemCapability.ArkUI.ArkUI.Full 485 * @crossplatform 486 * @form 487 * @atomicservice 488 * @since 11 489 */ 490 strokeMiterLimit(value: number | string): ShapeAttribute; 491 492 /** 493 * Called when the opacity of the border is set. 494 * 495 * @param { number | string | Resource } value 496 * @returns { ShapeAttribute } 497 * @syscap SystemCapability.ArkUI.ArkUI.Full 498 * @since 7 499 */ 500 /** 501 * Called when the opacity of the border is set. 502 * 503 * @param { number | string | Resource } value 504 * @returns { ShapeAttribute } 505 * @syscap SystemCapability.ArkUI.ArkUI.Full 506 * @form 507 * @since 9 508 */ 509 /** 510 * Called when the opacity of the border is set. 511 * 512 * @param { number | string | Resource } value 513 * @returns { ShapeAttribute } 514 * @syscap SystemCapability.ArkUI.ArkUI.Full 515 * @crossplatform 516 * @form 517 * @since 10 518 */ 519 /** 520 * Called when the opacity of the border is set. 521 * 522 * @param { number | string | Resource } value 523 * @returns { ShapeAttribute } 524 * @syscap SystemCapability.ArkUI.ArkUI.Full 525 * @crossplatform 526 * @form 527 * @atomicservice 528 * @since 11 529 */ 530 strokeOpacity(value: number | string | Resource): ShapeAttribute; 531 532 /** 533 * Called when the transparency of the border is set. 534 * 535 * @param { number | string | Resource } value 536 * @returns { ShapeAttribute } 537 * @syscap SystemCapability.ArkUI.ArkUI.Full 538 * @since 7 539 */ 540 /** 541 * Called when the transparency of the border is set. 542 * 543 * @param { number | string | Resource } value 544 * @returns { ShapeAttribute } 545 * @syscap SystemCapability.ArkUI.ArkUI.Full 546 * @form 547 * @since 9 548 */ 549 /** 550 * Called when the transparency of the border is set. 551 * 552 * @param { number | string | Resource } value 553 * @returns { ShapeAttribute } 554 * @syscap SystemCapability.ArkUI.ArkUI.Full 555 * @crossplatform 556 * @form 557 * @since 10 558 */ 559 /** 560 * Called when the transparency of the border is set. 561 * 562 * @param { number | string | Resource } value 563 * @returns { ShapeAttribute } 564 * @syscap SystemCapability.ArkUI.ArkUI.Full 565 * @crossplatform 566 * @form 567 * @atomicservice 568 * @since 11 569 */ 570 fillOpacity(value: number | string | Resource): ShapeAttribute; 571 572 /** 573 * Called when the width of the border is set. 574 * 575 * @param { number | string } value 576 * @returns { ShapeAttribute } 577 * @syscap SystemCapability.ArkUI.ArkUI.Full 578 * @since 7 579 */ 580 /** 581 * Called when the width of the border is set. 582 * 583 * @param { number | string } value 584 * @returns { ShapeAttribute } 585 * @syscap SystemCapability.ArkUI.ArkUI.Full 586 * @form 587 * @since 9 588 */ 589 /** 590 * Called when the width of the border is set. 591 * 592 * @param { number | string } value 593 * @returns { ShapeAttribute } 594 * @syscap SystemCapability.ArkUI.ArkUI.Full 595 * @crossplatform 596 * @form 597 * @since 10 598 */ 599 /** 600 * Called when the width of the border is set. 601 * 602 * @param { number | string } value 603 * @returns { ShapeAttribute } 604 * @syscap SystemCapability.ArkUI.ArkUI.Full 605 * @crossplatform 606 * @form 607 * @atomicservice 608 * @since 11 609 */ 610 strokeWidth(value: number | string): ShapeAttribute; 611 612 /** 613 * Called when setting whether anti aliasing is on. 614 * 615 * @param { boolean } value 616 * @returns { ShapeAttribute } 617 * @syscap SystemCapability.ArkUI.ArkUI.Full 618 * @since 7 619 */ 620 /** 621 * Called when setting whether anti aliasing is on. 622 * 623 * @param { boolean } value 624 * @returns { ShapeAttribute } 625 * @syscap SystemCapability.ArkUI.ArkUI.Full 626 * @form 627 * @since 9 628 */ 629 /** 630 * Called when setting whether anti aliasing is on. 631 * 632 * @param { boolean } value 633 * @returns { ShapeAttribute } 634 * @syscap SystemCapability.ArkUI.ArkUI.Full 635 * @crossplatform 636 * @form 637 * @since 10 638 */ 639 /** 640 * Called when setting whether anti aliasing is on. 641 * 642 * @param { boolean } value 643 * @returns { ShapeAttribute } 644 * @syscap SystemCapability.ArkUI.ArkUI.Full 645 * @crossplatform 646 * @form 647 * @atomicservice 648 * @since 11 649 */ 650 antiAlias(value: boolean): ShapeAttribute; 651 652 /** 653 * Called when shape mesh. 654 * 655 * @param { Array<any> } value 656 * @param { number } column 657 * @param { number } row 658 * @returns { ShapeAttribute } 659 * @syscap SystemCapability.ArkUI.ArkUI.Full 660 * @since 8 661 */ 662 /** 663 * Called when shape mesh. 664 * 665 * @param { Array<any> } value 666 * @param { number } column 667 * @param { number } row 668 * @returns { ShapeAttribute } 669 * @syscap SystemCapability.ArkUI.ArkUI.Full 670 * @form 671 * @since 9 672 */ 673 /** 674 * Called when shape mesh. 675 * 676 * @param { Array<any> } value 677 * @param { number } column 678 * @param { number } row 679 * @returns { ShapeAttribute } 680 * @syscap SystemCapability.ArkUI.ArkUI.Full 681 * @crossplatform 682 * @form 683 * @since 10 684 */ 685 /** 686 * Called when shape mesh. 687 * 688 * @param { Array<any> } value 689 * @param { number } column 690 * @param { number } row 691 * @returns { ShapeAttribute } 692 * @syscap SystemCapability.ArkUI.ArkUI.Full 693 * @crossplatform 694 * @form 695 * @atomicservice 696 * @since 11 697 */ 698 mesh(value: Array<any>, column: number, row: number): ShapeAttribute; 699} 700 701/** 702 * Defines Shape Component. 703 * 704 * @syscap SystemCapability.ArkUI.ArkUI.Full 705 * @since 7 706 */ 707/** 708 * Defines Shape Component. 709 * 710 * @syscap SystemCapability.ArkUI.ArkUI.Full 711 * @form 712 * @since 9 713 */ 714/** 715 * Defines Shape Component. 716 * 717 * @syscap SystemCapability.ArkUI.ArkUI.Full 718 * @crossplatform 719 * @form 720 * @since 10 721 */ 722/** 723 * Defines Shape Component. 724 * 725 * @syscap SystemCapability.ArkUI.ArkUI.Full 726 * @crossplatform 727 * @form 728 * @atomicservice 729 * @since 11 730 */ 731declare const Shape: ShapeInterface; 732 733/** 734 * Defines Shape Component instance. 735 * 736 * @syscap SystemCapability.ArkUI.ArkUI.Full 737 * @since 7 738 */ 739/** 740 * Defines Shape Component instance. 741 * 742 * @syscap SystemCapability.ArkUI.ArkUI.Full 743 * @form 744 * @since 9 745 */ 746/** 747 * Defines Shape Component instance. 748 * 749 * @syscap SystemCapability.ArkUI.ArkUI.Full 750 * @crossplatform 751 * @form 752 * @since 10 753 */ 754/** 755 * Defines Shape Component instance. 756 * 757 * @syscap SystemCapability.ArkUI.ArkUI.Full 758 * @crossplatform 759 * @form 760 * @atomicservice 761 * @since 11 762 */ 763declare const ShapeInstance: ShapeAttribute; 764