diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts index 61a56d1aa72e6861563496f92cef318966f40480..ea605c4560c4ec8e9327798c57bd5a49b18fc127 100644 --- a/api/@ohos.bundle.d.ts +++ b/api/@ohos.bundle.d.ts @@ -20,7 +20,6 @@ import { AbilityInfo } from './bundle/abilityInfo'; import { ExtensionAbilityInfo } from './bundle/extensionAbilityInfo'; import { Want } from './ability/want'; import { BundleInstaller } from './bundle/bundleInstaller'; -import { ShortcutInfo } from './bundle/shortcutInfo'; import { ModuleUsageRecord } from './bundle/moduleUsageRecord'; import { PermissionDef } from './bundle/PermissionDef'; import image from './@ohos.multimedia.image'; @@ -53,6 +52,10 @@ declare namespace bundle { * @since 8 */ GET_ABILITY_INFO_WITH_METADATA = 0x00000020, + /** + * @since 9 + */ + GET_BUNDLE_WITH_EXTENSION_ABILITY = 0x00000020, /** * @since 8 */ @@ -71,6 +74,20 @@ declare namespace bundle { GET_APPLICATION_INFO_WITH_DISABLE = 0x00000200, } +/** + * @name ExtensionFlag + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + * @import NA + * @permission NA + */ + enum ExtensionFlag { + GET_EXTENSION_INFO_DEFAULT = 0x00000000, + GET_EXTENSION_INFO_WITH_PERMISSION = 0x00000002, + GET_EXTENSION_INFO_WITH_APPLICATION = 0x00000004, + GET_EXTENSION_INFO_WITH_METADATA = 0x00000020, + } + /** * @name ColorMode * @since 7 @@ -205,6 +222,76 @@ declare namespace bundle { STANDARD = 1, } + /** + * @name ExtensionAbilityType + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + * @import NA + * @permission NA + */ + export enum ExtensionAbilityType { + /** + * @default Indicates extension info with type of form + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + FORM = 0, + /** + * @default Indicates extension info with type of work schedule + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + WORK_SCHEDULER = 1, + /** + * @default Indicates extension info with type of input method + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + INPUT_METHOD = 2, + /** + * @default Indicates extension info with type of service + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + SERVICE = 3, + /** + * @default Indicates extension info with type of accessibility + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + ACCESSIBILITY = 4, + /** + * @default Indicates extension info with type of datashare + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + DATA_SHARE = 5, + /** + * @default Indicates extension info with type of fileshare + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + FILE_SHARE = 6, + /** + * @default Indicates extension info with type of staticsubscriber + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + STATIC_SUBSCRIBER = 7, + /** + * @default Indicates extension info with type of wallpaper + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + WALLPAPER = 8, + /** + * @default Indicates extension info with type of unspecified + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + UNSPECIFIED = 9, + } + /** * @name BundleOptions * @since 7 @@ -415,18 +502,6 @@ declare namespace bundle { function getLaunchWantForBundle(bundleName: string, callback: AsyncCallback): void; function getLaunchWantForBundle(bundleName: string): Promise; - /** - * Obtains information about the shortcuts of the application. - * - * @since 7 - * @syscap SystemCapability.BundleManager.BundleFramework - * @param bundleName Indicates the bundle name of the application. - * @return Returns a list of ShortcutInfo objects containing shortcut information about the application. - * @permission ohos.permission.MANAGE_SHORTCUTS - */ - function getAllShortcutInfo(bundleName: string, callback: AsyncCallback>): void; - function getAllShortcutInfo(bundleName: string): Promise>; - /** * get module usage record list in descending order of lastLaunchTime. * @@ -480,6 +555,22 @@ declare namespace bundle { function setAbilityEnabled(info: AbilityInfo, isEnable: boolean, callback: AsyncCallback): void; function setAbilityEnabled(info: AbilityInfo, isEnable: boolean): Promise; + /** + * Query extension info of by utilizing a Want. + * + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + * @param want Indicates the Want containing the application bundle name to be queried. + * @param extensionFlags Indicates the flag used to specify information contained in the ExtensionInfo objects that + * will be returned. + * @param userId Indicates the user ID. + * @return Returns a list of ExtensionInfo objects. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO + */ + function queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, userId: number, callback: AsyncCallback>): void; + function queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, callback: AsyncCallback>): void; + function queryExtensionAbilityInfosByWant(want: Want, extensionFlags: number, userId?: number): Promise>; + /** * Get the permission details by permissionName. * @@ -495,30 +586,30 @@ declare namespace bundle { /** * Obtains the label of a specified ability. - * + * * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework * @param bundleName Indicates the bundle name of the application to which the ability belongs. * @param abilityName Indicates the ability name. - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO * @return Returns the label representing the label of the specified ability. */ function getAbilityLabel(bundleName: string, abilityName: string, callback: AsyncCallback): void; function getAbilityLabel(bundleName: string, abilityName: string): Promise; - + /** * Obtains the icon of a specified ability. - * + * * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework * @param bundleName Indicates the bundle name of the application to which the ability belongs. * @param abilityName Indicates the ability name. * @return Returns the PixelMap object representing the icon of the specified ability. - * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO */ function getAbilityIcon(bundleName: string, abilityName: string, callback: AsyncCallback): void; function getAbilityIcon(bundleName: string, abilityName: string): Promise; - + /** * Checks whether a specified ability is enabled. * @@ -529,10 +620,10 @@ declare namespace bundle { */ function isAbilityEnabled(info: AbilityInfo, callback: AsyncCallback): void; function isAbilityEnabled(info: AbilityInfo): Promise; - + /** * Checks whether a specified application is enabled. - * + * * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework * @param bundleName Indicates the bundle name of the application. diff --git a/api/ability/want.d.ts b/api/ability/want.d.ts index 7a0de81e061428530ad5e4698035175a61b32c56..40bfe433ae5c723c7d76bc7ca7aaf7289c9b0654 100644 --- a/api/ability/want.d.ts +++ b/api/ability/want.d.ts @@ -92,4 +92,20 @@ export declare interface Want { * @default - */ entities?: Array; + + /** + * The description of a extension ability name in a Want. + * @since 9 + * @syscap SystemCapability.Ability.AbilityBase + * @default - + */ + extensionAbilityName?: string; + + /** + * The description of a extension ability type in a Want. + * @since 9 + * @syscap SystemCapability.Ability.AbilityBase + * @default - + */ + extensionAbilityType?: number; } \ No newline at end of file diff --git a/api/bundle/abilityInfo.d.ts b/api/bundle/abilityInfo.d.ts index 1ffef682116829d535214de9ff54a791764a316e..099ba7a1b75925ecb5664c3972350e15fb5c1246 100644 --- a/api/bundle/abilityInfo.d.ts +++ b/api/bundle/abilityInfo.d.ts @@ -218,6 +218,14 @@ export interface AbilityInfo { /** * @default Indicates the metadata of ability + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + * + */ + readonly metadata: Array; + + /** + * @default Indicates whether the ability is enabled * @since 8 * @syscap SystemCapability.BundleManager.BundleFramework */ diff --git a/api/bundle/applicationInfo.d.ts b/api/bundle/applicationInfo.d.ts index b98e3c9bf61c9f434a399717ec676160d5b0cdbb..469e18a970c63cb5b39ef54c20a9396ef72ad9fe 100644 --- a/api/bundle/applicationInfo.d.ts +++ b/api/bundle/applicationInfo.d.ts @@ -144,6 +144,13 @@ export interface ApplicationInfo { */ readonly metaData: Map>; + /** + * @default Indicates the metadata of module + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly metadata: Map>; + /** * @default Indicates whether or not this application may be removable * @since 8 diff --git a/api/bundle/bundleInfo.d.ts b/api/bundle/bundleInfo.d.ts index 6444708ad5f959ca83935872ad333a4781485ea2..dddca464338e6f6db81c9f5770e02038222b65d0 100644 --- a/api/bundle/bundleInfo.d.ts +++ b/api/bundle/bundleInfo.d.ts @@ -242,4 +242,11 @@ export interface BundleInfo { * @syscap SystemCapability.BundleManager.BundleFramework */ readonly reqPermissionStates: Array; + + /** + * @default Obtains configuration information about an ability + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly extensionAbilityInfo: Array; } diff --git a/api/bundle/extensionAbilityInfo.d.ts b/api/bundle/extensionAbilityInfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..c533ad6dc54b7aab9eb928e0b6be0940c01001f5 --- /dev/null +++ b/api/bundle/extensionAbilityInfo.d.ts @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { ApplicationInfo } from './applicationInfo'; +import { Metadata } from './metadata' +import bundle from './../@ohos.bundle'; + +/** + * @name Obtains extension information about a bundle + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * + */ +export interface ExtensionAbilityInfo { + /** + * @default Indicates the name of the bundle + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly bundleName: string; + + /** + * @default Indicates the name of the module + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly moduleName: string; + + /** + * @default Indicates the name of the extension info + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly name: string; + + /** + * @default Indicates the label id of the entension info + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly labelId: number; + + /** + * @default Indicates the description id of the entension info + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly descriptionId: number; + + /** + * @default Indicates the icon id of the entension info + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly iconId: number; + + /** + * @default Indicates whether the entensionInfo can be visible or not + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly isVisible: boolean; + + /** + * @default Enumerates types of the entension info + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly extensionAbilityType: bundle.ExtensionAbilityType; + + /** + * @default The permissions that others need to use this extension info + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly permissions: Array; + + /** + * @default Obtains configuration information about an application + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly applicationInfo: ApplicationInfo; + + /** + * @default Indicates the metadata of bundle + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly metadata: Array; + + /** + * @default Indicates the src language to express extension info + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly enabled: boolean; + + /** + * @default Indicates the read permission extension ability info + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly readPermission: string; + + /** + * @default Indicates the write permission of extension ability info + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly writePermission: string; +} diff --git a/api/bundle/hapModuleInfo.d.ts b/api/bundle/hapModuleInfo.d.ts index c758e27243532749598b378e7795eb8a63d96ead..477ca86021fed8caf1c892dee53f3f2de6160065 100644 --- a/api/bundle/hapModuleInfo.d.ts +++ b/api/bundle/hapModuleInfo.d.ts @@ -115,4 +115,25 @@ export interface HapModuleInfo { * @syscap SystemCapability.BundleManager.BundleFramework */ readonly installationFree: boolean; + + /** + * @default Indicates main elementName of the module + * @since 8 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly mainElementName: string; + + /** + * @default Obtains configuration information about extension ability + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + readonly extensionAbilityInfo: Array; + /** + * @default Indicates the metadata of ability + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + * + */ + readonly metadata: Array; } \ No newline at end of file diff --git a/api/bundle/metadata.d.ts b/api/bundle/metadata.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..4fba45c5348ca3d4806cf46783ba4570b1c7e6c3 --- /dev/null +++ b/api/bundle/metadata.d.ts @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2021 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + /** + * @name Indicates the Metadata + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + * @permission NA + * + */ + export interface Metadata { + /** + * @default Indicates the metadata name + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + name: string; + + /** + * @default Indicates the metadata value + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + value: string; + + /** + * @default Indicates the metadata resource + * @since 9 + * @syscap SystemCapability.BundleManager.BundleFramework + */ + resource: string; + } \ No newline at end of file