• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-2023 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
16import { AbilityInfo } from './AbilityInfo';
17import { ExtensionAbilityInfo } from './ExtensionAbilityInfo';
18import { Metadata } from './Metadata';
19import bundleManager from './../@ohos.bundle.bundleManager';
20
21/**
22 * Obtains configuration information about a hap module.
23 *
24 * @typedef HapModuleInfo
25 * @syscap SystemCapability.BundleManager.BundleFramework.Core
26 * @since 9
27 */
28/**
29 * Obtains configuration information about a hap module.
30 *
31 * @typedef HapModuleInfo
32 * @syscap SystemCapability.BundleManager.BundleFramework.Core
33 * @crossplatform
34 * @since 10
35 */
36/**
37 * Obtains configuration information about a hap module.
38 *
39 * @typedef HapModuleInfo
40 * @syscap SystemCapability.BundleManager.BundleFramework.Core
41 * @crossplatform
42 * @atomicservice
43 * @since 11
44 */
45export interface HapModuleInfo {
46  /**
47   * Indicates the name of this hap module
48   *
49   * @type { string }
50   * @syscap SystemCapability.BundleManager.BundleFramework.Core
51   * @since 9
52   */
53  /**
54   * Indicates the name of this hap module
55   *
56   * @type { string }
57   * @syscap SystemCapability.BundleManager.BundleFramework.Core
58   * @crossplatform
59   * @since 10
60   */
61  /**
62   * Indicates the name of this hap module
63   *
64   * @type { string }
65   * @syscap SystemCapability.BundleManager.BundleFramework.Core
66   * @crossplatform
67   * @atomicservice
68   * @since 11
69   */
70  readonly name: string;
71
72  /**
73   * Indicates the icon of this hap module
74   *
75   * @type { string }
76   * @syscap SystemCapability.BundleManager.BundleFramework.Core
77   * @since 9
78   */
79  /**
80   * Indicates the icon of this hap module
81   *
82   * @type { string }
83   * @syscap SystemCapability.BundleManager.BundleFramework.Core
84   * @crossplatform
85   * @since 10
86   */
87  /**
88   * Indicates the icon of this hap module
89   *
90   * @type { string }
91   * @syscap SystemCapability.BundleManager.BundleFramework.Core
92   * @crossplatform
93   * @atomicservice
94   * @since 11
95   */
96  readonly icon: string;
97
98  /**
99   * Indicates the icon id of this hap module
100   *
101   * @type { number }
102   * @syscap SystemCapability.BundleManager.BundleFramework.Core
103   * @since 9
104   */
105  /**
106   * Indicates the icon id of this hap module
107   *
108   * @type { number }
109   * @syscap SystemCapability.BundleManager.BundleFramework.Core
110   * @crossplatform
111   * @since 10
112   */
113  /**
114   * Indicates the icon id of this hap module
115   *
116   * @type { number }
117   * @syscap SystemCapability.BundleManager.BundleFramework.Core
118   * @crossplatform
119   * @atomicservice
120   * @since 11
121   */
122  readonly iconId: number;
123
124  /**
125   * Indicates the label of this hap module
126   *
127   * @type { string }
128   * @syscap SystemCapability.BundleManager.BundleFramework.Core
129   * @since 9
130   */
131  /**
132   * Indicates the label of this hap module
133   *
134   * @type { string }
135   * @syscap SystemCapability.BundleManager.BundleFramework.Core
136   * @crossplatform
137   * @since 10
138   */
139  /**
140   * Indicates the label of this hap module
141   *
142   * @type { string }
143   * @syscap SystemCapability.BundleManager.BundleFramework.Core
144   * @crossplatform
145   * @atomicservice
146   * @since 11
147   */
148  readonly label: string;
149
150  /**
151   * Indicates the label id of this hap module
152   *
153   * @type { number }
154   * @syscap SystemCapability.BundleManager.BundleFramework.Core
155   * @since 9
156   */
157  /**
158   * Indicates the label id of this hap module
159   *
160   * @type { number }
161   * @syscap SystemCapability.BundleManager.BundleFramework.Core
162   * @crossplatform
163   * @since 10
164   */
165  /**
166   * Indicates the label id of this hap module
167   *
168   * @type { number }
169   * @syscap SystemCapability.BundleManager.BundleFramework.Core
170   * @crossplatform
171   * @atomicservice
172   * @since 11
173   */
174  readonly labelId: number;
175
176  /**
177   * Describes the hap module
178   *
179   * @type { string }
180   * @syscap SystemCapability.BundleManager.BundleFramework.Core
181   * @since 9
182   */
183  /**
184   * Describes the hap module
185   *
186   * @type { string }
187   * @syscap SystemCapability.BundleManager.BundleFramework.Core
188   * @crossplatform
189   * @since 10
190   */
191  /**
192   * Describes the hap module
193   *
194   * @type { string }
195   * @syscap SystemCapability.BundleManager.BundleFramework.Core
196   * @crossplatform
197   * @atomicservice
198   * @since 11
199   */
200  readonly description: string;
201
202  /**
203   * Indicates the description of this hap module
204   *
205   * @type { number }
206   * @syscap SystemCapability.BundleManager.BundleFramework.Core
207   * @since 9
208   */
209  /**
210   * Indicates the description of this hap module
211   *
212   * @type { number }
213   * @syscap SystemCapability.BundleManager.BundleFramework.Core
214   * @crossplatform
215   * @since 10
216   */
217  /**
218   * Indicates the description of this hap module
219   *
220   * @type { number }
221   * @syscap SystemCapability.BundleManager.BundleFramework.Core
222   * @crossplatform
223   * @atomicservice
224   * @since 11
225   */
226  readonly descriptionId: number;
227
228  /**
229   * Indicates main elementName of the hap module
230   *
231   * @type { string }
232   * @syscap SystemCapability.BundleManager.BundleFramework.Core
233   * @since 9
234   */
235  /**
236   * Indicates main elementName of the hap module
237   *
238   * @type { string }
239   * @syscap SystemCapability.BundleManager.BundleFramework.Core
240   * @crossplatform
241   * @since 10
242   */
243  /**
244   * Indicates main elementName of the hap module
245   *
246   * @type { string }
247   * @syscap SystemCapability.BundleManager.BundleFramework.Core
248   * @crossplatform
249   * @atomicservice
250   * @since 11
251   */
252  readonly mainElementName: string;
253
254  /**
255   * Obtains configuration information about abilities
256   *
257   * @type { Array<AbilityInfo> }
258   * @syscap SystemCapability.BundleManager.BundleFramework.Core
259   * @since 9
260   */
261  /**
262   * Obtains configuration information about abilities
263   *
264   * @type { Array<AbilityInfo> }
265   * @syscap SystemCapability.BundleManager.BundleFramework.Core
266   * @crossplatform
267   * @since 10
268   */
269  /**
270   * Obtains configuration information about abilities
271   *
272   * @type { Array<AbilityInfo> }
273   * @syscap SystemCapability.BundleManager.BundleFramework.Core
274   * @crossplatform
275   * @atomicservice
276   * @since 11
277   */
278  readonly abilitiesInfo: Array<AbilityInfo>;
279
280  /**
281   * Obtains configuration information about extension abilities
282   *
283   * @type { Array<ExtensionAbilityInfo> }
284   * @syscap SystemCapability.BundleManager.BundleFramework.Core
285   * @since 9
286   */
287  /**
288   * Obtains configuration information about extension abilities
289   *
290   * @type { Array<ExtensionAbilityInfo> }
291   * @syscap SystemCapability.BundleManager.BundleFramework.Core
292   * @atomicservice
293   * @since 11
294   */
295  readonly extensionAbilitiesInfo: Array<ExtensionAbilityInfo>;
296
297  /**
298   * Indicates the metadata of ability
299   *
300   * @type { Array<Metadata> }
301   * @syscap SystemCapability.BundleManager.BundleFramework.Core
302   * @since 9
303   */
304  /**
305   * Indicates the metadata of ability
306   *
307   * @type { Array<Metadata> }
308   * @syscap SystemCapability.BundleManager.BundleFramework.Core
309   * @crossplatform
310   * @since 10
311   */
312  /**
313   * Indicates the metadata of ability
314   *
315   * @type { Array<Metadata> }
316   * @syscap SystemCapability.BundleManager.BundleFramework.Core
317   * @crossplatform
318   * @atomicservice
319   * @since 11
320   */
321  readonly metadata: Array<Metadata>;
322
323  /**
324   * The device types that this hap module can run on
325   *
326   * @type { Array<string> }
327   * @syscap SystemCapability.BundleManager.BundleFramework.Core
328   * @since 9
329   */
330  /**
331   * The device types that this hap module can run on
332   *
333   * @type { Array<string> }
334   * @syscap SystemCapability.BundleManager.BundleFramework.Core
335   * @atomicservice
336   * @since 11
337   */
338  readonly deviceTypes: Array<string>;
339
340  /**
341   * Indicates whether free installation of the hap module is supported
342   *
343   * @type { boolean }
344   * @syscap SystemCapability.BundleManager.BundleFramework.Core
345   * @since 9
346   */
347  /**
348   * Indicates whether free installation of the hap module is supported
349   *
350   * @type { boolean }
351   * @syscap SystemCapability.BundleManager.BundleFramework.Core
352   * @atomicservice
353   * @since 11
354   */
355  readonly installationFree: boolean;
356
357  /**
358   * Indicates the hash value of the hap module
359   *
360   * @type { string }
361   * @syscap SystemCapability.BundleManager.BundleFramework.Core
362   * @since 9
363   */
364  /**
365   * Indicates the hash value of the hap module
366   *
367   * @type { string }
368   * @syscap SystemCapability.BundleManager.BundleFramework.Core
369   * @atomicservice
370   * @since 11
371   */
372  readonly hashValue: string;
373
374  /**
375   * Indicates the type of the module
376   *
377   * @type { bundleManager.ModuleType }
378   * @syscap SystemCapability.BundleManager.BundleFramework.Core
379   * @since 9
380   */
381  /**
382   * Indicates the type of the module
383   *
384   * @type { bundleManager.ModuleType }
385   * @syscap SystemCapability.BundleManager.BundleFramework.Core
386   * @atomicservice
387   * @since 11
388   */
389  readonly type: bundleManager.ModuleType;
390
391  /**
392   * Indicates the dependency module that this module depends on
393   *
394   * @type { Array<Dependency> }
395   * @syscap SystemCapability.BundleManager.BundleFramework.Core
396   * @since 9
397   */
398  /**
399   * Indicates the dependency module that this module depends on
400   *
401   * @type { Array<Dependency> }
402   * @syscap SystemCapability.BundleManager.BundleFramework.Core
403   * @atomicservice
404   * @since 11
405   */
406  readonly dependencies: Array<Dependency>;
407
408  /**
409   * Indicates the preload module
410   *
411   * @type { Array<PreloadItem> }
412   * @syscap SystemCapability.BundleManager.BundleFramework.Core
413   * @since 9
414   */
415  /**
416   * Indicates the preload module
417   *
418   * @type { Array<PreloadItem> }
419   * @syscap SystemCapability.BundleManager.BundleFramework.Core
420   * @atomicservice
421   * @since 11
422   */
423  readonly preloads: Array<PreloadItem>;
424
425  /**
426   * Indicates the menu configuration
427   *
428   * @type { string }
429   * @readonly
430   * @syscap SystemCapability.BundleManager.BundleFramework.Core
431   * @atomicservice
432   * @since 11
433   */
434  readonly fileContextMenuConfig: string;
435}
436
437/**
438 * Indicates the dependency
439 *
440 * @typedef Dependency
441 * @syscap SystemCapability.BundleManager.BundleFramework.Core
442 * @since 9
443 */
444/**
445 * Indicates the dependency
446 *
447 * @typedef Dependency
448 * @syscap SystemCapability.BundleManager.BundleFramework.Core
449 * @atomicservice
450 * @since 11
451 */
452export interface Dependency {
453  /**
454   * Indicates the module name
455   *
456   * @type { string }
457   * @syscap SystemCapability.BundleManager.BundleFramework.Core
458   * @since 9
459   */
460  /**
461   * Indicates the module name
462   *
463   * @type { string }
464   * @syscap SystemCapability.BundleManager.BundleFramework.Core
465   * @atomicservice
466   * @since 11
467   */
468  readonly moduleName: string;
469
470  /**
471   * Indicates the bundle name of the dependency
472   *
473   * @type { string }
474   * @syscap SystemCapability.BundleManager.BundleFramework.Core
475   * @since 10
476   */
477  /**
478   * Indicates the bundle name of the dependency
479   *
480   * @type { string }
481   * @syscap SystemCapability.BundleManager.BundleFramework.Core
482   * @atomicservice
483   * @since 11
484   */
485  readonly bundleName: string;
486
487  /**
488   * Indicates the version code of the dependency
489   *
490   * @type { number }
491   * @syscap SystemCapability.BundleManager.BundleFramework.Core
492   * @since 10
493   */
494  /**
495   * Indicates the version code of the dependency
496   *
497   * @type { number }
498   * @syscap SystemCapability.BundleManager.BundleFramework.Core
499   * @atomicservice
500   * @since 11
501   */
502  readonly versionCode: number;
503}
504
505/**
506 * Indicates the preloadItem
507 *
508 * @typedef PreloadItem
509 * @syscap SystemCapability.BundleManager.BundleFramework.Core
510 * @since 9
511 */
512/**
513 * Indicates the preloadItem
514 *
515 * @typedef PreloadItem
516 * @syscap SystemCapability.BundleManager.BundleFramework.Core
517 * @atomicservice
518 * @since 11
519 */
520export interface PreloadItem {
521  /**
522   * Indicates the module name need preload
523   *
524   * @type { string }
525   * @syscap SystemCapability.BundleManager.BundleFramework.Core
526   * @since 9
527   */
528  /**
529   * Indicates the module name need preload
530   *
531   * @type { string }
532   * @syscap SystemCapability.BundleManager.BundleFramework.Core
533   * @atomicservice
534   * @since 11
535   */
536  readonly moduleName: string;
537}
538