js-apis-bundleManager-packInfo.md 10.1 KB
Newer Older
1 2
# PackInfo

3 4
The **PackInfo** module provides information in the **pack.info** file. The information can be obtained using [freeInstall.getBundlePackInfo](js-apis-freeInstall.md).

5 6 7 8 9 10 11

> **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.

## BundlePackInfo

12
**System API**: This is a system API.
13

14
**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall
15

16 17 18 19 20

| Name    | Type                                   | Readable| Writable| Description                     |
| -------- | --------------------------------------- | ---- | ---- | ------------------------- |
| packages | Array\<[PackageConfig](#packageconfig)> | Yes  | No  | Package configuration information in the **pack.info** file.      |
| summary  | [PackageSummary](#packagesummary)       | Yes  | No  | Package summary information in the **pack.info** file.|
21 22 23

## PackageConfig

24
**System API**: This is a system API.
25

26
**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall
27 28 29

| Name               | Type          | Readable| Writable| Description                                                        |
| ------------------- | -------------- | ---- | ---- | ------------------------------------------------------------ |
30 31 32 33
| deviceTypes          | Array\<string> | Yes  | No  | Device types supported by the bundle.                                      |
| name                | string         | Yes  | No  | Bundle name.                                                  |
| moduleType          | string         | Yes  | No  | Module type of the bundle.                                            |
| deliveryWithInstall | boolean        | Yes  | No  | Whether the HAP file will be installed when the user installs the bundle. The value **true** means that the HAP file will be automatically installed when the user installs the bundle, and **false** means the opposite.|
34

35
## PackageSummary
36

37
**System API**: This is a system API.
38

39
**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall
40 41 42 43

| Name   | Type                                         | Readable| Writable| Description                |
| ------- | --------------------------------------------- | ---- | ---- | -------------------- |
| app     | [BundleConfigInfo](#bundleconfiginfo)         | Yes  | No  | Bundle configuration information.      |
44
| modules | Array\<[ModuleConfigInfo](#moduleconfiginfo)> | Yes  | No  | Module configuration information of the bundle.|
45 46 47

## BundleConfigInfo

48
**System API**: This is a system API.
49

50
**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall
51 52 53

| Name      | Type               | Readable| Writable| Description                              |
| ---------- | ------------------- | ---- | ---- | ---------------------------------- |
54
| bundleName | string              | Yes  | No  | Bundle name. It uniquely identifies the application.|
55 56 57 58
| version    | [Version](#version) | Yes  | No  | Bundle version.                        |

## ModuleConfigInfo

59
**System API**: This is a system API.
60

61
**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall
62 63 64

| Name              | Type                                             | Readable| Writable| Description                              |
| ------------------ | ------------------------------------------------- | ---- | ---- | ---------------------------------- |
65
| mainAbility | string | Yes| No| Name of the main ability.|
66
| apiVersion         | [ApiVersion](#apiversion)                         | Yes  | No  | API version of the module.                 |
67
| deviceType         | Array\<string>                                    | Yes  | No  | Device types supported by the module.                |
68 69
| distro             | [ModuleDistroInfo](#moduledistroinfo)             | Yes  | No  | Distribution information of the module.                |
| abilities          | Array\<[ModuleAbilityInfo](#moduleabilityinfo)>   | Yes  | No  | Ability information of the module.              |
70
| extensionAbilities | Array\<[ExtensionAbilities](#extensionability)> | Yes  | No  | Extension ability information of the module.|
71

72
## ModuleDistroInfo
73

74
**System API**: This is a system API.
75

76
**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall
77 78 79

| Name               | Type   | Readable| Writable| Description                                                        |
| ------------------- | ------- | ---- | ---- | ------------------------------------------------------------ |
80
| deliveryWithInstall | boolean | Yes  | No  | Whether the HAP file will be installed when the user installs the bundle. The value **true** means that the HAP file will be automatically installed when the user installs the bundle, and **false** means the opposite.|
81 82 83 84
| installationFree    | boolean | Yes  | No  | Whether the HAP file supports the installation-free feature. The value **true** means that the HAP file supports the installation-free feature and meets installation-free constraints, and **false** means the opposite.|
| moduleName          | string  | Yes  | No  | Module name.                                                |
| moduleType          | string  | Yes  | No  | Module type.                                                |

85
## ModuleAbilityInfo
86

87
**System API**: This is a system API.
88

89
**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall
90 91 92

| Name   | Type                                       | Readable| Writable| Description                                                        |
| ------- | ------------------------------------------- | ---- | ---- | ------------------------------------------------------------ |
93
| name    | string                                      | Yes  | No  | Name of the ability. The name must be unique in the bundle.           |
94
| label   | string                                      | Yes  | No  | Name of the ability displayed to users. The value is a resource index to names in multiple languages.|
95
| visible | boolean                                     | Yes  | No  | Whether the ability can be called by other bundles. The value **true** means that the ability can be called by other bundles, and **false** means the opposite.|
96 97
| forms   | Array\<[AbilityFormInfo](#abilityforminfo)> | Yes  | No  | Widget information.                                                  |

98
## ExtensionAbility
99

100
**System API**: This is a system API.
101

102
**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall
103 104 105

| Name | Type                                       | Readable| Writable| Description                                                        |
| ----- | ------------------------------------------- | ---- | ---- | ------------------------------------------------------------ |
106 107
| name | string | Yes| No| Name of the Extension ability.|
| forms | Array\<[AbilityFormInfo](#abilityforminfo)> | Yes  | No  | Widget information.|
108 109 110

## AbilityFormInfo

111
**System API**: This is a system API.
112

113
**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall
114 115 116 117 118

| Name               | Type          | Readable| Writable| Description                                                        |
| ------------------- | -------------- | ---- | ---- | ------------------------------------------------------------ |
| name                | string         | Yes  | No  | Widget name.                                           |
| type                | string         | Yes  | No  | Widget type.                                           |
119
| updateEnabled       | boolean        | Yes  | No  | Whether the widget supports periodic update. The value **true** means that the widget supports periodic update, and **false** means the opposite.|
120
| scheduledUpdateTime | string         | Yes  | No  | Scheduled time to update the widget. The value is in 24-hour format and accurate to the minute.        |
121 122 123
| updateDuration      | number         | Yes  | No  | Interval to update the widget. The unit is 30 minutes. The value is a multiple of 30. A widget can be updated at a specified interval (**updateDuration**) or at the scheduled time (**scheduledUpdateTime**). If both are configured, **updateDuration** takes precedence.|
| supportDimensions   | Array\<string> | Yes  | No  | Dimensions of the widget. The value can be **1\*2**, **2\*2**, **2\*4**, **4\*4**, or a combination of these options. At least one option must be specified when defining the widget.|
| defaultDimension    | string         | Yes  | No  | Default dimensions of the widget. The value must be available in the **supportDimensions** array of the widget.|
124 125 126 127 128

## ApiVersion

**System API**: This is a system API and cannot be called by third-party applications.

129
**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall
130 131 132 133 134

| Name       | Type  | Readable| Writable| Description                |
| ----------- | ------ | ---- | ---- | -------------------- |
| releaseType | string | Yes  | No  | Name of the API version.        |
| compatible  | number | Yes  | No  | Minimum API version.|
135
| target      | number  | Yes  | No  | Target API version.        |
136 137 138

## Version

139
**System API**: This is a system API.
140

141
**System capability**: SystemCapability.BundleManager.BundleFrameWork.FreeInstall
142 143 144

| Name                    | Type  | Readable| Writable| Description                                                        |
| ------------------------ | ------ | ---- | ---- | ------------------------------------------------------------ |
145 146 147
| minCompatibleVersionCode | number | Yes  | No  | Minimum compatible version of the bundle. It is used to check whether the bundle is compatible with a version on other devices in the cross-device scenario. The value is a 32-bit non-negative integer.|
| name                     | string | Yes  | No  | Version number of the bundle visible to users.                      |
| code                     | number | Yes  | No  | Version number of the bundle used only for bundle management. The value is a 32-bit non-negative integer. It is used only to determine whether a version is later than another version. A larger value indicates a later version.|