• 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 * @typedef HapModuleInfo
24 * @syscap SystemCapability.BundleManager.BundleFramework.Core
25 * @since 9
26 */
27export interface HapModuleInfo {
28  /**
29   * Indicates the name of this hap module
30   * @type {string}
31   * @syscap SystemCapability.BundleManager.BundleFramework.Core
32   * @since 9
33   */
34  readonly name: string;
35
36  /**
37   * Indicates the icon of this hap module
38   * @type {string}
39   * @syscap SystemCapability.BundleManager.BundleFramework.Core
40   * @since 9
41   */
42  readonly icon: string;
43
44   /**
45    * Indicates the icon id of this hap module
46    * @type {number}
47    * @syscap SystemCapability.BundleManager.BundleFramework.Core
48    * @since 9
49    */
50  readonly iconId: number;
51
52   /**
53    * Indicates the label of this hap module
54    * @type {string}
55    * @syscap SystemCapability.BundleManager.BundleFramework.Core
56    * @since 9
57    */
58   readonly label: string;
59
60   /**
61    * Indicates the label id of this hap module
62    * @type {number}
63    * @syscap SystemCapability.BundleManager.BundleFramework.Core
64    * @since 9
65    */
66   readonly labelId: number;
67
68  /**
69   * Describes the hap module
70   * @type {string}
71   * @syscap SystemCapability.BundleManager.BundleFramework.Core
72   * @since 9
73   */
74  readonly description: string;
75
76  /**
77   * Indicates the description of this hap module
78   * @type {number}
79   * @syscap SystemCapability.BundleManager.BundleFramework.Core
80   * @since 9
81   */
82  readonly descriptionId: number;
83
84  /**
85   * Indicates main elementName of the hap module
86   * @type {string}
87   * @syscap SystemCapability.BundleManager.BundleFramework.Core
88   * @since 9
89   */
90  readonly mainElementName: string;
91
92  /**
93   * Obtains configuration information about abilities
94   * @type {Array<AbilityInfo>}
95   * @syscap SystemCapability.BundleManager.BundleFramework.Core
96   * @since 9
97   */
98  readonly abilitiesInfo: Array<AbilityInfo>;
99
100  /**
101   * Obtains configuration information about extension abilities
102   * @type {Array<ExtensionAbilityInfo>}
103   * @syscap SystemCapability.BundleManager.BundleFramework.Core
104   * @since 9
105   */
106  readonly extensionAbilitiesInfo: Array<ExtensionAbilityInfo>;
107
108   /**
109    * Indicates the metadata of ability
110    * @type {Array<Metadata>}
111    * @syscap SystemCapability.BundleManager.BundleFramework.Core
112    * @since 9
113    */
114  readonly metadata: Array<Metadata>;
115
116  /**
117   * The device types that this hap module can run on
118   * @type {Array<string>}
119   * @syscap SystemCapability.BundleManager.BundleFramework.Core
120   * @since 9
121   */
122   readonly deviceTypes: Array<string>;
123
124  /**
125   * Indicates whether free installation of the hap module is supported
126   * @type {boolean}
127   * @syscap SystemCapability.BundleManager.BundleFramework.Core
128   * @since 9
129   */
130  readonly installationFree: boolean;
131
132   /**
133    * Indicates the hash value of the hap module
134    * @type {string}
135    * @syscap SystemCapability.BundleManager.BundleFramework.Core
136    * @since 9
137    */
138  readonly hashValue: string;
139
140   /**
141    * Indicates the type of the module
142    * @type {bundleManager.ModuleType}
143    * @syscap SystemCapability.BundleManager.BundleFramework.Core
144    * @since 9
145    */
146  readonly type: bundleManager.ModuleType;
147
148   /**
149    * Indicates the dependency module that this module depends on
150    * @type {Array<Dependency>}
151    * @syscap SystemCapability.BundleManager.BundleFramework.Core
152    * @since 9
153    */
154  readonly dependencies: Array<Dependency>;
155
156   /**
157    * Indicates the preload module
158    * @type {Array<PreloadItem>}
159    * @syscap SystemCapability.BundleManager.BundleFramework.Core
160    * @since 9
161    */
162  readonly preloads: Array<PreloadItem>;
163}
164
165/**
166 * Indicates the dependency
167 * @typedef Dependency
168 * @syscap SystemCapability.BundleManager.BundleFramework.Core
169 * @since 9
170 */
171export interface Dependency {
172  /**
173   * Indicates the module name
174   * @type {string}
175   * @syscap SystemCapability.BundleManager.BundleFramework.Core
176   * @since 9
177   */
178  readonly moduleName: string;
179}
180
181/**
182 * Indicates the preloadItem
183 * @typedef PreloadItem
184 * @syscap SystemCapability.BundleManager.BundleFramework.Core
185 * @since 9
186 */
187export interface PreloadItem{
188  /**
189   * Indicates the module name need preload
190   * @type {string}
191   * @syscap SystemCapability.BundleManager.BundleFramework.Core
192   * @since 9
193  */
194  readonly moduleName: string;
195}
196