• 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 */
36export interface HapModuleInfo {
37  /**
38   * Indicates the name of this hap module
39   *
40   * @type { string }
41   * @syscap SystemCapability.BundleManager.BundleFramework.Core
42   * @since 9
43   */
44  /**
45   * Indicates the name of this hap module
46   *
47   * @type { string }
48   * @syscap SystemCapability.BundleManager.BundleFramework.Core
49   * @crossplatform
50   * @since 10
51   */
52  readonly name: string;
53
54  /**
55   * Indicates the icon of this hap module
56   *
57   * @type { string }
58   * @syscap SystemCapability.BundleManager.BundleFramework.Core
59   * @since 9
60   */
61  /**
62   * Indicates the icon of this hap module
63   *
64   * @type { string }
65   * @syscap SystemCapability.BundleManager.BundleFramework.Core
66   * @crossplatform
67   * @since 10
68   */
69  readonly icon: string;
70
71  /**
72   * Indicates the icon id of this hap module
73   *
74   * @type { number }
75   * @syscap SystemCapability.BundleManager.BundleFramework.Core
76   * @since 9
77   */
78  /**
79   * Indicates the icon id of this hap module
80   *
81   * @type { number }
82   * @syscap SystemCapability.BundleManager.BundleFramework.Core
83   * @crossplatform
84   * @since 10
85   */
86  readonly iconId: number;
87
88  /**
89   * Indicates the label of this hap module
90   *
91   * @type { string }
92   * @syscap SystemCapability.BundleManager.BundleFramework.Core
93   * @since 9
94   */
95  /**
96   * Indicates the label of this hap module
97   *
98   * @type { string }
99   * @syscap SystemCapability.BundleManager.BundleFramework.Core
100   * @crossplatform
101   * @since 10
102   */
103  readonly label: string;
104
105  /**
106   * Indicates the label id of this hap module
107   *
108   * @type { number }
109   * @syscap SystemCapability.BundleManager.BundleFramework.Core
110   * @since 9
111   */
112  /**
113   * Indicates the label id of this hap module
114   *
115   * @type { number }
116   * @syscap SystemCapability.BundleManager.BundleFramework.Core
117   * @crossplatform
118   * @since 10
119   */
120  readonly labelId: number;
121
122  /**
123   * Describes the hap module
124   *
125   * @type { string }
126   * @syscap SystemCapability.BundleManager.BundleFramework.Core
127   * @since 9
128   */
129  /**
130   * Describes the hap module
131   *
132   * @type { string }
133   * @syscap SystemCapability.BundleManager.BundleFramework.Core
134   * @crossplatform
135   * @since 10
136   */
137  readonly description: string;
138
139  /**
140   * Indicates the description of this hap module
141   *
142   * @type { number }
143   * @syscap SystemCapability.BundleManager.BundleFramework.Core
144   * @since 9
145   */
146  /**
147   * Indicates the description of this hap module
148   *
149   * @type { number }
150   * @syscap SystemCapability.BundleManager.BundleFramework.Core
151   * @crossplatform
152   * @since 10
153   */
154  readonly descriptionId: number;
155
156  /**
157   * Indicates main elementName of the hap module
158   *
159   * @type { string }
160   * @syscap SystemCapability.BundleManager.BundleFramework.Core
161   * @since 9
162   */
163  /**
164   * Indicates main elementName of the hap module
165   *
166   * @type { string }
167   * @syscap SystemCapability.BundleManager.BundleFramework.Core
168   * @crossplatform
169   * @since 10
170   */
171  readonly mainElementName: string;
172
173  /**
174   * Obtains configuration information about abilities
175   *
176   * @type { Array<AbilityInfo> }
177   * @syscap SystemCapability.BundleManager.BundleFramework.Core
178   * @since 9
179   */
180  /**
181   * Obtains configuration information about abilities
182   *
183   * @type { Array<AbilityInfo> }
184   * @syscap SystemCapability.BundleManager.BundleFramework.Core
185   * @crossplatform
186   * @since 10
187   */
188  readonly abilitiesInfo: Array<AbilityInfo>;
189
190  /**
191   * Obtains configuration information about extension abilities
192   *
193   * @type { Array<ExtensionAbilityInfo> }
194   * @syscap SystemCapability.BundleManager.BundleFramework.Core
195   * @since 9
196   */
197  readonly extensionAbilitiesInfo: Array<ExtensionAbilityInfo>;
198
199  /**
200   * Indicates the metadata of ability
201   *
202   * @type { Array<Metadata> }
203   * @syscap SystemCapability.BundleManager.BundleFramework.Core
204   * @since 9
205   */
206  /**
207   * Indicates the metadata of ability
208   *
209   * @type { Array<Metadata> }
210   * @syscap SystemCapability.BundleManager.BundleFramework.Core
211   * @crossplatform
212   * @since 10
213   */
214  readonly metadata: Array<Metadata>;
215
216  /**
217   * The device types that this hap module can run on
218   *
219   * @type { Array<string> }
220   * @syscap SystemCapability.BundleManager.BundleFramework.Core
221   * @since 9
222   */
223  readonly deviceTypes: Array<string>;
224
225  /**
226   * Indicates whether free installation of the hap module is supported
227   *
228   * @type { boolean }
229   * @syscap SystemCapability.BundleManager.BundleFramework.Core
230   * @since 9
231   */
232  readonly installationFree: boolean;
233
234  /**
235   * Indicates the hash value of the hap module
236   *
237   * @type { string }
238   * @syscap SystemCapability.BundleManager.BundleFramework.Core
239   * @since 9
240   */
241  readonly hashValue: string;
242
243  /**
244   * Indicates the type of the module
245   *
246   * @type { bundleManager.ModuleType }
247   * @syscap SystemCapability.BundleManager.BundleFramework.Core
248   * @since 9
249   */
250  readonly type: bundleManager.ModuleType;
251
252  /**
253   * Indicates the dependency module that this module depends on
254   *
255   * @type { Array<Dependency> }
256   * @syscap SystemCapability.BundleManager.BundleFramework.Core
257   * @since 9
258   */
259  readonly dependencies: Array<Dependency>;
260
261  /**
262   * Indicates the preload module
263   *
264   * @type { Array<PreloadItem> }
265   * @syscap SystemCapability.BundleManager.BundleFramework.Core
266   * @since 9
267   */
268  readonly preloads: Array<PreloadItem>;
269}
270
271/**
272 * Indicates the dependency
273 *
274 * @typedef Dependency
275 * @syscap SystemCapability.BundleManager.BundleFramework.Core
276 * @since 9
277 */
278export interface Dependency {
279  /**
280   * Indicates the module name
281   *
282   * @type { string }
283   * @syscap SystemCapability.BundleManager.BundleFramework.Core
284   * @since 9
285   */
286  readonly moduleName: string;
287
288  /**
289   * Indicates the bundle name of the dependency
290   *
291   * @type { string }
292   * @syscap SystemCapability.BundleManager.BundleFramework.Core
293   * @since 10
294   */
295  readonly bundleName: string;
296
297  /**
298   * Indicates the version code of the dependency
299   *
300   * @type { number }
301   * @syscap SystemCapability.BundleManager.BundleFramework.Core
302   * @since 10
303   */
304  readonly versionCode: number;
305}
306
307/**
308 * Indicates the preloadItem
309 *
310 * @typedef PreloadItem
311 * @syscap SystemCapability.BundleManager.BundleFramework.Core
312 * @since 9
313 */
314export interface PreloadItem {
315  /**
316   * Indicates the module name need preload
317   *
318   * @type { string }
319   * @syscap SystemCapability.BundleManager.BundleFramework.Core
320   * @since 9
321   */
322  readonly moduleName: string;
323}
324