161847f8eSopenharmony_ci/* 261847f8eSopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd. 361847f8eSopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 461847f8eSopenharmony_ci * you may not use this file except in compliance with the License. 561847f8eSopenharmony_ci * You may obtain a copy of the License at 661847f8eSopenharmony_ci * 761847f8eSopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 861847f8eSopenharmony_ci * 961847f8eSopenharmony_ci * Unless required by applicable law or agreed to in writing, software 1061847f8eSopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 1161847f8eSopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1261847f8eSopenharmony_ci * See the License for the specific language governing permissions and 1361847f8eSopenharmony_ci * limitations under the License. 1461847f8eSopenharmony_ci */ 1561847f8eSopenharmony_ci 1661847f8eSopenharmony_ci/** 1761847f8eSopenharmony_ci * @file 1861847f8eSopenharmony_ci * @kit BasicServicesKit 1961847f8eSopenharmony_ci */ 2061847f8eSopenharmony_ci 2161847f8eSopenharmony_ciimport { AsyncCallback, BusinessError } from './@ohos.base'; 2261847f8eSopenharmony_ci 2361847f8eSopenharmony_ci/** 2461847f8eSopenharmony_ci * The interface of system parameters class. 2561847f8eSopenharmony_ci * 2661847f8eSopenharmony_ci * @namespace systemParameter 2761847f8eSopenharmony_ci * @syscap SystemCapability.Startup.SystemInfo 2861847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 2961847f8eSopenharmony_ci * @since 6 3061847f8eSopenharmony_ci */ 3161847f8eSopenharmony_cideclare namespace systemParameter { 3261847f8eSopenharmony_ci /** 3361847f8eSopenharmony_ci * Gets the value of the attribute with the specified key. 3461847f8eSopenharmony_ci * 3561847f8eSopenharmony_ci * @param { string } key Key of the system attribute. 3661847f8eSopenharmony_ci * @param { string } def Default value. 3761847f8eSopenharmony_ci * @returns { string } if the parameter is empty or doesn't exist, empty string will be returned. 3861847f8eSopenharmony_ci * @syscap SystemCapability.Startup.SystemInfo 3961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 4061847f8eSopenharmony_ci * @since 6 4161847f8eSopenharmony_ci * @deprecated since 9 4261847f8eSopenharmony_ci */ 4361847f8eSopenharmony_ci function getSync(key: string, def?: string): string; 4461847f8eSopenharmony_ci 4561847f8eSopenharmony_ci /** 4661847f8eSopenharmony_ci * Gets the value of the attribute with the specified key. 4761847f8eSopenharmony_ci * 4861847f8eSopenharmony_ci * @param { string } key Key of the system attribute. 4961847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback Callback function. 5061847f8eSopenharmony_ci * @syscap SystemCapability.Startup.SystemInfo 5161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 5261847f8eSopenharmony_ci * @since 6 5361847f8eSopenharmony_ci * @deprecated since 9 5461847f8eSopenharmony_ci */ 5561847f8eSopenharmony_ci function get(key: string, callback: AsyncCallback<string>): void; 5661847f8eSopenharmony_ci 5761847f8eSopenharmony_ci /** 5861847f8eSopenharmony_ci * Gets the value of the attribute with the specified key. 5961847f8eSopenharmony_ci * 6061847f8eSopenharmony_ci * @param { string } key Key of the system attribute. 6161847f8eSopenharmony_ci * @param { string } def Default value. 6261847f8eSopenharmony_ci * @param { AsyncCallback<string> } callback Callback function. 6361847f8eSopenharmony_ci * @syscap SystemCapability.Startup.SystemInfo 6461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 6561847f8eSopenharmony_ci * @since 6 6661847f8eSopenharmony_ci * @deprecated since 9 6761847f8eSopenharmony_ci */ 6861847f8eSopenharmony_ci function get(key: string, def: string, callback: AsyncCallback<string>): void; 6961847f8eSopenharmony_ci 7061847f8eSopenharmony_ci /** 7161847f8eSopenharmony_ci * Gets the value of the attribute with the specified key. 7261847f8eSopenharmony_ci * 7361847f8eSopenharmony_ci * @param { string } key Key of the system attribute. 7461847f8eSopenharmony_ci * @param { string } def Default value. 7561847f8eSopenharmony_ci * @returns { Promise<string> } , which is used to obtain the result asynchronously. 7661847f8eSopenharmony_ci * @syscap SystemCapability.Startup.SystemInfo 7761847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 7861847f8eSopenharmony_ci * @since 6 7961847f8eSopenharmony_ci * @deprecated since 9 8061847f8eSopenharmony_ci */ 8161847f8eSopenharmony_ci function get(key: string, def?: string): Promise<string>; 8261847f8eSopenharmony_ci 8361847f8eSopenharmony_ci /** 8461847f8eSopenharmony_ci * Sets a value for the attribute with the specified key. 8561847f8eSopenharmony_ci * 8661847f8eSopenharmony_ci * @param { string } key Key of the system attribute. 8761847f8eSopenharmony_ci * @param { string } value value System attribute value to set. 8861847f8eSopenharmony_ci * @syscap SystemCapability.Startup.SystemInfo 8961847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 9061847f8eSopenharmony_ci * @since 6 9161847f8eSopenharmony_ci */ 9261847f8eSopenharmony_ci function setSync(key: string, value: string): void; 9361847f8eSopenharmony_ci 9461847f8eSopenharmony_ci /** 9561847f8eSopenharmony_ci * Sets a value for the attribute with the specified key. 9661847f8eSopenharmony_ci * 9761847f8eSopenharmony_ci * @param { string } key Key of the system attribute. 9861847f8eSopenharmony_ci * @param { string } value System attribute value to set. 9961847f8eSopenharmony_ci * @param { AsyncCallback<void> } callback Callback function. 10061847f8eSopenharmony_ci * @syscap SystemCapability.Startup.SystemInfo 10161847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 10261847f8eSopenharmony_ci * @since 6 10361847f8eSopenharmony_ci * @deprecated since 9 10461847f8eSopenharmony_ci */ 10561847f8eSopenharmony_ci function set(key: string, value: string, callback: AsyncCallback<void>): void; 10661847f8eSopenharmony_ci 10761847f8eSopenharmony_ci /** 10861847f8eSopenharmony_ci * Sets a value for the attribute with the specified key. 10961847f8eSopenharmony_ci * 11061847f8eSopenharmony_ci * @param { string } key Key of the system attribute. 11161847f8eSopenharmony_ci * @param { string } value Default value. 11261847f8eSopenharmony_ci * @returns { Promise<void> } which is used to obtain the result asynchronously. 11361847f8eSopenharmony_ci * @syscap SystemCapability.Startup.SystemInfo 11461847f8eSopenharmony_ci * @systemapi Hide this for inner system use. 11561847f8eSopenharmony_ci * @since 6 11661847f8eSopenharmony_ci * @deprecated since 9 11761847f8eSopenharmony_ci */ 11861847f8eSopenharmony_ci function set(key: string, value: string): Promise<void>; 11961847f8eSopenharmony_ci} 12061847f8eSopenharmony_ci 12161847f8eSopenharmony_ciexport default systemParameter; 122