1/* 2 * Copyright (c) 2021-2023 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16/** 17 * @file 18 * @kit AbilityKit 19 */ 20 21import { AbilityInfo } from './AbilityInfo'; 22import { ExtensionAbilityInfo } from './ExtensionAbilityInfo'; 23import { Metadata } from './Metadata'; 24import bundleManager from './../@ohos.bundle.bundleManager'; 25 26/** 27 * Obtains configuration information about a hap module. 28 * 29 * @typedef HapModuleInfo 30 * @syscap SystemCapability.BundleManager.BundleFramework.Core 31 * @since 9 32 */ 33/** 34 * Obtains configuration information about a hap module. 35 * 36 * @typedef HapModuleInfo 37 * @syscap SystemCapability.BundleManager.BundleFramework.Core 38 * @crossplatform 39 * @since 10 40 */ 41/** 42 * Obtains configuration information about a hap module. 43 * 44 * @typedef HapModuleInfo 45 * @syscap SystemCapability.BundleManager.BundleFramework.Core 46 * @crossplatform 47 * @atomicservice 48 * @since 11 49 */ 50export interface HapModuleInfo { 51 /** 52 * Indicates the name of this hap module 53 * 54 * @type { string } 55 * @readonly 56 * @syscap SystemCapability.BundleManager.BundleFramework.Core 57 * @since 9 58 */ 59 /** 60 * Indicates the name of this hap module 61 * 62 * @type { string } 63 * @readonly 64 * @syscap SystemCapability.BundleManager.BundleFramework.Core 65 * @crossplatform 66 * @since 10 67 */ 68 /** 69 * Indicates the name of this hap module 70 * 71 * @type { string } 72 * @readonly 73 * @syscap SystemCapability.BundleManager.BundleFramework.Core 74 * @crossplatform 75 * @atomicservice 76 * @since 11 77 */ 78 readonly name: string; 79 80 /** 81 * Indicates the icon of this hap module 82 * 83 * @type { string } 84 * @readonly 85 * @syscap SystemCapability.BundleManager.BundleFramework.Core 86 * @since 9 87 */ 88 /** 89 * Indicates the icon of this hap module 90 * 91 * @type { string } 92 * @readonly 93 * @syscap SystemCapability.BundleManager.BundleFramework.Core 94 * @crossplatform 95 * @since 10 96 */ 97 /** 98 * Indicates the icon of this hap module 99 * 100 * @type { string } 101 * @readonly 102 * @syscap SystemCapability.BundleManager.BundleFramework.Core 103 * @crossplatform 104 * @atomicservice 105 * @since 11 106 */ 107 readonly icon: string; 108 109 /** 110 * Indicates the icon id of this hap module 111 * 112 * @type { number } 113 * @readonly 114 * @syscap SystemCapability.BundleManager.BundleFramework.Core 115 * @since 9 116 */ 117 /** 118 * Indicates the icon id of this hap module 119 * 120 * @type { number } 121 * @readonly 122 * @syscap SystemCapability.BundleManager.BundleFramework.Core 123 * @crossplatform 124 * @since 10 125 */ 126 /** 127 * Indicates the icon id of this hap module 128 * 129 * @type { number } 130 * @readonly 131 * @syscap SystemCapability.BundleManager.BundleFramework.Core 132 * @crossplatform 133 * @atomicservice 134 * @since 11 135 */ 136 readonly iconId: number; 137 138 /** 139 * Indicates the label of this hap module 140 * 141 * @type { string } 142 * @readonly 143 * @syscap SystemCapability.BundleManager.BundleFramework.Core 144 * @since 9 145 */ 146 /** 147 * Indicates the label of this hap module 148 * 149 * @type { string } 150 * @readonly 151 * @syscap SystemCapability.BundleManager.BundleFramework.Core 152 * @crossplatform 153 * @since 10 154 */ 155 /** 156 * Indicates the label of this hap module 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 this hap module 169 * 170 * @type { number } 171 * @readonly 172 * @syscap SystemCapability.BundleManager.BundleFramework.Core 173 * @since 9 174 */ 175 /** 176 * Indicates the label id of this hap module 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 this hap module 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 * Describes the hap module 198 * 199 * @type { string } 200 * @readonly 201 * @syscap SystemCapability.BundleManager.BundleFramework.Core 202 * @since 9 203 */ 204 /** 205 * Describes the hap module 206 * 207 * @type { string } 208 * @readonly 209 * @syscap SystemCapability.BundleManager.BundleFramework.Core 210 * @crossplatform 211 * @since 10 212 */ 213 /** 214 * Describes the hap module 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 of this hap module 227 * 228 * @type { number } 229 * @readonly 230 * @syscap SystemCapability.BundleManager.BundleFramework.Core 231 * @since 9 232 */ 233 /** 234 * Indicates the description of this hap module 235 * 236 * @type { number } 237 * @readonly 238 * @syscap SystemCapability.BundleManager.BundleFramework.Core 239 * @crossplatform 240 * @since 10 241 */ 242 /** 243 * Indicates the description of this hap module 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 main elementName of the hap module 256 * 257 * @type { string } 258 * @readonly 259 * @syscap SystemCapability.BundleManager.BundleFramework.Core 260 * @since 9 261 */ 262 /** 263 * Indicates main elementName of the hap module 264 * 265 * @type { string } 266 * @readonly 267 * @syscap SystemCapability.BundleManager.BundleFramework.Core 268 * @crossplatform 269 * @since 10 270 */ 271 /** 272 * Indicates main elementName of the hap module 273 * 274 * @type { string } 275 * @readonly 276 * @syscap SystemCapability.BundleManager.BundleFramework.Core 277 * @crossplatform 278 * @atomicservice 279 * @since 11 280 */ 281 readonly mainElementName: string; 282 283 /** 284 * Obtains configuration information about abilities 285 * 286 * @type { Array<AbilityInfo> } 287 * @readonly 288 * @syscap SystemCapability.BundleManager.BundleFramework.Core 289 * @since 9 290 */ 291 /** 292 * Obtains configuration information about abilities 293 * 294 * @type { Array<AbilityInfo> } 295 * @readonly 296 * @syscap SystemCapability.BundleManager.BundleFramework.Core 297 * @crossplatform 298 * @since 10 299 */ 300 /** 301 * Obtains configuration information about abilities 302 * 303 * @type { Array<AbilityInfo> } 304 * @readonly 305 * @syscap SystemCapability.BundleManager.BundleFramework.Core 306 * @crossplatform 307 * @atomicservice 308 * @since 11 309 */ 310 readonly abilitiesInfo: Array<AbilityInfo>; 311 312 /** 313 * Obtains configuration information about extension abilities 314 * 315 * @type { Array<ExtensionAbilityInfo> } 316 * @readonly 317 * @syscap SystemCapability.BundleManager.BundleFramework.Core 318 * @since 9 319 */ 320 /** 321 * Obtains configuration information about extension abilities 322 * 323 * @type { Array<ExtensionAbilityInfo> } 324 * @readonly 325 * @syscap SystemCapability.BundleManager.BundleFramework.Core 326 * @atomicservice 327 * @since 11 328 */ 329 readonly extensionAbilitiesInfo: Array<ExtensionAbilityInfo>; 330 331 /** 332 * Indicates the metadata of ability 333 * 334 * @type { Array<Metadata> } 335 * @readonly 336 * @syscap SystemCapability.BundleManager.BundleFramework.Core 337 * @since 9 338 */ 339 /** 340 * Indicates the metadata of ability 341 * 342 * @type { Array<Metadata> } 343 * @readonly 344 * @syscap SystemCapability.BundleManager.BundleFramework.Core 345 * @crossplatform 346 * @since 10 347 */ 348 /** 349 * Indicates the metadata of ability 350 * 351 * @type { Array<Metadata> } 352 * @readonly 353 * @syscap SystemCapability.BundleManager.BundleFramework.Core 354 * @crossplatform 355 * @atomicservice 356 * @since 11 357 */ 358 readonly metadata: Array<Metadata>; 359 360 /** 361 * The device types that this hap module can run on 362 * 363 * @type { Array<string> } 364 * @readonly 365 * @syscap SystemCapability.BundleManager.BundleFramework.Core 366 * @since 9 367 */ 368 /** 369 * The device types that this hap module can run on 370 * 371 * @type { Array<string> } 372 * @readonly 373 * @syscap SystemCapability.BundleManager.BundleFramework.Core 374 * @atomicservice 375 * @since 11 376 */ 377 readonly deviceTypes: Array<string>; 378 379 /** 380 * Indicates whether free installation of the hap module is supported 381 * 382 * @type { boolean } 383 * @readonly 384 * @syscap SystemCapability.BundleManager.BundleFramework.Core 385 * @since 9 386 */ 387 /** 388 * Indicates whether free installation of the hap module is supported 389 * 390 * @type { boolean } 391 * @readonly 392 * @syscap SystemCapability.BundleManager.BundleFramework.Core 393 * @atomicservice 394 * @since 11 395 */ 396 readonly installationFree: boolean; 397 398 /** 399 * Indicates the hash value of the hap module 400 * 401 * @type { string } 402 * @readonly 403 * @syscap SystemCapability.BundleManager.BundleFramework.Core 404 * @since 9 405 */ 406 /** 407 * Indicates the hash value of the hap module 408 * 409 * @type { string } 410 * @readonly 411 * @syscap SystemCapability.BundleManager.BundleFramework.Core 412 * @atomicservice 413 * @since 11 414 */ 415 readonly hashValue: string; 416 417 /** 418 * Indicates the type of the module 419 * 420 * @type { bundleManager.ModuleType } 421 * @readonly 422 * @syscap SystemCapability.BundleManager.BundleFramework.Core 423 * @since 9 424 */ 425 /** 426 * Indicates the type of the module 427 * 428 * @type { bundleManager.ModuleType } 429 * @readonly 430 * @syscap SystemCapability.BundleManager.BundleFramework.Core 431 * @atomicservice 432 * @since 11 433 */ 434 readonly type: bundleManager.ModuleType; 435 436 /** 437 * Indicates the dependency module that this module depends on 438 * 439 * @type { Array<Dependency> } 440 * @readonly 441 * @syscap SystemCapability.BundleManager.BundleFramework.Core 442 * @since 9 443 */ 444 /** 445 * Indicates the dependency module that this module depends on 446 * 447 * @type { Array<Dependency> } 448 * @readonly 449 * @syscap SystemCapability.BundleManager.BundleFramework.Core 450 * @atomicservice 451 * @since 11 452 */ 453 readonly dependencies: Array<Dependency>; 454 455 /** 456 * Indicates the preload module 457 * 458 * @type { Array<PreloadItem> } 459 * @readonly 460 * @syscap SystemCapability.BundleManager.BundleFramework.Core 461 * @since 9 462 */ 463 /** 464 * Indicates the preload module 465 * 466 * @type { Array<PreloadItem> } 467 * @readonly 468 * @syscap SystemCapability.BundleManager.BundleFramework.Core 469 * @atomicservice 470 * @since 11 471 */ 472 readonly preloads: Array<PreloadItem>; 473 474 /** 475 * Indicates the menu configuration 476 * 477 * @type { string } 478 * @readonly 479 * @syscap SystemCapability.BundleManager.BundleFramework.Core 480 * @atomicservice 481 * @since 11 482 */ 483 readonly fileContextMenuConfig: string; 484 485 /** 486 * Indicates the router information of the module 487 * 488 * @type { Array<RouterItem> } 489 * @readonly 490 * @syscap SystemCapability.BundleManager.BundleFramework.Core 491 * @atomicservice 492 * @since 12 493 */ 494 readonly routerMap: Array<RouterItem>; 495 496 /** 497 * Indicates native library path. 498 * 499 * @type { string } 500 * @readonly 501 * @syscap SystemCapability.BundleManager.BundleFramework.Core 502 * @since 12 503 */ 504 readonly nativeLibraryPath: string; 505 506 /** 507 * Indicates the code path 508 * 509 * @type { string } 510 * @readonly 511 * @syscap SystemCapability.BundleManager.BundleFramework.Core 512 * @atomicservice 513 * @since 12 514 */ 515 readonly codePath: string; 516} 517 518/** 519 * Indicates the dependency 520 * 521 * @typedef Dependency 522 * @syscap SystemCapability.BundleManager.BundleFramework.Core 523 * @since 9 524 */ 525/** 526 * Indicates the dependency 527 * 528 * @typedef Dependency 529 * @syscap SystemCapability.BundleManager.BundleFramework.Core 530 * @atomicservice 531 * @since 11 532 */ 533export interface Dependency { 534 /** 535 * Indicates the module name 536 * 537 * @type { string } 538 * @readonly 539 * @syscap SystemCapability.BundleManager.BundleFramework.Core 540 * @since 9 541 */ 542 /** 543 * Indicates the module name 544 * 545 * @type { string } 546 * @readonly 547 * @syscap SystemCapability.BundleManager.BundleFramework.Core 548 * @atomicservice 549 * @since 11 550 */ 551 readonly moduleName: string; 552 553 /** 554 * Indicates the bundle name of the dependency 555 * 556 * @type { string } 557 * @readonly 558 * @syscap SystemCapability.BundleManager.BundleFramework.Core 559 * @since 10 560 */ 561 /** 562 * Indicates the bundle name of the dependency 563 * 564 * @type { string } 565 * @readonly 566 * @syscap SystemCapability.BundleManager.BundleFramework.Core 567 * @atomicservice 568 * @since 11 569 */ 570 readonly bundleName: string; 571 572 /** 573 * Indicates the version code of the dependency 574 * 575 * @type { number } 576 * @readonly 577 * @syscap SystemCapability.BundleManager.BundleFramework.Core 578 * @since 10 579 */ 580 /** 581 * Indicates the version code of the dependency 582 * 583 * @type { number } 584 * @readonly 585 * @syscap SystemCapability.BundleManager.BundleFramework.Core 586 * @atomicservice 587 * @since 11 588 */ 589 readonly versionCode: number; 590} 591 592/** 593 * Indicates the preloadItem 594 * 595 * @typedef PreloadItem 596 * @syscap SystemCapability.BundleManager.BundleFramework.Core 597 * @since 9 598 */ 599/** 600 * Indicates the preloadItem 601 * 602 * @typedef PreloadItem 603 * @syscap SystemCapability.BundleManager.BundleFramework.Core 604 * @atomicservice 605 * @since 11 606 */ 607export interface PreloadItem { 608 /** 609 * Indicates the module name need preload 610 * 611 * @type { string } 612 * @readonly 613 * @syscap SystemCapability.BundleManager.BundleFramework.Core 614 * @since 9 615 */ 616 /** 617 * Indicates the module name need preload 618 * 619 * @type { string } 620 * @readonly 621 * @syscap SystemCapability.BundleManager.BundleFramework.Core 622 * @atomicservice 623 * @since 11 624 */ 625 readonly moduleName: string; 626} 627 628/** 629 * Indicates the router item 630 * 631 * @typedef RouterItem 632 * @syscap SystemCapability.BundleManager.BundleFramework.Core 633 * @atomicservice 634 * @since 12 635 */ 636export interface RouterItem { 637 /** 638 * Indicates the name of the module to which the current page belongs 639 * 640 * @type { string } 641 * @readonly 642 * @syscap SystemCapability.BundleManager.BundleFramework.Core 643 * @atomicservice 644 * @since 12 645 */ 646 readonly name: string; 647 /** 648 * Indicates the file path of the current page within the module 649 * 650 * @type { string } 651 * @readonly 652 * @syscap SystemCapability.BundleManager.BundleFramework.Core 653 * @atomicservice 654 * @since 12 655 */ 656 readonly pageSourceFile: string; 657 /** 658 * Indicates the name of the function @Builder decorated 659 * 660 * @type { string } 661 * @readonly 662 * @syscap SystemCapability.BundleManager.BundleFramework.Core 663 * @atomicservice 664 * @since 12 665 */ 666 readonly buildFunction: string; 667 /** 668 * Indicates the json string of custom data 669 * 670 * @type { string } 671 * @readonly 672 * @syscap SystemCapability.BundleManager.BundleFramework.Core 673 * @atomicservice 674 * @since 12 675 */ 676 readonly customData: string; 677 /** 678 * Indicates the data 679 * 680 * @type { Array<DataItem> } 681 * @readonly 682 * @syscap SystemCapability.BundleManager.BundleFramework.Core 683 * @atomicservice 684 * @since 12 685 */ 686 readonly data: Array<DataItem>; 687} 688 689/** 690 * Indicates the data item defined in router item 691 * 692 * @typedef DataItem 693 * @syscap SystemCapability.BundleManager.BundleFramework.Core 694 * @atomicservice 695 * @since 12 696 */ 697export interface DataItem { 698 /** 699 * Indicates the key of the custom data item 700 * 701 * @type { string } 702 * @readonly 703 * @syscap SystemCapability.BundleManager.BundleFramework.Core 704 * @atomicservice 705 * @since 12 706 */ 707 readonly key: string; 708 /** 709 * Indicates the value of the custom data item 710 * 711 * @type { string } 712 * @readonly 713 * @syscap SystemCapability.BundleManager.BundleFramework.Core 714 * @atomicservice 715 * @since 12 716 */ 717 readonly value: string; 718}