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