• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * The bundle pack info class.
18 * @typedef BundlePackInfo
19 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
20 * @systemapi
21 * @since 9
22 */
23export interface BundlePackInfo {
24  /**
25   * This contains package information in pack.info
26   * @type {PackageConfig}
27   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
28   * @since 9
29   */
30  readonly packages: Array<PackageConfig>;
31
32  /**
33   * This contains bundle summary information in pack.info
34   * @type {PackageSummary}
35   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
36   * @since 9
37   */
38  readonly summary: PackageSummary;
39}
40
41/**
42 * PackageConfig: the package info class.
43 * @typedef PackageConfig
44 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
45 * @systemapi
46 * @since 9
47 */
48export interface PackageConfig {
49  /**
50   * Indicates the device types of this package
51   * @type {Array<string>}
52   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
53   * @since 9
54   */
55  readonly deviceTypes: Array<string>;
56
57  /**
58   * Indicates the name of this package
59   * @type {string}
60   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
61   * @since 9
62   */
63  readonly name: string;
64
65  /**
66   * Indicates the module type of this package
67   * @type {string}
68   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
69   * @since 9
70   */
71  readonly moduleType: string;
72
73  /**
74   * Indicates whether this package is delivery and install
75   * @type {boolean}
76   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
77   * @since 9
78   */
79  readonly deliveryWithInstall: boolean;
80}
81
82/**
83 * PackageSummary: the package summary class.
84 * @typedef PackageSummary
85 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
86 * @systemapi
87 * @since 9
88 */
89export interface PackageSummary {
90  /**
91   * Indicates the bundle config info of this package
92   * @type {BundleConfigInfo}
93   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
94   * @since 9
95   */
96  readonly app: BundleConfigInfo;
97
98  /**
99   * Indicates the modules config info of this package
100   * @type {Array<ModuleConfigInfo>}
101   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
102   * @since 9
103   */
104  readonly modules: Array<ModuleConfigInfo>;
105}
106
107/**
108 * BundleConfigInfo: the bundle summary class.
109 * @typedef BundleConfigInfo
110 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
111 * @systemapi
112 * @since 9
113 */
114export interface BundleConfigInfo {
115  /**
116   * Indicates the name of this bundle
117   * @type {string}
118   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
119   * @since 9
120   */
121  readonly bundleName: string;
122
123  /**
124   * Indicates the bundle version
125   * @type {Version}
126   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
127   * @since 9
128   */
129  readonly version: Version;
130}
131
132/**
133 * ExtensionAbility: the extension ability forms class.
134 * @typedef ExtensionAbility
135 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
136 * @systemapi
137 * @since 9
138 */
139 export interface ExtensionAbility {
140  /**
141   * Indicates the name of this extension ability
142   * @type {string}
143   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
144   * @since 9
145   */
146  readonly name: string;
147
148  /**
149   * Indicates the ability forms info
150   * @type {Array<AbilityFormInfo>}
151   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
152   * @since 9
153   */
154   readonly forms: Array<AbilityFormInfo>;
155}
156
157/**
158 * ModuleConfigInfo: the module summary of a bundle.
159 * @typedef ModuleConfigInfo
160 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
161 * @systemapi
162 * @since 9
163 */
164export interface ModuleConfigInfo {
165  /**
166   * Indicates the name of main ability
167   * @type {string}
168   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
169   * @since 9
170   */
171  readonly mainAbility: string;
172
173  /**
174   * Indicates the api version
175   * @type {ApiVersion}
176   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
177   * @since 9
178   */
179  readonly apiVersion: ApiVersion;
180
181  /**
182   * Indicates the devices type
183   * @type {string}
184   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
185   * @since 9
186   */
187  readonly deviceTypes: Array<string>;
188
189  /**
190   * Indicates the module distro info
191   * @type {ModuleDistroInfo}
192   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
193   * @since 9
194   */
195  readonly distro: ModuleDistroInfo;
196
197  /**
198   * Indicates the abilities info of this module
199   * @type {Array<ModuleAbilityInfo>}
200   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
201   * @since 9
202   */
203  readonly abilities: Array<ModuleAbilityInfo>;
204
205  /**
206   * Indicates extension abilities info of this module
207   * @type {Array<ExtensionAbility>}
208   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
209   * @since 9
210   */
211   readonly extensionAbilities: Array<ExtensionAbility>;
212}
213
214/**
215 * ModuleDistroInfo: the bundle info summary class.
216 * @typedef ModuleDistroInfo
217 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
218 * @systemapi
219 * @since 9
220 */
221export interface ModuleDistroInfo {
222  /**
223   * Indicates whether this package is delivered with install
224   * @type {boolean}
225   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
226   * @since 9
227   */
228  readonly deliveryWithInstall: boolean;
229
230  /**
231   * Indicates whether this package is free install
232   * @type {boolean}
233   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
234   * @since 9
235   */
236  readonly installationFree: boolean;
237
238  /**
239   * Indicates the module name
240   * @type {string}
241   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
242   * @since 9
243   */
244  readonly moduleName: string;
245
246  /**
247   * Indicates the module type
248   * @type {string}
249   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
250   * @since 9
251   */
252  readonly moduleType: string;
253}
254
255/**
256 * ModuleAbilityInfo: the ability info of a module.
257 * @typedef ModuleAbilityInfo
258 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
259 * @systemapi
260 * @since 9
261 */
262export interface ModuleAbilityInfo {
263  /**
264   * Indicates the name of this module ability
265   * @type {string}
266   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
267   * @since 9
268   */
269  readonly name: string;
270
271  /**
272   * Indicates the label of this module ability
273   * @type {string}
274   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
275   * @since 9
276   */
277  readonly label: string;
278
279  /**
280   * Indicates whether this ability can be called by other abilities
281   * @type {boolean}
282   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
283   * @since 9
284   */
285  readonly exported: boolean;
286
287  /**
288   * Indicates the ability forms info
289   * @type {Array<AbilityFormInfo>}
290   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
291   * @since 9
292   */
293  readonly forms: Array<AbilityFormInfo>;
294}
295
296/**
297 * AbilityFormInfo: the form info of an ability.
298 * @typedef AbilityFormInfo
299 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
300 * @systemapi
301 * @since 9
302 */
303export interface AbilityFormInfo {
304  /**
305   * Indicates the name of this ability
306   * @type {string}
307   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
308   * @since 9
309   */
310  readonly name: string;
311
312  /**
313   * Indicates the type of this ability
314   * @type {string}
315   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
316   * @since 9
317   */
318  readonly type: string;
319
320  /**
321   * Indicates whether this form is enabled update
322   * @type {boolean}
323   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
324   * @since 9
325   */
326  readonly updateEnabled: boolean;
327
328  /**
329   * Indicates the scheduled update time
330   * @type {string}
331   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
332   * @since 9
333   */
334  readonly scheduledUpdateTime: string;
335
336  /**
337   * Indicates the update duration
338   * @type {number}
339   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
340   * @since 9
341   */
342  readonly updateDuration: number;
343
344  /**
345   * Indicates the ability support dimensions
346   * @type {Array<string>}
347   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
348   * @since 9
349   */
350  readonly supportDimensions: Array<string>;
351
352  /**
353   * Indicates the ability default dimension
354   * @type {string}
355   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
356   * @since 9
357   */
358  readonly defaultDimension: string;
359}
360
361/**
362 * Version: the bundle version class.
363 * @typedef Version
364 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
365 * @systemapi
366 * @since 9
367 */
368export interface Version {
369  /**
370   * Indicates the min compatible code of this version
371   * @type {number}
372   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
373   * @since 9
374   */
375  readonly minCompatibleVersionCode: number;
376
377  /**
378   * Indicates the name of this version
379   * @type {string}
380   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
381   * @since 9
382   */
383  readonly name: string;
384
385  /**
386   * Indicates the code of this version
387   * @type {number}
388   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
389   * @since 9
390   */
391  readonly code: number;
392}
393
394/**
395 * ApiVersion: the bundle Api version class.
396 * @typedef ApiVersion
397 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
398 * @systemapi
399 * @since 9
400 */
401export interface ApiVersion {
402  /**
403   * Indicates the release type of the api
404   * @type {string}
405   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
406   * @since 9
407   */
408  readonly releaseType: string;
409
410  /**
411   * Indicates the compatible version code of the api
412   * @type {number}
413   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
414   * @since 9
415   */
416  readonly compatible: number;
417
418  /**
419   * Indicates the target version code of the api
420   * @type {number}
421   * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall
422   * @since 9
423   */
424  readonly target: number;
425}
426