openharmony 鸿蒙 js-apis-bundleManager-hapModuleInfo

2025-06-12 浏览 (1)

HapModuleInfo

The HapModuleInfo module defines the HAP module information. A third-party application can obtain its own HAP module information through getBundleInfoForSelf, with GET_BUNDLE_INFO_WITH_HAP_MODULE passed in for bundleFlags.

NOTE

The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.

HapModuleInfo

System capability: SystemCapability.BundleManager.BundleFramework.Core

NameTypeRead-OnlyOptionalDescription
namestringYesNoModule name.
Atomic service API: This API can be used in atomic services since API version 11.
iconstringYesNoModule icon.
Atomic service API: This API can be used in atomic services since API version 11.
iconIdnumberYesNoID of the module icon.
Atomic service API: This API can be used in atomic services since API version 11.
labelstringYesNoModule label.
Atomic service API: This API can be used in atomic services since API version 11.
labelIdnumberYesNoID of the module label.
Atomic service API: This API can be used in atomic services since API version 11.
descriptionstringYesNoModule description.
Atomic service API: This API can be used in atomic services since API version 11.
descriptionIdnumberYesNoID of the module description.
Atomic service API: This API can be used in atomic services since API version 11.
mainElementNamestringYesNoName of the UIAbility or ExtensionAbility that serves as the entry of the current module.
Atomic service API: This API can be used in atomic services since API version 11.
abilitiesInfoArray<AbilityInfo>YesNoAbility information. The information can be obtained by passing in GET_BUNDLE_INFO_WITH_HAP_MODULE and GET_BUNDLE_INFO_WITH_ABILITY to the bundleFlags parameter of getBundleInfoForSelf.
Atomic service API: This API can be used in atomic services since API version 11.
extensionAbilitiesInfoArray<ExtensionAbilityInfo>YesNoExtensionAbility information. The information can be obtained by passing in GET_BUNDLE_INFO_WITH_HAP_MODULE and GET_BUNDLE_INFO_WITH_EXTENSION_ABILITY to the bundleFlags parameter of getBundleInfoForSelf.
Atomic service API: This API can be used in atomic services since API version 11.
metadataArray<Metadata>YesNoMetadata of the ability. The information can be obtained by passing in GET_BUNDLE_INFO_WITH_HAP_MODULE and GET_BUNDLE_INFO_WITH_METADATA to the bundleFlags parameter of getBundleInfoForSelf.
Atomic service API: This API can be used in atomic services since API version 11.
deviceTypesArray<string>YesNoTypes of devices that can run the module.
Atomic service API: This API can be used in atomic services since API version 11.
installationFreebooleanYesNoWhether the module supports the installation-free freature. Installation-free means that the module does not need to be explicitly installed through an app market. The value true means that the module supports installation-free, and false means the opposite.
Atomic service API: This API can be used in atomic services since API version 11.
hashValuestringYesNoHash value of the module.
Atomic service API: This API can be used in atomic services since API version 11.
typebundleManager.ModuleTypeYesNoType of the module.
Atomic service API: This API can be used in atomic services since API version 11.
preloadsArray<PreloadItem>YesNoPreloaded modules in the atomic service.
Atomic service API: This API can be used in atomic services since API version 11.
dependenciesArray<Dependency>YesNoDynamic shared libraries on which the module depends.
Atomic service API: This API can be used in atomic services since API version 11.
fileContextMenuConfig11+stringYesNoFile menu configuration of the module. The information can be obtained by passing in GET_BUNDLE_INFO_WITH_HAP_MODULE and GET_BUNDLE_INFO_WITH_MENU to the bundleFlags parameter of getBundleInfoForSelf.
Atomic service API: This API can be used in atomic services since API version 11.
routerMap12+Array<RouterItem>YesNoRouter table configuration of the module. The information can be obtained by passing in GET_BUNDLE_INFO_WITH_HAP_MODULE and GET_BUNDLE_INFO_WITH_ROUTER_MAP to the bundleFlags parameter of getBundleInfoForSelf.
Atomic service API: This API can be used in atomic services since API version 12.
codePath12+stringYesNoInstallation path of the module.
Atomic service API: This API can be used in atomic services since API version 12.
nativeLibraryPath12+stringYesNoLocal library file path of the module in the application.

PreloadItem

Describes the preloaded module information in the atomic service.

Atomic service API: This API can be used in atomic services since API version 11.

System capability: SystemCapability.BundleManager.BundleFramework.Core

NameTypeRead-OnlyOptionalDescription
moduleNamestringYesNoModule name.

Dependency

Describes the information about the dynamic shared library on which the module depends.

Atomic service API: This API can be used in atomic services since API version 11.

System capability: SystemCapability.BundleManager.BundleFramework.Core

NameTypeRead-OnlyOptionalDescription
bundleName10+stringYesNoName of the shared bundle on which the current module depends.
moduleNamestringYesNoModule name of the shared bundle on which the current module depends.
versionCode10+numberYesNoVersion number of the shared bundle.

RouterItem12+

Describes the router table configuration of the module.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.BundleManager.BundleFramework.Core

NameTypeRead-OnlyOptionalDescription
namestringYesNoName of the page to be redirected to.
pageSourceFilestringYesNoPath of the page in the module.
buildFunctionstringYesNoFunction decorated by @Builder. The function describes the UI of the page.
dataArray<DataItem>YesNoUser-defined string in the routing table configuration file, that is, value of the data field. This field is parsed by the system. You do not need to parse it.
customDatastringYesNoAny type of custom data in the routing table configuration file, that is, JSON string of the customData field. You need to call JSON.parse to parse the field.

DataItem12+

Describes the user-defined data in the routing table configuration of the module.

Atomic service API: This API can be used in atomic services since API version 12.

System capability: SystemCapability.BundleManager.BundleFramework.Core

NameTypeRead-OnlyOptionalDescription
keystringYesNoKey of the user-defined data.
valuestringYesNoValue of the user-defined data.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Ability Kit

harmony 鸿蒙AbilityAccessControl

harmony 鸿蒙AbilityBase

harmony 鸿蒙AbilityBase_Element

harmony 鸿蒙AbilityRuntime

harmony 鸿蒙bundle

harmony 鸿蒙OH_NativeBundle_ApplicationInfo

harmony 鸿蒙OH_NativeBundle_ElementName

harmony 鸿蒙ability_access_control.h

harmony 鸿蒙ability_base_common.h

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/kAygm5