diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts index 5172be5e139fc6829a5d1568bf43747a590607b7..aececd10e971729d96144d12e94664a9db7ca62e 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;