From 7b5a255c03b6b84687b474d94f85119e85112c6a Mon Sep 17 00:00:00 2001 From: leo9001 Date: Mon, 30 Jun 2025 16:13:19 +0800 Subject: [PATCH] =?UTF-8?q?overload=E6=95=B4=E6=94=B9=20ets=E5=AE=9E?= =?UTF-8?q?=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue: https://gitee.com/openharmony/bundlemanager_bundle_framework/issues/ICJJUP?from=project-issue Signed-off-by: leo9001 --- interfaces/ets/ani/ets/@ohos.configPolicy.ets | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/interfaces/ets/ani/ets/@ohos.configPolicy.ets b/interfaces/ets/ani/ets/@ohos.configPolicy.ets index 16929ba..31174a3 100644 --- a/interfaces/ets/ani/ets/@ohos.configPolicy.ets +++ b/interfaces/ets/ani/ets/@ohos.configPolicy.ets @@ -33,7 +33,7 @@ namespace configPolicy { native function getCfgDirListSync(): Array; - function getOneCfgFile(relPath: string, callback: AsyncCallback) : void { + function getOneCfgFile_chinast_1(relPath: string, callback: AsyncCallback) : void { taskpool.execute((): string => { return getOneCfgFileSync(relPath); }).then((content: NullishType) => { @@ -43,7 +43,7 @@ namespace configPolicy { }); } - function getOneCfgFile(relPath: string, followMode: FollowXMode, callback: AsyncCallback) : void { + function getOneCfgFile_chinast_2(relPath: string, followMode: FollowXMode, callback: AsyncCallback) : void { taskpool.execute((): string => { return getOneCfgFileSync(relPath, followMode); }).then((content: NullishType) => { @@ -53,7 +53,7 @@ namespace configPolicy { }); } - function getOneCfgFile( + function getOneCfgFile_chinast_3( relPath: string, followMode: FollowXMode, extra: string, callback: AsyncCallback) : void { taskpool.execute((): string => { return getOneCfgFileSync(relPath, followMode, extra); @@ -64,7 +64,7 @@ namespace configPolicy { }); } - function getOneCfgFile(relPath: string): Promise { + function getOneCfgFile_chinast_4(relPath: string): Promise { return new Promise((resolve, reject) => { taskpool.execute((): string => { return getOneCfgFileSync(relPath); @@ -76,7 +76,7 @@ namespace configPolicy { }); } - function getOneCfgFile(relPath: string, followMode: FollowXMode, extra?: string): Promise { + function getOneCfgFile_chinast_5(relPath: string, followMode: FollowXMode, extra?: string): Promise { return new Promise((resolve, reject) => { taskpool.execute((): string => { return getOneCfgFileSync(relPath, followMode, extra); @@ -88,7 +88,9 @@ namespace configPolicy { }); } - function getCfgFiles(relPath: string, callback: AsyncCallback>) : void { + overload getOneCfgFile { getOneCfgFile_chinast_1, getOneCfgFile_chinast_2,getOneCfgFile_chinast_3,getOneCfgFile_chinast_4,getOneCfgFile_chinast_5 } + + function getCfgFiles_chinast_1(relPath: string, callback: AsyncCallback>) : void { taskpool.execute((): Array => { return getCfgFilesSync(relPath); }).then((content: NullishType) => { @@ -98,7 +100,7 @@ namespace configPolicy { }); } - function getCfgFiles(relPath: string, followMode: FollowXMode, callback: AsyncCallback>) : void { + function getCfgFiles_chinast_2(relPath: string, followMode: FollowXMode, callback: AsyncCallback>) : void { taskpool.execute((): Array => { return getCfgFilesSync(relPath, followMode); }).then((content: NullishType) => { @@ -108,7 +110,7 @@ namespace configPolicy { }); } - function getCfgFiles( + function getCfgFiles_chinast_3( relPath: string, followMode: FollowXMode, extra: string, callback: AsyncCallback>) : void { taskpool.execute((): Array => { return getCfgFilesSync(relPath, followMode, extra); @@ -119,7 +121,7 @@ namespace configPolicy { }); } - function getCfgFiles(relPath: string): Promise> { + function getCfgFiles_chinast_4(relPath: string): Promise> { return new Promise>((resolve, reject) => { taskpool.execute((): Array => { return getCfgFilesSync(relPath); @@ -131,7 +133,7 @@ namespace configPolicy { }); } - function getCfgFiles(relPath: string, followMode: FollowXMode, extra?: string): Promise> { + function getCfgFiles_chinast_5(relPath: string, followMode: FollowXMode, extra?: string): Promise> { return new Promise>((resolve, reject) => { taskpool.execute((): Array => { return getCfgFilesSync(relPath, followMode, extra); @@ -143,7 +145,9 @@ namespace configPolicy { }); } - function getCfgDirList(callback: AsyncCallback>) : void { + overload getCfgFiles { getCfgFiles_chinast_1, getCfgFiles_chinast_2,getCfgFiles_chinast_3,getCfgFiles_chinast_4,getCfgFiles_chinast_5 } + + function getCfgDirList_chinast_1(callback: AsyncCallback>) : void { taskpool.execute((): Array => { return getCfgDirListSync(); }).then((content: NullishType) => { @@ -153,7 +157,7 @@ namespace configPolicy { }); } - function getCfgDirList(): Promise> { + function getCfgDirList_chinast_2(): Promise> { return new Promise>((resolve, reject) => { taskpool.execute((): Array => { return getCfgDirListSync(); @@ -164,6 +168,9 @@ namespace configPolicy { }); }); } + + overload getCfgDirList { getCfgDirList_chinast_1, getCfgDirList_chinast_2 } + } export default configPolicy; -- Gitee