From 80fc60acf8505240d84ddab24857417ffba07d0a Mon Sep 17 00:00:00 2001 From: tongdiaoZS <1904807608@qq.com> Date: Mon, 21 Jul 2025 12:04:40 +0800 Subject: [PATCH] taihe: modify systemParameterEnhance declaration according to the new overload Issue: https://gitee.com/openharmony/interface_sdk-js/issues/ICNN4E Signed-off-by: tongdiaoZS <1904807608@qq.com> --- api/@ohos.systemParameterEnhance.d.ts | 109 +++++++++++++++++++++++++- 1 file changed, 108 insertions(+), 1 deletion(-) diff --git a/api/@ohos.systemParameterEnhance.d.ts b/api/@ohos.systemParameterEnhance.d.ts index 44b2b5f99c..c3d93aa0e8 100644 --- a/api/@ohos.systemParameterEnhance.d.ts +++ b/api/@ohos.systemParameterEnhance.d.ts @@ -16,7 +16,6 @@ /** * @file * @kit BasicServicesKit - * @arkts 1.1&1.2 */ import { AsyncCallback, BusinessError } from './@ohos.base'; @@ -28,6 +27,7 @@ import { AsyncCallback, BusinessError } from './@ohos.base'; * @syscap SystemCapability.Startup.SystemInfo * @systemapi Hide this for inner system use. * @since 9 + * @arkts 1.1&1.2 */ declare namespace systemParameterEnhance { /** @@ -45,9 +45,16 @@ declare namespace systemParameterEnhance { * @syscap SystemCapability.Startup.SystemInfo * @systemapi Hide this for inner system use. * @since 9 + * @arkts 1.1&1.2 */ function getSync(key: string, def?: string): string; + /** + * @since 20 + * @arkts 1.2 + */ + overload get { getWithCallback, getWithDefCallback, getReturnsPromise }; + /** * Gets the value of the attribute with the specified key. * @@ -65,6 +72,24 @@ declare namespace systemParameterEnhance { */ function get(key: string, callback: AsyncCallback): void; + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + function getWithCallback(key: string, callback: AsyncCallback): void; + /** * Gets the value of the attribute with the specified key. * @@ -83,6 +108,25 @@ declare namespace systemParameterEnhance { */ function get(key: string, def: string, callback: AsyncCallback): void; + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + function getWithDefCallback(key: string, def: string, callback: AsyncCallback): void; + /** * Gets the value of the attribute with the specified key. * @@ -101,6 +145,25 @@ declare namespace systemParameterEnhance { */ function get(key: string, def?: string): Promise; + /** + * Gets the value of the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } def Default value. + * @returns { Promise }, which is used to obtain the result asynchronously. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700101 - System parameter not found. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + function getReturnsPromise(key: string, def?: string): Promise; + /** * Sets a value for the attribute with the specified key. * @@ -118,6 +181,12 @@ declare namespace systemParameterEnhance { */ function setSync(key: string, value: string): void; + /** + * @since 20 + * @arkts 1.2 + */ + overload set { setWithCallback, setReturnsPromise }; + /** * Sets a value for the attribute with the specified key. * @@ -136,6 +205,25 @@ declare namespace systemParameterEnhance { */ function set(key: string, value: string, callback: AsyncCallback): void; + /** + * Sets a value for the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } value System attribute value to set, cannot exceed 96 characters. + * @param { AsyncCallback } callback Callback function. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700102 - Invalid system parameter value. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + function setWithCallback(key: string, value: string, callback: AsyncCallback): void; + /** * Sets a value for the attribute with the specified key. * @@ -153,6 +241,25 @@ declare namespace systemParameterEnhance { * @since 9 */ function set(key: string, value: string): Promise; + + /** + * Sets a value for the attribute with the specified key. + * + * @param { string } key Key of the system attribute, cannot exceed 128 characters, + * only allow alphanumeric, plus '.', '-', '@', ':', or '_', don't allow '..'. + * @param { string } value Default value, cannot exceed 96 characters. + * @returns { Promise }, which is used to obtain the result asynchronously. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1.Mandatory parameters are left unspecified; + * 2.incorrect parameter types; 3.parameter verification failed. + * @throws { BusinessError } 14700102 - Invalid system parameter value. + * @throws { BusinessError } 14700103 - The operation on the system permission is denied. + * @throws { BusinessError } 14700104 - System internal error such as out memory or deadlock. + * @syscap SystemCapability.Startup.SystemInfo + * @systemapi Hide this for inner system use. + * @since 20 + * @arkts 1.2 + */ + function setReturnsPromise(key: string, value: string): Promise; } export default systemParameterEnhance; -- Gitee