1e41f4b71Sopenharmony_ci# HapModuleInfo 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciThe **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). 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci> **NOTE** 6e41f4b71Sopenharmony_ci> 7e41f4b71Sopenharmony_ci> 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. 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci## HapModuleInfo 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ci**System capability**: SystemCapability.BundleManager.BundleFramework.Core 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci| Name | Type | Read-Only| Optional| Description | 14e41f4b71Sopenharmony_ci| --------------------------------- | ------------------------------------------------------------ | ---- | ---- | -------------------- | 15e41f4b71Sopenharmony_ci| name | string | Yes | No | Module name.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 16e41f4b71Sopenharmony_ci| icon | string | Yes | No | Module icon.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 17e41f4b71Sopenharmony_ci| 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.| 18e41f4b71Sopenharmony_ci| label | string | Yes | No | Module label.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 19e41f4b71Sopenharmony_ci| 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.| 20e41f4b71Sopenharmony_ci| description | string | Yes | No | Module description.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 21e41f4b71Sopenharmony_ci| 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.| 22e41f4b71Sopenharmony_ci| 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.| 23e41f4b71Sopenharmony_ci| 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.| 24e41f4b71Sopenharmony_ci| 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.| 25e41f4b71Sopenharmony_ci| 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.| 26e41f4b71Sopenharmony_ci| 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.| 27e41f4b71Sopenharmony_ci| 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.| 28e41f4b71Sopenharmony_ci| 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.| 29e41f4b71Sopenharmony_ci| 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.| 30e41f4b71Sopenharmony_ci| 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.| 31e41f4b71Sopenharmony_ci| 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.| 32e41f4b71Sopenharmony_ci| 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.| 33e41f4b71Sopenharmony_ci| 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.| 34e41f4b71Sopenharmony_ci| 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.| 35e41f4b71Sopenharmony_ci| nativeLibraryPath<sup>12+</sup> | string | Yes | No | Local library file path of a HAP module in the application. | 36e41f4b71Sopenharmony_ci 37e41f4b71Sopenharmony_ci## PreloadItem 38e41f4b71Sopenharmony_ci 39e41f4b71Sopenharmony_ciDescribes the preloaded module information in the atomic service. 40e41f4b71Sopenharmony_ci 41e41f4b71Sopenharmony_ci **Atomic service API**: This API can be used in atomic services since API version 11. 42e41f4b71Sopenharmony_ci 43e41f4b71Sopenharmony_ci **System capability**: SystemCapability.BundleManager.BundleFramework.Core 44e41f4b71Sopenharmony_ci 45e41f4b71Sopenharmony_ci| Name | Type | Read-Only| Optional| Description | 46e41f4b71Sopenharmony_ci| --------- | -------------- | ---- | ---- | --------------------------- | 47e41f4b71Sopenharmony_ci|moduleName | string | Yes | No | Name of the module automatically preloaded by the system.| 48e41f4b71Sopenharmony_ci 49e41f4b71Sopenharmony_ci## Dependency 50e41f4b71Sopenharmony_ci 51e41f4b71Sopenharmony_ciDescribes the information about the dynamic shared library on which the module depends. 52e41f4b71Sopenharmony_ci 53e41f4b71Sopenharmony_ci **Atomic service API**: This API can be used in atomic services since API version 11. 54e41f4b71Sopenharmony_ci 55e41f4b71Sopenharmony_ci **System capability**: SystemCapability.BundleManager.BundleFramework.Core 56e41f4b71Sopenharmony_ci 57e41f4b71Sopenharmony_ci| Name | Type | Read-Only| Optional| Description | 58e41f4b71Sopenharmony_ci| ----------- | ------ | ---- | ---- | ---------------------- | 59e41f4b71Sopenharmony_ci| bundleName<sup>10+</sup> | string | Yes | No | Name of the shared bundle on which the current module depends. | 60e41f4b71Sopenharmony_ci| moduleName | string | Yes | No | Module name of the shared bundle on which the current module depends.| 61e41f4b71Sopenharmony_ci| versionCode<sup>10+</sup> | number | Yes | No | Version number of the shared bundle. | 62e41f4b71Sopenharmony_ci 63e41f4b71Sopenharmony_ci## RouterItem<sup>12+</sup> 64e41f4b71Sopenharmony_ci 65e41f4b71Sopenharmony_ciDescribes the router table configuration of the module. 66e41f4b71Sopenharmony_ci 67e41f4b71Sopenharmony_ci **Atomic service API**: This API can be used in atomic services since API version 12. 68e41f4b71Sopenharmony_ci 69e41f4b71Sopenharmony_ci **System capability**: SystemCapability.BundleManager.BundleFramework.Core 70e41f4b71Sopenharmony_ci 71e41f4b71Sopenharmony_ci| Name | Type | Read-Only| Optional| Description | 72e41f4b71Sopenharmony_ci| ------------- | ------ | ---- | ---- | ---------------------- | 73e41f4b71Sopenharmony_ci| name | string | Yes | No | Name of the page to be redirected to. | 74e41f4b71Sopenharmony_ci| pageSourceFile| string | Yes | No | Path of the page in the module. | 75e41f4b71Sopenharmony_ci| buildFunction | string | Yes | No | Function decorated by @Builder. The function describes the UI of the page. | 76e41f4b71Sopenharmony_ci| 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. | 77e41f4b71Sopenharmony_ci| 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. | 78e41f4b71Sopenharmony_ci 79e41f4b71Sopenharmony_ci## DataItem<sup>12+</sup> 80e41f4b71Sopenharmony_ci 81e41f4b71Sopenharmony_ciDescribes the user-defined data in the routing table configuration of the module. 82e41f4b71Sopenharmony_ci 83e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 12. 84e41f4b71Sopenharmony_ci 85e41f4b71Sopenharmony_ci**System capability**: SystemCapability.BundleManager.BundleFramework.Core 86e41f4b71Sopenharmony_ci 87e41f4b71Sopenharmony_ci| Name | Type | Read-Only| Optional| Description | 88e41f4b71Sopenharmony_ci| ------------- | ------ | ---- | ---- | ---------------------- | 89e41f4b71Sopenharmony_ci| key | string | Yes | No | Key of the user-defined data. | 90e41f4b71Sopenharmony_ci| value | string | Yes | No | Value of the user-defined data.| 91