1/* 2 * Copyright (c) 2021 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 BasicServicesKit 19 */ 20 21/** 22 * A static class pertaining to the product information. 23 * 24 * @namespace deviceInfo 25 * @syscap SystemCapability.Startup.SystemInfo 26 * @since 6 27 */ 28/** 29 * A static class pertaining to the product information. 30 * 31 * @namespace deviceInfo 32 * @syscap SystemCapability.Startup.SystemInfo 33 * @crossplatform 34 * @atomicservice 35 * @since 11 36 */ 37declare namespace deviceInfo { 38 /** 39 * Obtains the device type represented by a string, 40 * which can be {@code phone} (or {@code default} for phones), {@code wearable}, {@code liteWearable}, 41 * {@code tablet}, {@code tv}, {@code car}, or {@code smartVision}. 42 * 43 * @constant 44 * @syscap SystemCapability.Startup.SystemInfo 45 * @since 6 46 */ 47 /** 48 * Obtains the device type represented by a string, 49 * which can be {@code phone} (or {@code default} for phones), {@code wearable}, {@code liteWearable}, 50 * {@code tablet}, {@code tv}, {@code car}, or {@code smartVision}. 51 * 52 * @constant 53 * @syscap SystemCapability.Startup.SystemInfo 54 * @crossplatform 55 * @since 10 56 */ 57 /** 58 * Obtains the device type represented by a string, 59 * which can be {@code phone} (or {@code default} for phones), {@code wearable}, {@code liteWearable}, 60 * {@code tablet}, {@code tv}, {@code car}, or {@code smartVision}. 61 * 62 * @constant 63 * @syscap SystemCapability.Startup.SystemInfo 64 * @crossplatform 65 * @atomicservice 66 * @since 11 67 */ 68 const deviceType: string; 69 70 /** 71 * Obtains the device manufacturer represented by a string. 72 * 73 * @constant 74 * @syscap SystemCapability.Startup.SystemInfo 75 * @since 6 76 */ 77 /** 78 * Obtains the device manufacturer represented by a string. 79 * 80 * @constant 81 * @syscap SystemCapability.Startup.SystemInfo 82 * @crossplatform 83 * @since 10 84 */ 85 const manufacture: string; 86 87 /** 88 * Obtains the device brand represented by a string. 89 * 90 * @constant 91 * @syscap SystemCapability.Startup.SystemInfo 92 * @since 6 93 */ 94 /** 95 * Obtains the device brand represented by a string. 96 * 97 * @constant 98 * @syscap SystemCapability.Startup.SystemInfo 99 * @crossplatform 100 * @since 10 101 */ 102 /** 103 * Obtains the device brand represented by a string. 104 * 105 * @constant 106 * @syscap SystemCapability.Startup.SystemInfo 107 * @crossplatform 108 * @atomicservice 109 * @since 11 110 */ 111 const brand: string; 112 113 /** 114 * Obtains the external product series represented by a string. 115 * 116 * @constant 117 * @syscap SystemCapability.Startup.SystemInfo 118 * @since 6 119 */ 120 /** 121 * Obtains the external product series represented by a string. 122 * 123 * @constant 124 * @syscap SystemCapability.Startup.SystemInfo 125 * @crossplatform 126 * @since 10 127 */ 128 const marketName: string; 129 130 /** 131 * Obtains the product series represented by a string. 132 * 133 * @constant 134 * @syscap SystemCapability.Startup.SystemInfo 135 * @since 6 136 */ 137 /** 138 * Obtains the product series represented by a string. 139 * 140 * @constant 141 * @syscap SystemCapability.Startup.SystemInfo 142 * @crossplatform 143 * @since 10 144 */ 145 const productSeries: string; 146 147 /** 148 * Obtains the product model represented by a string. 149 * 150 * @constant 151 * @syscap SystemCapability.Startup.SystemInfo 152 * @since 6 153 */ 154 /** 155 * Obtains the product model represented by a string. 156 * 157 * @constant 158 * @syscap SystemCapability.Startup.SystemInfo 159 * @crossplatform 160 * @since 10 161 */ 162 /** 163 * Obtains the product model represented by a string. 164 * 165 * @constant 166 * @syscap SystemCapability.Startup.SystemInfo 167 * @crossplatform 168 * @atomicservice 169 * @since 11 170 */ 171 const productModel: string; 172 173 /** 174 * Obtains the software model represented by a string. 175 * 176 * @constant 177 * @syscap SystemCapability.Startup.SystemInfo 178 * @since 6 179 */ 180 /** 181 * Obtains the software model represented by a string. 182 * 183 * @constant 184 * @syscap SystemCapability.Startup.SystemInfo 185 * @crossplatform 186 * @since 10 187 */ 188 const softwareModel: string; 189 190 /** 191 * Obtains the hardware model represented by a string. 192 * 193 * @constant 194 * @syscap SystemCapability.Startup.SystemInfo 195 * @since 6 196 */ 197 /** 198 * Obtains the hardware model represented by a string. 199 * 200 * @constant 201 * @syscap SystemCapability.Startup.SystemInfo 202 * @crossplatform 203 * @since 10 204 */ 205 const hardwareModel: string; 206 207 /** 208 * Obtains the hardware profile represented by a string. 209 * 210 * @constant 211 * @syscap SystemCapability.Startup.SystemInfo 212 * @since 6 213 * @deprecated since 9 214 */ 215 const hardwareProfile: string; 216 217 /** 218 * Obtains the device serial number represented by a string. 219 * This API can be called only by system applications. 220 * 221 * @permission ohos.permission.sec.ACCESS_UDID 222 * @constant 223 * @syscap SystemCapability.Startup.SystemInfo 224 * @since 6 225 */ 226 const serial: string; 227 228 /** 229 * Obtains the bootloader version number represented by a string. 230 * 231 * @constant 232 * @syscap SystemCapability.Startup.SystemInfo 233 * @since 6 234 */ 235 /** 236 * Obtains the bootloader version number represented by a string. 237 * 238 * @constant 239 * @syscap SystemCapability.Startup.SystemInfo 240 * @crossplatform 241 * @since 10 242 */ 243 const bootloaderVersion: string; 244 245 /** 246 * Obtains the application binary interface (Abi) list represented by a string. 247 * 248 * @constant 249 * @syscap SystemCapability.Startup.SystemInfo 250 * @since 6 251 */ 252 /** 253 * Obtains the application binary interface (Abi) list represented by a string. 254 * 255 * @constant 256 * @syscap SystemCapability.Startup.SystemInfo 257 * @crossplatform 258 * @since 10 259 */ 260 const abiList: string; 261 262 /** 263 * Obtains the security patch level represented by a string. 264 * 265 * @constant 266 * @syscap SystemCapability.Startup.SystemInfo 267 * @since 6 268 */ 269 /** 270 * Obtains the security patch level represented by a string. 271 * 272 * @constant 273 * @syscap SystemCapability.Startup.SystemInfo 274 * @crossplatform 275 * @since 10 276 */ 277 const securityPatchTag: string; 278 279 /** 280 * Obtains the product version represented by a string. 281 * 282 * @constant 283 * @syscap SystemCapability.Startup.SystemInfo 284 * @since 6 285 */ 286 /** 287 * Obtains the product version represented by a string. 288 * 289 * @constant 290 * @syscap SystemCapability.Startup.SystemInfo 291 * @crossplatform 292 * @since 10 293 */ 294 const displayVersion: string; 295 296 /** 297 * Obtains the incremental version represented by a string. 298 * 299 * @constant 300 * @syscap SystemCapability.Startup.SystemInfo 301 * @since 6 302 */ 303 /** 304 * Obtains the incremental version represented by a string. 305 * 306 * @constant 307 * @syscap SystemCapability.Startup.SystemInfo 308 * @crossplatform 309 * @since 10 310 */ 311 const incrementalVersion: string; 312 313 /** 314 * Obtains the OS release type represented by a string. 315 * <p>The OS release category can be {@code Release}, {@code Beta}, or {@code Canary}. 316 * The specific release type may be {@code Release}, {@code Beta1}, or others alike. 317 * 318 * @constant 319 * @syscap SystemCapability.Startup.SystemInfo 320 * @since 6 321 */ 322 /** 323 * Obtains the OS release type represented by a string. 324 * <p>The OS release category can be {@code Release}, {@code Beta}, or {@code Canary}. 325 * The specific release type may be {@code Release}, {@code Beta1}, or others alike. 326 * 327 * @constant 328 * @syscap SystemCapability.Startup.SystemInfo 329 * @crossplatform 330 * @since 10 331 */ 332 const osReleaseType: string; 333 334 /** 335 * Obtains the OS version represented by a string. 336 * 337 * @constant 338 * @syscap SystemCapability.Startup.SystemInfo 339 * @since 6 340 */ 341 /** 342 * Obtains the OS version represented by a string. 343 * 344 * @constant 345 * @syscap SystemCapability.Startup.SystemInfo 346 * @crossplatform 347 * @since 10 348 */ 349 /** 350 * Obtains the OS version represented by a string. 351 * 352 * @constant 353 * @syscap SystemCapability.Startup.SystemInfo 354 * @crossplatform 355 * @atomicservice 356 * @since 11 357 */ 358 const osFullName: string; 359 360 /** 361 * Obtains the major (M) version number, which increases with any updates to the overall architecture. 362 * <p>The M version number monotonically increases from 1 to 99. 363 * 364 * @constant 365 * @syscap SystemCapability.Startup.SystemInfo 366 * @since 6 367 */ 368 /** 369 * Obtains the major (M) version number, which increases with any updates to the overall architecture. 370 * <p>The M version number monotonically increases from 1 to 99. 371 * 372 * @constant 373 * @syscap SystemCapability.Startup.SystemInfo 374 * @crossplatform 375 * @since 10 376 */ 377 const majorVersion: number; 378 379 /** 380 * Obtains the senior (S) version number, which increases with any updates to the partial 381 * architecture or major features. 382 * <p>The S version number monotonically increases from 0 to 99. 383 * 384 * @constant 385 * @syscap SystemCapability.Startup.SystemInfo 386 * @since 6 387 */ 388 /** 389 * Obtains the senior (S) version number, which increases with any updates to the partial 390 * architecture or major features. 391 * <p>The S version number monotonically increases from 0 to 99. 392 * 393 * @constant 394 * @syscap SystemCapability.Startup.SystemInfo 395 * @crossplatform 396 * @since 10 397 */ 398 const seniorVersion: number; 399 400 /** 401 * Obtains the feature (F) version number, which increases with any planned new features. 402 * <p>The F version number monotonically increases from 0 or 1 to 99. 403 * 404 * @constant 405 * @syscap SystemCapability.Startup.SystemInfo 406 * @since 6 407 */ 408 /** 409 * Obtains the feature (F) version number, which increases with any planned new features. 410 * <p>The F version number monotonically increases from 0 or 1 to 99. 411 * 412 * @constant 413 * @syscap SystemCapability.Startup.SystemInfo 414 * @crossplatform 415 * @since 10 416 */ 417 const featureVersion: number; 418 419 /** 420 * Obtains the build (B) version number, which increases with each new development build. 421 * <p>The B version number monotonically increases from 0 or 1 to 999. 422 * 423 * @constant 424 * @syscap SystemCapability.Startup.SystemInfo 425 * @since 6 426 */ 427 /** 428 * Obtains the build (B) version number, which increases with each new development build. 429 * <p>The B version number monotonically increases from 0 or 1 to 999. 430 * 431 * @constant 432 * @syscap SystemCapability.Startup.SystemInfo 433 * @crossplatform 434 * @since 10 435 */ 436 const buildVersion: number; 437 438 /** 439 * Obtains the SDK API version number. 440 * 441 * @constant 442 * @syscap SystemCapability.Startup.SystemInfo 443 * @since 6 444 */ 445 /** 446 * Obtains the SDK API version number. 447 * 448 * @constant 449 * @syscap SystemCapability.Startup.SystemInfo 450 * @crossplatform 451 * @since 10 452 */ 453 const sdkApiVersion: number; 454 455 /** 456 * Obtains the first API version number. 457 * 458 * @constant 459 * @syscap SystemCapability.Startup.SystemInfo 460 * @since 6 461 */ 462 /** 463 * Obtains the first API version number. 464 * 465 * @constant 466 * @syscap SystemCapability.Startup.SystemInfo 467 * @crossplatform 468 * @since 10 469 */ 470 const firstApiVersion: number; 471 472 /** 473 * Obtains the version ID by a string. 474 * 475 * @constant 476 * @syscap SystemCapability.Startup.SystemInfo 477 * @since 6 478 */ 479 /** 480 * Obtains the version ID by a string. 481 * 482 * @constant 483 * @syscap SystemCapability.Startup.SystemInfo 484 * @crossplatform 485 * @since 10 486 */ 487 const versionId: string; 488 489 /** 490 * Obtains the build types of the same baseline code. 491 * 492 * @constant 493 * @syscap SystemCapability.Startup.SystemInfo 494 * @since 6 495 */ 496 /** 497 * Obtains the build types of the same baseline code. 498 * 499 * @constant 500 * @syscap SystemCapability.Startup.SystemInfo 501 * @crossplatform 502 * @since 10 503 */ 504 const buildType: string; 505 506 /** 507 * Obtains the different build user of the same baseline code. 508 * 509 * @constant 510 * @syscap SystemCapability.Startup.SystemInfo 511 * @since 6 512 */ 513 /** 514 * Obtains the different build user of the same baseline code. 515 * 516 * @constant 517 * @syscap SystemCapability.Startup.SystemInfo 518 * @crossplatform 519 * @since 10 520 */ 521 const buildUser: string; 522 523 /** 524 * Obtains the different build host of the same baseline code. 525 * 526 * @constant 527 * @syscap SystemCapability.Startup.SystemInfo 528 * @since 6 529 */ 530 /** 531 * Obtains the different build host of the same baseline code. 532 * 533 * @constant 534 * @syscap SystemCapability.Startup.SystemInfo 535 * @crossplatform 536 * @since 10 537 */ 538 const buildHost: string; 539 540 /** 541 * Obtains the build time. 542 * 543 * @constant 544 * @syscap SystemCapability.Startup.SystemInfo 545 * @since 6 546 */ 547 /** 548 * Obtains the build time. 549 * 550 * @constant 551 * @syscap SystemCapability.Startup.SystemInfo 552 * @crossplatform 553 * @since 10 554 */ 555 const buildTime: string; 556 557 /** 558 * Obtains the version hash. 559 * 560 * @constant 561 * @syscap SystemCapability.Startup.SystemInfo 562 * @since 6 563 */ 564 /** 565 * Obtains the version hash. 566 * 567 * @constant 568 * @syscap SystemCapability.Startup.SystemInfo 569 * @crossplatform 570 * @since 10 571 */ 572 const buildRootHash: string; 573 /** 574 * Obtains the device udid. 575 * This API can be called only by system applications. 576 * 577 * @permission ohos.permission.sec.ACCESS_UDID 578 * @constant 579 * @syscap SystemCapability.Startup.SystemInfo 580 * @since 7 581 */ 582 const udid: string; 583 584 /** 585 * Obtains the Distribution OS name. 586 * <p>Independent Software Vendor (ISV) may distribute OHOS with their own OS name. 587 * distributionOsName will return the ISV OS name 588 * If ISV not specified, it will return an empty string 589 * 590 * @constant 591 * @syscap SystemCapability.Startup.SystemInfo 592 * @since 10 593 */ 594 const distributionOSName: string; 595 596 /** 597 * Obtains the Distribution OS version. 598 * <p>Independent Software Vendor (ISV) may distribute OHOS with their own OS version. 599 * distributionOSVersion will return the ISV OS version 600 * If ISV not specified, it will return the same value as osFullName 601 * 602 * @constant 603 * @syscap SystemCapability.Startup.SystemInfo 604 * @since 10 605 */ 606 const distributionOSVersion: string; 607 608 /** 609 * Obtains the Distribution OS version. 610 * <p>Independent Software Vendor (ISV) may distribute OHOS with their own OS api version. 611 * distributionOSVersion will return the ISV OS api version 612 * If ISV not specified, it will return the same value as sdkApiVersion 613 * 614 * @constant 615 * @syscap SystemCapability.Startup.SystemInfo 616 * @since 10 617 */ 618 const distributionOSApiVersion: number; 619 620 /** 621 * Obtains the Distribution OS api name. 622 * <p>Independent Software Vendor (ISV) may distribute OHOS with their own OS api name. 623 * distributionOSApiName will return the ISV OS api name 624 * 625 * @syscap SystemCapability.Startup.SystemInfo 626 * @since 13 627 */ 628 const distributionOSApiName: string; 629 630 /** 631 * Obtains the Distribution OS release type. 632 * <p>Independent Software Vendor (ISV) may distribute OHOS with their own OS release type. 633 * distributionOSVersion will return the ISV OS release type 634 * If ISV not specified, it will return the same value as osReleaseType 635 * 636 * @constant 637 * @syscap SystemCapability.Startup.SystemInfo 638 * @since 10 639 */ 640 const distributionOSReleaseType: string; 641 642 /** 643 * Open Device Identifier (ODID): a developer-level non-permanent device identifier. 644 * A developer can be an enterprise or individual developer. 645 * Example: dff3cdfd-7beb-1e7d-fdf7-1dbfddd7d30c 646 * 647 * An ODID will be regenerate in the following scenarios: 648 * Restore a phone to its factory settings. 649 * Uninstall and reinstall all apps of one developer on one device. 650 * 651 * An ODID is generated based on the following rules: 652 * For apps from the same developer, which are running on the same device, they have the same ODID. 653 * For apps from different developers, which are running on the same device, each of them has its own ODID. 654 * For apps from the same developer, which are running on different devices, each of them has its own ODID. 655 * For apps from different developers, which are running on different devices, each of them has its own ODID. 656 * 657 * @constant 658 * @syscap SystemCapability.Startup.SystemInfo 659 * @since 12 660 */ 661 const ODID: string; 662} 663 664export default deviceInfo; 665