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 16/** 17 * @file 18 * @kit AbilityKit 19 */ 20 21import { ApplicationInfo } from './ApplicationInfo'; 22import { Metadata } from './Metadata'; 23import bundleManager from './../@ohos.bundle.bundleManager'; 24import { Skill } from './Skill'; 25 26/** 27 * Extension information about a bundle 28 * 29 * @typedef ExtensionAbilityInfo 30 * @syscap SystemCapability.BundleManager.BundleFramework.Core 31 * @since 9 32 */ 33/** 34 * Extension information about a bundle 35 * 36 * @typedef ExtensionAbilityInfo 37 * @syscap SystemCapability.BundleManager.BundleFramework.Core 38 * @atomicservice 39 * @since 11 40 */ 41export interface ExtensionAbilityInfo { 42 /** 43 * Indicates the name of the bundle 44 * 45 * @type { string } 46 * @syscap SystemCapability.BundleManager.BundleFramework.Core 47 * @since 9 48 */ 49 /** 50 * Indicates the name of the bundle 51 * 52 * @type { string } 53 * @syscap SystemCapability.BundleManager.BundleFramework.Core 54 * @atomicservice 55 * @since 11 56 */ 57 readonly bundleName: string; 58 59 /** 60 * Indicates the name of the module 61 * 62 * @type { string } 63 * @syscap SystemCapability.BundleManager.BundleFramework.Core 64 * @since 9 65 */ 66 /** 67 * Indicates the name of the module 68 * 69 * @type { string } 70 * @syscap SystemCapability.BundleManager.BundleFramework.Core 71 * @atomicservice 72 * @since 11 73 */ 74 readonly moduleName: string; 75 76 /** 77 * Indicates the name of the extension ability info 78 * 79 * @type { string } 80 * @syscap SystemCapability.BundleManager.BundleFramework.Core 81 * @since 9 82 */ 83 /** 84 * Indicates the name of the extension ability info 85 * 86 * @type { string } 87 * @syscap SystemCapability.BundleManager.BundleFramework.Core 88 * @atomicservice 89 * @since 11 90 */ 91 readonly name: string; 92 93 /** 94 * Indicates the label id of the extension ability info 95 * 96 * @type { number } 97 * @syscap SystemCapability.BundleManager.BundleFramework.Core 98 * @since 9 99 */ 100 /** 101 * Indicates the label id of the extension ability info 102 * 103 * @type { number } 104 * @syscap SystemCapability.BundleManager.BundleFramework.Core 105 * @atomicservice 106 * @since 11 107 */ 108 readonly labelId: number; 109 110 /** 111 * Indicates the description id of the extension ability info 112 * 113 * @type { number } 114 * @syscap SystemCapability.BundleManager.BundleFramework.Core 115 * @since 9 116 */ 117 /** 118 * Indicates the description id of the extension ability info 119 * 120 * @type { number } 121 * @syscap SystemCapability.BundleManager.BundleFramework.Core 122 * @atomicservice 123 * @since 11 124 */ 125 readonly descriptionId: number; 126 127 /** 128 * Indicates the icon id of the extension ability info 129 * 130 * @type { number } 131 * @syscap SystemCapability.BundleManager.BundleFramework.Core 132 * @since 9 133 */ 134 /** 135 * Indicates the icon id of the extension ability info 136 * 137 * @type { number } 138 * @syscap SystemCapability.BundleManager.BundleFramework.Core 139 * @atomicservice 140 * @since 11 141 */ 142 readonly iconId: number; 143 144 /** 145 * Indicates whether this ability can be called by other abilities 146 * 147 * @type { boolean } 148 * @syscap SystemCapability.BundleManager.BundleFramework.Core 149 * @since 9 150 */ 151 /** 152 * Indicates whether this ability can be called by other abilities 153 * 154 * @type { boolean } 155 * @syscap SystemCapability.BundleManager.BundleFramework.Core 156 * @atomicservice 157 * @since 11 158 */ 159 readonly exported: boolean; 160 161 /** 162 * Enumerates types of the extension ability info 163 * 164 * @type { bundleManager.ExtensionAbilityType } 165 * @syscap SystemCapability.BundleManager.BundleFramework.Core 166 * @since 9 167 */ 168 /** 169 * Enumerates types of the extension ability info 170 * 171 * @type { bundleManager.ExtensionAbilityType } 172 * @syscap SystemCapability.BundleManager.BundleFramework.Core 173 * @atomicservice 174 * @since 11 175 */ 176 readonly extensionAbilityType: bundleManager.ExtensionAbilityType; 177 178 /** 179 * Indicates type name of the extension ability. 180 * 181 * @type { string } 182 * @readonly 183 * @syscap SystemCapability.BundleManager.BundleFramework.Core 184 * @atomicservice 185 * @since 11 186 */ 187 readonly extensionAbilityTypeName: string; 188 189 /** 190 * The permissions that others need to use this extension ability info 191 * 192 * @type { Array<string> } 193 * @syscap SystemCapability.BundleManager.BundleFramework.Core 194 * @since 9 195 */ 196 /** 197 * The permissions that others need to use this extension ability info 198 * 199 * @type { Array<string> } 200 * @syscap SystemCapability.BundleManager.BundleFramework.Core 201 * @atomicservice 202 * @since 11 203 */ 204 readonly permissions: Array<string>; 205 206 /** 207 * Obtains configuration information about an application 208 * 209 * @type { ApplicationInfo } 210 * @syscap SystemCapability.BundleManager.BundleFramework.Core 211 * @since 9 212 */ 213 /** 214 * Obtains configuration information about an application 215 * 216 * @type { ApplicationInfo } 217 * @syscap SystemCapability.BundleManager.BundleFramework.Core 218 * @atomicservice 219 * @since 11 220 */ 221 readonly applicationInfo: ApplicationInfo; 222 223 /** 224 * Indicates the metadata of bundle 225 * 226 * @type { Array<Metadata> } 227 * @syscap SystemCapability.BundleManager.BundleFramework.Core 228 * @since 9 229 */ 230 /** 231 * Indicates the metadata of bundle 232 * 233 * @type { Array<Metadata> } 234 * @syscap SystemCapability.BundleManager.BundleFramework.Core 235 * @atomicservice 236 * @since 11 237 */ 238 readonly metadata: Array<Metadata>; 239 240 /** 241 * Indicates the src language to express extension ability info 242 * 243 * @type { boolean } 244 * @syscap SystemCapability.BundleManager.BundleFramework.Core 245 * @since 9 246 */ 247 /** 248 * Indicates the src language to express extension ability info 249 * 250 * @type { boolean } 251 * @syscap SystemCapability.BundleManager.BundleFramework.Core 252 * @atomicservice 253 * @since 11 254 */ 255 readonly enabled: boolean; 256 257 /** 258 * Indicates the read permission extension ability info 259 * 260 * @type { string } 261 * @syscap SystemCapability.BundleManager.BundleFramework.Core 262 * @since 9 263 */ 264 /** 265 * Indicates the read permission extension ability info 266 * 267 * @type { string } 268 * @syscap SystemCapability.BundleManager.BundleFramework.Core 269 * @atomicservice 270 * @since 11 271 */ 272 readonly readPermission: string; 273 274 /** 275 * Indicates the write permission of extension ability info 276 * 277 * @type { string } 278 * @syscap SystemCapability.BundleManager.BundleFramework.Core 279 * @since 9 280 */ 281 /** 282 * Indicates the write permission of extension ability info 283 * 284 * @type { string } 285 * @syscap SystemCapability.BundleManager.BundleFramework.Core 286 * @atomicservice 287 * @since 11 288 */ 289 readonly writePermission: string; 290 291 /** 292 * Indicates skills of the extension ability 293 * 294 * @type { Array<Skill> } 295 * @readonly 296 * @syscap SystemCapability.BundleManager.BundleFramework.Core 297 * @atomicservice 298 * @since 12 299 */ 300 readonly skills: Array<Skill>; 301 302 /** 303 * Indicates the appIndex of extension ability, only work in clone app mode 304 * 305 * @type { number } 306 * @readonly 307 * @syscap SystemCapability.BundleManager.BundleFramework.Core 308 * @since 12 309 */ 310 readonly appIndex: number; 311} 312