• 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
16/**
17 * @file
18 * @kit AbilityKit
19 */
20
21import { AbilityInfo } from './AbilityInfo';
22import { ExtensionAbilityInfo } from './ExtensionAbilityInfo';
23import { Metadata } from './Metadata';
24import bundleManager from './../@ohos.bundle.bundleManager';
25
26/**
27 * Obtains configuration information about a hap module.
28 *
29 * @typedef HapModuleInfo
30 * @syscap SystemCapability.BundleManager.BundleFramework.Core
31 * @since 9
32 */
33/**
34 * Obtains configuration information about a hap module.
35 *
36 * @typedef HapModuleInfo
37 * @syscap SystemCapability.BundleManager.BundleFramework.Core
38 * @crossplatform
39 * @since 10
40 */
41/**
42 * Obtains configuration information about a hap module.
43 *
44 * @typedef HapModuleInfo
45 * @syscap SystemCapability.BundleManager.BundleFramework.Core
46 * @crossplatform
47 * @atomicservice
48 * @since arkts {'1.1':'11', '1.2':'20'}
49 * @arkts 1.1&1.2
50 */
51export interface HapModuleInfo {
52  /**
53   * Indicates the name of this hap module
54   *
55   * @type { string }
56   * @readonly
57   * @syscap SystemCapability.BundleManager.BundleFramework.Core
58   * @since 9
59   */
60  /**
61   * Indicates the name of this hap module
62   *
63   * @type { string }
64   * @readonly
65   * @syscap SystemCapability.BundleManager.BundleFramework.Core
66   * @crossplatform
67   * @since 10
68   */
69  /**
70   * Indicates the name of this hap module
71   *
72   * @type { string }
73   * @readonly
74   * @syscap SystemCapability.BundleManager.BundleFramework.Core
75   * @crossplatform
76   * @atomicservice
77   * @since arkts {'1.1':'11', '1.2':'20'}
78   * @arkts 1.1&1.2
79   */
80  readonly name: string;
81
82  /**
83   * Indicates the icon of this hap module
84   *
85   * @type { string }
86   * @readonly
87   * @syscap SystemCapability.BundleManager.BundleFramework.Core
88   * @since 9
89   */
90  /**
91   * Indicates the icon of this hap module
92   *
93   * @type { string }
94   * @readonly
95   * @syscap SystemCapability.BundleManager.BundleFramework.Core
96   * @crossplatform
97   * @since 10
98   */
99  /**
100   * Indicates the icon of this hap module
101   *
102   * @type { string }
103   * @readonly
104   * @syscap SystemCapability.BundleManager.BundleFramework.Core
105   * @crossplatform
106   * @atomicservice
107   * @since arkts {'1.1':'11', '1.2':'20'}
108   * @arkts 1.1&1.2
109   */
110  readonly icon: string;
111
112  /**
113   * Indicates the icon id of this hap module
114   *
115   * @type { number }
116   * @readonly
117   * @syscap SystemCapability.BundleManager.BundleFramework.Core
118   * @since 9
119   */
120  /**
121   * Indicates the icon id of this hap module
122   *
123   * @type { number }
124   * @readonly
125   * @syscap SystemCapability.BundleManager.BundleFramework.Core
126   * @crossplatform
127   * @since 10
128   */
129  /**
130   * Indicates the icon id of this hap module
131   *
132   * @type { number }
133   * @readonly
134   * @syscap SystemCapability.BundleManager.BundleFramework.Core
135   * @crossplatform
136   * @atomicservice
137   * @since arkts {'1.1':'11', '1.2':'20'}
138   * @arkts 1.1&1.2
139   */
140  readonly iconId: number;
141
142  /**
143   * Indicates the label of this hap module
144   *
145   * @type { string }
146   * @readonly
147   * @syscap SystemCapability.BundleManager.BundleFramework.Core
148   * @since 9
149   */
150  /**
151   * Indicates the label of this hap module
152   *
153   * @type { string }
154   * @readonly
155   * @syscap SystemCapability.BundleManager.BundleFramework.Core
156   * @crossplatform
157   * @since 10
158   */
159  /**
160   * Indicates the label of this hap module
161   *
162   * @type { string }
163   * @readonly
164   * @syscap SystemCapability.BundleManager.BundleFramework.Core
165   * @crossplatform
166   * @atomicservice
167   * @since arkts {'1.1':'11', '1.2':'20'}
168   * @arkts 1.1&1.2
169   */
170  readonly label: string;
171
172  /**
173   * Indicates the label id of this hap module
174   *
175   * @type { number }
176   * @readonly
177   * @syscap SystemCapability.BundleManager.BundleFramework.Core
178   * @since 9
179   */
180  /**
181   * Indicates the label id of this hap module
182   *
183   * @type { number }
184   * @readonly
185   * @syscap SystemCapability.BundleManager.BundleFramework.Core
186   * @crossplatform
187   * @since 10
188   */
189  /**
190   * Indicates the label id of this hap module
191   *
192   * @type { number }
193   * @readonly
194   * @syscap SystemCapability.BundleManager.BundleFramework.Core
195   * @crossplatform
196   * @atomicservice
197   * @since arkts {'1.1':'11', '1.2':'20'}
198   * @arkts 1.1&1.2
199   */
200  readonly labelId: number;
201
202  /**
203   * Describes the hap module
204   *
205   * @type { string }
206   * @readonly
207   * @syscap SystemCapability.BundleManager.BundleFramework.Core
208   * @since 9
209   */
210  /**
211   * Describes the hap module
212   *
213   * @type { string }
214   * @readonly
215   * @syscap SystemCapability.BundleManager.BundleFramework.Core
216   * @crossplatform
217   * @since 10
218   */
219  /**
220   * Describes the hap module
221   *
222   * @type { string }
223   * @readonly
224   * @syscap SystemCapability.BundleManager.BundleFramework.Core
225   * @crossplatform
226   * @atomicservice
227   * @since arkts {'1.1':'11', '1.2':'20'}
228   * @arkts 1.1&1.2
229   */
230  readonly description: string;
231
232  /**
233   * Indicates the description of this hap module
234   *
235   * @type { number }
236   * @readonly
237   * @syscap SystemCapability.BundleManager.BundleFramework.Core
238   * @since 9
239   */
240  /**
241   * Indicates the description of this hap module
242   *
243   * @type { number }
244   * @readonly
245   * @syscap SystemCapability.BundleManager.BundleFramework.Core
246   * @crossplatform
247   * @since 10
248   */
249  /**
250   * Indicates the description of this hap module
251   *
252   * @type { number }
253   * @readonly
254   * @syscap SystemCapability.BundleManager.BundleFramework.Core
255   * @crossplatform
256   * @atomicservice
257   * @since arkts {'1.1':'11', '1.2':'20'}
258   * @arkts 1.1&1.2
259   */
260  readonly descriptionId: number;
261
262  /**
263   * Indicates main elementName of the hap module
264   *
265   * @type { string }
266   * @readonly
267   * @syscap SystemCapability.BundleManager.BundleFramework.Core
268   * @since 9
269   */
270  /**
271   * Indicates main elementName of the hap module
272   *
273   * @type { string }
274   * @readonly
275   * @syscap SystemCapability.BundleManager.BundleFramework.Core
276   * @crossplatform
277   * @since 10
278   */
279  /**
280   * Indicates main elementName of the hap module
281   *
282   * @type { string }
283   * @readonly
284   * @syscap SystemCapability.BundleManager.BundleFramework.Core
285   * @crossplatform
286   * @atomicservice
287   * @since arkts {'1.1':'11', '1.2':'20'}
288   * @arkts 1.1&1.2
289   */
290  readonly mainElementName: string;
291
292  /**
293   * Obtains configuration information about abilities
294   *
295   * @type { Array<AbilityInfo> }
296   * @readonly
297   * @syscap SystemCapability.BundleManager.BundleFramework.Core
298   * @since 9
299   */
300  /**
301   * Obtains configuration information about abilities
302   *
303   * @type { Array<AbilityInfo> }
304   * @readonly
305   * @syscap SystemCapability.BundleManager.BundleFramework.Core
306   * @crossplatform
307   * @since 10
308   */
309  /**
310   * Obtains configuration information about abilities
311   *
312   * @type { Array<AbilityInfo> }
313   * @readonly
314   * @syscap SystemCapability.BundleManager.BundleFramework.Core
315   * @crossplatform
316   * @atomicservice
317   * @since arkts {'1.1':'11', '1.2':'20'}
318   * @arkts 1.1&1.2
319   */
320  readonly abilitiesInfo: Array<AbilityInfo>;
321
322  /**
323   * Obtains configuration information about extension abilities
324   *
325   * @type { Array<ExtensionAbilityInfo> }
326   * @readonly
327   * @syscap SystemCapability.BundleManager.BundleFramework.Core
328   * @since 9
329   */
330  /**
331   * Obtains configuration information about extension abilities
332   *
333   * @type { Array<ExtensionAbilityInfo> }
334   * @readonly
335   * @syscap SystemCapability.BundleManager.BundleFramework.Core
336   * @atomicservice
337   * @since arkts {'1.1':'11', '1.2':'20'}
338   * @arkts 1.1&1.2
339   */
340  readonly extensionAbilitiesInfo: Array<ExtensionAbilityInfo>;
341
342  /**
343   * Indicates the metadata of ability
344   *
345   * @type { Array<Metadata> }
346   * @readonly
347   * @syscap SystemCapability.BundleManager.BundleFramework.Core
348   * @since 9
349   */
350  /**
351   * Indicates the metadata of ability
352   *
353   * @type { Array<Metadata> }
354   * @readonly
355   * @syscap SystemCapability.BundleManager.BundleFramework.Core
356   * @crossplatform
357   * @since 10
358   */
359  /**
360   * Indicates the metadata of ability
361   *
362   * @type { Array<Metadata> }
363   * @readonly
364   * @syscap SystemCapability.BundleManager.BundleFramework.Core
365   * @crossplatform
366   * @atomicservice
367   * @since arkts {'1.1':'11', '1.2':'20'}
368   * @arkts 1.1&1.2
369   */
370  readonly metadata: Array<Metadata>;
371
372  /**
373   * The device types that this hap module can run on
374   *
375   * @type { Array<string> }
376   * @readonly
377   * @syscap SystemCapability.BundleManager.BundleFramework.Core
378   * @since 9
379   */
380  /**
381   * The device types that this hap module can run on
382   *
383   * @type { Array<string> }
384   * @readonly
385   * @syscap SystemCapability.BundleManager.BundleFramework.Core
386   * @atomicservice
387   * @since 11
388   */
389  /**
390   * The device types that this hap module can run on
391   *
392   * @type { Array<string> }
393   * @readonly
394   * @syscap SystemCapability.BundleManager.BundleFramework.Core
395   * @crossplatform
396   * @atomicservice
397   * @since 20
398   * @arkts 1.1&1.2
399   */
400  readonly deviceTypes: Array<string>;
401
402  /**
403   * Indicates whether free installation of the hap module is supported
404   *
405   * @type { boolean }
406   * @readonly
407   * @syscap SystemCapability.BundleManager.BundleFramework.Core
408   * @since 9
409   */
410  /**
411   * Indicates whether free installation of the hap module is supported
412   *
413   * @type { boolean }
414   * @readonly
415   * @syscap SystemCapability.BundleManager.BundleFramework.Core
416   * @atomicservice
417   * @since 11
418   */
419  /**
420   * Indicates whether free installation of the hap module is supported
421   *
422   * @type { boolean }
423   * @readonly
424   * @syscap SystemCapability.BundleManager.BundleFramework.Core
425   * @crossplatform
426   * @atomicservice
427   * @since 20
428   * @arkts 1.1&1.2
429   */
430  readonly installationFree: boolean;
431
432  /**
433   * Indicates the hash value of the hap module
434   *
435   * @type { string }
436   * @readonly
437   * @syscap SystemCapability.BundleManager.BundleFramework.Core
438   * @since 9
439   */
440  /**
441   * Indicates the hash value of the hap module
442   *
443   * @type { string }
444   * @readonly
445   * @syscap SystemCapability.BundleManager.BundleFramework.Core
446   * @atomicservice
447   * @since 11
448   */
449  /**
450   * Indicates the hash value of the hap module
451   *
452   * @type { string }
453   * @readonly
454   * @syscap SystemCapability.BundleManager.BundleFramework.Core
455   * @crossplatform
456   * @atomicservice
457   * @since 20
458   * @arkts 1.1&1.2
459   */
460  readonly hashValue: string;
461
462  /**
463   * Indicates the type of the module
464   *
465   * @type { bundleManager.ModuleType }
466   * @readonly
467   * @syscap SystemCapability.BundleManager.BundleFramework.Core
468   * @since 9
469   */
470  /**
471   * Indicates the type of the module
472   *
473   * @type { bundleManager.ModuleType }
474   * @readonly
475   * @syscap SystemCapability.BundleManager.BundleFramework.Core
476   * @atomicservice
477   * @since 11
478   */
479  /**
480   * Indicates the type of the module
481   *
482   * @type { bundleManager.ModuleType }
483   * @readonly
484   * @syscap SystemCapability.BundleManager.BundleFramework.Core
485   * @crossplatform
486   * @atomicservice
487   * @since 20
488   * @arkts 1.1&1.2
489   */
490  readonly type: bundleManager.ModuleType;
491
492  /**
493   * Indicates the dependency module that this module depends on
494   *
495   * @type { Array<Dependency> }
496   * @readonly
497   * @syscap SystemCapability.BundleManager.BundleFramework.Core
498   * @since 9
499   */
500  /**
501   * Indicates the dependency module that this module depends on
502   *
503   * @type { Array<Dependency> }
504   * @readonly
505   * @syscap SystemCapability.BundleManager.BundleFramework.Core
506   * @atomicservice
507   * @since arkts {'1.1':'11', '1.2':'20'}
508   * @arkts 1.1&1.2
509   */
510  readonly dependencies: Array<Dependency>;
511
512  /**
513   * Indicates the preload module
514   *
515   * @type { Array<PreloadItem> }
516   * @readonly
517   * @syscap SystemCapability.BundleManager.BundleFramework.Core
518   * @since 9
519   */
520  /**
521   * Indicates the preload module
522   *
523   * @type { Array<PreloadItem> }
524   * @readonly
525   * @syscap SystemCapability.BundleManager.BundleFramework.Core
526   * @atomicservice
527   * @since arkts {'1.1':'11', '1.2':'20'}
528   * @arkts 1.1&1.2
529   */
530  readonly preloads: Array<PreloadItem>;
531
532  /**
533   * Indicates the menu configuration
534   *
535   * @type { string }
536   * @readonly
537   * @syscap SystemCapability.BundleManager.BundleFramework.Core
538   * @atomicservice
539   * @since arkts {'1.1':'11', '1.2':'20'}
540   * @arkts 1.1&1.2
541   */
542  readonly fileContextMenuConfig: string;
543
544  /**
545   * Indicates the router information of the module
546   *
547   * @type { Array<RouterItem> }
548   * @readonly
549   * @syscap SystemCapability.BundleManager.BundleFramework.Core
550   * @atomicservice
551   * @since arkts {'1.1':'12', '1.2':'20'}
552   * @arkts 1.1&1.2
553   */
554  readonly routerMap: Array<RouterItem>;
555
556  /**
557   * Indicates native library path.
558   *
559   * @type { string }
560   * @readonly
561   * @syscap SystemCapability.BundleManager.BundleFramework.Core
562   * @since arkts {'1.1':'12', '1.2':'20'}
563   * @arkts 1.1&1.2
564   */
565  readonly nativeLibraryPath: string;
566
567  /**
568   * Indicates the code path
569   *
570   * @type { string }
571   * @readonly
572   * @syscap SystemCapability.BundleManager.BundleFramework.Core
573   * @atomicservice
574   * @since arkts {'1.1':'12', '1.2':'20'}
575   * @arkts 1.1&1.2
576   */
577  readonly codePath: string;
578}
579
580/**
581 * Indicates the dependency
582 *
583 * @typedef Dependency
584 * @syscap SystemCapability.BundleManager.BundleFramework.Core
585 * @since 9
586 */
587/**
588 * Indicates the dependency
589 *
590 * @typedef Dependency
591 * @syscap SystemCapability.BundleManager.BundleFramework.Core
592 * @atomicservice
593 * @since arkts {'1.1':'11', '1.2':'20'}
594 * @arkts 1.1&1.2
595 */
596export interface Dependency {
597  /**
598   * Indicates the module name
599   *
600   * @type { string }
601   * @readonly
602   * @syscap SystemCapability.BundleManager.BundleFramework.Core
603   * @since 9
604   */
605  /**
606   * Indicates the module name
607   *
608   * @type { string }
609   * @readonly
610   * @syscap SystemCapability.BundleManager.BundleFramework.Core
611   * @atomicservice
612   * @since arkts {'1.1':'11', '1.2':'20'}
613   * @arkts 1.1&1.2
614   */
615  readonly moduleName: string;
616
617  /**
618   * Indicates the bundle name of the dependency
619   *
620   * @type { string }
621   * @readonly
622   * @syscap SystemCapability.BundleManager.BundleFramework.Core
623   * @since 10
624   */
625  /**
626   * Indicates the bundle name of the dependency
627   *
628   * @type { string }
629   * @readonly
630   * @syscap SystemCapability.BundleManager.BundleFramework.Core
631   * @atomicservice
632   * @since arkts {'1.1':'11', '1.2':'20'}
633   * @arkts 1.1&1.2
634   */
635  readonly bundleName: string;
636
637  /**
638   * Indicates the version code of the dependency
639   *
640   * @type { number }
641   * @readonly
642   * @syscap SystemCapability.BundleManager.BundleFramework.Core
643   * @since 10
644   */
645  /**
646   * Indicates the version code of the dependency
647   *
648   * @type { number }
649   * @readonly
650   * @syscap SystemCapability.BundleManager.BundleFramework.Core
651   * @atomicservice
652   * @since arkts {'1.1':'11', '1.2':'20'}
653   * @arkts 1.1&1.2
654   */
655  readonly versionCode: number;
656}
657
658/**
659 * Indicates the preloadItem
660 *
661 * @typedef PreloadItem
662 * @syscap SystemCapability.BundleManager.BundleFramework.Core
663 * @since 9
664 */
665/**
666 * Indicates the preloadItem
667 *
668 * @typedef PreloadItem
669 * @syscap SystemCapability.BundleManager.BundleFramework.Core
670 * @atomicservice
671 * @since arkts {'1.1':'11', '1.2':'20'}
672 * @arkts 1.1&1.2
673 */
674export interface PreloadItem {
675  /**
676   * Indicates the module name need preload
677   *
678   * @type { string }
679   * @readonly
680   * @syscap SystemCapability.BundleManager.BundleFramework.Core
681   * @since 9
682   */
683  /**
684   * Indicates the module name need preload
685   *
686   * @type { string }
687   * @readonly
688   * @syscap SystemCapability.BundleManager.BundleFramework.Core
689   * @atomicservice
690   * @since arkts {'1.1':'11', '1.2':'20'}
691   * @arkts 1.1&1.2
692   */
693  readonly moduleName: string;
694}
695
696/**
697 * Indicates the router item
698 *
699 * @typedef RouterItem
700 * @syscap SystemCapability.BundleManager.BundleFramework.Core
701 * @atomicservice
702 * @since arkts {'1.1':'12', '1.2':'20'}
703 * @arkts 1.1&1.2
704 */
705export interface RouterItem {
706  /**
707   * Indicates the name of the module to which the current page belongs
708   *
709   * @type { string }
710   * @readonly
711   * @syscap SystemCapability.BundleManager.BundleFramework.Core
712   * @atomicservice
713   * @since arkts {'1.1':'12', '1.2':'20'}
714   * @arkts 1.1&1.2
715   */
716  readonly name: string;
717  /**
718   * Indicates the file path of the current page within the module
719   *
720   * @type { string }
721   * @readonly
722   * @syscap SystemCapability.BundleManager.BundleFramework.Core
723   * @atomicservice
724   * @since arkts {'1.1':'12', '1.2':'20'}
725   * @arkts 1.1&1.2
726   */
727  readonly pageSourceFile: string;
728  /**
729   * Indicates the name of the function @Builder decorated
730   *
731   * @type { string }
732   * @readonly
733   * @syscap SystemCapability.BundleManager.BundleFramework.Core
734   * @atomicservice
735   * @since arkts {'1.1':'12', '1.2':'20'}
736   * @arkts 1.1&1.2
737   */
738  readonly buildFunction: string;
739  /**
740   * Indicates the json string of custom data
741   *
742   * @type { string }
743   * @readonly
744   * @syscap SystemCapability.BundleManager.BundleFramework.Core
745   * @atomicservice
746   * @since arkts {'1.1':'12', '1.2':'20'}
747   * @arkts 1.1&1.2
748   */
749  readonly customData: string;
750  /**
751   * Indicates the data
752   *
753   * @type { Array<DataItem> }
754   * @readonly
755   * @syscap SystemCapability.BundleManager.BundleFramework.Core
756   * @atomicservice
757   * @since arkts {'1.1':'12', '1.2':'20'}
758   * @arkts 1.1&1.2
759   */
760  readonly data: Array<DataItem>;
761}
762
763/**
764 * Indicates the data item defined in router item
765 *
766 * @typedef DataItem
767 * @syscap SystemCapability.BundleManager.BundleFramework.Core
768 * @atomicservice
769 * @since arkts {'1.1':'12', '1.2':'20'}
770 * @arkts 1.1&1.2
771 */
772export interface DataItem {
773  /**
774   * Indicates the key of the custom data item
775   *
776   * @type { string }
777   * @readonly
778   * @syscap SystemCapability.BundleManager.BundleFramework.Core
779   * @atomicservice
780   * @since arkts {'1.1':'12', '1.2':'20'}
781   * @arkts 1.1&1.2
782   */
783  readonly key: string;
784  /**
785   * Indicates the value of the custom data item
786   *
787   * @type { string }
788   * @readonly
789   * @syscap SystemCapability.BundleManager.BundleFramework.Core
790   * @atomicservice
791   * @since arkts {'1.1':'12', '1.2':'20'}
792   * @arkts 1.1&1.2
793   */
794  readonly value: string;
795}