From 86ea1c11bdb3cba8d4063a4c773f303415fbe7b7 Mon Sep 17 00:00:00 2001 From: shikai-123 Date: Mon, 4 Jul 2022 12:39:56 +0800 Subject: [PATCH] Modify the return value type of promisewrapper Change the return value from object to function issues: https://gitee.com/openharmony/js_util_module/issues/I5DVPV Signed-off-by: zhoufei --- api/@ohos.util.d.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/api/@ohos.util.d.ts b/api/@ohos.util.d.ts index ea00afe070..f3f42ea249 100644 --- a/api/@ohos.util.d.ts +++ b/api/@ohos.util.d.ts @@ -64,10 +64,21 @@ declare namespace util { */ function callbackWrapper(original: Function): (err: Object, value: Object) => void; + /** + * Takes a function following the common error-first callback style, i.e taking an (err, value) => + * callback as the last argument, and return a function that returns promises. + * @since 9 + * @syscap SystemCapability.Utils.Lang + * @param original asynchronous function + * @return return a version that returns promises + */ + function promiseWrapper(original: (err: Object, value: Object) => void): Function; + /** * Takes a function following the common error-first callback style, i.e taking an (err, value) => * callback as the last argument, and return a version that returns promises. * @since 7 + * @deprecated since 9 * @syscap SystemCapability.Utils.Lang * @param original asynchronous function * @return return a version that returns promises -- Gitee