• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021 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 { ApplicationInfo } from './applicationInfo';
17import { CustomizeData } from './customizeData'
18import bundle from './../@ohos.bundle';
19
20/**
21 * @name Obtains configuration information about an ability
22 * @since 7
23 * @syscap SystemCapability.BundleManager.BundleFramework
24 * @permission NA
25 */
26export interface AbilityInfo {
27  /**
28    * @default Indicates the name of the bundle containing the ability
29    * @since 7
30    * @syscap SystemCapability.BundleManager.BundleFramework
31    */
32  readonly bundleName: string;
33
34  /**
35    * @default Ability simplified class name
36    * @since 7
37    * @syscap SystemCapability.BundleManager.BundleFramework
38    */
39  readonly name: string;
40
41  /**
42    * @default Indicates the label of the ability
43    * @since 7
44    * @syscap SystemCapability.BundleManager.BundleFramework
45    */
46  readonly label: string;
47
48  /**
49    * @default Describes the ability
50    * @since 7
51    * @syscap SystemCapability.BundleManager.BundleFramework
52    */
53  readonly description: string;
54
55  /**
56    * @default Indicates the icon of the ability
57    * @since 7
58    * @syscap SystemCapability.BundleManager.BundleFramework
59    */
60  readonly icon: string;
61
62  /**
63    * @default Indicates the label id of the ability
64    * @since 7
65    * @syscap SystemCapability.BundleManager.BundleFramework
66    */
67  readonly labelId: number;
68
69  /**
70    * @default Indicates the description id of the ability
71    * @since 7
72    * @syscap SystemCapability.BundleManager.BundleFramework
73    */
74  readonly descriptionId: number;
75
76  /**
77    * @default Indicates the icon id of the ability
78    * @since 7
79    * @syscap SystemCapability.BundleManager.BundleFramework
80    */
81  readonly iconId: number;
82
83  /**
84    * @default Indicates the name of the .hap package to which the capability belongs
85    * @since 7
86    * @syscap SystemCapability.BundleManager.BundleFramework
87    */
88  readonly moduleName: string;
89
90  /**
91    * @default Process of ability, if user do not set it ,the value equal application process
92    * @since 7
93    * @syscap SystemCapability.BundleManager.BundleFramework
94    */
95  readonly process: string;
96
97  /**
98    * @default Info about which ability is this nick point to
99    * @since 7
100    * @syscap SystemCapability.BundleManager.BundleFramework
101    * @FAModelOnly
102    */
103  readonly targetAbility: string;
104
105  /**
106    * @default Indicates the background service addressing a specific usage scenario
107    * @since 7
108    * @syscap SystemCapability.BundleManager.BundleFramework
109    * @FAModelOnly
110    */
111  readonly backgroundModes: number;
112
113  /**
114    * @default Indicates whether an ability can be called by other abilities
115    * @since 7
116    * @syscap SystemCapability.BundleManager.BundleFramework
117    */
118  readonly isVisible: boolean;
119
120  /**
121    * @default Indicates whether the ability provides the embedded card capability
122    * @since 7
123    * @syscap SystemCapability.BundleManager.BundleFramework
124    * @FAModelOnly
125    */
126  readonly formEnabled: boolean;
127
128  /**
129    * @default Enumerates types of templates that can be used by an ability
130    * @since 7
131    * @syscap SystemCapability.BundleManager.BundleFramework
132    * @FAModelOnly
133    */
134  readonly type: bundle.AbilityType;
135
136  /**
137    * @default Enumerates the subType of templates used by an ability
138    * @since 7
139    * @syscap SystemCapability.BundleManager.BundleFramework
140    * @FAModelOnly
141    */
142  readonly subType: bundle.AbilitySubType;
143
144  /**
145    * @default Enumerates ability display orientations
146    * @since 7
147    * @syscap SystemCapability.BundleManager.BundleFramework
148    * @FAModelOnly
149    */
150  readonly orientation: bundle.DisplayOrientation;
151
152  /**
153    * @default Enumerates ability launch modes
154    * @since 7
155    * @syscap SystemCapability.BundleManager.BundleFramework
156    */
157  readonly launchMode: bundle.LaunchMode;
158
159  /**
160    * @default The permissions that others need to launch this ability
161    * @since 7
162    * @syscap SystemCapability.BundleManager.BundleFramework
163    */
164  readonly permissions: Array<string>;
165
166  /**
167    * @default The device types that this ability can run on
168    * @since 7
169    * @syscap SystemCapability.BundleManager.BundleFramework
170    */
171  readonly deviceTypes: Array<string>;
172
173  /**
174    * @default The device capability that this ability needs
175    * @since 7
176    * @syscap SystemCapability.BundleManager.BundleFramework
177    */
178  readonly deviceCapabilities: Array<string>;
179
180  /**
181    * @default Indicates the permission required for reading ability data
182    * @since 7
183    * @syscap SystemCapability.BundleManager.BundleFramework
184    * @FAModelOnly
185    */
186  readonly readPermission: string;
187
188  /**
189    * @default Indicates the permission required for writing data to the ability
190    * @since 7
191    * @syscap SystemCapability.BundleManager.BundleFramework
192    * @FAModelOnly
193    */
194  readonly writePermission: string;
195
196  /**
197    * @default Obtains configuration information about an application
198    * @since 7
199    * @syscap SystemCapability.BundleManager.BundleFramework
200    */
201  readonly applicationInfo: ApplicationInfo;
202
203  /**
204    * @default Uri of ability
205    * @since 7
206    * @syscap SystemCapability.BundleManager.BundleFramework
207    * @FAModelOnly
208    */
209  readonly uri: string;
210
211  /**
212    * @default Indicates the metadata of ability
213    * @since 8
214    * @syscap SystemCapability.BundleManager.BundleFramework
215    */
216  readonly metaData: Array<CustomizeData>;
217
218  /**
219    * @default Indicates whether the ability is enabled
220    * @since 8
221    * @syscap SystemCapability.BundleManager.BundleFramework
222    */
223   readonly enabled: boolean;
224}
225