From 5fffc25dc48537adbcbe1c627e96289023ea3276 Mon Sep 17 00:00:00 2001 From: dujingcheng Date: Wed, 5 Jan 2022 02:41:39 +0000 Subject: [PATCH] bms api Signed-off-by: dujingcheng --- api/@ohos.bundle.d.ts | 40 +++++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts index 2c977e8e71..2a1ed79838 100644 --- a/api/@ohos.bundle.d.ts +++ b/api/@ohos.bundle.d.ts @@ -188,6 +188,30 @@ declare namespace bundle { STANDARD = 1, } + /** + * @name BundleOptions + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @import NA + * @permission NA + * @devices phone, tablet, tv, wearable + */ + export interface BundleOptions { + /** + * @default Indicates the user id + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + userId?: number; + + /** + * @default Indicates the network id + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + networkId?: string; + } + /** * @name InstallErrorCode * @since 7 @@ -216,20 +240,20 @@ declare namespace bundle { } /** - * Obtains based on a given networkId and bundle name. + * Obtains bundleInfo based on bundleName, bundleFlags and options. * * @devices phone, tablet, tv, wearable * @since 7 * @SysCap SystemCapability.Appexecfwk - * @param networkId Indicates the device networkId in area network. * @param bundleName Indicates the application bundle name to be queried. - * @param flags Indicates the flag used to specify information contained in that will be - * returned. + * @param bundleFlags Indicates the application bundle flags to be queried. + * @param options Indicates the bundle options object. * @return Returns the BundleInfo object. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED,ohos.permission.GET_BUNDLE_INFO */ + function getBundleInfo(bundleName: string, bundleFlags: number, options: BundleOptions, callback: AsyncCallback): void; function getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback): void; - function getBundleInfo(bundleName: string, bundleFlags: number): Promise; + function getBundleInfo(bundleName: string, bundleFlags: number, options?: BundleOptions): Promise; /** * Obtains the interface used to install bundles. @@ -296,13 +320,15 @@ declare namespace bundle { * @devices phone, tablet, tv, wearable * @since 7 * @SysCap SystemCapability.Appexecfwk - * @param flags Indicates the flag used to specify information contained in the BundleInfo that will be + * @param bundlelFlag Indicates the flag used to specify information contained in the BundleInfo that will be * returned. + * @param userId Indicates the user id. * @return Returns a list of BundleInfo objects. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED */ + function getAllBundleInfo(bundlelFlag: BundleFlag, userId: number, callback: AsyncCallback>) : void; function getAllBundleInfo(bundlelFlag: BundleFlag, callback: AsyncCallback>) : void; - function getAllBundleInfo(bundlelFlag: BundleFlag) : Promise>; + function getAllBundleInfo(bundlelFlag: BundleFlag, userId?: number) : Promise>; /** * Obtains information about all installed applications of a specified user. -- Gitee