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