• 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
21import { AsyncCallback, BusinessError } from './@ohos.base';
22
23/**
24 * The interface of system parameters class.
25 *
26 * @namespace systemParameter
27 * @syscap SystemCapability.Startup.SystemInfo
28 * @systemapi Hide this for inner system use.
29 * @since 6
30 * @deprecated since 9
31 */
32declare namespace systemParameter {
33  /**
34   * Gets the value of the attribute with the specified key.
35   *
36   * @param { string } key Key of the system attribute.
37   * @param { string } def Default value.
38   * @returns { string } if the parameter is empty or doesn't exist, empty string will be returned.
39   * @syscap SystemCapability.Startup.SystemInfo
40   * @systemapi Hide this for inner system use.
41   * @since 6
42   * @deprecated since 9
43   */
44  function getSync(key: string, def?: string): string;
45
46  /**
47   * Gets the value of the attribute with the specified key.
48   *
49   * @param { string } key Key of the system attribute.
50   * @param { AsyncCallback<string> } callback Callback function.
51   * @syscap SystemCapability.Startup.SystemInfo
52   * @systemapi Hide this for inner system use.
53   * @since 6
54   * @deprecated since 9
55   */
56  function get(key: string, callback: AsyncCallback<string>): void;
57
58  /**
59   * Gets the value of the attribute with the specified key.
60   *
61   * @param { string } key Key of the system attribute.
62   * @param { string } def Default value.
63   * @param { AsyncCallback<string> } callback Callback function.
64   * @syscap SystemCapability.Startup.SystemInfo
65   * @systemapi Hide this for inner system use.
66   * @since 6
67   * @deprecated since 9
68   */
69  function get(key: string, def: string, callback: AsyncCallback<string>): void;
70
71  /**
72   * Gets the value of the attribute with the specified key.
73   *
74   * @param { string } key Key of the system attribute.
75   * @param { string } def Default value.
76   * @returns { Promise<string> } , which is used to obtain the result asynchronously.
77   * @syscap SystemCapability.Startup.SystemInfo
78   * @systemapi Hide this for inner system use.
79   * @since 6
80   * @deprecated since 9
81   */
82  function get(key: string, def?: string): Promise<string>;
83
84  /**
85   * Sets a value for the attribute with the specified key.
86   *
87   * @param { string } key Key of the system attribute.
88   * @param { string } value value System attribute value to set.
89   * @syscap SystemCapability.Startup.SystemInfo
90   * @systemapi Hide this for inner system use.
91   * @since 6
92   * @deprecated since 9
93   */
94  function setSync(key: string, value: string): void;
95
96  /**
97   * Sets a value for the attribute with the specified key.
98   *
99   * @param { string } key Key of the system attribute.
100   * @param { string } value System attribute value to set.
101   * @param { AsyncCallback<void> } callback Callback function.
102   * @syscap SystemCapability.Startup.SystemInfo
103   * @systemapi Hide this for inner system use.
104   * @since 6
105   * @deprecated since 9
106   */
107  function set(key: string, value: string, callback: AsyncCallback<void>): void;
108
109  /**
110   * Sets a value for the attribute with the specified key.
111   *
112   * @param { string } key Key of the system attribute.
113   * @param { string } value Default value.
114   * @returns { Promise<void> } which is used to obtain the result asynchronously.
115   * @syscap SystemCapability.Startup.SystemInfo
116   * @systemapi Hide this for inner system use.
117   * @since 6
118   * @deprecated since 9
119   */
120  function set(key: string, value: string): Promise<void>;
121}
122
123export default systemParameter;
124