1/* 2 * Copyright (c) 2022 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 { Metadata } from './Metadata'; 18import bundleManager from './../@ohos.bundle.bundleManager'; 19 20/** 21 * Extension information about a bundle 22 * @typedef ExtensionAbilityInfo 23 * @syscap SystemCapability.BundleManager.BundleFramework.Core 24 * @since 9 25 */ 26export interface ExtensionAbilityInfo { 27 /** 28 * Indicates the name of the bundle 29 * @type {string} 30 * @syscap SystemCapability.BundleManager.BundleFramework.Core 31 * @since 9 32 */ 33 readonly bundleName: string; 34 35 /** 36 * Indicates the name of the module 37 * @type {string} 38 * @syscap SystemCapability.BundleManager.BundleFramework.Core 39 * @since 9 40 */ 41 readonly moduleName: string; 42 43 /** 44 * Indicates the name of the extension ability info 45 * @type {string} 46 * @syscap SystemCapability.BundleManager.BundleFramework.Core 47 * @since 9 48 */ 49 readonly name: string; 50 51 /** 52 * Indicates the label id of the extension ability info 53 * @type {number} 54 * @syscap SystemCapability.BundleManager.BundleFramework.Core 55 * @since 9 56 */ 57 readonly labelId: number; 58 59 /** 60 * Indicates the description id of the extension ability info 61 * @type {number} 62 * @syscap SystemCapability.BundleManager.BundleFramework.Core 63 * @since 9 64 */ 65 readonly descriptionId: number; 66 67 /** 68 * Indicates the icon id of the extension ability info 69 * @type {number} 70 * @syscap SystemCapability.BundleManager.BundleFramework.Core 71 * @since 9 72 */ 73 readonly iconId: number; 74 75 /** 76 * Indicates whether this ability can be called by other abilities 77 * @type {boolean} 78 * @syscap SystemCapability.BundleManager.BundleFramework.Core 79 * @since 9 80 */ 81 readonly exported: boolean; 82 83 /** 84 * Enumerates types of the extension ability info 85 * @type {bundleManager.ExtensionAbilityType} 86 * @syscap SystemCapability.BundleManager.BundleFramework.Core 87 * @since 9 88 */ 89 readonly extensionAbilityType: bundleManager.ExtensionAbilityType; 90 91 /** 92 * The permissions that others need to use this extension ability info 93 * @type {Array<string>} 94 * @syscap SystemCapability.BundleManager.BundleFramework.Core 95 * @since 9 96 */ 97 readonly permissions: Array<string>; 98 99 /** 100 * Obtains configuration information about an application 101 * @type {ApplicationInfo} 102 * @syscap SystemCapability.BundleManager.BundleFramework.Core 103 * @since 9 104 */ 105 readonly applicationInfo: ApplicationInfo; 106 107 /** 108 * Indicates the metadata of bundle 109 * @type {Array<Metadata>} 110 * @syscap SystemCapability.BundleManager.BundleFramework.Core 111 * @since 9 112 */ 113 readonly metadata: Array<Metadata>; 114 115 /** 116 * Indicates the src language to express extension ability info 117 * @type {boolean} 118 * @syscap SystemCapability.BundleManager.BundleFramework.Core 119 * @since 9 120 */ 121 readonly enabled: boolean; 122 123 /** 124 * Indicates the read permission extension ability info 125 * @type {string} 126 * @syscap SystemCapability.BundleManager.BundleFramework.Core 127 * @since 9 128 */ 129 readonly readPermission: string; 130 131 /** 132 * Indicates the write permission of extension ability info 133 * @type {string} 134 * @syscap SystemCapability.BundleManager.BundleFramework.Core 135 * @since 9 136 */ 137 readonly writePermission: string; 138} 139