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