1/* 2 * Copyright (c) 2022 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 AbilityKit 19 */ 20 21import { ApplicationInfo } from './ApplicationInfo'; 22import { Metadata } from './Metadata'; 23import bundleManager from './../@ohos.bundle.bundleManager'; 24import { Skill } from './Skill'; 25 26/** 27 * Obtains configuration information about an ability 28 * 29 * @typedef AbilityInfo 30 * @syscap SystemCapability.BundleManager.BundleFramework.Core 31 * @since 9 32 */ 33/** 34 * Obtains configuration information about an ability 35 * 36 * @typedef AbilityInfo 37 * @syscap SystemCapability.BundleManager.BundleFramework.Core 38 * @crossplatform 39 * @since 10 40 */ 41/** 42 * Obtains configuration information about an ability 43 * 44 * @typedef AbilityInfo 45 * @syscap SystemCapability.BundleManager.BundleFramework.Core 46 * @crossplatform 47 * @atomicservice 48 * @since 11 49 */ 50export interface AbilityInfo { 51 /** 52 * Indicates the name of the bundle containing the ability 53 * 54 * @type { string } 55 * @readonly 56 * @syscap SystemCapability.BundleManager.BundleFramework.Core 57 * @since 9 58 */ 59 /** 60 * Indicates the name of the bundle containing the ability 61 * 62 * @type { string } 63 * @readonly 64 * @syscap SystemCapability.BundleManager.BundleFramework.Core 65 * @crossplatform 66 * @since 10 67 */ 68 /** 69 * Indicates the name of the bundle containing the ability 70 * 71 * @type { string } 72 * @readonly 73 * @syscap SystemCapability.BundleManager.BundleFramework.Core 74 * @crossplatform 75 * @atomicservice 76 * @since 11 77 */ 78 readonly bundleName: string; 79 80 /** 81 * Indicates the name of the .hap package to which the capability belongs 82 * 83 * @type { string } 84 * @readonly 85 * @syscap SystemCapability.BundleManager.BundleFramework.Core 86 * @since 9 87 */ 88 /** 89 * Indicates the name of the .hap package to which the capability belongs 90 * 91 * @type { string } 92 * @readonly 93 * @syscap SystemCapability.BundleManager.BundleFramework.Core 94 * @crossplatform 95 * @since 10 96 */ 97 /** 98 * Indicates the name of the .hap package to which the capability belongs 99 * 100 * @type { string } 101 * @readonly 102 * @syscap SystemCapability.BundleManager.BundleFramework.Core 103 * @crossplatform 104 * @atomicservice 105 * @since 11 106 */ 107 readonly moduleName: string; 108 109 /** 110 * Ability simplified class name 111 * 112 * @type { string } 113 * @readonly 114 * @syscap SystemCapability.BundleManager.BundleFramework.Core 115 * @since 9 116 */ 117 /** 118 * Ability simplified class name 119 * 120 * @type { string } 121 * @readonly 122 * @syscap SystemCapability.BundleManager.BundleFramework.Core 123 * @crossplatform 124 * @since 10 125 */ 126 /** 127 * Ability simplified class name 128 * 129 * @type { string } 130 * @readonly 131 * @syscap SystemCapability.BundleManager.BundleFramework.Core 132 * @crossplatform 133 * @atomicservice 134 * @since 11 135 */ 136 readonly name: string; 137 138 /** 139 * Indicates the label of the ability 140 * 141 * @type { string } 142 * @readonly 143 * @syscap SystemCapability.BundleManager.BundleFramework.Core 144 * @since 9 145 */ 146 /** 147 * Indicates the label of the ability 148 * 149 * @type { string } 150 * @readonly 151 * @syscap SystemCapability.BundleManager.BundleFramework.Core 152 * @crossplatform 153 * @since 10 154 */ 155 /** 156 * Indicates the label of the ability 157 * 158 * @type { string } 159 * @readonly 160 * @syscap SystemCapability.BundleManager.BundleFramework.Core 161 * @crossplatform 162 * @atomicservice 163 * @since 11 164 */ 165 readonly label: string; 166 167 /** 168 * Indicates the label id of the ability 169 * 170 * @type { number } 171 * @readonly 172 * @syscap SystemCapability.BundleManager.BundleFramework.Core 173 * @since 9 174 */ 175 /** 176 * Indicates the label id of the ability 177 * 178 * @type { number } 179 * @readonly 180 * @syscap SystemCapability.BundleManager.BundleFramework.Core 181 * @crossplatform 182 * @since 10 183 */ 184 /** 185 * Indicates the label id of the ability 186 * 187 * @type { number } 188 * @readonly 189 * @syscap SystemCapability.BundleManager.BundleFramework.Core 190 * @crossplatform 191 * @atomicservice 192 * @since 11 193 */ 194 readonly labelId: number; 195 196 /** 197 * Indicates the ability 198 * 199 * @type { string } 200 * @readonly 201 * @syscap SystemCapability.BundleManager.BundleFramework.Core 202 * @since 9 203 */ 204 /** 205 * Indicates the ability 206 * 207 * @type { string } 208 * @readonly 209 * @syscap SystemCapability.BundleManager.BundleFramework.Core 210 * @crossplatform 211 * @since 10 212 */ 213 /** 214 * Indicates the ability 215 * 216 * @type { string } 217 * @readonly 218 * @syscap SystemCapability.BundleManager.BundleFramework.Core 219 * @crossplatform 220 * @atomicservice 221 * @since 11 222 */ 223 readonly description: string; 224 225 /** 226 * Indicates the description id of the ability 227 * 228 * @type { number } 229 * @readonly 230 * @syscap SystemCapability.BundleManager.BundleFramework.Core 231 * @since 9 232 */ 233 /** 234 * Indicates the description id of the ability 235 * 236 * @type { number } 237 * @readonly 238 * @syscap SystemCapability.BundleManager.BundleFramework.Core 239 * @crossplatform 240 * @since 10 241 */ 242 /** 243 * Indicates the description id of the ability 244 * 245 * @type { number } 246 * @readonly 247 * @syscap SystemCapability.BundleManager.BundleFramework.Core 248 * @crossplatform 249 * @atomicservice 250 * @since 11 251 */ 252 readonly descriptionId: number; 253 254 /** 255 * Indicates the icon of the ability 256 * 257 * @type { string } 258 * @readonly 259 * @syscap SystemCapability.BundleManager.BundleFramework.Core 260 * @since 9 261 */ 262 /** 263 * Indicates the icon of the ability 264 * 265 * @type { string } 266 * @readonly 267 * @syscap SystemCapability.BundleManager.BundleFramework.Core 268 * @crossplatform 269 * @since 10 270 */ 271 /** 272 * Indicates the icon of the ability 273 * 274 * @type { string } 275 * @readonly 276 * @syscap SystemCapability.BundleManager.BundleFramework.Core 277 * @crossplatform 278 * @atomicservice 279 * @since 11 280 */ 281 readonly icon: string; 282 283 /** 284 * Indicates the icon id of the ability 285 * 286 * @type { number } 287 * @readonly 288 * @syscap SystemCapability.BundleManager.BundleFramework.Core 289 * @since 9 290 */ 291 /** 292 * Indicates the icon id of the ability 293 * 294 * @type { number } 295 * @readonly 296 * @syscap SystemCapability.BundleManager.BundleFramework.Core 297 * @crossplatform 298 * @since 10 299 */ 300 /** 301 * Indicates the icon id of the ability 302 * 303 * @type { number } 304 * @readonly 305 * @syscap SystemCapability.BundleManager.BundleFramework.Core 306 * @crossplatform 307 * @atomicservice 308 * @since 11 309 */ 310 readonly iconId: number; 311 312 /** 313 * Process of ability, if user do not set it, the value equal application process 314 * 315 * @type { string } 316 * @readonly 317 * @syscap SystemCapability.BundleManager.BundleFramework.Core 318 * @since 9 319 */ 320 /** 321 * Process of ability, if user do not set it, the value equal application process 322 * 323 * @type { string } 324 * @readonly 325 * @syscap SystemCapability.BundleManager.BundleFramework.Core 326 * @atomicservice 327 * @since 11 328 */ 329 readonly process: string; 330 331 /** 332 * Indicates whether this ability can be called by other abilities 333 * 334 * @type { boolean } 335 * @readonly 336 * @syscap SystemCapability.BundleManager.BundleFramework.Core 337 * @since 9 338 */ 339 /** 340 * Indicates whether this ability can be called by other abilities 341 * 342 * @type { boolean } 343 * @readonly 344 * @syscap SystemCapability.BundleManager.BundleFramework.Core 345 * @atomicservice 346 * @since 11 347 */ 348 readonly exported: boolean; 349 350 /** 351 * Enumerates types of templates that can be used by an ability 352 * 353 * @type { bundleManager.AbilityType } 354 * @readonly 355 * @syscap SystemCapability.BundleManager.BundleFramework.Core 356 * @FAModelOnly 357 * @since 9 358 */ 359 readonly type: bundleManager.AbilityType; 360 361 /** 362 * Enumerates ability display orientations 363 * 364 * @type { bundleManager.DisplayOrientation } 365 * @readonly 366 * @syscap SystemCapability.BundleManager.BundleFramework.Core 367 * @since 9 368 */ 369 /** 370 * Enumerates ability display orientations 371 * 372 * @type { bundleManager.DisplayOrientation } 373 * @readonly 374 * @syscap SystemCapability.BundleManager.BundleFramework.Core 375 * @atomicservice 376 * @since 11 377 */ 378 readonly orientation: bundleManager.DisplayOrientation; 379 380 /** 381 * Enumerates ability launch type 382 * 383 * @type { bundleManager.LaunchType } 384 * @readonly 385 * @syscap SystemCapability.BundleManager.BundleFramework.Core 386 * @since 9 387 */ 388 /** 389 * Enumerates ability launch type 390 * 391 * @type { bundleManager.LaunchType } 392 * @readonly 393 * @syscap SystemCapability.BundleManager.BundleFramework.Core 394 * @crossplatform 395 * @since 10 396 */ 397 /** 398 * Enumerates ability launch type 399 * 400 * @type { bundleManager.LaunchType } 401 * @readonly 402 * @syscap SystemCapability.BundleManager.BundleFramework.Core 403 * @crossplatform 404 * @atomicservice 405 * @since 11 406 */ 407 readonly launchType: bundleManager.LaunchType; 408 409 /** 410 * The permissions that others need to launch this ability 411 * 412 * @type { Array<string> } 413 * @readonly 414 * @syscap SystemCapability.BundleManager.BundleFramework.Core 415 * @since 9 416 */ 417 /** 418 * The permissions that others need to launch this ability 419 * 420 * @type { Array<string> } 421 * @readonly 422 * @syscap SystemCapability.BundleManager.BundleFramework.Core 423 * @atomicservice 424 * @since 11 425 */ 426 readonly permissions: Array<string>; 427 428 /** 429 * Indicates the permission required for reading ability data 430 * 431 * @type { string } 432 * @readonly 433 * @syscap SystemCapability.BundleManager.BundleFramework.Core 434 * @FAModelOnly 435 * @since 9 436 */ 437 readonly readPermission: string; 438 439 /** 440 * Indicates the permission required for writing data to the ability 441 * 442 * @type { string } 443 * @readonly 444 * @syscap SystemCapability.BundleManager.BundleFramework.Core 445 * @FAModelOnly 446 * @since 9 447 */ 448 readonly writePermission: string; 449 450 /** 451 * Uri of ability 452 * 453 * @type { string } 454 * @readonly 455 * @syscap SystemCapability.BundleManager.BundleFramework.Core 456 * @FAModelOnly 457 * @since 9 458 */ 459 readonly uri: string; 460 461 /** 462 * The device types that this ability can run on 463 * 464 * @type { Array<string> } 465 * @readonly 466 * @syscap SystemCapability.BundleManager.BundleFramework.Core 467 * @since 9 468 */ 469 /** 470 * The device types that this ability can run on 471 * 472 * @type { Array<string> } 473 * @readonly 474 * @syscap SystemCapability.BundleManager.BundleFramework.Core 475 * @atomicservice 476 * @since 11 477 */ 478 readonly deviceTypes: Array<string>; 479 480 /** 481 * Obtains configuration information about an application 482 * 483 * @type { ApplicationInfo } 484 * @readonly 485 * @syscap SystemCapability.BundleManager.BundleFramework.Core 486 * @since 9 487 */ 488 /** 489 * Obtains configuration information about an application 490 * 491 * @type { ApplicationInfo } 492 * @readonly 493 * @syscap SystemCapability.BundleManager.BundleFramework.Core 494 * @crossplatform 495 * @since 10 496 */ 497 /** 498 * Obtains configuration information about an application 499 * 500 * @type { ApplicationInfo } 501 * @readonly 502 * @syscap SystemCapability.BundleManager.BundleFramework.Core 503 * @crossplatform 504 * @atomicservice 505 * @since 11 506 */ 507 readonly applicationInfo: ApplicationInfo; 508 509 /** 510 * Indicates the metadata of ability 511 * 512 * @type { Array<Metadata> } 513 * @readonly 514 * @syscap SystemCapability.BundleManager.BundleFramework.Core 515 * @since 9 516 */ 517 /** 518 * Indicates the metadata of ability 519 * 520 * @type { Array<Metadata> } 521 * @readonly 522 * @syscap SystemCapability.BundleManager.BundleFramework.Core 523 * @crossplatform 524 * @since 10 525 */ 526 /** 527 * Indicates the metadata of ability 528 * 529 * @type { Array<Metadata> } 530 * @readonly 531 * @syscap SystemCapability.BundleManager.BundleFramework.Core 532 * @crossplatform 533 * @atomicservice 534 * @since 11 535 */ 536 readonly metadata: Array<Metadata>; 537 538 /** 539 * Indicates whether the ability is enabled 540 * 541 * @type { boolean } 542 * @readonly 543 * @syscap SystemCapability.BundleManager.BundleFramework.Core 544 * @since 9 545 */ 546 /** 547 * Indicates whether the ability is enabled 548 * 549 * @type { boolean } 550 * @readonly 551 * @syscap SystemCapability.BundleManager.BundleFramework.Core 552 * @atomicservice 553 * @since 11 554 */ 555 readonly enabled: boolean; 556 557 /** 558 * Indicates which window mode is supported 559 * 560 * @type { Array<bundleManager.SupportWindowMode> } 561 * @readonly 562 * @syscap SystemCapability.BundleManager.BundleFramework.Core 563 * @since 9 564 */ 565 /** 566 * Indicates which window mode is supported 567 * 568 * @type { Array<bundleManager.SupportWindowMode> } 569 * @readonly 570 * @syscap SystemCapability.BundleManager.BundleFramework.Core 571 * @atomicservice 572 * @since 11 573 */ 574 readonly supportWindowModes: Array<bundleManager.SupportWindowMode>; 575 576 /** 577 * Indicates window size 578 * 579 * @type { WindowSize } 580 * @readonly 581 * @syscap SystemCapability.BundleManager.BundleFramework.Core 582 * @since 9 583 */ 584 /** 585 * Indicates window size 586 * 587 * @type { WindowSize } 588 * @readonly 589 * @syscap SystemCapability.BundleManager.BundleFramework.Core 590 * @atomicservice 591 * @since 11 592 */ 593 readonly windowSize: WindowSize; 594 595 /** 596 * Indicates whether to hide the application icon from the dock area 597 * 598 * @type { boolean } 599 * @readonly 600 * @syscap SystemCapability.BundleManager.BundleFramework.Core 601 * @atomicservice 602 * @since 12 603 */ 604 readonly excludeFromDock: boolean; 605 606 /** 607 * Indicates skills of the ability 608 * 609 * @type { Array<Skill> } 610 * @readonly 611 * @syscap SystemCapability.BundleManager.BundleFramework.Core 612 * @atomicservice 613 * @since 12 614 */ 615 readonly skills: Array<Skill>; 616 617 /** 618 * Indicates the appIndex of application, only work in clone app mode 619 * 620 * @type { number } 621 * @readonly 622 * @syscap SystemCapability.BundleManager.BundleFramework.Core 623 * @since 12 624 */ 625 readonly appIndex: number; 626 627 /** 628 * Indicates the orientation id of the ability 629 * 630 * @type { number } 631 * @readonly 632 * @syscap SystemCapability.BundleManager.BundleFramework.Core 633 * @atomicservice 634 * @since 14 635 */ 636 readonly orientationId: number; 637} 638 639/** 640 * Indicates the window size. 641 * 642 * @typedef WindowSize 643 * @syscap SystemCapability.BundleManager.BundleFramework.Core 644 * @since 9 645 */ 646/** 647 * Indicates the window size. 648 * 649 * @typedef WindowSize 650 * @syscap SystemCapability.BundleManager.BundleFramework.Core 651 * @atomicservice 652 * @since 11 653 */ 654export interface WindowSize { 655 /** 656 * Indicates maximum ratio of width over height of window under free window status. 657 * 658 * @type { number } 659 * @readonly 660 * @syscap SystemCapability.BundleManager.BundleFramework.Core 661 * @since 9 662 */ 663 /** 664 * Indicates maximum ratio of width over height of window under free window status. 665 * 666 * @type { number } 667 * @readonly 668 * @syscap SystemCapability.BundleManager.BundleFramework.Core 669 * @atomicservice 670 * @since 11 671 */ 672 readonly maxWindowRatio: number; 673 674 /** 675 * Indicates minimum ratio of width over height of window under free window status. 676 * 677 * @type { number } 678 * @readonly 679 * @syscap SystemCapability.BundleManager.BundleFramework.Core 680 * @since 9 681 */ 682 /** 683 * Indicates minimum ratio of width over height of window under free window status. 684 * 685 * @type { number } 686 * @readonly 687 * @syscap SystemCapability.BundleManager.BundleFramework.Core 688 * @atomicservice 689 * @since 11 690 */ 691 readonly minWindowRatio: number; 692 693 /** 694 * Indicates maximum width of window under free window status. 695 * 696 * @type { number } 697 * @readonly 698 * @syscap SystemCapability.BundleManager.BundleFramework.Core 699 * @since 9 700 */ 701 /** 702 * Indicates maximum width of window under free window status. 703 * 704 * @type { number } 705 * @readonly 706 * @syscap SystemCapability.BundleManager.BundleFramework.Core 707 * @atomicservice 708 * @since 11 709 */ 710 readonly maxWindowWidth: number; 711 712 /** 713 * Indicates minimum width of window under free window status. 714 * 715 * @type { number } 716 * @readonly 717 * @syscap SystemCapability.BundleManager.BundleFramework.Core 718 * @since 9 719 */ 720 /** 721 * Indicates minimum width of window under free window status. 722 * 723 * @type { number } 724 * @readonly 725 * @syscap SystemCapability.BundleManager.BundleFramework.Core 726 * @atomicservice 727 * @since 11 728 */ 729 readonly minWindowWidth: number; 730 731 /** 732 * Indicates maximum height of window under free window status. 733 * 734 * @type { number } 735 * @readonly 736 * @syscap SystemCapability.BundleManager.BundleFramework.Core 737 * @since 9 738 */ 739 /** 740 * Indicates maximum height of window under free window status. 741 * 742 * @type { number } 743 * @readonly 744 * @syscap SystemCapability.BundleManager.BundleFramework.Core 745 * @atomicservice 746 * @since 11 747 */ 748 readonly maxWindowHeight: number; 749 750 /** 751 * Indicates minimum height of window under free window status. 752 * 753 * @type { number } 754 * @readonly 755 * @syscap SystemCapability.BundleManager.BundleFramework.Core 756 * @since 9 757 */ 758 /** 759 * Indicates minimum height of window under free window status. 760 * 761 * @type { number } 762 * @readonly 763 * @syscap SystemCapability.BundleManager.BundleFramework.Core 764 * @atomicservice 765 * @since 11 766 */ 767 readonly minWindowHeight: number; 768} 769