• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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   *
220   * @permission ohos.permission.sec.ACCESS_UDID
221   * @constant
222   * @syscap SystemCapability.Startup.SystemInfo
223   * @since 6
224   */
225  const serial: string;
226
227  /**
228   * Obtains the bootloader version number represented by a string.
229   *
230   * @constant
231   * @syscap SystemCapability.Startup.SystemInfo
232   * @since 6
233   */
234  /**
235   * Obtains the bootloader version number represented by a string.
236   *
237   * @constant
238   * @syscap SystemCapability.Startup.SystemInfo
239   * @crossplatform
240   * @since 10
241   */
242  const bootloaderVersion: string;
243
244  /**
245   * Obtains the application binary interface (Abi) list represented by a string.
246   *
247   * @constant
248   * @syscap SystemCapability.Startup.SystemInfo
249   * @since 6
250   */
251  /**
252   * Obtains the application binary interface (Abi) list represented by a string.
253   *
254   * @constant
255   * @syscap SystemCapability.Startup.SystemInfo
256   * @crossplatform
257   * @since 10
258   */
259  const abiList: string;
260
261  /**
262   * Obtains the security patch level represented by a string.
263   *
264   * @constant
265   * @syscap SystemCapability.Startup.SystemInfo
266   * @since 6
267   */
268  /**
269   * Obtains the security patch level represented by a string.
270   *
271   * @constant
272   * @syscap SystemCapability.Startup.SystemInfo
273   * @crossplatform
274   * @since 10
275   */
276  const securityPatchTag: string;
277
278  /**
279   * Obtains the product version represented by a string.
280   *
281   * @constant
282   * @syscap SystemCapability.Startup.SystemInfo
283   * @since 6
284   */
285  /**
286   * Obtains the product version represented by a string.
287   *
288   * @constant
289   * @syscap SystemCapability.Startup.SystemInfo
290   * @crossplatform
291   * @since 10
292   */
293  const displayVersion: string;
294
295  /**
296   * Obtains the incremental version represented by a string.
297   *
298   * @constant
299   * @syscap SystemCapability.Startup.SystemInfo
300   * @since 6
301   */
302  /**
303   * Obtains the incremental version represented by a string.
304   *
305   * @constant
306   * @syscap SystemCapability.Startup.SystemInfo
307   * @crossplatform
308   * @since 10
309   */
310  const incrementalVersion: string;
311
312  /**
313   * Obtains the OS release type represented by a string.
314   * <p>The OS release category can be {@code Release}, {@code Beta}, or {@code Canary}.
315   * The specific release type may be {@code Release}, {@code Beta1}, or others alike.
316   *
317   * @constant
318   * @syscap SystemCapability.Startup.SystemInfo
319   * @since 6
320   */
321  /**
322   * Obtains the OS release type represented by a string.
323   * <p>The OS release category can be {@code Release}, {@code Beta}, or {@code Canary}.
324   * The specific release type may be {@code Release}, {@code Beta1}, or others alike.
325   *
326   * @constant
327   * @syscap SystemCapability.Startup.SystemInfo
328   * @crossplatform
329   * @since 10
330   */
331  const osReleaseType: string;
332
333  /**
334   * Obtains the OS version represented by a string.
335   *
336   * @constant
337   * @syscap SystemCapability.Startup.SystemInfo
338   * @since 6
339   */
340  /**
341   * Obtains the OS version represented by a string.
342   *
343   * @constant
344   * @syscap SystemCapability.Startup.SystemInfo
345   * @crossplatform
346   * @since 10
347   */
348  /**
349   * Obtains the OS version represented by a string.
350   *
351   * @constant
352   * @syscap SystemCapability.Startup.SystemInfo
353   * @crossplatform
354   * @atomicservice
355   * @since 11
356   */
357  const osFullName: string;
358
359  /**
360   * Obtains the major (M) version number, which increases with any updates to the overall architecture.
361   * <p>The M version number monotonically increases from 1 to 99.
362   *
363   * @constant
364   * @syscap SystemCapability.Startup.SystemInfo
365   * @since 6
366   */
367  /**
368   * Obtains the major (M) version number, which increases with any updates to the overall architecture.
369   * <p>The M version number monotonically increases from 1 to 99.
370   *
371   * @constant
372   * @syscap SystemCapability.Startup.SystemInfo
373   * @crossplatform
374   * @since 10
375   */
376  const majorVersion: number;
377
378  /**
379   * Obtains the senior (S) version number, which increases with any updates to the partial
380   * architecture or major features.
381   * <p>The S version number monotonically increases from 0 to 99.
382   *
383   * @constant
384   * @syscap SystemCapability.Startup.SystemInfo
385   * @since 6
386   */
387  /**
388   * Obtains the senior (S) version number, which increases with any updates to the partial
389   * architecture or major features.
390   * <p>The S version number monotonically increases from 0 to 99.
391   *
392   * @constant
393   * @syscap SystemCapability.Startup.SystemInfo
394   * @crossplatform
395   * @since 10
396   */
397  const seniorVersion: number;
398
399  /**
400   * Obtains the feature (F) version number, which increases with any planned new features.
401   * <p>The F version number monotonically increases from 0 or 1 to 99.
402   *
403   * @constant
404   * @syscap SystemCapability.Startup.SystemInfo
405   * @since 6
406   */
407  /**
408   * Obtains the feature (F) version number, which increases with any planned new features.
409   * <p>The F version number monotonically increases from 0 or 1 to 99.
410   *
411   * @constant
412   * @syscap SystemCapability.Startup.SystemInfo
413   * @crossplatform
414   * @since 10
415   */
416  const featureVersion: number;
417
418  /**
419   * Obtains the build (B) version number, which increases with each new development build.
420   * <p>The B version number monotonically increases from 0 or 1 to 999.
421   *
422   * @constant
423   * @syscap SystemCapability.Startup.SystemInfo
424   * @since 6
425   */
426  /**
427   * Obtains the build (B) version number, which increases with each new development build.
428   * <p>The B version number monotonically increases from 0 or 1 to 999.
429   *
430   * @constant
431   * @syscap SystemCapability.Startup.SystemInfo
432   * @crossplatform
433   * @since 10
434   */
435  const buildVersion: number;
436
437  /**
438   * Obtains the SDK API version number.
439   *
440   * @constant
441   * @syscap SystemCapability.Startup.SystemInfo
442   * @since 6
443   */
444  /**
445   * Obtains the SDK API version number.
446   *
447   * @constant
448   * @syscap SystemCapability.Startup.SystemInfo
449   * @crossplatform
450   * @since 10
451   */
452  const sdkApiVersion: number;
453
454  /**
455   * Obtains the first API version number.
456   *
457   * @constant
458   * @syscap SystemCapability.Startup.SystemInfo
459   * @since 6
460   */
461  /**
462   * Obtains the first API version number.
463   *
464   * @constant
465   * @syscap SystemCapability.Startup.SystemInfo
466   * @crossplatform
467   * @since 10
468   */
469  const firstApiVersion: number;
470
471  /**
472   * Obtains the version ID by a string.
473   *
474   * @constant
475   * @syscap SystemCapability.Startup.SystemInfo
476   * @since 6
477   */
478  /**
479   * Obtains the version ID by a string.
480   *
481   * @constant
482   * @syscap SystemCapability.Startup.SystemInfo
483   * @crossplatform
484   * @since 10
485   */
486  const versionId: string;
487
488  /**
489   * Obtains the build types of the same baseline code.
490   *
491   * @constant
492   * @syscap SystemCapability.Startup.SystemInfo
493   * @since 6
494   */
495  /**
496   * Obtains the build types of the same baseline code.
497   *
498   * @constant
499   * @syscap SystemCapability.Startup.SystemInfo
500   * @crossplatform
501   * @since 10
502   */
503  const buildType: string;
504
505  /**
506   * Obtains the different build user of the same baseline code.
507   *
508   * @constant
509   * @syscap SystemCapability.Startup.SystemInfo
510   * @since 6
511   */
512  /**
513   * Obtains the different build user of the same baseline code.
514   *
515   * @constant
516   * @syscap SystemCapability.Startup.SystemInfo
517   * @crossplatform
518   * @since 10
519   */
520  const buildUser: string;
521
522  /**
523   * Obtains the different build host of the same baseline code.
524   *
525   * @constant
526   * @syscap SystemCapability.Startup.SystemInfo
527   * @since 6
528   */
529  /**
530   * Obtains the different build host of the same baseline code.
531   *
532   * @constant
533   * @syscap SystemCapability.Startup.SystemInfo
534   * @crossplatform
535   * @since 10
536   */
537  const buildHost: string;
538
539  /**
540   * Obtains the build time.
541   *
542   * @constant
543   * @syscap SystemCapability.Startup.SystemInfo
544   * @since 6
545   */
546  /**
547   * Obtains the build time.
548   *
549   * @constant
550   * @syscap SystemCapability.Startup.SystemInfo
551   * @crossplatform
552   * @since 10
553   */
554  const buildTime: string;
555
556  /**
557   * Obtains the version hash.
558   *
559   * @constant
560   * @syscap SystemCapability.Startup.SystemInfo
561   * @since 6
562   */
563  /**
564   * Obtains the version hash.
565   *
566   * @constant
567   * @syscap SystemCapability.Startup.SystemInfo
568   * @crossplatform
569   * @since 10
570   */
571  const buildRootHash: string;
572  /**
573   * Obtains the device udid.
574   *
575   * @permission ohos.permission.sec.ACCESS_UDID
576   * @constant
577   * @syscap SystemCapability.Startup.SystemInfo
578   * @since 7
579   */
580  const udid: string;
581
582  /**
583   * Obtains the Distribution OS name.
584   * <p>Independent Software Vendor (ISV) may distribute OHOS with their own OS name.
585   * distributionOsName will return the ISV OS name
586   * If ISV not specified, it will return an empty string
587   *
588   * @constant
589   * @syscap SystemCapability.Startup.SystemInfo
590   * @since 10
591   */
592  const distributionOSName: string;
593
594  /**
595   * Obtains the Distribution OS version.
596   * <p>Independent Software Vendor (ISV) may distribute OHOS with their own OS version.
597   * distributionOSVersion will return the ISV OS version
598   * If ISV not specified, it will return the same value as osFullName
599   *
600   * @constant
601   * @syscap SystemCapability.Startup.SystemInfo
602   * @since 10
603   */
604  const distributionOSVersion: string;
605
606  /**
607   * Obtains the Distribution OS version.
608   * <p>Independent Software Vendor (ISV) may distribute OHOS with their own OS api version.
609   * distributionOSVersion will return the ISV OS api version
610   * If ISV not specified, it will return the same value as sdkApiVersion
611   *
612   * @constant
613   * @syscap SystemCapability.Startup.SystemInfo
614   * @since 10
615   */
616  const distributionOSApiVersion: number;
617
618  /**
619   * Obtains the Distribution OS release type.
620   * <p>Independent Software Vendor (ISV) may distribute OHOS with their own OS release type.
621   * distributionOSVersion will return the ISV OS release type
622   * If ISV not specified, it will return the same value as osReleaseType
623   *
624   * @constant
625   * @syscap SystemCapability.Startup.SystemInfo
626   * @since 10
627   */
628  const distributionOSReleaseType: string;
629
630  /**
631   * Open Device Identifier (ODID): a developer-level non-permanent device identifier.
632   * A developer can be an enterprise or individual developer.
633   * Example: dff3cdfd-7beb-1e7d-fdf7-1dbfddd7d30c
634   *
635   * An ODID will be regenerated in the following scenarios:
636   * Restore a phone to its factory settings.
637   * Uninstall and reinstall all apps of one developer on one device.
638   *
639   * An ODID is generated based on the following rules:
640   * For apps from the same developer, which are running on the same device, they have the same ODID.
641   * For apps from different developers, which are running on the same device, each of them has its own ODID.
642   * For apps from the same developer, which are running on different devices, each of them has its own ODID.
643   * For apps from different developers, which are running on different devices, each of them has its own ODID.
644   *
645   * @constant
646   * @syscap SystemCapability.Startup.SystemInfo
647   * @since 12
648   */
649  const ODID: string;
650}
651
652export default deviceInfo;
653