diff --git a/en/application-dev/reference/apis/js-apis-Bundle.md b/en/application-dev/reference/apis/js-apis-Bundle.md index 36574c39a68ac6c669e7bfa7e5f0a3d660848e18..e631e0e777d8e315c667f58dd2632ec89ef4ce92 100644 --- a/en/application-dev/reference/apis/js-apis-Bundle.md +++ b/en/application-dev/reference/apis/js-apis-Bundle.md @@ -1,6 +1,6 @@ # Bundle Module (JavaScript SDK APIs) -> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
+> **NOTE**
> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. > API version 9 is a canary version for trial use. The APIs of this version may be unstable. ## Modules to Import @@ -9,7 +9,7 @@ import bundle from '@ohos.bundle'; ``` -## System Capabilities +## System Capability SystemCapability.BundleManager.BundleFramework @@ -47,7 +47,7 @@ SystemCapability.BundleManager.BundleFramework | Type | Description | | ------------------------- | ------------------ | -| Promise\ | Promise used to return the application information.| +| Promise\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)> | Promise used to return the application information.| **Example** @@ -86,7 +86,7 @@ SystemCapability.BundleManager.BundleFramework | bundleName | string | Yes | Bundle name of the application. | | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | -| callback | AsyncCallback\ | Yes | Callback used to return the application information. | +| callback | AsyncCallback\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)> | Yes | Callback used to return the application information. | **Example** @@ -124,7 +124,7 @@ SystemCapability.BundleManager.BundleFramework | ----------- | ------------------------------- | ---- | --------------------------------------- | | bundleName | string | Yes | Bundle name of the application. | | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| -| callback | AsyncCallback\ | Yes | Callback used to return the application information. | +| callback | AsyncCallback\<[ApplicationInfo](js-apis-bundle-ApplicationInfo.md)> | Yes | Callback used to return the application information. | **Example** @@ -166,7 +166,7 @@ SystemCapability.BundleManager.BundleFramework | Type | Description | | --------------------------- | -------------------------- | -| Promise> | Promise used to return the information of all available bundles.| +| Promise> | Promise used to return the information of all available bundles.| **Example** @@ -202,7 +202,7 @@ SystemCapability.BundleManager.BundleFramework | Name | Type | Mandatory | Description | | ---------- | --------------------------------- | ---- | --------------------------------------- | | bundleFlag | BundleFlag | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| -| callback | AsyncCallback> | Yes | Callback used to return the information of all available bundles. | +| callback | AsyncCallback> | Yes | Callback used to return the information of all available bundles. | **Example** @@ -238,7 +238,7 @@ SystemCapability.BundleManager.BundleFramework | ---------- | --------------------------------- | ---- | --------------------------------------- | | bundleFlag | BundleFlag | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | -| callback | AsyncCallback> | Yes | Callback used to return the information of all available bundles. | +| callback | AsyncCallback> | Yes | Callback used to return the information of all available bundles. | **Example** @@ -274,15 +274,15 @@ SystemCapability.BundleManager.BundleFramework | Name | Type | Mandatory | Description | | ----------- | ------------- | ---- | --------------------------------------- | -| bundleName | string | Yes | Bundle name. | +| bundleName | string | Yes | Bundle name of the application. | | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| -| options | BundleOptions | No | Includes **userId**. | +| options | [BundleOptions](#bundleoptions)| No | Includes **userId**. | **Return value** | Type | Description | | -------------------- | ---------------------------- | -| Promise\ | Promise used to return the bundle information.| +| Promise\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Promise used to return the bundle information.| **Example** @@ -320,9 +320,9 @@ SystemCapability.BundleManager.BundleFramework | Name | Type | Mandatory | Description | | ----------- | -------------------------- | ---- | --------------------------------------- | -| bundleName | string | Yes | Bundle name. | +| bundleName | string | Yes | Bundle name of the application. | | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| -| callback | AsyncCallback\ | Yes | Callback used to return the bundle information. | +| callback | AsyncCallback\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Yes | Callback used to return the bundle information. | **Example** @@ -357,10 +357,10 @@ SystemCapability.BundleManager.BundleFramework | Name | Type | Mandatory | Description | | ----------- | -------------------------- | ---- | --------------------------------------- | -| bundleName | string | Yes | Bundle name. | +| bundleName | string | Yes | Bundle name of the application. | | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| -| options | BundleOptions | Yes | Includes **userId**. | -| callback | AsyncCallback\ | Yes | Callback used to return the bundle information. | +| options | [BundleOptions](#bundleoptions) | Yes | Includes **userId**. | +| callback | AsyncCallback\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Yes | Callback used to return the bundle information. | **Example** @@ -405,7 +405,7 @@ SystemCapability.BundleManager.BundleFramework | Type | Description | | -------------------------------- | ------------------------------- | -| Promise> | Promise used to return the application information.| +| Promise> | Promise used to return the application information.| **Example** @@ -442,7 +442,7 @@ SystemCapability.BundleManager.BundleFramework | ----------- | -------------------------------------- | ---- | --------------------------------------- | | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| | userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | -| callback | AsyncCallback> | Yes | Callback used to return the application information. | +| callback | AsyncCallback> | Yes | Callback used to return the application information. | **Example** @@ -478,7 +478,7 @@ SystemCapability.BundleManager.BundleFramework | Name | Type | Mandatory | Description | | ----------- | -------------------------------------- | ---- | --------------------------------------- | | bundleFlags | number | Yes | Type of information that will be returned. The default value is **0**. The value must be greater than or equal to 0.| -| callback | AsyncCallback> | Yes | Callback used to return the application information. | +| callback | AsyncCallback> | Yes | Callback used to return the application information. | **Example** @@ -493,6 +493,73 @@ bundle.getAllApplicationInfo(bundleFlags, (err, data) => { }) ``` +## bundle.getBundleArchiveInfo + +getBundleArchiveInfo(hapFilePath: string, bundleFlags: number) : Promise + +Obtains information about the bundles contained in a HAP file. This API uses a promise to return the result. + +**System capability** + +SystemCapability.BundleManager.BundleFramework + +**Parameters** + +| Name | Type | Mandatory | Description | +| ---------- | ------ | ---- | ------------ | +| hapFilePath | string | Yes | Path where the HAP file is stored. The path should point to the relative directory of the current application's data directory.| +| bundleFlags | number | Yes | Flags used to specify information contained in the **BundleInfo** object that will be returned. The default value is **0**. The value must be greater than 0.| + +**Return value** +| Type | Description | +| -------------- | -------------------------------------- | +| Promise\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Promise used to return the information about the bundles.| + +**Example** + +```js +let hapFilePath = "/data/xxx/test.hap"; +let bundleFlags = 0; +bundle.getBundleArchiveInfo(hapFilePath, bundleFlags) +.then((data) => { + console.info('Operation successful. Data: ' + JSON.stringify(data)); +}).catch((error) => { + console.error('Operation failed. Cause: ' + JSON.stringify(error)); +}) +``` + +## bundle.getBundleArchiveInfo + +getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback) : void + +Obtains information about the bundles contained in a HAP file. This API uses an asynchronous callback to return the result. + +**System capability** + +SystemCapability.BundleManager.BundleFramework + +**Parameters** + +| Name | Type | Mandatory | Description | +| ---------- | ------ | ---- | ------------ | +| hapFilePath | string | Yes | Path where the HAP file is stored. The path should point to the relative directory of the current application's data directory.| +| bundleFlags | number | Yes | Flags used to specify information contained in the **BundleInfo** object that will be returned. The default value is **0**. The value must be greater than 0.| +| callback| AsyncCallback\<[BundleInfo](js-apis-bundle-BundleInfo.md)> | Yes | Flags used to specify information contained in the **BundleInfo** object that will be returned. The default value is **0**. The value must be greater than 0.| + +**Example** + +```js +let hapFilePath = "/data/xxx/test.hap"; +let bundleFlags = 0; +bundle.getBundleArchiveInfo(hapFilePath, bundleFlags, (err, data) => { + if (err) { + console.error('Operation failed. Cause: ' + JSON.stringify(err)); + return; + } + console.info('Operation successful. Data:' + JSON.stringify(data)); +}) +``` + ## bundle.getAbilityInfo getAbilityInfo(bundleName: string, abilityName: string): Promise\ @@ -518,7 +585,7 @@ SystemCapability.BundleManager.BundleFramework | Type | Description | | --------------------- | --------------------- | -| Promise\ | Promise used to return the ability information.| +| Promise\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)> | Promise used to return the ability information.| **Example** @@ -553,7 +620,7 @@ SystemCapability.BundleManager.BundleFramework | ----------- | ------------ | ---- | ---------------- | | bundleName | string | Yes | Bundle name of the application. | | abilityName | string | Yes | Ability name.| -| callback | AsyncCallback\ | Yes | Callback used to return the ability information.| +| callback | AsyncCallback\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)> | Yes | Callback used to return the ability information.| **Example** @@ -649,7 +716,7 @@ bundle.getAbilityLabel(bundleName, abilityName, (err, data) => { isAbilityEnabled(info: AbilityInfo): Promise\ -Checks whether an ability is enabled based on a given **AbilityInfo** object. This API uses a promise to return the result. +Checks whether the ability that matches a given **AbilityInfo** object is enabled. This API uses a promise to return the result. **Required permissions** @@ -663,7 +730,7 @@ SystemCapability.BundleManager.BundleFramework | Name | Type | Mandatory | Description | | ---- | ----------- | ---- | ------------ | -| info | AbilityInfo | Yes | Ability information.| +| info | [AbilityInfo](js-apis-bundle-AbilityInfo.md) | Yes | Ability information.| **Return value** @@ -690,7 +757,7 @@ bundle.isAbilityEnabled(Info) isAbilityEnabled(info : AbilityInfo, callback : AsyncCallback\): void -Checks whether an ability is enabled based on a given **AbilityInfo** object. This API uses an asynchronous callback to return the result. +Checks whether the ability that matches a given **AbilityInfo** object is enabled. This API uses an asynchronous callback to return the result. **Required permissions** @@ -704,7 +771,7 @@ SystemCapability.BundleManager.BundleFramework | Name | Type | Mandatory | Description | | -------- | ----------------------- | ---- | --------------- | -| info | AbilityInfo | Yes | Ability information. | +| info | [AbilityInfo](js-apis-bundle-AbilityInfo.md) | Yes | Ability information. | | callback | AsyncCallback\ | Yes | Callback used to return whether the ability is enabled. If the ability is enabled, **true** will be returned; otherwise, **false** will be returned.| **Example** @@ -765,7 +832,7 @@ bundle.isApplicationEnabled(bundleName) isApplicationEnabled(bundleName: string, callback : AsyncCallback\): void -Checks whether an application is enabled based on a given want. This API uses an asynchronous callback to return the result. +Checks whether an application is enabled based on a given bundle name. This API uses an asynchronous callback to return the result. **Required permissions** @@ -813,7 +880,7 @@ SystemCapability.BundleManager.BundleFramework | Name | Type | Mandatory | Description | | ----------- | ------ | ---- | ------------------------------------- | -| want | Want | Yes | Want that contains the bundle name. | +| want | [Want](js-apis-application-Want.md) | Yes | Want that contains the bundle name. | | bundleFlags | number | Yes | Ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.| | userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | @@ -821,7 +888,7 @@ SystemCapability.BundleManager.BundleFramework | Type | Description | | ---------------------------- | --------------------- | -| Promise\>| Promise used to return the ability information.| +| Promise> | Promise used to return the ability information.| **Example** @@ -856,10 +923,10 @@ SystemCapability.BundleManager.BundleFramework | Name | Type | Mandatory | Description | | ----------- | ---------------------------------- | ---- | ------------------------------------- | -| want | Want | Yes | Want that contains the bundle name. | -| bundleFlags | number | Yes | Type of the ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.| +| want | [Want](js-apis-application-Want.md) | Yes | Want that contains the bundle name. | +| bundleFlags | number | Yes | Ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.| | userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | -| callback | AsyncCallback> | Yes | Callback used to return the ability information. | +| callback | AsyncCallback> | Yes | Callback used to return the ability information. | **Example** @@ -893,9 +960,9 @@ SystemCapability.BundleManager.BundleFramework | Name | Type | Mandatory | Description | | ----------- | ---------------------------------- | ---- | ------------------------------------- | -| want | Want | Yes | Want that contains the bundle name. | -| bundleFlags | number | Yes | Type of the ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.| -| callback | AsyncCallback> | Yes | Callback used to return the ability information. | +| want | [Want](js-apis-application-Want.md) | Yes | Want that contains the bundle name. | +| bundleFlags | number | Yes | Ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.| +| callback | AsyncCallback> | Yes | Callback used to return the ability information. | **Example** @@ -939,7 +1006,7 @@ SystemCapability.BundleManager.BundleFramework **Return value** | Type | Description | | -------------- | -------------------------------------- | -| Promise\ | Promise used to return the **Want** object.| +| Promise\<[Want](js-apis-application-Want.md)> | Promise used to return the **Want** object.| **Example** @@ -972,7 +1039,7 @@ SystemCapability.BundleManager.BundleFramework | Name | Type | Mandatory | Description | | ---------- | -------------------- | ---- | ------------------------------ | | bundleName | string | Yes | Bundle name of the application. | -| callback | AsyncCallback\ | Yes | Callback used to return the **Want** object.| +| callback | AsyncCallback\<[Want](js-apis-application-Want.md)> | Yes | Callback used to return the **Want** object.| **Example** @@ -1056,7 +1123,7 @@ bundle.getNameForUid(uid, (err, data) => { getAbilityIcon(bundleName: string, abilityName: string): Promise\; -Obtains the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md) of the icon corresponding to a given bundle name and ability name. This API uses a promise to return the result. +Obtains the [PixelMap](js-apis-image.md) of the icon corresponding to a given bundle name and ability name. This API uses a promise to return the result. **Required permissions** @@ -1076,7 +1143,7 @@ SystemCapability.BundleManager.BundleFramework **Return value** | Type | Description | | --------------------- | ------------------------------------------------------------ | -| Promise\ | Promise used to return the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md)>.| +| Promise\ | Promise used to return the [PixelMap](js-apis-image.md).| **Example** @@ -1095,7 +1162,7 @@ bundle.getAbilityIcon(bundleName, abilityName) getAbilityIcon(bundleName: string, abilityName: string, callback: AsyncCallback\): void; -Obtains the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md) of the icon corresponding to a given bundle name and ability name. This API uses an asynchronous callback to return the result. +Obtains the [PixelMap](js-apis-image.md) of the icon corresponding to a given bundle name and ability name. This API uses an asynchronous callback to return the result. **Required permissions** @@ -1111,7 +1178,7 @@ SystemCapability.BundleManager.BundleFramework | ----------- | ---------------------------------------- | ---- | ---------------------------------------- | | bundleName | string | Yes | Bundle name based on which the pixel map is to obtain. | | abilityName | string | Yes | Ability name based on which the pixel map is to obtain. | -| callback | AsyncCallback\ | Yes | Callback used to return the [PixelMap](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-image.md)>.| +| callback | AsyncCallback\ | Yes | Callback used to return the [PixelMap](js-apis-image.md).| **Example** @@ -1127,17 +1194,133 @@ bundle.getAbilityIcon(bundleName, abilityName, (err, data) => { }) ``` -## ElementName - **System capability**: SystemCapability.BundleManager.BundleFramework +## bundle.queryExtensionAbilityInfosByWant9+ + +queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, userId?: number): Promise> + +Obtains the Extension ability information based on a given want. This API uses a promise to return the result. + +**Required permissions** + +ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO + +**System capability** + +SystemCapability.BundleManager.BundleFramework + +**Parameters** + +| Name | Type | Mandatory | Description | +| -------------- | ------ | ---- | ---------------------------------------- | +| want | [Want](js-apis-application-Want.md) | Yes | Want that contains the bundle name. | +| extensionFlags | number | Yes | Extension ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.| +| userId | number | No | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | + +**Return value** + +| Type | Description | +| ------------------------------------- | ------------------------------ | +| Promise> | Promise used to return the Extension ability information.| + +**Example** + +```js +let extensionFlags = 0; +let userId = 100; +let want = { + bundleName : "com.example.myapplication", + abilityName : "com.example.myapplication.MainAbility" +}; +bundle.queryExtensionAbilityInfosByWant(want, extensionFlags, userId) +.then((data) => { + console.info('Operation successful. Data: ' + JSON.stringify(data)); +}).catch((error) => { + console.error('Operation failed. Cause: ' + JSON.stringify(error)); +}) +``` + + + +## bundle.queryExtensionAbilityInfosByWant9+ + +queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, userId: number, callback: AsyncCallback>): void + +Obtains the Extension ability information based on a given want. This API uses an asynchronous callback to return the result. + +**Required permissions** + +ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO + +**System capability** -| Name | Readable/Writable| Type | Mandatory | Description | -| ----------- | ---- | ------ | ---- | ---------------------------------------- | -| deviceId | Read-only | string | No | ID of the device that runs the ability. | -| bundleName | Read-only | string | Yes | Bundle name of the ability. If both **bundleName** and **abilityName** are specified in a **Want**, the **Want** can directly match the specified ability.| -| abilityName | Read-only | string | Yes | Name of the ability. If both **bundleName** and **abilityName** are specified in a **Want**, the **Want** can directly match the specified ability.| -| uri | Read-only | string | No | Resource ID. | -| shortName | Read-only | string | No | Short name of the **ElementName**. | +SystemCapability.BundleManager.BundleFramework + +**Parameters** + +| Name | Type | Mandatory | Description | +| -------------- | ---------------------------------------- | ---- | ---------------------------------------- | +| want | [Want](js-apis-application-Want.md) | Yes | Want that contains the bundle name. | +| extensionFlags | number | Yes | Extension ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.| +| userId | number | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0. | +| callback | AsyncCallback> | Yes | Callback used to return the Extension ability information. | + +**Example** + +```js +let extensionFlags = 0; +let userId = 100; +let want = { + bundleName : "com.example.myapplication", + abilityName : "com.example.myapplication.MainAbility" +}; +bundle.queryExtensionAbilityInfosByWant(want, extensionFlags, userId, (err, data) => { + if (err) { + console.error('Operation failed. Cause: ' + JSON.stringify(err)); + return; + } + console.info('Operation successful. Data:' + JSON.stringify(data)); +}) +``` + +## bundle.queryExtensionAbilityInfosByWant9+ + +queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, callback: AsyncCallback>): void; + +Obtains the Extension ability information based on a given want. This API uses an asynchronous callback to return the result. + +**Required permissions** + +ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO + +**System capability** + +SystemCapability.BundleManager.BundleFramework + +**Parameters** + +| Name | Type | Mandatory | Description | +| -------------- | ---------------------------------------- | ---- | ---------------------------------------- | +| want | [Want](js-apis-application-Want.md) | Yes | Want that contains the bundle name. | +| extensionFlags | number | Yes | Extension ability information to be returned. The default value is **0**. The value must be greater than or equal to 0.| +| callback | AsyncCallback> | Yes | Callback used to return the Extension ability information. | + +**Example** + +```js +let extensionFlags = 0; +let want = { + bundleName : "com.example.myapplication", + abilityName : "com.example.myapplication.MainAbility" +}; +bundle.queryExtensionAbilityInfosByWant(want, extensionFlags, (err, data) => { + if (err) { + console.error('Operation failed. Cause: ' + JSON.stringify(err)); + return; + } + console.info('Operation successful. Data:' + JSON.stringify(data)); +}) +``` ## InstallErrorCode @@ -1181,6 +1364,7 @@ Enumerates bundle flags. | GET_APPLICATION_INFO_WITH_PERMISSION | 0x00000008 | Obtains the application information with the permission information. | | GET_BUNDLE_WITH_REQUESTED_PERMISSION | 0x00000010 | Obtains the bundle information with the information about the required permissions. | | GET_ABILITY_INFO_WITH_METADATA8+ | 0x00000020 | Obtains the ability metadata information. | +| GET_BUNDLE_WITH_EXTENSION_ABILITY9+ | 0x00000020 | Obtains the bundle information with the Extension ability information.| | GET_APPLICATION_INFO_WITH_METADATA8+ | 0x00000040 | Obtains the application metadata information. | | GET_ABILITY_INFO_SYSTEMAPP_ONLY8+ | 0x00000080 | Obtains the ability information of system applications.| | GET_ABILITY_INFO_WITH_DISABLE8+ | 0x00000100 | Obtains information about disabled abilities. | @@ -1197,174 +1381,6 @@ Describes the bundle options. | ------ | ------ | ---- | ---- | ---------------------------- | | userId | number | Yes | Yes | User ID. The default value is the user ID of the caller. The value must be greater than or equal to 0.| -## BundleInfo - -Describes the application bundle information. - - **System capability**: SystemCapability.BundleManager.BundleFramework - -| Name | Type | Readable | Writable | Description | -| --------------------------------- | ---------------------------- | ---- | ---- | --------------------- | -| name | string | Yes | No | Bundle name. | -| type | string | Yes | No | Bundle type. | -| appId | string | Yes | No | ID of the application to which the bundle belongs. | -| uid | number | Yes | No | UID of the application to which the bundle belongs. | -| installTime | number | Yes | No | Time when the HAP file was installed. | -| updateTime | number | Yes | No | Time when the HAP file was updated. | -| appInfo | ApplicationInfo | Yes | No | Application configuration information. | -| abilityInfos | Array\ | Yes | No | Ability configuration information. | -| reqPermissions | Array\ | Yes | No | Array of the permissions to request from the system. | -| reqPermissionDetails | Array\ | Yes | No | Detailed information of the permissions to request from the system.| -| vendor | string | Yes | No | Vendor of the bundle. | -| versionCode | number | Yes | No | Version number of the bundle. | -| versionName | string | Yes | No | Version description of the bundle. | -| compatibleVersion | number | Yes | No | Earliest SDK version required for running the bundle. | -| targetVersion | number | Yes | No | Latest SDK version required for running the bundle. | -| isCompressNativeLibs | boolean | Yes | No | Whether to compress the native library of the bundle. The default value is **true**. | -| hapModuleInfos | Array\ | Yes | No | Module configuration information. | -| entryModuleName | string | Yes | No | Name of the entry module. | -| cpuAbi | string | Yes | No | cpuAbi information of the bundle. | -| isSilentInstallation | string | Yes | No | Whether to install the bundle in silent mode. | -| minCompatibleVersionCode | number | Yes | No | Earliest version compatible with the bundle in the distributed scenario. | -| entryInstallationFree | boolean | Yes | No | Whether installation-free is supported for the entry module. | -| reqPermissionStates8+ | Array\ | Yes | No | Permission grant state. | - -## ApplicationInfo - -Describes the application information. - - **System capability**: SystemCapability.BundleManager.BundleFramework - -| Name | Type | Readable | Writable | Description | -| -------------------------- | ---------------------------------- | ---- | ---- | --------------------- | -| name | string | Yes | No | Application name. | -| description | string | Yes | No | Application description. | -| descriptionId | number | Yes | No | Application description ID. | -| systemApp | boolean | Yes | No | Whether the application is a system application. The default value is **false**. | -| enabled | boolean | Yes | No | Whether the application is enabled. The default value is **true**. | -| label | string | Yes | No | Application label. | -| labelId | string | Yes | No | Application label ID. | -| icon | string | Yes | No | Application icon. | -| iconId | string | Yes | No | Application icon ID. | -| process | string | Yes | No | Process in which the application runs. If this parameter is not set, the bundle name is used.| -| supportedModes | number | Yes | No | Running modes supported by the application. | -| moduleSourceDirs | Array\ | Yes | No | Relative paths for storing application resources. | -| permissions | Array\ | Yes | No | Permissions required for accessing the application. | -| moduleInfos | Array\ | Yes | No | Application module information. | -| entryDir | string | Yes | No | Path for storing application files. | -| codePath8+ | string | Yes | No | Installation directory of the application. | -| metaData8+ | Map> | Yes | No | Custom metadata of the application. | -| removable8+ | boolean | Yes | No | Whether the application is removable. | -| accessTokenId8+ | number | Yes | No | Access token ID of the application. | -| uid8+ | number | Yes | No | UID of the application. | - -## ModuleInfo - -Describes the module information of the application. - - **System capability**: SystemCapability.BundleManager.BundleFramework - -| Name | Type | Readable | Writable | Description | -| --------------- | ------ | ---- | ---- | ---- | -| moduleName | string | Yes | No | Module name.| -| moduleSourceDir | string | Yes | No | Installation directory.| - -## CustomizeData - -Describes the custom metadata. - - **System capability**: SystemCapability.BundleManager.BundleFramework - -| Name | Type | Readable | Writable | Description | -| ------------------ | ------ | ---- | ---- | -------- | -| name | string | Yes | Yes | Custom metadata name.| -| value | string | Yes | Yes | Custom metadata value. | -| extra8+ | string | Yes | Yes | Custom resources. | - - -## HapModuleInfo - -Describes the HAP module information. - - **System capability**: SystemCapability.BundleManager.BundleFramework - -| Name | Type | Readable | Writable | Description | -| --------------------------------- | ---------------------------- | ---- | ---- | ------------------ | -| name | string | Yes | No | Module name. | -| description | string | Yes | No | Module description. | -| descriptionId | number | Yes | No | Module description ID. | -| icon | string | Yes | No | Module icon. | -| label | string | Yes | No | Module label. | -| labelId | number | Yes | No | Module label ID. | -| iconId | number | Yes | No | Module icon ID. | -| backgroundImg | string | Yes | No | Module background image. | -| supportedModes | number | Yes | No | Modes supported by the module. | -| reqCapabilities | Array\ | Yes | No | Capabilities required for module running. | -| deviceTypes | Array\ | Yes | No | An array of supported device types. | -| abilityInfo | Array\ | Yes | No | Ability information. | -| moduleName | string | Yes | No | Module name. | -| mainAbilityName | string | Yes | No | Name of the entry ability. | -| installationFree | boolean | Yes | No | Whether installation-free is supported. | - -## ReqPermissionDetail - -Describes the detailed information of the permissions to request from the system. - - **System capability**: SystemCapability.BundleManager.BundleFramework - -| Name | Type | Readable | Writable | Description | -| --------- | --------- | ---- | ---- | ---------- | -| name | string | Yes | Yes | Name of the permission to request. | -| reason | string | Yes | Yes | Reason for requesting the permission. | -| usedScene | UsedScene | Yes | Yes | Application scenario and timing for using the permission.| - -## UsedScene - -Describes the application scenario and timing for using the permission. - - **System capability**: SystemCapability.BundleManager.BundleFramework - -| Name | Type | Readable | Writable | Description | -| --------- | -------------- | ---- | ---- | ---------------- | -| abilities | Array\ | Yes | Yes | Abilities that use the permission.| -| when | string | Yes | Yes | Time when the permission is used. | - - -## AbilityInfo - -Describes the ability information. - - **System capability**: SystemCapability.BundleManager.BundleFramework - -| Name | Type | Readable | Writable | Description | -| --------------------- | --------------------- | ---- | ---- | ------------------------ | -| bundleName | string | Yes | No | Application bundle name. | -| name | string | Yes | No | Ability name. | -| label | string | Yes | No | Ability name visible to users. | -| description | string | Yes | No | Ability description. | -| icon | string | Yes | No | Index of the ability icon resource file. | -| descriptionId | number | Yes | No | Ability description ID. | -| iconId | number | Yes | No | Ability icon ID. | -| moduleName | string | Yes | No | Name of the HAP file to which the ability belongs. | -| process | string | Yes | No | Process in which this ability runs. If this parameter is not set, the bundle name is used by default.| -| targetAbility | string | Yes | No | Target ability that the ability alias points to. | -| backgroundModes | number | Yes | No | Background service mode of the ability. | -| isVisible | boolean | Yes | No | Whether the ability can be called by other applications. | -| formEnabled | boolean | Yes | No | Whether the ability provides the service widget capability. | -| type | AbilityType | Yes | No | Ability type. | -| orientation | DisplayOrientation | Yes | No | Ability display orientation. | -| launchMode | LaunchMode | Yes | No | Ability launch mode. | -| permissions | Array\ | Yes | No | Permissions required for other applications to call the ability.| -| deviceTypes | Array\ | Yes | No | Device types supported by the ability. | -| deviceCapabilities | Array\ | Yes | No | Device capabilities required for the ability. | -| readPermission | string | Yes | No | Permission required for reading the ability data. | -| writePermission | string | Yes | No | Permission required for writing data to the ability. | -| applicationInfo | ApplicationInfo | Yes | No | Application configuration information. | -| uri | string | Yes | No | URI of the ability. | -| labelId | number | Yes | No | Ability label ID. | -| subType | AbilitySubType | Yes | No | Subtype of the template that can be used by the ability. | -| metaData8+ | Array\ | Yes | No | Custom information of the ability. | -| enabled8+ | boolean | Yes | No | Whether the ability is enabled. | ## AbilityType @@ -1414,6 +1430,37 @@ Enumerates ability subtypes. | UNSPECIFIED | 0 | Undefined ability subtype. | | CA | 1 | Ability that has a UI.| +## ExtensionAbilityType9+ + +Enumerates Extension ability types. + + **System capability**: SystemCapability.BundleManager.BundleFramework + +| Name | Type | Description | +| ------------------------------ | ---- | ------------------------- | +| FORM9+ | 0 | Form included. | +| WORK_SCHEDULER9+ | 1 | Work scheduler included.| +| INPUT_METHOD9+ | 2 | Input method included. | +| SERVICE9+ | 3 | Service included. | +| ACCESSIBILITY9+ | 4 | Accessibility included. | +| DATA_SHARE9+ | 5 | Data sharing included.| +| FILE_SHARE9+ | 6 | File sharing included.| +| STATIC_SUBSCRIBER9+ | 7 | Subscribers included. | +| WALLPAPER9+ | 8 | Wallpaper included. | +| UNSPECIFIED9+ | 9 | Unspecified type. | + +## ExtensionFlag9+ + +Enumerates Extension flags. + + **System capability**: SystemCapability.BundleManager.BundleFramework + +| Name | Default Value | Description | +| ---------------------------------------- | ---------- | ------------------------------ | +| GET_EXTENSION_INFO_DEFAULT9+ | 0x00000000 | Obtains the default Extension ability information. | +| GET_EXTENSION_INFO_WITH_PERMISSION9+ | 0x00000002 | Obtains the Extension ability information that carries permission information. | +| GET_EXTENSION_INFO_WITH_APPLICATION9+ | 0x00000004 | Obtains the Extension ability information that carries application information. | +| GET_EXTENSION_INFO_WITH_METADATA9+ | 0x00000020 | Obtains the Extension ability information that carries metadata information.| ## ColorMode @@ -1427,7 +1474,6 @@ Enumerates color modes. | DARK_MODE | 0 | Dark mode.| | LIGHT_MODE | 1 | Light mode.| - ## GrantStatus Enumerates permission grant states. diff --git a/en/application-dev/reference/apis/js-apis-bundle-AbilityInfo.md b/en/application-dev/reference/apis/js-apis-bundle-AbilityInfo.md new file mode 100644 index 0000000000000000000000000000000000000000..75f36cbabd3f1cb7fd3fd16634a8b1193f55b314 --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-bundle-AbilityInfo.md @@ -0,0 +1,47 @@ +# AbilityInfo + + + +> **NOTE**
+> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. +> +> API version 9 is a canary version for trial use. The APIs of this version may be unstable. + + + +Provides the ability information. + + + + **System capability**: SystemCapability.BundleManager.BundleFramework + +| Name | Type | Readable| Writable| Description | +| --------------------- | -------------------------------------------------------- | ---- | ---- | ----------------------------------------- | +| bundleName | string | Yes | No | Bundle name of the application. | +| name | string | Yes | No | Ability name. | +| label | string | Yes | No | Ability name visible to users. | +| description | string | Yes | No | Ability description. | +| icon | string | Yes | No | Index of the ability icon resource file. | +| descriptionId | number | Yes | No | Ability description ID. | +| iconId | number | Yes | No | Ability icon ID. | +| moduleName | string | Yes | No | Name of the HAP file to which the ability belongs. | +| process | string | Yes | No | Process in which the ability runs. If this parameter is not set, the bundle name is used.| +| targetAbility | string | Yes | No | Target ability that the ability alias points to. | +| backgroundModes | number | Yes | No | Background service mode of the ability. | +| isVisible | boolean | Yes | No | Whether the ability can be called by other applications. | +| formEnabled | boolean | Yes | No | Whether the ability provides the service widget capability. | +| type | AbilityType | Yes | No | Ability type. | +| orientation | DisplayOrientation | Yes | No | Ability display orientation. | +| launchMode | LaunchMode | Yes | No | Ability launch mode. | +| permissions | Array\ | Yes | No | Permissions required for other applications to call the ability.| +| deviceTypes | Array\ | Yes | No | Device types supported by the ability. | +| deviceCapabilities | Array\ | Yes | No | Device capabilities required for the ability. | +| readPermission | string | Yes | No | Permission required for reading the ability data. | +| writePermission | string | Yes | No | Permission required for writing data to the ability. | +| applicationInfo | ApplicationInfo | Yes | No | Application configuration information. | +| uri | string | Yes | No | URI of the ability. | +| labelId | number | Yes | No | Ability label ID. | +| subType | AbilitySubType | Yes | No | Subtype of the template that can be used by the ability. | +| metaData8+ | Array\<[CustomizeData](js-apis-bundle-CustomizeData.md)> | Yes | No | Custom metadata of the ability. | +| metaData9+ | Array\<[Metadata](js-apis-bundle-Metadata.md)> | Yes | No | Metadata of the ability. | +| enabled8+ | boolean | Yes | No | Whether the ability is enabled. | diff --git a/en/application-dev/reference/apis/js-apis-bundle-ApplicationInfo.md b/en/application-dev/reference/apis/js-apis-bundle-ApplicationInfo.md new file mode 100644 index 0000000000000000000000000000000000000000..db5f9d10136113d71f195e54b6a07ba22b81d186 --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-bundle-ApplicationInfo.md @@ -0,0 +1,43 @@ +# ApplicationInfo + + + +> **NOTE**
+> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. +> +> API version 9 is a canary version for trial use. The APIs of this version may be unstable. + + + +Provides the application information. + + + +**System capability**: SystemCapability.BundleManager.BundleFramework + + + +| Name | Type | Readable| Writable| Description | +| -------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------ | +| name | string | Yes | No | Application name. | +| description | string | Yes | No | Application description. | +| descriptionId | number | Yes | No | Application description ID. | +| systemApp | boolean | Yes | No | Whether the application is a system application. The default value is **false**. | +| enabled | boolean | Yes | No | Whether the application is enabled. The default value is **true**. | +| label | string | Yes | No | Application label. | +| labelId | string | Yes | No | Application label ID. | +| icon | string | Yes | No | Application icon. | +| iconId | string | Yes | No | Application icon ID. | +| process | string | Yes | No | Process in which the application runs. If this parameter is not set, the bundle name is used.| +| supportedModes | number | Yes | No | Running modes supported by the application. | +| moduleSourceDirs | Array\ | Yes | No | Relative paths for storing application resources. | +| permissions | Array\ | Yes | No | Permissions required for accessing the application. | +| moduleInfos | Array\<[ModuleInfo](js-apis-bundle-ModuleInfo.md)> | Yes | No | Application module information. | +| entryDir | string | Yes | No | Path for storing application files. | +| codePath8+ | string | Yes | No | Installation directory of the application. | +| metaData8+ | Map\> | Yes | No | Custom metadata of the application. | +| metaData9+ | Map\> | Yes | No | Metadata of the application. | +| removable8+ | boolean | Yes | No | Whether the application is removable. | +| accessTokenId8+ | number | Yes | No | Access token ID of the application. | +| uid8+ | number | Yes | No | UID of the application. | +| entityType8+ | string | Yes | No | Entity type of the application. | diff --git a/en/application-dev/reference/apis/js-apis-bundle-BundleInfo.md b/en/application-dev/reference/apis/js-apis-bundle-BundleInfo.md new file mode 100644 index 0000000000000000000000000000000000000000..4faaf2531a2a3e36733dcc190c8401f39374fd65 --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-bundle-BundleInfo.md @@ -0,0 +1,70 @@ +# BundleInfo + + + +> **NOTE**
+> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. +> +> API version 9 is a canary version for trial use. The APIs of this version may be unstable. + + + +Provides the application bundle information. + + + + **System capability**: SystemCapability.BundleManager.BundleFramework + +| Name | Type | Readable| Writable| Description | +| --------------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------ | +| name | string | Yes | No | Bundle name. | +| type | string | Yes | No | Bundle type. | +| appId | string | Yes | No | ID of the application to which the bundle belongs. | +| uid | number | Yes | No | UID of the application to which the bundle belongs. | +| installTime | number | Yes | No | Time when the HAP file was installed. | +| updateTime | number | Yes | No | Time when the HAP file was updated. | +| appInfo | ApplicationInfo | Yes | No | Application configuration information. | +| abilityInfos | Array\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)> | Yes | No | Ability configuration information. | +| reqPermissions | Array\ | Yes | No | Permissions to request from the system for running the application. | +| reqPermissionDetails | Array\<[ReqPermissionDetail](#ReqPermissionDetail)> | Yes | No | Detailed information of the permissions to request from the system.| +| vendor | string | Yes | No | Vendor of the bundle. | +| versionCode | number | Yes | No | Version number of the bundle. | +| versionName | string | Yes | No | Version description of the bundle. | +| compatibleVersion | number | Yes | No | Earliest SDK version required for running the bundle. | +| targetVersion | number | Yes | No | Latest SDK version required for running the bundle. | +| isCompressNativeLibs | boolean | Yes | No | Whether to compress the native library of the bundle. The default value is **true**. | +| hapModuleInfos | Array\<[HapModuleInfo](js-apis-bundle-HapModuleInfo.md)> | Yes | No | Module configuration information. | +| entryModuleName | string | Yes | No | Name of the entry module. | +| cpuAbi | string | Yes | No | cpuAbi information of the bundle. | +| isSilentInstallation | string | Yes | No | Whether the application can be installed in silent mode. | +| minCompatibleVersionCode | number | Yes | No | Earliest version compatible with the bundle in the distributed scenario. | +| entryInstallationFree | boolean | Yes | No | Whether installation-free is supported for the entry module. | +| reqPermissionStates8+ | Array\ | Yes | No | Permission grant state. | +| extensionAbilityInfo9+ | Array\<[ExtensionAbilityInfo](js-apis-bundle-ExtensionAbilityInfo.md)> | Yes | No | Extension ability information. | + + + +## ReqPermissionDetail + +Provides the detailed information of the permissions to request from the system. + + **System capability**: SystemCapability.BundleManager.BundleFramework + +| Name | Type | Readable| Writable| Description | +| --------------------- | ----------------------- | ---- | ---- | -------------------- | +| name | string | Yes | Yes | Name of the permission to request. | +| reason | string | Yes | Yes | Reason for requesting the permission. | +| usedScene | [UsedScene](#usedscene) | Yes | Yes | Application scenario and timing for using the permission.| + + + +## UsedScene + +Describes the application scenario and timing for using the permission. + + **System capability**: SystemCapability.BundleManager.BundleFramework + +| Name | Type | Readable| Writable| Description | +| --------- | -------------- | ---- | ---- | ------------------------- | +| abilities | Array\ | Yes | Yes | Abilities that use the permission.| +| when | string | Yes | Yes | Time when the permission is used. | diff --git a/en/application-dev/reference/apis/js-apis-bundle-CustomizeData.md b/en/application-dev/reference/apis/js-apis-bundle-CustomizeData.md new file mode 100644 index 0000000000000000000000000000000000000000..d45e4620d5af5f29334b9cb4bc264acea124095a --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-bundle-CustomizeData.md @@ -0,0 +1,22 @@ +# CustomizeData + + + +> **NOTE**
+> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. + + + +Provides custom metadata. + + + +**System capability**: SystemCapability.BundleManager.BundleFramework + + + +| Name | Type | Readable| Writable| Description | +| ------------------ | ------ | ---- | ---- | ---------------- | +| name | string | Yes | Yes | Custom metadata name.| +| value | string | Yes | Yes | Custom metadata value. | +| extra8+ | string | Yes | Yes | Custom metadata resources. | diff --git a/en/application-dev/reference/apis/js-apis-bundle-ExtensionAbilityInfo.md b/en/application-dev/reference/apis/js-apis-bundle-ExtensionAbilityInfo.md new file mode 100644 index 0000000000000000000000000000000000000000..596753259d18ac2defea135cb8479719977f9ced --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-bundle-ExtensionAbilityInfo.md @@ -0,0 +1,33 @@ +# ExtensionAbilityInfo + + + +> **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. +> +> API version 9 is a canary version for trial use. The APIs of this version may be unstable. + + + +Provides the Extension ability information. + + + +**System capability**: SystemCapability.BundleManager.BundleFramework + +| Name | Type | Readable| Writable| Description | +| -------------------- | ---------------------------------------------------- | ---- | ---- | -------------------------------------------------- | +| bundleName | string | Yes | No | Bundle name of the application. | +| moduleName | string | Yes | No | Name of the HAP file to which the Extension ability belongs. | +| name | string | Yes | No | Name of the Extension ability. | +| labelId | number | Yes | No | Label ID of the Extension ability. | +| descriptionId | number | Yes | No | Description ID of the Extension ability. | +| iconId | number | Yes | No | Icon ID of the Extension ability. | +| isVisible | boolean | Yes | No | Whether the Extension ability can be called by other applications. | +| extensionAbilityType | bundle.ExtensionAbilityType | Yes | No | Type of the Extension ability. | +| permissions | Array\ | Yes | No | Permissions required for other applications to call the Extension ability.| +| applicationInfo | ApplicationInfo | Yes | No | Application information of the Extension ability. | +| metaData | Array\<[Metadata](js-apis-bundle-Metadata.md)> | Yes | No | Metadata of the Extension ability. | +| enabled | boolean | Yes | No | Whether the Extension ability is enabled. | +| readPermission | string | Yes | No | Permission required for reading the Extension ability data. | +| writePermission | string | Yes | No | Permission required for writing data to the Extension ability. | diff --git a/en/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md b/en/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md new file mode 100644 index 0000000000000000000000000000000000000000..dd69a7f722faa97d3e50db2ed82bb691b4bd8211 --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-bundle-HapModuleInfo.md @@ -0,0 +1,39 @@ +# HapModuleInfo + + + +> **NOTE**
+> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. +> +> API version 9 is a canary version for trial use. The APIs of this version may be unstable. + + + +Provides the HAP module information. + + + +**System capability**: SystemCapability.BundleManager.BundleFramework + + + +| Name | Type | Readable| Writable| Description | +| --------------------------------- | ------------------------------------------------------------ | ---- | ---- | -------------------- | +| name | string | Yes | No | Module name. | +| description | string | Yes | No | Module description. | +| descriptionId | number | Yes | No | Module description ID. | +| icon | string | Yes | No | Module icon. | +| label | string | Yes | No | Module label. | +| labelId | number | Yes | No | Module label ID. | +| iconId | number | Yes | No | Module icon ID. | +| backgroundImg | string | Yes | No | Module background image. | +| supportedModes | number | Yes | No | Running modes supported by the module. | +| reqCapabilities | Array\ | Yes | No | Capabilities required for module running. | +| deviceTypes | Array\ | Yes | No | Device types supported by the module. | +| abilityInfo | Array\<[AbilityInfo](js-apis-bundle-AbilityInfo.md)> | Yes | No | Ability information. | +| moduleName | string | Yes | No | Module name. | +| mainAbilityName | string | Yes | No | Name of the main ability. | +| installationFree | boolean | Yes | No | Whether installation-free is supported. | +| mainElementName9+ | string | Yes | No | Information about the main ability. | +| extensionAbilityInfo9+ | Array\<[ExtensionAbilityInfo](js-apis-bundle-ExtensionAbilityInfo.md)> | Yes | No | Information about the Extension ability.| +| metadata9+ | Array\<[Metadata](js-apis-bundle-Metadata.md)> | Yes | No | Metadata of the ability. | diff --git a/en/application-dev/reference/apis/js-apis-bundle-Metadata.md b/en/application-dev/reference/apis/js-apis-bundle-Metadata.md new file mode 100644 index 0000000000000000000000000000000000000000..cf1060e9a4634c480da7b1bb21c25342eac019cd --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-bundle-Metadata.md @@ -0,0 +1,24 @@ +# Metadata + + + +> **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. +> +> API version 9 is a canary version for trial use. The APIs of this version may be unstable. + + + +Provides the metadata information. + + + +**System capability**: SystemCapability.BundleManager.BundleFramework + + + +| Name | Type | Readable| Writable| Description | +| -------- | ------ | ---- | ---- | ---------- | +| name | string | Yes | Yes | Metadata name.| +| value | string | Yes | Yes | Metadata value. | +| resource | string | Yes | Yes | Metadata resource.| diff --git a/en/application-dev/reference/apis/js-apis-bundle-ModuleInfo.md b/en/application-dev/reference/apis/js-apis-bundle-ModuleInfo.md new file mode 100644 index 0000000000000000000000000000000000000000..71fc24ff40eca2febce360b6be7b9eeb149d1b52 --- /dev/null +++ b/en/application-dev/reference/apis/js-apis-bundle-ModuleInfo.md @@ -0,0 +1,21 @@ +# ModuleInfo + + + +> **NOTE**
+> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version. + + + +Provides the module information of the application. + + + +**System capability**: SystemCapability.BundleManager.BundleFramework + + + +| Name | Type | Readable| Writable| Description | +| --------------- | ------ | ---- | ---- | -------- | +| moduleName | string | Yes | No | Module name.| +| moduleSourceDir | string | Yes | No | Installation directory.|