From b81105409a864e73fce1814166100c6f80997ab6 Mon Sep 17 00:00:00 2001 From: shilei Date: Sat, 21 May 2022 17:56:43 +0800 Subject: [PATCH] obtain config file Signed-off-by: shilei Change-Id: Ifa6c4f4a4a68f4eba6e8efa9cc19c02fc177a2cb --- api/@ohos.bundle.d.ts | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts index 5172be5e13..aececd10e9 100644 --- a/api/@ohos.bundle.d.ts +++ b/api/@ohos.bundle.d.ts @@ -727,6 +727,32 @@ declare namespace bundle { */ function getAbilityIcon(bundleName: string, moduleName: string, abilityName: string, callback: AsyncCallback): void; function getAbilityIcon(bundleName: string, moduleName: string, abilityName: string): Promise; + + /** + * Obtains the config file designated by metadata name and ability. + * + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + * @param ability Indicates the abilityInfo of the application. + * @param metadataName Indicates the name of metadata in ability. + * @return Returns string in json-format of the corresponding config file. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + */ + function getConfigFileByAbility(ability: AbilityInfo, metadataName: string, callback: AsyncCallback>): void; + function getConfigFileByAbility(ability: AbilityInfo, metadataName?: string): Promise>; + + /** + * Obtains the config file designated by metadata name and ability. + * + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + * @param ability Indicates the abilityInfo of the application. + * @param metadataName Indicates the name of metadata in ability. + * @return Returns string in json-format of the corresponding config file. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED or ohos.permission.GET_BUNDLE_INFO + */ + function getConfigFileByExtension(extension: ExtensionAbilityInfo, metadataName: string, callback: AsyncCallback>): void; + function getConfigFileByExtension(extension: ExtensionAbilityInfo, metadataName?: string): Promise>; } export default bundle; -- Gitee