From e8464f815f2737ca5735844d5e747ef18e7419c8 Mon Sep 17 00:00:00 2001 From: Fouckttt Date: Sat, 19 Jul 2025 19:32:42 +0800 Subject: [PATCH] Overload Correction Issue:https://gitee.com/openharmony/interface_sdk-js/issues/ICNBV2 Signed-off-by: Fouckttt --- interfaces/kits/js/src/mod_hash/ani/ets/@ohos.file.hash.ets | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/interfaces/kits/js/src/mod_hash/ani/ets/@ohos.file.hash.ets b/interfaces/kits/js/src/mod_hash/ani/ets/@ohos.file.hash.ets index c9b4d5840..edd277b16 100644 --- a/interfaces/kits/js/src/mod_hash/ani/ets/@ohos.file.hash.ets +++ b/interfaces/kits/js/src/mod_hash/ani/ets/@ohos.file.hash.ets @@ -17,7 +17,7 @@ import { BusinessError, AsyncCallback } from '@ohos.base'; import stream from '@ohos.util.stream'; export default namespace hash { - export function hash(path: string, algorithm: string): Promise { + export function hashReturnsPromise(path: string, algorithm: string): Promise { return new Promise((resolve: (result: string) => void, reject: (e: BusinessError) => void) => { let promise = taskpool.execute(HashImpl.hashSync, path, algorithm); promise.then((ret: NullishType): void => { @@ -29,7 +29,7 @@ export default namespace hash { }); } - export function hash(path: string, algorithm: string, callback: AsyncCallback): void { + export function hashWithCallback(path: string, algorithm: string, callback: AsyncCallback): void { let promise = taskpool.execute(HashImpl.hashSync, path, algorithm); promise.then((ret: NullishType) => { let e = new BusinessError(); @@ -41,6 +41,8 @@ export default namespace hash { }); } + export overload hash { hashReturnsPromise, hashWithCallback } + export function createHash(algorithm: string): HashStream { return new HashStream(algorithm); } -- Gitee