From 17f744e424dc432e7c3495a6c7e5f711d21e5b74 Mon Sep 17 00:00:00 2001 From: xiaozuo00 Date: Thu, 13 Mar 2025 21:01:45 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EgetExtensionAbilityResourceIn?= =?UTF-8?q?fo=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xiaozuo00 --- api/@ohos.bundle.bundleResourceManager.d.ts | 22 +++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/api/@ohos.bundle.bundleResourceManager.d.ts b/api/@ohos.bundle.bundleResourceManager.d.ts index ef2deaf321..fc3ee2f924 100644 --- a/api/@ohos.bundle.bundleResourceManager.d.ts +++ b/api/@ohos.bundle.bundleResourceManager.d.ts @@ -19,6 +19,7 @@ */ import type { AsyncCallback } from './@ohos.base'; +import bundleManager from './@ohos.bundle.bundleManager'; import type { BundleResourceInfo as _BundleResourceInfo } from './bundleManager/BundleResourceInfo'; import type { LauncherAbilityResourceInfo as _LauncherAbilityResourceInfo } from './bundleManager/LauncherAbilityResourceInfo'; @@ -220,6 +221,27 @@ declare namespace bundleResourceManager { */ function getAllLauncherAbilityResourceInfo(resourceFlags: number): Promise>; + /** + * Obtains the abilityResourceInfo of a specified bundle. + * + * @permission ohos.permission.GET_BUNDLE_RESOURCES + * @param { string } bundleName - Indicates the bundle name of the application. + * @param { bundleManager.ExtensionAbilityType } extensionAbilityType - Indicates ExtensionAbilityType. + * @param { number } resourceFlags - Indicates the flag used to specify information. + *
contained in the ExtensionAbilityResourceInfo object that will be returned. + * @param { number } [appIndex] - Indicates the index of the bundle. + * @returns { Array } Returns a list of LauncherAbilityResourceInfo objects. + * @throws { BusinessError } 201 - Permission denied. + * @throws { BusinessError } 202 - Permission denied, non-system app called system api. + * @throws { BusinessError } 401 - Parameter error. Possible causes: 1. Mandatory parameters are left unspecified; 2. Incorrect parameter types. + * @throws { BusinessError } 17700001 - The specified bundleName is not found. + * @throws { BusinessError } 17700061 - AppIndex not in valid range or not found. + * @syscap SystemCapability.BundleManager.BundleFramework.Resource + * @systemapi + * @since 20 + */ + function getExtensionAbilityResourceInfo(bundleName: string, extensionAbilityType: bundleManager.ExtensionAbilityType, resourceFlags: number, appIndex?: number): Array; + /** * Obtains resource info of a bundle. * -- Gitee