1/* 2 * Copyright (c) 2022-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 FormKit 19 */ 20 21import Want from './@ohos.app.ability.Want'; 22 23/** 24 * interface of formInfo. 25 * 26 * @namespace formInfo 27 * @syscap SystemCapability.Ability.Form 28 * @since 9 29 */ 30/** 31 * interface of formInfo. 32 * 33 * @namespace formInfo 34 * @syscap SystemCapability.Ability.Form 35 * @atomicservice 36 * @since arkts {'1.1':'11', '1.2':'20'} 37 * @arkts 1.1&1.2 38 */ 39declare namespace formInfo { 40 /** 41 * Provides information about a form. 42 * 43 * @typedef FormInfo 44 * @syscap SystemCapability.Ability.Form 45 * @since 9 46 */ 47 /** 48 * Provides information about a form. 49 * 50 * @typedef FormInfo 51 * @syscap SystemCapability.Ability.Form 52 * @atomicservice 53 * @since arkts {'1.1':'11', '1.2':'20'} 54 * @arkts 1.1&1.2 55 */ 56 interface FormInfo { 57 /** 58 * Obtains the bundle name of the application to which this form belongs. 59 * 60 * @type { string } 61 * @syscap SystemCapability.Ability.Form 62 * @since 9 63 */ 64 /** 65 * Obtains the bundle name of the application to which this form belongs. 66 * 67 * @type { string } 68 * @syscap SystemCapability.Ability.Form 69 * @atomicservice 70 * @since arkts {'1.1':'11', '1.2':'20'} 71 * @arkts 1.1&1.2 72 */ 73 bundleName: string; 74 75 /** 76 * Obtains the name of the application module to which this form belongs. 77 * 78 * @type { string } 79 * @syscap SystemCapability.Ability.Form 80 * @since 9 81 */ 82 /** 83 * Obtains the name of the application module to which this form belongs. 84 * 85 * @type { string } 86 * @syscap SystemCapability.Ability.Form 87 * @atomicservice 88 * @since arkts {'1.1':'11', '1.2':'20'} 89 * @arkts 1.1&1.2 90 */ 91 moduleName: string; 92 93 /** 94 * Obtains the class name of the ability to which this form belongs. 95 * 96 * @type { string } 97 * @syscap SystemCapability.Ability.Form 98 * @since 9 99 */ 100 /** 101 * Obtains the class name of the ability to which this form belongs. 102 * 103 * @type { string } 104 * @syscap SystemCapability.Ability.Form 105 * @atomicservice 106 * @since arkts {'1.1':'11', '1.2':'20'} 107 * @arkts 1.1&1.2 108 */ 109 abilityName: string; 110 111 /** 112 * Obtains the name of this form. 113 * 114 * @type { string } 115 * @syscap SystemCapability.Ability.Form 116 * @since 9 117 */ 118 /** 119 * Obtains the name of this form. 120 * 121 * @type { string } 122 * @syscap SystemCapability.Ability.Form 123 * @atomicservice 124 * @since arkts {'1.1':'11', '1.2':'20'} 125 * @arkts 1.1&1.2 126 */ 127 name: string; 128 129 /** 130 * Obtains the display name of this form. 131 * 132 * @type { string } 133 * @syscap SystemCapability.Ability.Form 134 * @atomicservice 135 * @since arkts {'1.1':'11', '1.2':'20'} 136 * @arkts 1.1&1.2 137 */ 138 displayName: string; 139 140 /** 141 * Obtains the displayName resource id of this form. 142 * 143 * @type { number } 144 * @syscap SystemCapability.Ability.Form 145 * @atomicservice 146 * @since arkts {'1.1':'11', '1.2':'20'} 147 * @arkts 1.1&1.2 148 */ 149 displayNameId: number; 150 151 /** 152 * Obtains the description of this form. 153 * 154 * @type { string } 155 * @syscap SystemCapability.Ability.Form 156 * @since 9 157 */ 158 /** 159 * Obtains the description of this form. 160 * 161 * @type { string } 162 * @syscap SystemCapability.Ability.Form 163 * @atomicservice 164 * @since arkts {'1.1':'11', '1.2':'20'} 165 * @arkts 1.1&1.2 166 */ 167 description: string; 168 169 /** 170 * Obtains the description id of this form. 171 * 172 * @type { number } 173 * @syscap SystemCapability.Ability.Form 174 * @since 10 175 */ 176 /** 177 * Obtains the description id of this form. 178 * 179 * @type { number } 180 * @syscap SystemCapability.Ability.Form 181 * @atomicservice 182 * @since arkts {'1.1':'11', '1.2':'20'} 183 * @arkts 1.1&1.2 184 */ 185 descriptionId: number; 186 187 /** 188 * Obtains the type of this form. Currently, JS forms are supported. 189 * 190 * @type { FormType } 191 * @syscap SystemCapability.Ability.Form 192 * @since 9 193 */ 194 /** 195 * Obtains the type of this form. Currently, JS forms are supported. 196 * 197 * @type { FormType } 198 * @syscap SystemCapability.Ability.Form 199 * @atomicservice 200 * @since arkts {'1.1':'11', '1.2':'20'} 201 * @arkts 1.1&1.2 202 */ 203 type: FormType; 204 205 /** 206 * Obtains the JS component name of this JS form. 207 * 208 * @type { string } 209 * @syscap SystemCapability.Ability.Form 210 * @since 9 211 */ 212 /** 213 * Obtains the JS component name of this JS form. 214 * 215 * @type { string } 216 * @syscap SystemCapability.Ability.Form 217 * @atomicservice 218 * @since arkts {'1.1':'11', '1.2':'20'} 219 * @arkts 1.1&1.2 220 */ 221 jsComponentName: string; 222 223 /** 224 * Obtains the color mode of this form. 225 * 226 * @type { ColorMode } 227 * @syscap SystemCapability.Ability.Form 228 * @since 9 229 */ 230 /** 231 * Obtains the color mode of this form. 232 * 233 * @type { ColorMode } 234 * @syscap SystemCapability.Ability.Form 235 * @atomicservice 236 * @since 11 237 * @deprecated since 20 238 */ 239 colorMode: ColorMode; 240 241 /** 242 * Checks whether this form is a default form. 243 * 244 * @type { boolean } 245 * @syscap SystemCapability.Ability.Form 246 * @since 9 247 */ 248 /** 249 * Checks whether this form is a default form. 250 * 251 * @type { boolean } 252 * @syscap SystemCapability.Ability.Form 253 * @atomicservice 254 * @since arkts {'1.1':'11', '1.2':'20'} 255 * @arkts 1.1&1.2 256 */ 257 isDefault: boolean; 258 259 /** 260 * Obtains the updateEnabled. 261 * 262 * @type { boolean } 263 * @syscap SystemCapability.Ability.Form 264 * @since 9 265 */ 266 /** 267 * Obtains the updateEnabled. 268 * 269 * @type { boolean } 270 * @syscap SystemCapability.Ability.Form 271 * @atomicservice 272 * @since arkts {'1.1':'11', '1.2':'20'} 273 * @arkts 1.1&1.2 274 */ 275 updateEnabled: boolean; 276 277 /** 278 * Obtains whether notify visible of this form. 279 * 280 * @type { boolean } 281 * @syscap SystemCapability.Ability.Form 282 * @since 9 283 */ 284 /** 285 * Obtains whether notify visible of this form. 286 * 287 * @type { boolean } 288 * @syscap SystemCapability.Ability.Form 289 * @atomicservice 290 * @since arkts {'1.1':'11', '1.2':'20'} 291 * @arkts 1.1&1.2 292 */ 293 formVisibleNotify: boolean; 294 295 /** 296 * Obtains the scheduledUpdateTime. 297 * 298 * @type { string } 299 * @syscap SystemCapability.Ability.Form 300 * @since 9 301 */ 302 /** 303 * Obtains the scheduledUpdateTime. 304 * 305 * @type { string } 306 * @syscap SystemCapability.Ability.Form 307 * @atomicservice 308 * @since arkts {'1.1':'11', '1.2':'20'} 309 * @arkts 1.1&1.2 310 */ 311 scheduledUpdateTime: string; 312 313 /** 314 * Obtains the form config ability about this form. 315 * 316 * @type { string } 317 * @syscap SystemCapability.Ability.Form 318 * @since 9 319 */ 320 /** 321 * Obtains the form config ability about this form. 322 * 323 * @type { string } 324 * @syscap SystemCapability.Ability.Form 325 * @atomicservice 326 * @since arkts {'1.1':'11', '1.2':'20'} 327 * @arkts 1.1&1.2 328 */ 329 formConfigAbility: string; 330 331 /** 332 * Obtains the updateDuration. 333 * 334 * @type { number } 335 * @syscap SystemCapability.Ability.Form 336 * @since 9 337 */ 338 /** 339 * Obtains the updateDuration. 340 * 341 * @type { number } 342 * @syscap SystemCapability.Ability.Form 343 * @atomicservice 344 * @since arkts {'1.1':'11', '1.2':'20'} 345 * @arkts 1.1&1.2 346 */ 347 updateDuration: number; 348 349 /** 350 * Obtains the default grid style of this form. 351 * 352 * @type { number } 353 * @syscap SystemCapability.Ability.Form 354 * @since 9 355 */ 356 /** 357 * Obtains the default grid style of this form. 358 * 359 * @type { number } 360 * @syscap SystemCapability.Ability.Form 361 * @atomicservice 362 * @since arkts {'1.1':'11', '1.2':'20'} 363 * @arkts 1.1&1.2 364 */ 365 defaultDimension: number; 366 367 /** 368 * Obtains the grid styles supported by this form. 369 * 370 * @type { Array<number> } 371 * @syscap SystemCapability.Ability.Form 372 * @since 9 373 */ 374 /** 375 * Obtains the grid styles supported by this form. 376 * 377 * @type { Array<number> } 378 * @syscap SystemCapability.Ability.Form 379 * @atomicservice 380 * @since arkts {'1.1':'11', '1.2':'20'} 381 * @arkts 1.1&1.2 382 */ 383 supportDimensions: Array<number>; 384 385 /** 386 * Obtains the custom data defined in this form. 387 * 388 * @type { object } 389 * @syscap SystemCapability.Ability.Form 390 * @since 9 391 */ 392 /** 393 * Obtains the custom data defined in this form. 394 * 395 * @type { Record<string, string> } 396 * @syscap SystemCapability.Ability.Form 397 * @atomicservice 398 * @since arkts {'1.1':'11', '1.2':'20'} 399 * @arkts 1.1&1.2 400 */ 401 customizeData: Record<string, string>; 402 403 /** 404 * Obtains whether this form is a dynamic form. 405 * 406 * @type { boolean } 407 * @syscap SystemCapability.Ability.Form 408 * @since 10 409 */ 410 /** 411 * Obtains whether this form is a dynamic form. 412 * 413 * @type { boolean } 414 * @syscap SystemCapability.Ability.Form 415 * @atomicservice 416 * @since arkts {'1.1':'11', '1.2':'20'} 417 * @arkts 1.1&1.2 418 */ 419 isDynamic: boolean; 420 421 /** 422 * Indicates whether the form can be set as a transparent background 423 * 424 * @type { boolean } 425 * @default false 426 * @syscap SystemCapability.Ability.Form 427 * @atomicservice 428 * @since arkts {'1.1':'11', '1.2':'20'} 429 * @arkts 1.1&1.2 430 */ 431 transparencyEnabled: boolean; 432 433 /** 434 * Obtains the shape supported by this form. 435 * 436 * @type { Array<number> } 437 * @syscap SystemCapability.Ability.Form 438 * @atomicservice 439 * @since arkts {'1.1':'12', '1.2':'20'} 440 * @arkts 1.1&1.2 441 */ 442 supportedShapes: Array<number>; 443 444 /** 445 * Indicates the form previewImage IDs map corresponds to the \"supportDimensions\". 446 * 447 * @type { ?Array<number> } 448 * @readonly 449 * @syscap SystemCapability.Ability.Form 450 * @systemapi 451 * @atomicservice 452 * @since arkts {'1.1':'18', '1.2':'20'} 453 * @arkts 1.1&1.2 454 */ 455 readonly previewImages?: Array<number>; 456 457 /** 458 * Indicates whether the form uses a blur background provided by the form host. 459 * 460 * @type { ?boolean } 461 * @readonly 462 * @syscap SystemCapability.Ability.Form 463 * @systemapi 464 * @since arkts {'1.1':'18', '1.2':'20'} 465 * @arkts 1.1&1.2 466 */ 467 readonly enableBlurBackground?: boolean; 468 469 /** 470 * Obtains the rendering mode of the form. 471 * 472 * @type { ?RenderingMode } 473 * @readonly 474 * @syscap SystemCapability.Ability.Form 475 * @systemapi 476 * @since arkts {'1.1':'18', '1.2':'20'} 477 * @arkts 1.1&1.2 478 */ 479 readonly renderingMode?: RenderingMode; 480 481 /** 482 * Indicates the fun interaction form params 483 * 484 * @type { ?FunInteractionParams } 485 * @readonly 486 * @syscap SystemCapability.Ability.Form 487 * @systemapi 488 * @since 20 489 */ 490 readonly funInteractionParams?: FunInteractionParams; 491 492 /** 493 * Indicates the scene animation form params 494 * 495 * @type { ?SceneAnimationParams } 496 * @readonly 497 * @syscap SystemCapability.Ability.Form 498 * @systemapi 499 * @since 20 500 */ 501 readonly sceneAnimationParams?: SceneAnimationParams; 502 503 /** 504 * Obtains the resizable of the form. 505 * 506 * @type { ?boolean } 507 * @readonly 508 * @syscap SystemCapability.Ability.Form 509 * @systemapi 510 * @since 20 511 */ 512 readonly resizable?: boolean; 513 514 /** 515 * Obtains the group id of the form. 516 * 517 * @type { ?string } 518 * @readonly 519 * @syscap SystemCapability.Ability.Form 520 * @systemapi 521 * @since 20 522 */ 523 readonly groupId?: string; 524 } 525 526 /** 527 * Rendering mode. 528 * 529 * @enum { number } 530 * @syscap SystemCapability.Ability.Form 531 * @systemapi 532 * @since arkts {'1.1':'18', '1.2':'20'} 533 * @arkts 1.1&1.2 534 */ 535 enum RenderingMode { 536 /** 537 * Auto color mode. 538 * 539 * @syscap SystemCapability.Ability.Form 540 * @systemapi 541 * @since arkts {'1.1':'18', '1.2':'20'} 542 * @arkts 1.1&1.2 543 */ 544 AUTO_COLOR = 0, 545 /** 546 * Full color mode. 547 * 548 * @syscap SystemCapability.Ability.Form 549 * @systemapi 550 * @since arkts {'1.1':'18', '1.2':'20'} 551 * @arkts 1.1&1.2 552 */ 553 FULL_COLOR = 1, 554 /** 555 * Single color mode. 556 * 557 * @syscap SystemCapability.Ability.Form 558 * @systemapi 559 * @since arkts {'1.1':'18', '1.2':'20'} 560 * @arkts 1.1&1.2 561 */ 562 SINGLE_COLOR = 2 563 } 564 565 /** 566 * Type of form. 567 * 568 * @enum { number } 569 * @syscap SystemCapability.Ability.Form 570 * @since 9 571 */ 572 /** 573 * Type of form. 574 * 575 * @enum { number } 576 * @syscap SystemCapability.Ability.Form 577 * @atomicservice 578 * @since arkts {'1.1':'11', '1.2':'20'} 579 * @arkts 1.1&1.2 580 */ 581 enum FormType { 582 /** 583 * JS form. 584 * 585 * @syscap SystemCapability.Ability.Form 586 * @since 9 587 */ 588 /** 589 * JS form. 590 * 591 * @syscap SystemCapability.Ability.Form 592 * @atomicservice 593 * @since arkts {'1.1':'11', '1.2':'20'} 594 * @arkts 1.1&1.2 595 */ 596 JS = 1, 597 598 /** 599 * eTS form. 600 * 601 * @syscap SystemCapability.Ability.Form 602 * @since 9 603 */ 604 /** 605 * eTS form. 606 * 607 * @syscap SystemCapability.Ability.Form 608 * @atomicservice 609 * @since arkts {'1.1':'11', '1.2':'20'} 610 * @arkts 1.1&1.2 611 */ 612 eTS = 2 613 } 614 615 /** 616 * Color mode. 617 * 618 * @enum { number } 619 * @syscap SystemCapability.Ability.Form 620 * @since 9 621 */ 622 /** 623 * Color mode. 624 * 625 * @enum { number } 626 * @syscap SystemCapability.Ability.Form 627 * @atomicservice 628 * @since 11 629 * @deprecated since 20 630 */ 631 enum ColorMode { 632 /** 633 * Automatic mode. 634 * 635 * @syscap SystemCapability.Ability.Form 636 * @since 9 637 */ 638 /** 639 * Automatic mode. 640 * 641 * @syscap SystemCapability.Ability.Form 642 * @atomicservice 643 * @since 11 644 * @deprecated since 20 645 */ 646 MODE_AUTO = -1, 647 648 /** 649 * Dark mode. 650 * 651 * @syscap SystemCapability.Ability.Form 652 * @since 9 653 */ 654 /** 655 * Dark mode. 656 * 657 * @syscap SystemCapability.Ability.Form 658 * @atomicservice 659 * @since 11 660 * @deprecated since 20 661 */ 662 MODE_DARK = 0, 663 664 /** 665 * Light mode. 666 * 667 * @syscap SystemCapability.Ability.Form 668 * @since 9 669 */ 670 /** 671 * Light mode. 672 * 673 * @syscap SystemCapability.Ability.Form 674 * @atomicservice 675 * @since 11 676 * @deprecated since 20 677 */ 678 MODE_LIGHT = 1 679 } 680 681 /** 682 * Provides state information about a form. 683 * 684 * @typedef FormStateInfo 685 * @syscap SystemCapability.Ability.Form 686 * @since 9 687 */ 688 /** 689 * Provides state information about a form. 690 * 691 * @typedef FormStateInfo 692 * @syscap SystemCapability.Ability.Form 693 * @atomicservice 694 * @since arkts {'1.1':'11', '1.2':'20'} 695 * @arkts 1.1&1.2 696 */ 697 interface FormStateInfo { 698 /** 699 * Obtains the form state. 700 * 701 * @type { FormState } 702 * @syscap SystemCapability.Ability.Form 703 * @since 9 704 */ 705 /** 706 * Obtains the form state. 707 * 708 * @type { FormState } 709 * @syscap SystemCapability.Ability.Form 710 * @atomicservice 711 * @since arkts {'1.1':'11', '1.2':'20'} 712 * @arkts 1.1&1.2 713 */ 714 formState: FormState; 715 716 /** 717 * Obtains the want form . 718 * 719 * @type { Want } 720 * @syscap SystemCapability.Ability.Form 721 * @since 9 722 */ 723 /** 724 * Obtains the want form . 725 * 726 * @type { Want } 727 * @syscap SystemCapability.Ability.Form 728 * @atomicservice 729 * @since arkts {'1.1':'11', '1.2':'20'} 730 * @arkts 1.1&1.2 731 */ 732 want: Want; 733 } 734 735 /** 736 * Provides state about a form. 737 * 738 * @enum { number } 739 * @syscap SystemCapability.Ability.Form 740 * @since 9 741 */ 742 /** 743 * Provides state about a form. 744 * 745 * @enum { number } 746 * @syscap SystemCapability.Ability.Form 747 * @atomicservice 748 * @since arkts {'1.1':'11', '1.2':'20'} 749 * @arkts 1.1&1.2 750 */ 751 enum FormState { 752 /** 753 * Indicates that the form status is unknown due to an internal error. 754 * 755 * @syscap SystemCapability.Ability.Form 756 * @since 9 757 */ 758 /** 759 * Indicates that the form status is unknown due to an internal error. 760 * 761 * @syscap SystemCapability.Ability.Form 762 * @atomicservice 763 * @since arkts {'1.1':'11', '1.2':'20'} 764 * @arkts 1.1&1.2 765 */ 766 UNKNOWN = -1, 767 768 /** 769 * Indicates that the form is in the default state. 770 * 771 * @syscap SystemCapability.Ability.Form 772 * @since 9 773 */ 774 /** 775 * Indicates that the form is in the default state. 776 * 777 * @syscap SystemCapability.Ability.Form 778 * @atomicservice 779 * @since arkts {'1.1':'11', '1.2':'20'} 780 * @arkts 1.1&1.2 781 */ 782 DEFAULT = 0, 783 784 /** 785 * Indicates that the form is ready. 786 * 787 * @syscap SystemCapability.Ability.Form 788 * @since 9 789 */ 790 /** 791 * Indicates that the form is ready. 792 * 793 * @syscap SystemCapability.Ability.Form 794 * @atomicservice 795 * @since arkts {'1.1':'11', '1.2':'20'} 796 * @arkts 1.1&1.2 797 */ 798 READY = 1 799 } 800 801 /** 802 * Parameter of form. 803 * 804 * @enum { string } 805 * @syscap SystemCapability.Ability.Form 806 * @since 9 807 */ 808 /** 809 * Parameter of form. 810 * 811 * @enum { string } 812 * @syscap SystemCapability.Ability.Form 813 * @atomicservice 814 * @since arkts {'1.1':'11', '1.2':'20'} 815 * @arkts 1.1&1.2 816 */ 817 enum FormParam { 818 /** 819 * Indicates the key specifying the ID of the form to be obtained, which is represented as 820 * want: { 821 * "parameters": { 822 * IDENTITY_KEY: "119476135" 823 * } 824 * }. 825 * 826 * @syscap SystemCapability.Ability.Form 827 * @since 9 828 */ 829 /** 830 * Indicates the key specifying the ID of the form to be obtained, which is represented as 831 * want: { 832 * "parameters": { 833 * IDENTITY_KEY: "119476135" 834 * } 835 * }. 836 * 837 * @syscap SystemCapability.Ability.Form 838 * @atomicservice 839 * @since arkts {'1.1':'11', '1.2':'20'} 840 * @arkts 1.1&1.2 841 */ 842 IDENTITY_KEY = "ohos.extra.param.key.form_identity", 843 844 /** 845 * Indicates the key specifying the grid style of the form to be obtained, which is represented as 846 * want: { 847 * "parameters": { 848 * DIMENSION_KEY: FormDimension.Dimension_1_2 849 * } 850 * }. 851 * 852 * @syscap SystemCapability.Ability.Form 853 * @since 9 854 */ 855 /** 856 * Indicates the key specifying the grid style of the form to be obtained, which is represented as 857 * want: { 858 * "parameters": { 859 * DIMENSION_KEY: FormDimension.Dimension_1_2 860 * } 861 * }. 862 * 863 * @syscap SystemCapability.Ability.Form 864 * @atomicservice 865 * @since arkts {'1.1':'11', '1.2':'20'} 866 * @arkts 1.1&1.2 867 */ 868 DIMENSION_KEY = "ohos.extra.param.key.form_dimension", 869 870 /** 871 * Indicates the key specifying the name of the form to be obtained, which is represented as 872 * want: { 873 * "parameters": { 874 * NAME_KEY: "formName" 875 * } 876 * }. 877 * 878 * @syscap SystemCapability.Ability.Form 879 * @since 9 880 */ 881 /** 882 * Indicates the key specifying the name of the form to be obtained, which is represented as 883 * want: { 884 * "parameters": { 885 * NAME_KEY: "formName" 886 * } 887 * }. 888 * 889 * @syscap SystemCapability.Ability.Form 890 * @atomicservice 891 * @since arkts {'1.1':'11', '1.2':'20'} 892 * @arkts 1.1&1.2 893 */ 894 NAME_KEY = "ohos.extra.param.key.form_name", 895 896 /** 897 * Indicates the key specifying the name of the module to which the form to be obtained belongs, which is 898 * represented as 899 * want: { 900 * "parameters": { 901 * MODULE_NAME_KEY: "formEntry" 902 * } 903 * } 904 * This constant is mandatory. 905 * 906 * @syscap SystemCapability.Ability.Form 907 * @since 9 908 */ 909 /** 910 * Indicates the key specifying the name of the module to which the form to be obtained belongs, which is 911 * represented as 912 * want: { 913 * "parameters": { 914 * MODULE_NAME_KEY: "formEntry" 915 * } 916 * } 917 * This constant is mandatory. 918 * 919 * @syscap SystemCapability.Ability.Form 920 * @atomicservice 921 * @since arkts {'1.1':'11', '1.2':'20'} 922 * @arkts 1.1&1.2 923 */ 924 MODULE_NAME_KEY = "ohos.extra.param.key.module_name", 925 926 /** 927 * Indicates the key specifying the width of the form to be obtained, which is represented as 928 * want: { 929 * "parameters": { 930 * WIDTH_KEY: 800 931 * } 932 * } 933 * 934 * @syscap SystemCapability.Ability.Form 935 * @since 9 936 */ 937 /** 938 * Indicates the key specifying the width of the form to be obtained, which is represented as 939 * want: { 940 * "parameters": { 941 * WIDTH_KEY: 800 942 * } 943 * } 944 * 945 * @syscap SystemCapability.Ability.Form 946 * @atomicservice 947 * @since arkts {'1.1':'11', '1.2':'20'} 948 * @arkts 1.1&1.2 949 */ 950 WIDTH_KEY = "ohos.extra.param.key.form_width", 951 952 /** 953 * Indicates the key specifying the height of the form to be obtained, which is represented as 954 * want: { 955 * "parameters": { 956 * HEIGHT_KEY: 400 957 * } 958 * } 959 * 960 * @syscap SystemCapability.Ability.Form 961 * @since 9 962 */ 963 /** 964 * Indicates the key specifying the height of the form to be obtained, which is represented as 965 * want: { 966 * "parameters": { 967 * HEIGHT_KEY: 400 968 * } 969 * } 970 * 971 * @syscap SystemCapability.Ability.Form 972 * @atomicservice 973 * @since arkts {'1.1':'11', '1.2':'20'} 974 * @arkts 1.1&1.2 975 */ 976 HEIGHT_KEY = "ohos.extra.param.key.form_height", 977 978 /** 979 * Indicates the key specifying whether a form is temporary, which is represented as 980 * want: { 981 * "parameters": { 982 * TEMPORARY_KEY: true 983 * } 984 * } 985 * 986 * @syscap SystemCapability.Ability.Form 987 * @since 9 988 */ 989 /** 990 * Indicates the key specifying whether a form is temporary, which is represented as 991 * want: { 992 * "parameters": { 993 * TEMPORARY_KEY: true 994 * } 995 * } 996 * 997 * @syscap SystemCapability.Ability.Form 998 * @atomicservice 999 * @since arkts {'1.1':'11', '1.2':'20'} 1000 * @arkts 1.1&1.2 1001 */ 1002 TEMPORARY_KEY = "ohos.extra.param.key.form_temporary", 1003 1004 /** 1005 * Indicates the key specifying the name of the bundle to be obtained, which is represented as 1006 * want: { 1007 * "parameters": { 1008 * BUNDLE_NAME_KEY: "bundleName" 1009 * } 1010 * } 1011 * 1012 * @syscap SystemCapability.Ability.Form 1013 * @since 9 1014 */ 1015 /** 1016 * Indicates the key specifying the name of the bundle to be obtained, which is represented as 1017 * want: { 1018 * "parameters": { 1019 * BUNDLE_NAME_KEY: "bundleName" 1020 * } 1021 * } 1022 * 1023 * @syscap SystemCapability.Ability.Form 1024 * @atomicservice 1025 * @since arkts {'1.1':'11', '1.2':'20'} 1026 * @arkts 1.1&1.2 1027 */ 1028 BUNDLE_NAME_KEY = "ohos.extra.param.key.bundle_name", 1029 1030 /** 1031 * Indicates the key specifying the name of the ability to be obtained, which is represented as 1032 * want: { 1033 * "parameters": { 1034 * ABILITY_NAME_KEY: "abilityName" 1035 * } 1036 * } 1037 * 1038 * @syscap SystemCapability.Ability.Form 1039 * @since 9 1040 */ 1041 /** 1042 * Indicates the key specifying the name of the ability to be obtained, which is represented as 1043 * want: { 1044 * "parameters": { 1045 * ABILITY_NAME_KEY: "abilityName" 1046 * } 1047 * } 1048 * 1049 * @syscap SystemCapability.Ability.Form 1050 * @atomicservice 1051 * @since arkts {'1.1':'11', '1.2':'20'} 1052 * @arkts 1.1&1.2 1053 */ 1054 ABILITY_NAME_KEY = "ohos.extra.param.key.ability_name", 1055 1056 /** 1057 * Indicates the key specifying whether a form type is theme, which is represented as 1058 * want: { 1059 * "parameters": { 1060 * THEME_KEY: true 1061 * } 1062 * } 1063 * 1064 * @syscap SystemCapability.Ability.Form 1065 * @systemapi 1066 * @since arkts {'1.1':'12', '1.2':'20'} 1067 * @arkts 1.1&1.2 1068 */ 1069 THEME_KEY = 'ohos.extra.param.key.form_is_theme', 1070 1071 /** 1072 * Indicates the key specifying the the device ID, which is represented as 1073 * want: { 1074 * "parameters": { 1075 * DEVICE_ID_KEY : "EFC11C0C53628D8CC2F8CB5052477E130D075917034613B9884C55CD22B3DEF2" 1076 * } 1077 * } 1078 * 1079 * @syscap SystemCapability.Ability.Form 1080 * @systemapi 1081 * @since arkts {'1.1':'9', '1.2':'20'} 1082 * @arkts 1.1&1.2 1083 */ 1084 DEVICE_ID_KEY = "ohos.extra.param.key.device_id", 1085 1086 /** 1087 * Indicates the key specifying the launch reason of the form to be obtained, which is represented as 1088 * want: { 1089 * "parameters": { 1090 * LAUNCH_REASON_KEY: LaunchReason.FORM_DEFAULT 1091 * } 1092 * } 1093 * 1094 * @syscap SystemCapability.Ability.Form 1095 * @since 10 1096 */ 1097 /** 1098 * Indicates the key specifying the launch reason of the form to be obtained, which is represented as 1099 * want: { 1100 * "parameters": { 1101 * LAUNCH_REASON_KEY: LaunchReason.FORM_DEFAULT 1102 * } 1103 * } 1104 * 1105 * @syscap SystemCapability.Ability.Form 1106 * @atomicservice 1107 * @since arkts {'1.1':'11', '1.2':'20'} 1108 * @arkts 1.1&1.2 1109 */ 1110 LAUNCH_REASON_KEY = "ohos.extra.param.key.form_launch_reason", 1111 1112 /** 1113 * Indicates the key specifying the custom data of the form to be obtained, which is represented as 1114 * want: { 1115 * "parameters": { 1116 * PARAM_FORM_CUSTOMIZE_KEY: { 1117 * "key": "userData" 1118 * } 1119 * } 1120 * } 1121 * 1122 * @syscap SystemCapability.Ability.Form 1123 * @since 10 1124 */ 1125 /** 1126 * Indicates the key specifying the custom data of the form to be obtained, which is represented as 1127 * want: { 1128 * "parameters": { 1129 * PARAM_FORM_CUSTOMIZE_KEY: { 1130 * "key": "userData" 1131 * } 1132 * } 1133 * } 1134 * 1135 * @syscap SystemCapability.Ability.Form 1136 * @atomicservice 1137 * @since arkts {'1.1':'11', '1.2':'20'} 1138 * @arkts 1.1&1.2 1139 */ 1140 PARAM_FORM_CUSTOMIZE_KEY = "ohos.extra.param.key.form_customize", 1141 1142 /** 1143 * Indicates the key specifying the form location, which is represented as 1144 * want: { 1145 * "parameters": { 1146 * FORM_LOCATION_KEY: FormLocation.DESKTOP 1147 * } 1148 * }. 1149 * 1150 * @syscap SystemCapability.Ability.Form 1151 * @since arkts {'1.1':'12', '1.2':'20'} 1152 * @arkts 1.1&1.2 1153 */ 1154 FORM_LOCATION_KEY = 'ohos.extra.param.key.form_location', 1155 1156 /** 1157 * Indicates the key specifying the form rendering mode, which is represented as 1158 * want: { 1159 * "parameters": { 1160 * FORM_RENDERING_MODE_KEY: FormRenderingMode.SINGLE_COLOR 1161 * } 1162 * }. 1163 * 1164 * @syscap SystemCapability.Ability.Form 1165 * @since 11 1166 */ 1167 /** 1168 * Indicates the key specifying the form rendering mode, which is represented as 1169 * want: { 1170 * "parameters": { 1171 * FORM_RENDERING_MODE_KEY: FormRenderingMode.SINGLE_COLOR 1172 * } 1173 * }. 1174 * 1175 * @syscap SystemCapability.Ability.Form 1176 * @atomicservice 1177 * @since arkts {'1.1':'12', '1.2':'20'} 1178 * @arkts 1.1&1.2 1179 */ 1180 FORM_RENDERING_MODE_KEY = 'ohos.extra.param.key.form_rendering_mode', 1181 1182 /** 1183 * Indicates the key specifying the inverse of the host background color, which is represented as 1184 * want: { 1185 * "parameters": { 1186 * HOST_BG_INVERSE_COLOR_KEY: "#FF000000" 1187 * } 1188 * }. 1189 * 1190 * @syscap SystemCapability.Ability.Form 1191 * @atomicservice 1192 * @since arkts {'1.1':'12', '1.2':'20'} 1193 * @arkts 1.1&1.2 1194 */ 1195 HOST_BG_INVERSE_COLOR_KEY = 'ohos.extra.param.key.host_bg_inverse_color', 1196 1197 /** 1198 * Indicates the key specifying the user granted permission name, which is represented as 1199 * want: { 1200 * "parameters": { 1201 * FORM_PERMISSION_NAME_KEY: "permissionName" 1202 * } 1203 * }. 1204 * 1205 * @syscap SystemCapability.Ability.Form 1206 * @atomicservice 1207 * @since arkts {'1.1':'12', '1.2':'20'} 1208 * @arkts 1.1&1.2 1209 */ 1210 FORM_PERMISSION_NAME_KEY = 'ohos.extra.param.key.permission_name', 1211 1212 /** 1213 * Indicates the key specifying whether the user granted, which is represented as 1214 * want: { 1215 * "parameters": { 1216 * FORM_PERMISSION_GRANTED_KEY: true 1217 * } 1218 * }. 1219 * 1220 * @syscap SystemCapability.Ability.Form 1221 * @atomicservice 1222 * @since arkts {'1.1':'12', '1.2':'20'} 1223 * @arkts 1.1&1.2 1224 */ 1225 FORM_PERMISSION_GRANTED_KEY = 'ohos.extra.param.key.permission_granted', 1226 1227 /** 1228 * Indicates the key specifying the original form id, used in conjunction with LaunchReason.FORM_SIZE_CHANGE. 1229 * which is represented as 1230 * want: { 1231 * "parameters": { 1232 * ORIGINAL_FORM_KEY: "119476135" 1233 * } 1234 * } 1235 * 1236 * @syscap SystemCapability.Ability.Form 1237 * @atomicservice 1238 * @since 20 1239 */ 1240 ORIGINAL_FORM_KEY = 'ohos.extra.param.key.original_form_id', 1241 } 1242 1243 /** 1244 * The optional options used as filters to ask 1245 * getFormsInfo to return formInfos from only forms that match the options. 1246 * 1247 * @typedef FormInfoFilter 1248 * @syscap SystemCapability.Ability.Form 1249 * @since 9 1250 */ 1251 /** 1252 * The optional options used as filters to ask 1253 * getFormsInfo to return formInfos from only forms that match the options. 1254 * 1255 * @typedef FormInfoFilter 1256 * @syscap SystemCapability.Ability.Form 1257 * @atomicservice 1258 * @since arkts {'1.1':'11', '1.2':'20'} 1259 * @arkts 1.1&1.2 1260 */ 1261 interface FormInfoFilter { 1262 /** 1263 * optional bundleName that used to ask getFormsInfo to return 1264 * form infos with the same bundleName. 1265 * 1266 * @type { ?string } 1267 * @syscap SystemCapability.Ability.Form 1268 * @systemapi 1269 * @since arkts {'1.1':'12', '1.2':'20'} 1270 * @arkts 1.1&1.2 1271 */ 1272 bundleName?: string; 1273 1274 /** 1275 * optional moduleName that used to ask getFormsInfo to return 1276 * form infos with the same moduleName. 1277 * 1278 * @type { ?string } 1279 * @syscap SystemCapability.Ability.Form 1280 * @since 9 1281 */ 1282 /** 1283 * optional moduleName that used to ask getFormsInfo to return 1284 * form infos with the same moduleName. 1285 * 1286 * @type { ?string } 1287 * @syscap SystemCapability.Ability.Form 1288 * @atomicservice 1289 * @since arkts {'1.1':'11', '1.2':'20'} 1290 * @arkts 1.1&1.2 1291 */ 1292 moduleName?: string; 1293 1294 /** 1295 * optional supportedDimensions that used to ask getFormsInfo to return 1296 * form infos with the same supportedDimensions. 1297 * 1298 * @type { ?Array<number> } 1299 * @syscap SystemCapability.Ability.Form 1300 * @systemapi 1301 * @since arkts {'1.1':'12', '1.2':'20'} 1302 * @arkts 1.1&1.2 1303 */ 1304 supportedDimensions?: Array<number>; 1305 1306 /** 1307 * optional supportedShapes that used to ask getFormsInfo to return 1308 * form infos with the same supportedShapes. 1309 * 1310 * @type { ?Array<number> } 1311 * @syscap SystemCapability.Ability.Form 1312 * @systemapi 1313 * @since arkts {'1.1':'12', '1.2':'20'} 1314 * @arkts 1.1&1.2 1315 */ 1316 supportedShapes?: Array<number>; 1317 } 1318 1319 /** 1320 * Defines the FormDimension enum. 1321 * 1322 * @enum { number } 1323 * @syscap SystemCapability.Ability.Form 1324 * @since 9 1325 */ 1326 /** 1327 * Defines the FormDimension enum. 1328 * 1329 * @enum { number } 1330 * @syscap SystemCapability.Ability.Form 1331 * @atomicservice 1332 * @since arkts {'1.1':'11', '1.2':'20'} 1333 * @arkts 1.1&1.2 1334 */ 1335 enum FormDimension { 1336 /** 1337 * 1 x 2 form 1338 * 1339 * @syscap SystemCapability.Ability.Form 1340 * @since 9 1341 */ 1342 /** 1343 * 1 x 2 form 1344 * 1345 * @syscap SystemCapability.Ability.Form 1346 * @atomicservice 1347 * @since arkts {'1.1':'11', '1.2':'20'} 1348 * @arkts 1.1&1.2 1349 */ 1350 Dimension_1_2 = 1, 1351 1352 /** 1353 * 2 x 2 form 1354 * 1355 * @syscap SystemCapability.Ability.Form 1356 * @since 9 1357 */ 1358 /** 1359 * 2 x 2 form 1360 * 1361 * @syscap SystemCapability.Ability.Form 1362 * @atomicservice 1363 * @since arkts {'1.1':'11', '1.2':'20'} 1364 * @arkts 1.1&1.2 1365 */ 1366 Dimension_2_2 = 2, 1367 1368 /** 1369 * 2 x 4 form 1370 * 1371 * @syscap SystemCapability.Ability.Form 1372 * @since 9 1373 */ 1374 /** 1375 * 2 x 4 form 1376 * 1377 * @syscap SystemCapability.Ability.Form 1378 * @atomicservice 1379 * @since arkts {'1.1':'11', '1.2':'20'} 1380 * @arkts 1.1&1.2 1381 */ 1382 Dimension_2_4 = 3, 1383 1384 /** 1385 * 4 x 4 form 1386 * 1387 * @syscap SystemCapability.Ability.Form 1388 * @since 9 1389 */ 1390 /** 1391 * 4 x 4 form 1392 * 1393 * @syscap SystemCapability.Ability.Form 1394 * @atomicservice 1395 * @since arkts {'1.1':'11', '1.2':'20'} 1396 * @arkts 1.1&1.2 1397 */ 1398 Dimension_4_4 = 4, 1399 1400 /** 1401 * 2 x 1 form 1402 * 1403 * @syscap SystemCapability.Ability.Form 1404 * @since 9 1405 */ 1406 /** 1407 * 2 x 1 form 1408 * 1409 * @syscap SystemCapability.Ability.Form 1410 * @atomicservice 1411 * @since 11 1412 * @deprecated since 20 1413 */ 1414 Dimension_2_1, 1415 1416 /** 1417 * 1 x 1 form 1418 * 1419 * @syscap SystemCapability.Ability.Form 1420 * @atomicservice 1421 * @since arkts {'1.1':'11', '1.2':'20'} 1422 * @arkts 1.1&1.2 1423 */ 1424 DIMENSION_1_1 = 6, 1425 1426 /** 1427 * 6 x 4 form 1428 * 1429 * @syscap SystemCapability.Ability.Form 1430 * @atomicservice 1431 * @since arkts {'1.1':'12', '1.2':'20'} 1432 * @arkts 1.1&1.2 1433 */ 1434 DIMENSION_6_4 = 7, 1435 1436 /** 1437 * 2 x 3 form used for wearable devices 1438 * 1439 * @syscap SystemCapability.Ability.Form 1440 * @atomicservice 1441 * @since arkts {'1.1':'18', '1.2':'20'} 1442 * @arkts 1.1&1.2 1443 */ 1444 DIMENSION_2_3 = 8, 1445 1446 /** 1447 * 3 x 3 form used for wearable devices 1448 * 1449 * @syscap SystemCapability.Ability.Form 1450 * @atomicservice 1451 * @since arkts {'1.1':'18', '1.2':'20'} 1452 * @arkts 1.1&1.2 1453 */ 1454 DIMENSION_3_3 = 9 1455 } 1456 1457 /** 1458 * Defines the FormShape enum. 1459 * 1460 * @enum { number } 1461 * @syscap SystemCapability.Ability.Form 1462 * @atomicservice 1463 * @since arkts {'1.1':'12', '1.2':'20'} 1464 * @arkts 1.1&1.2 1465 */ 1466 enum FormShape { 1467 /** 1468 * The rect shape. 1469 * 1470 * @syscap SystemCapability.Ability.Form 1471 * @atomicservice 1472 * @since arkts {'1.1':'12', '1.2':'20'} 1473 * @arkts 1.1&1.2 1474 */ 1475 RECT = 1, 1476 1477 /** 1478 * The circle shape. 1479 * 1480 * @syscap SystemCapability.Ability.Form 1481 * @atomicservice 1482 * @since arkts {'1.1':'12', '1.2':'20'} 1483 * @arkts 1.1&1.2 1484 */ 1485 CIRCLE = 2 1486 } 1487 1488 /** 1489 * The visibility of a form. 1490 * 1491 * @enum { number } 1492 * @syscap SystemCapability.Ability.Form 1493 * @since 9 1494 */ 1495 /** 1496 * The visibility of a form. 1497 * 1498 * @enum { number } 1499 * @syscap SystemCapability.Ability.Form 1500 * @atomicservice 1501 * @since arkts {'1.1':'11', '1.2':'20'} 1502 * @arkts 1.1&1.2 1503 */ 1504 enum VisibilityType { 1505 /** 1506 * Indicates the type of the form type is unknown. 1507 * Often used as a condition variable in function OnVisibilityChange to specify actions only on forms that are 1508 * changing to unknown. 1509 * 1510 * @syscap SystemCapability.Ability.Form 1511 * @since 10 1512 */ 1513 /** 1514 * Indicates the type of the form type is unknown. 1515 * Often used as a condition variable in function OnVisibilityChange to specify actions only on forms that are 1516 * changing to unknown. 1517 * 1518 * @syscap SystemCapability.Ability.Form 1519 * @atomicservice 1520 * @since arkts {'1.1':'11', '1.2':'20'} 1521 * @arkts 1.1&1.2 1522 */ 1523 UNKNOWN = 0, 1524 /** 1525 * Indicates the type of the form is visible. 1526 * Often used as a condition variable in function OnVisibilityChange to specify actions only on forms that are 1527 * changing to visible. 1528 * 1529 * @syscap SystemCapability.Ability.Form 1530 * @since 9 1531 */ 1532 /** 1533 * Indicates the type of the form is visible. 1534 * Often used as a condition variable in function OnVisibilityChange to specify actions only on forms that are 1535 * changing to visible. 1536 * 1537 * @syscap SystemCapability.Ability.Form 1538 * @atomicservice 1539 * @since arkts {'1.1':'11', '1.2':'20'} 1540 * @arkts 1.1&1.2 1541 */ 1542 FORM_VISIBLE = 1, 1543 /** 1544 * Indicates the type of the form is invisible. 1545 * Often used as a condition variable in function OnVisibilityChange to specify actions only on forms that are 1546 * changing to invisible. 1547 * 1548 * @syscap SystemCapability.Ability.Form 1549 * @since 9 1550 */ 1551 /** 1552 * Indicates the type of the form is invisible. 1553 * Often used as a condition variable in function OnVisibilityChange to specify actions only on forms that are 1554 * changing to invisible. 1555 * 1556 * @syscap SystemCapability.Ability.Form 1557 * @atomicservice 1558 * @since arkts {'1.1':'11', '1.2':'20'} 1559 * @arkts 1.1&1.2 1560 */ 1561 FORM_INVISIBLE = 2 1562 } 1563 1564 /** 1565 * Indicates the launch reason of a form. 1566 * 1567 * @enum { number } 1568 * @syscap SystemCapability.Ability.Form 1569 * @since 10 1570 */ 1571 /** 1572 * Indicates the launch reason of a form. 1573 * 1574 * @enum { number } 1575 * @syscap SystemCapability.Ability.Form 1576 * @atomicservice 1577 * @since arkts {'1.1':'11', '1.2':'20'} 1578 * @arkts 1.1&1.2 1579 */ 1580 enum LaunchReason { 1581 /** 1582 * Indicates the launch reason of a form is default. 1583 * 1584 * @syscap SystemCapability.Ability.Form 1585 * @since 10 1586 */ 1587 /** 1588 * Indicates the launch reason of a form is default. 1589 * 1590 * @syscap SystemCapability.Ability.Form 1591 * @atomicservice 1592 * @since arkts {'1.1':'11', '1.2':'20'} 1593 * @arkts 1.1&1.2 1594 */ 1595 FORM_DEFAULT = 1, 1596 /** 1597 * Indicates the launch reason of a form is share. 1598 * 1599 * @syscap SystemCapability.Ability.Form 1600 * @since 10 1601 */ 1602 /** 1603 * Indicates the launch reason of a form is share. 1604 * 1605 * @syscap SystemCapability.Ability.Form 1606 * @atomicservice 1607 * @since arkts {'1.1':'11', '1.2':'20'} 1608 * @arkts 1.1&1.2 1609 */ 1610 FORM_SHARE = 2, 1611 /** 1612 * Indicates the launch reason of a form is change size. 1613 * 1614 * @syscap SystemCapability.Ability.Form 1615 * @atomicservice 1616 * @since 20 1617 */ 1618 FORM_SIZE_CHANGE = 3 1619 } 1620 1621 /** 1622 * The result of publish form. 1623 * 1624 * @typedef PublishFormResult 1625 * @syscap SystemCapability.Ability.Form 1626 * @systemapi 1627 * @stagemodelonly 1628 * @since arkts {'1.1':'12', '1.2':'20'} 1629 * @arkts 1.1&1.2 1630 */ 1631 interface PublishFormResult { 1632 /** 1633 * The error code. 1634 * 1635 * @type { PublishFormErrorCode } 1636 * @syscap SystemCapability.Ability.Form 1637 * @systemapi 1638 * @stagemodelonly 1639 * @since arkts {'1.1':'12', '1.2':'20'} 1640 * @arkts 1.1&1.2 1641 */ 1642 code: PublishFormErrorCode; 1643 1644 /** 1645 * The message. 1646 * 1647 * @type { string } 1648 * @syscap SystemCapability.Ability.Form 1649 * @systemapi 1650 * @stagemodelonly 1651 * @since arkts {'1.1':'12', '1.2':'20'} 1652 * @arkts 1.1&1.2 1653 */ 1654 message: string; 1655 } 1656 1657 /** 1658 * The error code of publish form. 1659 * 1660 * @enum { number } 1661 * @syscap SystemCapability.Ability.Form 1662 * @systemapi 1663 * @stagemodelonly 1664 * @since arkts {'1.1':'12', '1.2':'20'} 1665 * @arkts 1.1&1.2 1666 */ 1667 enum PublishFormErrorCode { 1668 /** 1669 * Publish form success. 1670 * 1671 * @syscap SystemCapability.Ability.Form 1672 * @systemapi 1673 * @stagemodelonly 1674 * @since arkts {'1.1':'12', '1.2':'20'} 1675 * @arkts 1.1&1.2 1676 */ 1677 SUCCESS = 0, 1678 1679 /** 1680 * Host has no space to publish form. 1681 * 1682 * @syscap SystemCapability.Ability.Form 1683 * @systemapi 1684 * @stagemodelonly 1685 * @since arkts {'1.1':'12', '1.2':'20'} 1686 * @arkts 1.1&1.2 1687 */ 1688 NO_SPACE = 1, 1689 1690 /** 1691 * Check param failed. 1692 * 1693 * @syscap SystemCapability.Ability.Form 1694 * @systemapi 1695 * @stagemodelonly 1696 * @since arkts {'1.1':'12', '1.2':'20'} 1697 * @arkts 1.1&1.2 1698 */ 1699 PARAM_ERROR = 2, 1700 1701 /** 1702 * Internal error occurs during form processing. 1703 * 1704 * @syscap SystemCapability.Ability.Form 1705 * @systemapi 1706 * @stagemodelonly 1707 * @since arkts {'1.1':'12', '1.2':'20'} 1708 * @arkts 1.1&1.2 1709 */ 1710 INTERNAL_ERROR = 3 1711 } 1712 1713 /** 1714 * Information about a running form. 1715 * 1716 * @typedef FormProviderFilter 1717 * @syscap SystemCapability.Ability.Form 1718 * @systemapi 1719 * @stagemodelonly 1720 * @since arkts {'1.1':'10', '1.2':'20'} 1721 * @arkts 1.1&1.2 1722 */ 1723 interface FormProviderFilter { 1724 /** 1725 * Obtains the bundle name of the provider application. 1726 * 1727 * @type { string } 1728 * @syscap SystemCapability.Ability.Form 1729 * @systemapi 1730 * @stagemodelonly 1731 * @since arkts {'1.1':'10', '1.2':'20'} 1732 * @arkts 1.1&1.2 1733 */ 1734 bundleName: string; 1735 1736 /** 1737 * Obtains the form name of the provider application form. 1738 * 1739 * @type { ?string } 1740 * @syscap SystemCapability.Ability.Form 1741 * @systemapi 1742 * @stagemodelonly 1743 * @since arkts {'1.1':'10', '1.2':'20'} 1744 * @arkts 1.1&1.2 1745 */ 1746 formName ?: string; 1747 1748 /** 1749 * Obtains the module name of the provider application module. 1750 * 1751 * @type { ?string } 1752 * @syscap SystemCapability.Ability.Form 1753 * @systemapi 1754 * @stagemodelonly 1755 * @since arkts {'1.1':'10', '1.2':'20'} 1756 * @arkts 1.1&1.2 1757 */ 1758 moduleName ?: string; 1759 1760 /** 1761 * Obtains the ability name of the provider application module. 1762 * 1763 * @type { ?string } 1764 * @syscap SystemCapability.Ability.Form 1765 * @systemapi 1766 * @stagemodelonly 1767 * @since arkts {'1.1':'10', '1.2':'20'} 1768 * @arkts 1.1&1.2 1769 */ 1770 abilityName ?: string; 1771 1772 /** 1773 * Indicates whether to include unused form. 1774 * 1775 * @type { ?boolean } 1776 * @default false 1777 * @syscap SystemCapability.Ability.Form 1778 * @systemapi 1779 * @stagemodelonly 1780 * @since arkts {'1.1':'11', '1.2':'20'} 1781 * @arkts 1.1&1.2 1782 */ 1783 isUnusedIncluded?: boolean; 1784 } 1785 1786 /** 1787 * The class of a running form information. 1788 * 1789 * @typedef RunningFormInfo 1790 * @syscap SystemCapability.Ability.Form 1791 * @systemapi hide this for inner system use 1792 * @since 10 1793 */ 1794 /** 1795 * The class of a running form information. 1796 * 1797 * @typedef RunningFormInfo 1798 * @syscap SystemCapability.Ability.Form 1799 * @atomicservice 1800 * @since 20 1801 * @arkts 1.1&1.2 1802 */ 1803 interface RunningFormInfo { 1804 /** 1805 * Obtains the id of the this form. 1806 * 1807 * @type { string } 1808 * @readonly 1809 * @default - 1810 * @syscap SystemCapability.Ability.Form 1811 * @systemapi 1812 * @since 10 1813 */ 1814 /** 1815 * Obtains the id of the this form. 1816 * 1817 * @type { string } 1818 * @readonly 1819 * @default - 1820 * @syscap SystemCapability.Ability.Form 1821 * @atomicservice 1822 * @since 20 1823 * @arkts 1.1&1.2 1824 */ 1825 readonly formId: string; 1826 1827 /** 1828 * Obtains the bundle name of the application to which this form belongs. 1829 * 1830 * @type { string } 1831 * @readonly 1832 * @default - 1833 * @syscap SystemCapability.Ability.Form 1834 * @systemapi 1835 * @since 10 1836 */ 1837 /** 1838 * Obtains the bundle name of the application to which this form belongs. 1839 * 1840 * @type { string } 1841 * @readonly 1842 * @default - 1843 * @syscap SystemCapability.Ability.Form 1844 * @atomicservice 1845 * @since 20 1846 * @arkts 1.1&1.2 1847 */ 1848 readonly bundleName: string; 1849 1850 /** 1851 * Obtains the bundle name of the form host application. 1852 * 1853 * @type { string } 1854 * @readonly 1855 * @default - 1856 * @syscap SystemCapability.Ability.Form 1857 * @systemapi 1858 * @since arkts {'1.1':'10', '1.2':'20'} 1859 * @arkts 1.1&1.2 1860 */ 1861 readonly hostBundleName: string; 1862 1863 /** 1864 * The location of this form. 1865 * 1866 * @type { FormLocation } 1867 * @readonly 1868 * @default - 1869 * @syscap SystemCapability.Ability.Form 1870 * @systemapi 1871 * @since 12 1872 */ 1873 /** 1874 * The location of this form. 1875 * 1876 * @type { FormLocation } 1877 * @readonly 1878 * @default - 1879 * @syscap SystemCapability.Ability.Form 1880 * @atomicservice 1881 * @since 20 1882 * @arkts 1.1&1.2 1883 */ 1884 readonly formLocation: FormLocation; 1885 1886 /** 1887 * Obtains the visibility of this form. 1888 * 1889 * @type { VisibilityType } 1890 * @readonly 1891 * @default - 1892 * @syscap SystemCapability.Ability.Form 1893 * @systemapi 1894 * @since arkts {'1.1':'10', '1.2':'20'} 1895 * @arkts 1.1&1.2 1896 */ 1897 readonly visibilityType: VisibilityType; 1898 1899 /** 1900 * Obtains the name of the application module to which this form belongs. 1901 * 1902 * @type { string } 1903 * @readonly 1904 * @default - 1905 * @syscap SystemCapability.Ability.Form 1906 * @systemapi 1907 * @since 10 1908 */ 1909 /** 1910 * Obtains the name of the application module to which this form belongs. 1911 * 1912 * @type { string } 1913 * @readonly 1914 * @default - 1915 * @syscap SystemCapability.Ability.Form 1916 * @atomicservice 1917 * @since 20 1918 * @arkts 1.1&1.2 1919 */ 1920 readonly moduleName: string; 1921 1922 /** 1923 * Obtains the class name of the ability to which this form belongs. 1924 * 1925 * @type { string } 1926 * @readonly 1927 * @default - 1928 * @syscap SystemCapability.Ability.Form 1929 * @systemapi 1930 * @since 10 1931 */ 1932 /** 1933 * Obtains the class name of the ability to which this form belongs. 1934 * 1935 * @type { string } 1936 * @readonly 1937 * @default - 1938 * @syscap SystemCapability.Ability.Form 1939 * @atomicservice 1940 * @since 20 1941 * @arkts 1.1&1.2 1942 */ 1943 readonly abilityName: string; 1944 1945 /** 1946 * Obtains the name of this form. 1947 * 1948 * @type { string } 1949 * @readonly 1950 * @default - 1951 * @syscap SystemCapability.Ability.Form 1952 * @systemapi 1953 * @since 10 1954 */ 1955 /** 1956 * Obtains the name of this form. 1957 * 1958 * @type { string } 1959 * @readonly 1960 * @default - 1961 * @syscap SystemCapability.Ability.Form 1962 * @atomicservice 1963 * @since 20 1964 * @arkts 1.1&1.2 1965 */ 1966 readonly formName: string; 1967 1968 /** 1969 * Obtains the grid style of this form. 1970 * 1971 * @type { number } 1972 * @default - 1973 * @readonly 1974 * @syscap SystemCapability.Ability.Form 1975 * @systemapi 1976 * @since 10 1977 */ 1978 /** 1979 * Obtains the grid style of this form. 1980 * 1981 * @type { int } 1982 * @default - 1983 * @readonly 1984 * @syscap SystemCapability.Ability.Form 1985 * @atomicservice 1986 * @since 20 1987 * @arkts 1.1&1.2 1988 */ 1989 readonly dimension: number; 1990 1991 /** 1992 * Obtains the stage of form use. 1993 * 1994 * @type { FormUsageState } 1995 * @default FormUsageState.USED 1996 * @readonly 1997 * @syscap SystemCapability.Ability.Form 1998 * @systemapi 1999 * @since arkts {'1.1':'11', '1.2':'20'} 2000 * @arkts 1.1&1.2 2001 */ 2002 readonly formUsageState: FormUsageState; 2003 2004 /** 2005 * Obtains the description of this form. 2006 * 2007 * @type { string } 2008 * @readonly 2009 * @syscap SystemCapability.Ability.Form 2010 * @systemapi 2011 * @since arkts {'1.1':'11', '1.2':'20'} 2012 * @arkts 1.1&1.2 2013 */ 2014 readonly formDescription: string; 2015 2016 /** 2017 * Obtains the extra data of the this form. 2018 * 2019 * @type { ?Record<string, Object> } 2020 * @default - 2021 * @readonly 2022 * @syscap SystemCapability.Ability.Form 2023 * @systemapi 2024 * @since arkts {'1.1':'12', '1.2':'20'} 2025 * @arkts 1.1&1.2 2026 */ 2027 readonly extraData?: Record<string, Object>; 2028 } 2029 2030 /** 2031 * The stage of form use. 2032 * 2033 * @enum { number } 2034 * @syscap SystemCapability.Ability.Form 2035 * @systemapi 2036 * @since arkts {'1.1':'11', '1.2':'20'} 2037 * @arkts 1.1&1.2 2038 */ 2039 enum FormUsageState { 2040 /** 2041 * Indicates the stage of the form is used. 2042 * 2043 * @syscap SystemCapability.Ability.Form 2044 * @systemapi 2045 * @since arkts {'1.1':'11', '1.2':'20'} 2046 * @arkts 1.1&1.2 2047 */ 2048 USED = 0, 2049 /** 2050 * Indicates the stage of the form is unused. 2051 * 2052 * @syscap SystemCapability.Ability.Form 2053 * @systemapi 2054 * @since arkts {'1.1':'11', '1.2':'20'} 2055 * @arkts 1.1&1.2 2056 */ 2057 UNUSED = 1 2058 } 2059 2060 /** 2061 * Defines the FormLocation enum. 2062 * 2063 * @enum { int } 2064 * @syscap SystemCapability.Ability.Form 2065 * @systemapi 2066 * @since 12 2067 */ 2068 /** 2069 * Defines the FormLocation enum. 2070 * 2071 * @enum { int } 2072 * @syscap SystemCapability.Ability.Form 2073 * @atomicservice 2074 * @since 20 2075 * @arkts 1.1&1.2 2076 */ 2077 enum FormLocation { 2078 /** 2079 * Form is on the other location. 2080 * 2081 * @syscap SystemCapability.Ability.Form 2082 * @systemapi 2083 * @since arkts {'1.1':'12', '1.2':'20'} 2084 * @arkts 1.1&1.2 2085 */ 2086 OTHER = -1, 2087 2088 /** 2089 * Form is on the desktop 2090 * 2091 * @syscap SystemCapability.Ability.Form 2092 * @systemapi 2093 * @since 12 2094 */ 2095 /** 2096 * Form is on the desktop 2097 * 2098 * @syscap SystemCapability.Ability.Form 2099 * @atomicservice 2100 * @since 20 2101 * @arkts 1.1&1.2 2102 */ 2103 DESKTOP = 0, 2104 2105 /** 2106 * Form is on the form center. 2107 * 2108 * @syscap SystemCapability.Ability.Form 2109 * @systemapi 2110 * @since 12 2111 */ 2112 /** 2113 * Form is on the form center. 2114 * 2115 * @syscap SystemCapability.Ability.Form 2116 * @atomicservice 2117 * @since 20 2118 * @arkts 1.1&1.2 2119 */ 2120 FORM_CENTER = 1, 2121 2122 /** 2123 * Form is on the form manager. 2124 * 2125 * @syscap SystemCapability.Ability.Form 2126 * @systemapi 2127 * @since 12 2128 */ 2129 /** 2130 * Form is on the form manager. 2131 * 2132 * @syscap SystemCapability.Ability.Form 2133 * @atomicservice 2134 * @since 20 2135 * @arkts 1.1&1.2 2136 */ 2137 FORM_MANAGER = 2, 2138 2139 /** 2140 * Form is on the negative screen. 2141 * 2142 * @syscap SystemCapability.Ability.Form 2143 * @systemapi 2144 * @since 12 2145 */ 2146 /** 2147 * Form is on the negative screen. 2148 * 2149 * @syscap SystemCapability.Ability.Form 2150 * @atomicservice 2151 * @since 20 2152 * @arkts 1.1&1.2 2153 */ 2154 NEGATIVE_SCREEN = 3, 2155 2156 /** 2157 * Form is on the form center of negative screen. 2158 * 2159 * @syscap SystemCapability.Ability.Form 2160 * @systemapi 2161 * @since arkts {'1.1':'12', '1.2':'20'} 2162 * @arkts 1.1&1.2 2163 */ 2164 FORM_CENTER_NEGATIVE_SCREEN = 4, 2165 2166 /** 2167 * Form is on the form manager of negative screen. 2168 * 2169 * @syscap SystemCapability.Ability.Form 2170 * @systemapi 2171 * @since arkts {'1.1':'12', '1.2':'20'} 2172 * @arkts 1.1&1.2 2173 */ 2174 FORM_MANAGER_NEGATIVE_SCREEN = 5, 2175 2176 /** 2177 * Form is on the screen lock. 2178 * 2179 * @syscap SystemCapability.Ability.Form 2180 * @systemapi 2181 * @since 12 2182 */ 2183 /** 2184 * Form is on the screen lock. 2185 * 2186 * @syscap SystemCapability.Ability.Form 2187 * @atomicservice 2188 * @since 20 2189 * @arkts 1.1&1.2 2190 */ 2191 SCREEN_LOCK = 6, 2192 2193 /** 2194 * Form is on the ai suggestion. 2195 * 2196 * @syscap SystemCapability.Ability.Form 2197 * @systemapi 2198 * @since 12 2199 */ 2200 /** 2201 * Form is on the ai suggestion. 2202 * 2203 * @syscap SystemCapability.Ability.Form 2204 * @atomicservice 2205 * @since 20 2206 * @arkts 1.1&1.2 2207 */ 2208 AI_SUGGESTION = 7, 2209 } 2210 2211 /** 2212 * Provides OverflowInfo about funInteraction or sceneAniamtion form 2213 * 2214 * @typedef { OverflowInfo } 2215 * @syscap SystemCapability.Ability.Form 2216 * @atomicservice 2217 * @since 20 2218 */ 2219 interface OverflowInfo { 2220 /** 2221 * The overflow animation area 2222 * 2223 * @type { Rect } 2224 * @syscap SystemCapability.Ability.Form 2225 * @atomicservice 2226 * @since 20 2227 */ 2228 area: Rect; 2229 2230 /** 2231 * The overflow animation duration 2232 * 2233 * @type { number } 2234 * @syscap SystemCapability.Ability.Form 2235 * @atomicservice 2236 * @since 20 2237 */ 2238 duration: number; 2239 2240 /** 2241 * Whether use default animation, default is true 2242 * 2243 * @type { ?boolean } 2244 * @syscap SystemCapability.Ability.Form 2245 * @atomicservice 2246 * @since 20 2247 */ 2248 useDefaultAnimation?: boolean; 2249 } 2250 2251 /** 2252 * Provides OverflowRequest about request/cancel form's overflow 2253 * 2254 * @typedef { OverflowRequest } 2255 * @syscap SystemCapability.Ability.Form 2256 * @systemapi 2257 * @since 20 2258 */ 2259 interface OverflowRequest { 2260 /** 2261 * The form id about request/cancel overflow animation 2262 * 2263 * @type { string } 2264 * @syscap SystemCapability.Ability.Form 2265 * @systemapi 2266 * @since 20 2267 */ 2268 formId: string; 2269 2270 /** 2271 * Whether the form request or cancel overflow animation 2272 * 2273 * @type { boolean } 2274 * @syscap SystemCapability.Ability.Form 2275 * @systemapi 2276 * @since 20 2277 */ 2278 isOverflow: boolean; 2279 2280 /** 2281 * The form's overflow animation paramter 2282 * 2283 * @type { ?OverflowInfo } 2284 * @syscap SystemCapability.Ability.Form 2285 * @systemapi 2286 * @since 20 2287 */ 2288 overflowInfo?: OverflowInfo; 2289 } 2290 2291 /** 2292 * ChangeSceneAnimationStateRequest 2293 * 2294 * @typedef { ChangeSceneAnimationStateRequest } 2295 * @syscap SystemCapability.Ability.Form 2296 * @systemapi 2297 * @since 20 2298 */ 2299 interface ChangeSceneAnimationStateRequest { 2300 /** 2301 * The form id about request change scene animation state 2302 * 2303 * @type { string } 2304 * @syscap SystemCapability.Ability.Form 2305 * @systemapi 2306 * @since 20 2307 */ 2308 formId: string; 2309 2310 /** 2311 * The state of scene animation. 2312 * 2313 * @type { number } 2314 * @syscap SystemCapability.Ability.Form 2315 * @systemapi 2316 * @since 20 2317 */ 2318 state: number; 2319 } 2320 2321 /** 2322 * Indicates rectangle 2323 * 2324 * @typedef { Rect } 2325 * @syscap SystemCapability.Ability.Form 2326 * @atomicservice 2327 * @since 20 2328 */ 2329 interface Rect { 2330 /** 2331 * The left position of rect 2332 * 2333 * @type { number } 2334 * @syscap SystemCapability.Ability.Form 2335 * @atomicservice 2336 * @since 20 2337 */ 2338 left: number; 2339 2340 /** 2341 * The top position of rect 2342 * 2343 * @type { number } 2344 * @syscap SystemCapability.Ability.Form 2345 * @atomicservice 2346 * @since 20 2347 */ 2348 top: number; 2349 2350 /** 2351 * The width of rect 2352 * 2353 * @type { number } 2354 * @syscap SystemCapability.Ability.Form 2355 * @atomicservice 2356 * @since 20 2357 */ 2358 width: number; 2359 2360 /** 2361 * The height of rect 2362 * 2363 * @type { number } 2364 * @syscap SystemCapability.Ability.Form 2365 * @atomicservice 2366 * @since 20 2367 */ 2368 height: number; 2369 } 2370 2371 /** 2372 * The fun interaction form params. 2373 * 2374 * @typedef { FunInteractionParams } 2375 * @syscap SystemCapability.Ability.Form 2376 * @systemapi 2377 * @since 20 2378 */ 2379 interface FunInteractionParams { 2380 /** 2381 * The ability name of the fun interaction form. 2382 * 2383 * @type { ?string } 2384 * @syscap SystemCapability.Ability.Form 2385 * @systemapi 2386 * @since 20 2387 */ 2388 abilityName?: string; 2389 2390 /** 2391 * The bundle name used by game engine. 2392 * 2393 * @type { string } 2394 * @syscap SystemCapability.Ability.Form 2395 * @systemapi 2396 * @since 20 2397 */ 2398 targetBundleName: string; 2399 2400 /** 2401 * The sub bundle name used by game engine. 2402 * 2403 * @type { string } 2404 * @syscap SystemCapability.Ability.Form 2405 * @systemapi 2406 * @since 20 2407 */ 2408 subBundleName: string; 2409 2410 /** 2411 * The duration of the fun interaction form will be paused if not operate, default is 10s 2412 * 2413 * @type { ?number } 2414 * @syscap SystemCapability.Ability.Form 2415 * @systemapi 2416 * @since 20 2417 */ 2418 keepStateDuration? :number; 2419 } 2420 2421 /** 2422 * The scene animation form params. 2423 * 2424 * @typedef { SceneAnimationParams } 2425 * @syscap SystemCapability.Ability.Form 2426 * @systemapi 2427 * @since 20 2428 */ 2429 interface SceneAnimationParams { 2430 /** 2431 * Ability name of the scene animation form. 2432 * 2433 * @type { string } 2434 * @syscap SystemCapability.Ability.Form 2435 * @systemapi 2436 * @since 20 2437 */ 2438 abilityName: string; 2439 2440 /** 2441 * Indicates disabled desktop behaviors, only takes effect for system app. 2442 * 2443 * @type { ?string } 2444 * @syscap SystemCapability.Ability.Form 2445 * @systemapi 2446 * @since 20 2447 */ 2448 disabledDesktopBehaviors?: string; 2449 } 2450 2451 /** 2452 * Get form rect info callback 2453 * 2454 * @typedef GetFormRectInfoCallback 2455 * @syscap SystemCapability.Ability.Form 2456 * @systemapi 2457 * @since 20 2458 */ 2459 interface GetFormRectInfoCallback { 2460 /** 2461 * Get form rect info 2462 * 2463 * @param { string } formId 2464 * @returns { Promise<formInfo.Rect> } 2465 * 2466 * @throws { BusinessError } 202 - The application is not a system application. 2467 * @syscap SystemCapability.Ability.Form 2468 * @systemapi 2469 * @since 20 2470 */ 2471 (formId: string): Promise<formInfo.Rect>; 2472 } 2473 2474 /** 2475 * Get live form status info callback 2476 * 2477 * @typedef GetLiveFormStatusCallback 2478 * @syscap SystemCapability.Ability.Form 2479 * @systemapi 2480 * @since 20 2481 */ 2482 interface GetLiveFormStatusCallback { 2483 /** 2484 * Get all live form status Record 2485 * 2486 * @returns { Record<string, string> } 2487 * @throws { BusinessError } 202 - The application is not a system application. 2488 * @syscap SystemCapability.Ability.Form 2489 * @systemapi 2490 * @since 20 2491 */ 2492 (): Record<string, string>; 2493 } 2494} 2495export default formInfo; 2496