From 2be9927d7feee31bf5a225fc4f9ce229220e414e Mon Sep 17 00:00:00 2001 From: liujia178 Date: Fri, 20 Jun 2025 15:45:29 +0800 Subject: [PATCH] feat: Add ArkTS1.2 SDK: promisify Issue: https://gitee.com/openharmony/arkcompiler_runtime_core/issues/ICEZ69?from=project-issue Signed-off-by: liujia178 --- api/@ohos.util.d.ets | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/api/@ohos.util.d.ets b/api/@ohos.util.d.ets index 72a794baa4..03b4f1def2 100644 --- a/api/@ohos.util.d.ets +++ b/api/@ohos.util.d.ets @@ -1442,6 +1442,19 @@ declare namespace util { isWeakSet(value: Object): boolean; } + /** + * 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. + * + * @param { Function } original - Asynchronous Function + * @returns { Function } Return a function that returns promises + * @syscap SystemCapability.Utils.Lang + * @crossplatform + * @atomicservice + * @since 20 + */ + function promisify(original: Function): (...args: FixedArray) => Promise; + /** * Get the hash code of an object. * -- Gitee