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 21/** 22 * The bundle pack info class. 23 * 24 * @typedef BundlePackInfo 25 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 26 * @systemapi 27 * @since 9 28 */ 29export interface BundlePackInfo { 30 /** 31 * This contains package information in pack.info 32 * 33 * @type { Array<PackageConfig> } 34 * @readonly 35 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 36 * @systemapi 37 * @since 9 38 */ 39 readonly packages: Array<PackageConfig>; 40 41 /** 42 * This contains bundle summary information in pack.info 43 * 44 * @type { PackageSummary } 45 * @readonly 46 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 47 * @systemapi 48 * @since 9 49 */ 50 readonly summary: PackageSummary; 51} 52 53/** 54 * PackageConfig: the package info class. 55 * 56 * @typedef PackageConfig 57 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 58 * @systemapi 59 * @since 9 60 */ 61export interface PackageConfig { 62 /** 63 * Indicates the device types of this package 64 * 65 * @type { Array<string> } 66 * @readonly 67 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 68 * @systemapi 69 * @since 9 70 */ 71 readonly deviceTypes: Array<string>; 72 73 /** 74 * Indicates the name of this package 75 * 76 * @type { string } 77 * @readonly 78 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 79 * @systemapi 80 * @since 9 81 */ 82 readonly name: string; 83 84 /** 85 * Indicates the module type of this package 86 * 87 * @type { string } 88 * @readonly 89 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 90 * @systemapi 91 * @since 9 92 */ 93 readonly moduleType: string; 94 95 /** 96 * Indicates whether this package is delivery and install 97 * 98 * @type { boolean } 99 * @readonly 100 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 101 * @systemapi 102 * @since 9 103 */ 104 readonly deliveryWithInstall: boolean; 105} 106 107/** 108 * PackageSummary: the package summary class. 109 * 110 * @typedef PackageSummary 111 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 112 * @systemapi 113 * @since 9 114 */ 115export interface PackageSummary { 116 /** 117 * Indicates the bundle config info of this package 118 * 119 * @type { BundleConfigInfo } 120 * @readonly 121 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 122 * @systemapi 123 * @since 9 124 */ 125 readonly app: BundleConfigInfo; 126 127 /** 128 * Indicates the modules config info of this package 129 * 130 * @type { Array<ModuleConfigInfo> } 131 * @readonly 132 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 133 * @systemapi 134 * @since 9 135 */ 136 readonly modules: Array<ModuleConfigInfo>; 137} 138 139/** 140 * BundleConfigInfo: the bundle summary class. 141 * 142 * @typedef BundleConfigInfo 143 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 144 * @systemapi 145 * @since 9 146 */ 147export interface BundleConfigInfo { 148 /** 149 * Indicates the name of this bundle 150 * 151 * @type { string } 152 * @readonly 153 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 154 * @systemapi 155 * @since 9 156 */ 157 readonly bundleName: string; 158 159 /** 160 * Indicates the bundle version 161 * 162 * @type { Version } 163 * @readonly 164 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 165 * @systemapi 166 * @since 9 167 */ 168 readonly version: Version; 169} 170 171/** 172 * ExtensionAbility: the extension ability forms class. 173 * 174 * @typedef ExtensionAbility 175 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 176 * @systemapi 177 * @since 9 178 */ 179export interface ExtensionAbility { 180 /** 181 * Indicates the name of this extension ability 182 * 183 * @type { string } 184 * @readonly 185 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 186 * @systemapi 187 * @since 9 188 */ 189 readonly name: string; 190 191 /** 192 * Indicates the ability forms info 193 * 194 * @type { Array<AbilityFormInfo> } 195 * @readonly 196 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 197 * @systemapi 198 * @since 9 199 */ 200 readonly forms: Array<AbilityFormInfo>; 201} 202 203/** 204 * ModuleConfigInfo: the module summary of a bundle. 205 * 206 * @typedef ModuleConfigInfo 207 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 208 * @systemapi 209 * @since 9 210 */ 211export interface ModuleConfigInfo { 212 /** 213 * Indicates the name of main ability 214 * 215 * @type { string } 216 * @readonly 217 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 218 * @systemapi 219 * @since 9 220 */ 221 readonly mainAbility: string; 222 223 /** 224 * Indicates the api version 225 * 226 * @type { ApiVersion } 227 * @readonly 228 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 229 * @systemapi 230 * @since 9 231 */ 232 readonly apiVersion: ApiVersion; 233 234 /** 235 * Indicates the devices type 236 * 237 * @type { Array<string> } 238 * @readonly 239 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 240 * @systemapi 241 * @since 9 242 */ 243 readonly deviceTypes: Array<string>; 244 245 /** 246 * Indicates the module distro info 247 * 248 * @type { ModuleDistroInfo } 249 * @readonly 250 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 251 * @systemapi 252 * @since 9 253 */ 254 readonly distro: ModuleDistroInfo; 255 256 /** 257 * Indicates the abilities info of this module 258 * 259 * @type { Array<ModuleAbilityInfo> } 260 * @readonly 261 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 262 * @systemapi 263 * @since 9 264 */ 265 readonly abilities: Array<ModuleAbilityInfo>; 266 267 /** 268 * Indicates extension abilities info of this module 269 * 270 * @type { Array<ExtensionAbility> } 271 * @readonly 272 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 273 * @systemapi 274 * @since 9 275 */ 276 readonly extensionAbilities: Array<ExtensionAbility>; 277} 278 279/** 280 * ModuleDistroInfo: the bundle info summary class. 281 * 282 * @typedef ModuleDistroInfo 283 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 284 * @systemapi 285 * @since 9 286 */ 287export interface ModuleDistroInfo { 288 /** 289 * Indicates whether this package is delivered with install 290 * 291 * @type { boolean } 292 * @readonly 293 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 294 * @systemapi 295 * @since 9 296 */ 297 readonly deliveryWithInstall: boolean; 298 299 /** 300 * Indicates whether this package is free install 301 * 302 * @type { boolean } 303 * @readonly 304 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 305 * @systemapi 306 * @since 9 307 */ 308 readonly installationFree: boolean; 309 310 /** 311 * Indicates the module name 312 * 313 * @type { string } 314 * @readonly 315 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 316 * @systemapi 317 * @since 9 318 */ 319 readonly moduleName: string; 320 321 /** 322 * Indicates the module type 323 * 324 * @type { string } 325 * @readonly 326 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 327 * @systemapi 328 * @since 9 329 */ 330 readonly moduleType: string; 331} 332 333/** 334 * ModuleAbilityInfo: the ability info of a module. 335 * 336 * @typedef ModuleAbilityInfo 337 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 338 * @systemapi 339 * @since 9 340 */ 341export interface ModuleAbilityInfo { 342 /** 343 * Indicates the name of this module ability 344 * 345 * @type { string } 346 * @readonly 347 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 348 * @systemapi 349 * @since 9 350 */ 351 readonly name: string; 352 353 /** 354 * Indicates the label of this module ability 355 * 356 * @type { string } 357 * @readonly 358 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 359 * @systemapi 360 * @since 9 361 */ 362 readonly label: string; 363 364 /** 365 * Indicates whether this ability can be called by other abilities 366 * 367 * @type { boolean } 368 * @readonly 369 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 370 * @systemapi 371 * @since 9 372 */ 373 readonly exported: boolean; 374 375 /** 376 * Indicates the ability forms info 377 * 378 * @type { Array<AbilityFormInfo> } 379 * @readonly 380 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 381 * @systemapi 382 * @since 9 383 */ 384 readonly forms: Array<AbilityFormInfo>; 385} 386 387/** 388 * AbilityFormInfo: the form info of an ability. 389 * 390 * @typedef AbilityFormInfo 391 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 392 * @systemapi 393 * @since 9 394 */ 395export interface AbilityFormInfo { 396 /** 397 * Indicates the name of this ability 398 * 399 * @type { string } 400 * @readonly 401 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 402 * @systemapi 403 * @since 9 404 */ 405 readonly name: string; 406 407 /** 408 * Indicates the type of this ability 409 * 410 * @type { string } 411 * @readonly 412 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 413 * @systemapi 414 * @since 9 415 */ 416 readonly type: string; 417 418 /** 419 * Indicates whether this form is enabled update 420 * 421 * @type { boolean } 422 * @readonly 423 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 424 * @systemapi 425 * @since 9 426 */ 427 readonly updateEnabled: boolean; 428 429 /** 430 * Indicates the scheduled update time 431 * 432 * @type { string } 433 * @readonly 434 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 435 * @systemapi 436 * @since 9 437 */ 438 readonly scheduledUpdateTime: string; 439 440 /** 441 * Indicates the update duration 442 * 443 * @type { number } 444 * @readonly 445 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 446 * @systemapi 447 * @since 9 448 */ 449 readonly updateDuration: number; 450 451 /** 452 * Indicates the ability support dimensions 453 * 454 * @type { Array<string> } 455 * @readonly 456 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 457 * @systemapi 458 * @since 9 459 */ 460 readonly supportDimensions: Array<string>; 461 462 /** 463 * Indicates the ability default dimension 464 * 465 * @type { string } 466 * @readonly 467 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 468 * @systemapi 469 * @since 9 470 */ 471 readonly defaultDimension: string; 472} 473 474/** 475 * Version: the bundle version class. 476 * 477 * @typedef Version 478 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 479 * @systemapi 480 * @since 9 481 */ 482export interface Version { 483 /** 484 * Indicates the min compatible code of this version 485 * 486 * @type { number } 487 * @readonly 488 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 489 * @systemapi 490 * @since 9 491 */ 492 readonly minCompatibleVersionCode: number; 493 494 /** 495 * Indicates the name of this version 496 * 497 * @type { string } 498 * @readonly 499 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 500 * @systemapi 501 * @since 9 502 */ 503 readonly name: string; 504 505 /** 506 * Indicates the code of this version 507 * 508 * @type { number } 509 * @readonly 510 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 511 * @systemapi 512 * @since 9 513 */ 514 readonly code: number; 515} 516 517/** 518 * ApiVersion: the bundle Api version class. 519 * 520 * @typedef ApiVersion 521 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 522 * @systemapi 523 * @since 9 524 */ 525export interface ApiVersion { 526 /** 527 * Indicates the release type of the api 528 * 529 * @type { string } 530 * @readonly 531 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 532 * @systemapi 533 * @since 9 534 */ 535 readonly releaseType: string; 536 537 /** 538 * Indicates the compatible version code of the api 539 * 540 * @type { number } 541 * @readonly 542 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 543 * @systemapi 544 * @since 9 545 */ 546 readonly compatible: number; 547 548 /** 549 * Indicates the target version code of the api 550 * 551 * @type { number } 552 * @readonly 553 * @syscap SystemCapability.BundleManager.BundleFramework.FreeInstall 554 * @systemapi 555 * @since 9 556 */ 557 readonly target: number; 558} 559