• 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
16/**
17 * @file
18 * @kit AbilityKit
19 */
20
21/**
22 * Provides information about a shortcut, including the shortcut ID and label.
23 *
24 * @typedef ShortcutInfo
25 * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
26 * @systemapi
27 * @since 9
28 */
29export interface ShortcutInfo {
30  /**
31   * Indicates the ID of the application to which this shortcut belongs
32   *
33   * @type { string }
34   * @readonly
35   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
36   * @systemapi
37   * @since 9
38   */
39  /**
40   * Indicates the ID of the application to which this shortcut belongs
41   *
42   * @type { string }
43   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
44   * @systemapi
45   * @since 12
46   */
47  id: string;
48
49  /**
50   * Indicates the name of the bundle containing the shortcut
51   *
52   * @type { string }
53   * @readonly
54   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
55   * @systemapi
56   * @since 9
57   */
58  /**
59   * Indicates the name of the bundle containing the shortcut
60   *
61   * @type { string }
62   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
63   * @systemapi
64   * @since 12
65   */
66  bundleName: string;
67
68  /**
69   * Indicates the moduleName of the shortcut
70   *
71   * @type { string }
72   * @readonly
73   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
74   * @systemapi
75   * @since 9
76   */
77  /**
78   * Indicates the moduleName of the shortcut
79   *
80   * @type { ?string }
81   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
82   * @systemapi
83   * @since 12
84   */
85  moduleName?: string;
86
87  /**
88   * Indicates the host ability of the shortcut
89   *
90   * @type { string }
91   * @readonly
92   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
93   * @systemapi
94   * @since 9
95   */
96  /**
97   * Indicates the host ability of the shortcut
98   *
99   * @type { ?string }
100   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
101   * @systemapi
102   * @since 12
103   */
104  hostAbility?: string;
105
106  /**
107   * Indicates the icon of the shortcut
108   *
109   * @type { string }
110   * @readonly
111   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
112   * @systemapi
113   * @since 9
114   */
115  /**
116   * Indicates the icon of the shortcut
117   *
118   * @type { ?string }
119   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
120   * @systemapi
121   * @since 12
122   */
123  icon?: string;
124
125  /**
126   * Indicates the icon id of the shortcut
127   *
128   * @type { number }
129   * @readonly
130   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
131   * @systemapi
132   * @since 9
133   */
134  /**
135   * Indicates the icon id of the shortcut
136   *
137   * @type { ?number }
138   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
139   * @systemapi
140   * @since 12
141   */
142  iconId?: number;
143
144  /**
145   * Indicates the label of the shortcut
146   *
147   * @type { string }
148   * @readonly
149   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
150   * @systemapi
151   * @since 9
152   */
153  /**
154   * Indicates the label of the shortcut
155   *
156   * @type { ?string }
157   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
158   * @systemapi
159   * @since 12
160   */
161  label?: string;
162
163  /**
164   * Indicates the label id of the shortcut
165   *
166   * @type { number }
167   * @readonly
168   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
169   * @systemapi
170   * @since 9
171   */
172  /**
173   * Indicates the label id of the shortcut
174   *
175   * @type { ?number }
176   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
177   * @systemapi
178   * @since 12
179   */
180  labelId?: number;
181
182  /**
183   * Indicates the wants of the shortcut
184   *
185   * @type { Array<ShortcutWant> }
186   * @readonly
187   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
188   * @systemapi
189   * @since 9
190   */
191  /**
192   * Indicates the wants of the shortcut
193   *
194   * @type { ?Array<ShortcutWant> }
195   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
196   * @systemapi
197   * @since 12
198   */
199  wants?: Array<ShortcutWant>;
200
201  /**
202   * Indicates the index of application clone.
203   *
204   * @type { number }
205   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
206   * @systemapi
207   * @since 12
208   */
209  appIndex: number;
210
211  /**
212   * Indicates the source type of shortcut.
213   *
214   * @type { number }
215   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
216   * @systemapi
217   * @since 12
218   */
219  sourceType: number;
220}
221
222/**
223 * Obtains information about the ability that a shortcut will start.
224 *
225 * @typedef ShortcutWant
226 * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
227 * @systemapi
228 * @since 9
229 */
230export interface ShortcutWant {
231  /**
232   * Indicates the target bundle of the shortcut want
233   *
234   * @type { string }
235   * @readonly
236   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
237   * @systemapi
238   * @since 9
239   */
240  /**
241   * Indicates the target bundle of the shortcut want
242   *
243   * @type { string }
244   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
245   * @systemapi
246   * @since 12
247   */
248  targetBundle: string;
249
250  /**
251   * Indicates the target module of the shortcut want
252   *
253   * @type { string }
254   * @readonly
255   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
256   * @systemapi
257   * @since 9
258   */
259  /**
260   * Indicates the target module of the shortcut want
261   *
262   * @type { ?string }
263   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
264   * @systemapi
265   * @since 12
266   */
267  targetModule?: string;
268
269  /**
270   * Indicates the target ability of the shortcut want
271   *
272   * @type { string }
273   * @readonly
274   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
275   * @systemapi
276   * @since 9
277   */
278  /**
279   * Indicates the target ability of the shortcut want
280   *
281   * @type { string }
282   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
283   * @systemapi
284   * @since 12
285   */
286  targetAbility: string;
287
288  /**
289   * Indicates the parameters of the shortcut want
290   *
291   * @type { ?Array<ParameterItem> }
292   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
293   * @systemapi
294   * @since 12
295   */
296  parameters?: Array<ParameterItem>;
297}
298
299/**
300 * Obtains information about the ability that a shortcut will start.
301 *
302 * @typedef ParameterItem
303 * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
304 * @systemapi
305 * @since 12
306 */
307export interface ParameterItem {
308  /**
309   * Indicates the key of the parameter item.
310   *
311   * @type { string }
312   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
313   * @systemapi
314   * @since 12
315   */
316  key: string;
317
318  /**
319   * Indicates the value of the parameter item.
320   *
321   * @type { string }
322   * @syscap SystemCapability.BundleManager.BundleFramework.Launcher
323   * @systemapi
324   * @since 12
325   */
326  value: string;
327}
328