1# HapModuleInfo 2 3The **HapModuleInfo** module defines the HAP module information. A third-party 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). 4 5> **NOTE** 6> 7> 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. 8 9## HapModuleInfo 10 11**System capability**: SystemCapability.BundleManager.BundleFramework.Core 12 13| Name | Type | Read-Only| Optional| Description | 14| --------------------------------- | ------------------------------------------------------------ | ---- | ---- | -------------------- | 15| name | string | Yes | No | Module name.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 16| icon | string | Yes | No | Module icon.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 17| iconId | number | Yes | No | ID of the module icon.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 18| label | string | Yes | No | Module label.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 19| labelId | number | Yes | No | ID of the module label.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 20| description | string | Yes | No | Module description.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 21| 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.| 22| mainElementName | string | Yes | No | Name of the main ability.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 23| abilitiesInfo | Array\<[AbilityInfo](js-apis-bundleManager-abilityInfo.md)> | Yes | No | Ability 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](js-apis-bundleManager.md#bundlemanagergetbundleinfoforself).<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 24| extensionAbilitiesInfo | Array\<[ExtensionAbilityInfo](js-apis-bundleManager-extensionAbilityInfo.md)> | Yes | No | ExtensionAbility 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](js-apis-bundleManager.md#bundlemanagergetbundleinfoforself).<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 25| metadata | Array\<[Metadata](js-apis-bundleManager-metadata.md)> | Yes | No | Metadata 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](js-apis-bundleManager.md#bundlemanagergetbundleinfoforself).<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 26| deviceTypes | Array\<string> | Yes | No | Types of devices where the module can run.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 27| installationFree | boolean | Yes | No | Whether installation-free is supported.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 28| 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.| 29| 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.| 30| 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.| 31| 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.| 32| 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.| 33| 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.| 34| 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.| 35| nativeLibraryPath<sup>12+</sup> | string | Yes | No | Local library file path of a HAP module in the application. | 36 37## PreloadItem 38 39Describes the preloaded module information in the atomic service. 40 41 **Atomic service API**: This API can be used in atomic services since API version 11. 42 43 **System capability**: SystemCapability.BundleManager.BundleFramework.Core 44 45| Name | Type | Read-Only| Optional| Description | 46| --------- | -------------- | ---- | ---- | --------------------------- | 47|moduleName | string | Yes | No | Name of the module automatically preloaded by the system.| 48 49## Dependency 50 51Describes the information about the dynamic shared library on which the module depends. 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| bundleName<sup>10+</sup> | string | Yes | No | Name of the shared bundle on which the current module depends. | 60| moduleName | string | Yes | No | Module name of the shared bundle on which the current module depends.| 61| versionCode<sup>10+</sup> | number | Yes | No | Version number of the shared bundle. | 62 63## RouterItem<sup>12+</sup> 64 65Describes the router table configuration of the module. 66 67 **Atomic service API**: This API can be used in atomic services since API version 12. 68 69 **System capability**: SystemCapability.BundleManager.BundleFramework.Core 70 71| Name | Type | Read-Only| Optional| Description | 72| ------------- | ------ | ---- | ---- | ---------------------- | 73| name | string | Yes | No | Name of the page to be redirected to. | 74| pageSourceFile| string | Yes | No | Path of the page in the module. | 75| buildFunction | string | Yes | No | Function decorated by @Builder. The function describes the UI of the page. | 76| 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. | 77| 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. | 78 79## DataItem<sup>12+</sup> 80 81Describes the user-defined data in the routing table configuration of the module. 82 83**Atomic service API**: This API can be used in atomic services since API version 12. 84 85**System capability**: SystemCapability.BundleManager.BundleFramework.Core 86 87| Name | Type | Read-Only| Optional| Description | 88| ------------- | ------ | ---- | ---- | ---------------------- | 89| key | string | Yes | No | Key of the user-defined data. | 90| value | string | Yes | No | Value of the user-defined data.| 91