1# HapModuleInfo 2<!--Kit: Ability Kit--> 3<!--Subsystem: BundleManager--> 4<!--Owner: @wanghang904--> 5<!--Designer: @hanfeng6--> 6<!--Tester: @kongjing2--> 7<!--Adviser: @Brilliantry_Rui--> 8 9The module defines the HAP module information. An application can obtain its own HAP module information through [getBundleInfoForSelf](js-apis-bundleManager.md#bundlemanagergetbundleinfoforself), with **GET_BUNDLE_INFO_WITH_HAP_MODULE** passed in for [bundleFlags](js-apis-bundleManager.md#bundleflag). 10 11> **NOTE** 12> 13> 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. 14 15## Modules to Import 16 17```ts 18import { bundleManager } from '@kit.AbilityKit'; 19``` 20 21## HapModuleInfo 22 23**System capability**: SystemCapability.BundleManager.BundleFramework.Core 24 25| Name | Type | Read-Only| Optional| Description | 26| --------------------------------- | ------------------------------------------------------------ | ---- | ---- | -------------------- | 27| name | string | Yes | No | Module name.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 28| icon | string | Yes | No | [Icon](../../quick-start/layered-image.md) for the entry ability of the current module. It is the index of the icon resource file and should match the value of **icon** in the [abilities](../../quick-start/module-configuration-file.md#abilities) or [extensionAbilities](../../quick-start/module-configuration-file.md#extensionabilities) field in the module configuration file. If no entry ability is configured, this parameter is left empty.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 29| iconId | number | Yes | No | [Resource ID](../../quick-start/resource-categories-and-access.md#resource-directories) of the icon for the entry ability of the current module. If no entry ability is configured, this parameter is left empty.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 30| label | string | Yes | No | Label of the entry ability of the current module. It is the index of a string resource and should match the value of **label** in the [abilities](../../quick-start/module-configuration-file.md#abilities) or [extensionAbilities](../../quick-start/module-configuration-file.md#extensionabilities) field in the module configuration file. If no entry ability is configured, this parameter is left empty.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 31| labelId | number | Yes | No | [Resource ID](../../quick-start/resource-categories-and-access.md#resource-directories) of the label for the entry ability of the current module. If no entry ability is configured, this parameter is left empty.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 32| description | string | Yes | No | Module description.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 33| descriptionId | number | Yes | No | ID of the module description.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 34| mainElementName | string | Yes | No | Name of the UIAbility or ExtensionAbility that serves as the entry of the current module.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 35| abilitiesInfo | Array\<[AbilityInfo](js-apis-bundleManager-abilityInfo.md)> | Yes | No | Information about all ability components of the current module. 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](js-apis-bundleManager.md#bundlemanagergetbundleinfoforself).<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 36| extensionAbilitiesInfo | Array\<[ExtensionAbilityInfo](js-apis-bundleManager-extensionAbilityInfo.md)> | Yes | No | Information about all ExtensionAbility components of the current module. 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](js-apis-bundleManager.md#bundlemanagergetbundleinfoforself).<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 37| metadata | Array\<[Metadata](js-apis-bundleManager-metadata.md)> | Yes | No | Metadata of the current module. 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](js-apis-bundleManager.md#bundlemanagergetbundleinfoforself).<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 38| deviceTypes | Array\<string> | Yes | No | Array of [device types](../../quick-start/module-configuration-file.md#devicetypes) that the module supports for installation and running.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 39| installationFree | boolean | Yes | No | Whether the module supports the installation-free feature. Installation-free means that the module does not need to be explicitly installed through an app market. **true** if the module supports installation-free, **false** otherwise.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 40| hashValue | string | Yes | No | Hash value of the module.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 41| type | [bundleManager.ModuleType](js-apis-bundleManager.md#moduletype) | Yes | No | Type of the module.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 42| preloads | Array\<[PreloadItem](#preloaditem)> | Yes | No | Preloaded modules in the atomic service.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 43| dependencies | Array\<[Dependency](#dependency)> | Yes | No | Dynamic shared libraries on which the module depends.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 44| fileContextMenuConfig<sup>11+</sup> | string | Yes | No | File 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](js-apis-bundleManager.md#bundlemanagergetbundleinfoforself).<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 45| routerMap<sup>12+</sup> | Array\<[RouterItem](#routeritem12)> | Yes | No | [Router table configuration of the module](../../quick-start/module-configuration-file.md#routermap). 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](js-apis-bundleManager.md#bundlemanagergetbundleinfoforself).<br>**Atomic service API**: This API can be used in atomic services since API version 12.| 46| codePath<sup>12+</sup> | string | Yes | No | Installation path of the module.<br>**Atomic service API**: This API can be used in atomic services since API version 12.| 47| nativeLibraryPath<sup>12+</sup> | string | Yes | No | Local library file path of the module in the application. | 48 49## PreloadItem 50 51Describes the preloaded module information in the atomic service. 52 53**Atomic service API**: This API can be used in atomic services since API version 11. 54 55**System capability**: SystemCapability.BundleManager.BundleFramework.Core 56 57| Name | Type | Read-Only| Optional| Description | 58| --------- | -------------- | ---- | ---- | --------------------------- | 59|moduleName | string | Yes | No | Module name.| 60 61## Dependency 62 63Describes the information about the dynamic shared library on which the module depends. 64 65**Atomic service API**: This API can be used in atomic services since API version 11. 66 67**System capability**: SystemCapability.BundleManager.BundleFramework.Core 68 69| Name | Type | Read-Only| Optional| Description | 70| ----------- | ------ | ---- | ---- | ---------------------- | 71| bundleName<sup>10+</sup> | string | Yes | No | Name of the shared bundle on which the current module depends. | 72| moduleName | string | Yes | No | Module name of the shared bundle on which the current module depends.| 73| versionCode<sup>10+</sup> | number | Yes | No | Version number of the shared bundle. | 74 75## RouterItem<sup>12+</sup> 76 77Describes the router table configuration of the module. 78 79**Atomic service API**: This API can be used in atomic services since API version 12. 80 81**System capability**: SystemCapability.BundleManager.BundleFramework.Core 82 83| Name | Type | Read-Only| Optional| Description | 84| ------------- | ------ | ---- | ---- | ---------------------- | 85| name | string | Yes | No | Name of the page to be redirected to. | 86| pageSourceFile| string | Yes | No | Path of the page in the module. | 87| buildFunction | string | Yes | No | Function decorated by @Builder. The function describes the UI of the page. | 88| data | Array\<[DataItem](#dataitem12)> | Yes | No | User-defined string in the [routing table configuration file](../../quick-start/module-configuration-file.md#routermap), that is, value of the **data** field. This field is parsed by the system. You do not need to parse it. | 89| customData | string | Yes | No | Any type of custom data in the [routing table configuration file](../../quick-start/module-configuration-file.md#routermap), that is, JSON string of the **customData** field. You need to call **JSON.parse** to parse the field. | 90 91## DataItem<sup>12+</sup> 92 93Describes the user-defined data in the routing table configuration of the module. 94 95**Atomic service API**: This API can be used in atomic services since API version 12. 96 97**System capability**: SystemCapability.BundleManager.BundleFramework.Core 98 99| Name | Type | Read-Only| Optional| Description | 100| ------------- | ------ | ---- | ---- | ---------------------- | 101| key | string | Yes | No | Key of the user-defined data. | 102| value | string | Yes | No | Value of the user-defined data.| 103