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