From 9a4f54035e3b112ff65a1193a2c3599093077bbc Mon Sep 17 00:00:00 2001 From: shikai-123 Date: Thu, 14 Jul 2022 20:04:28 +0800 Subject: [PATCH] Modify the return value type of promisewrapper Modify the return value type of promisewrapper issues: https://gitee.com/openharmony/interface_sdk-js/issues/I5H68P Signed-off-by: shikai-123 --- 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