diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts old mode 100644 new mode 100755 index 69de064da1604f247b88c3a99b17cc019b7112d4..6b4d6a7e9acfc49d7b2da845711d6a028821d86b --- a/api/@ohos.bundle.d.ts +++ b/api/@ohos.bundle.d.ts @@ -17,6 +17,7 @@ import { AsyncCallback, Callback } from './basic'; import { ApplicationInfo } from './bundle/applicationInfo'; import { BundleInfo } from './bundle/bundleInfo'; 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'; @@ -49,27 +50,46 @@ declare namespace bundle { GET_BUNDLE_WITH_REQUESTED_PERMISSION = 0x00000010, GET_ALL_APPLICATION_INFO = 0xFFFF0000, /** - * @since 8 - */ + * @since 8 + */ GET_ABILITY_INFO_WITH_METADATA = 0x00000020, /** - * @since 8 - */ - GET_APPLICATION_INFO_WITH_METADATA = 0x00000040, + * @since 8 + */ + GET_BUNDLE_WITH_EXTENSION_ABILITY = 0x00000020, /** - * @since 8 - */ + * @since 8 + */ + GET_APPLICATION_INFO_WITH_METADATA = 0x00000040, + /** + * @since 8 + */ GET_ABILITY_INFO_SYSTEMAPP_ONLY = 0x00000080, /** - * @since 8 - */ + * @since 8 + */ GET_ABILITY_INFO_WITH_DISABLE = 0x00000100, - /** - * @since 8 - */ + /** + * @since 8 + */ GET_APPLICATION_INFO_WITH_DISABLE = 0x00000200, } + /** + * @name ExtensionFlag + * @since 8 + * @SysCap SystemCapability.Appexecfwk + * @import NA + * @permission NA + * @devices phone, tablet, tv, wearable + */ + 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 @@ -107,31 +127,31 @@ declare namespace bundle { */ export enum AbilityType { /** - * @default Indicates an unknown ability type - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates an unknown ability type + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ UNKNOWN, /** - * @default Indicates that the ability has a UI - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates that the ability has a UI + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ PAGE, /** - * @default Indicates that the ability does not have a UI - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates that the ability does not have a UI + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ SERVICE, /** - * @default Indicates that the ability is used to provide data access services - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates that the ability is used to provide data access services + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ DATA, } @@ -158,31 +178,31 @@ declare namespace bundle { */ export enum DisplayOrientation { /** - * @default Indicates that the system automatically determines the display orientation - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates that the system automatically determines the display orientation + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ UNSPECIFIED, /** - * @default Indicates the landscape orientation - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates the landscape orientation + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ LANDSCAPE, /** - * @default Indicates the portrait orientation - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates the portrait orientation + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ PORTRAIT, /** - * @default Indicates the page ability orientation is the same as that of the nearest ability in the stack - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates the page ability orientation is the same as that of the nearest ability in the stack + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ FOLLOW_RECENT, } @@ -196,20 +216,91 @@ declare namespace bundle { */ export enum LaunchMode { /** - * @default Indicates that the ability has only one instance - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates that the ability has only one instance + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ SINGLETON = 0, /** - * @default Indicates that the ability can have multiple instances - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates that the ability can have multiple instances + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ STANDARD = 1, } + /** + * @name ExtensionAbilityType + * @since 8 + * @SysCap SystemCapability.Appexecfwk + * @import NA + * @permission NA + * @devices phone, tablet, tv, wearable + */ + export enum ExtensionAbilityType { + /** + * @default Indicates extension info with type of form + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + FORM = 0, + /** + * @default Indicates extension info with type of work schedule + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + WORK_SCHEDULER = 1, + /** + * @default Indicates extension info with type of input method + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + INPUTMETHOD = 2, + /** + * @default Indicates extension info with type of service + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + SERVICE = 3, + /** + * @default Indicates extension info with type of accessibility + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + ACCESSIBILITY = 4, + /** + * @default Indicates extension info with type of datashare + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + DATASHARE = 5, + /** + * @default Indicates extension info with type of fileshare + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + FILESHARE = 6, + /** + * @default Indicates extension info with type of staticsubscriber + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + STATICSUBSCRIBER = 7, + /** + * @default Indicates extension info with type of wallpaper + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + WALLPAPER = 8, + /** + * @default Indicates extension info with type of unspecified + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + UNSPECIFIED = 9, + } + /** * @name BundleOptions * @since 7 @@ -220,20 +311,21 @@ declare namespace bundle { */ export interface BundleOptions { /** - * @default Indicates the user id - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates the user id + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ userId?: number; /** - * @default Indicates the network id - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ + * @default Indicates the network id + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ networkId?: string; } + /** * @name InstallErrorCode * @since 7 @@ -267,7 +359,12 @@ declare namespace bundle { /** * @since 7 */ - STATUS_BMS_SERVICE_ERROR = 0x41 + STATUS_BMS_SERVICE_ERROR = 0x41, + /** + * @since 8 + */ + STATUS_FAILED_NO_SPACE_LEFT = 0x42 + } /** @@ -305,7 +402,7 @@ declare namespace bundle { * @since 7 * @SysCap SystemCapability.Appexecfwk * @param bundleName Indicates the application bundle name to be queried. - * @param flags Indicates the flag used to specify information contained in the ApplicationInfo object + * @param bundleFlags Indicates the flag used to specify information contained in the ApplicationInfo object * that will be returned. * @param userId Indicates the user ID. * @return Returns the ApplicationInfo object. @@ -333,9 +430,9 @@ declare namespace bundle { * @devices phone, tablet, tv, wearable * @since 7 * @SysCap SystemCapability.Appexecfwk - * @param intent Indicates the Intent containing the application bundle name to + * @param want Indicates the Want containing the application bundle name to * be queried. - * @param flags Indicates the flag used to specify information contained in the AbilityInfo objects that + * @param bundleFlags Indicates the flag used to specify information contained in the AbilityInfo objects that * will be returned. * @param userId Indicates the user ID. * @return Returns a list of AbilityInfo objects. @@ -367,7 +464,7 @@ 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 ApplicationInfo objects + * @param bundleFlags Indicates the flag used to specify information contained in the ApplicationInfo objects * that will be returned. * @param userId Indicates the user ID. * @return Returns a list of ApplicationInfo objects. @@ -384,7 +481,7 @@ declare namespace bundle { * @SysCap SystemCapability.Appexecfwk * @param hapFilePath Indicates the path storing the HAP. The path should be the relative path to the data * directory of the current application. - * @param flags Indicates the flag used to specify information contained in the BundleInfo object to be + * @param bundleFlags Indicates the flag used to specify information contained in the BundleInfo object to be * returned. * @return Returns the BundleInfo object. */ @@ -394,16 +491,16 @@ declare namespace bundle { /** /** - * Obtains the Intent for starting the main ability of an application based on the + * Obtains the Want for starting the main ability of an application based on the * given bundle name. The main ability of an application is the ability that has the - * #ACTION_HOME and #ENTITY_HOME intent + * #ACTION_HOME and #ENTITY_HOME Want * filters set in the application's config.json file. * * @devices phone, tablet, tv, wearable * @since 7 * @SysCap SystemCapability.Appexecfwk * @param bundleName Indicates the bundle name of the application. - * @return Returns the Intent for starting the application's main ability if any; returns null if + * @return Returns the Want for starting the application's main ability if any; returns null if * the given bundle does not exist or does not contain any main ability. * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED */ @@ -479,6 +576,23 @@ 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. + * + * @devices phone, tablet, tv, wearable, car + * @since 8 + * @SysCap SystemCapability.Appexecfwk + * @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 queryExtensionAbilityInfoByWant(want: Want, extensionFlags: number, userId: number, callback: AsyncCallback>): void; + function queryExtensionAbilityInfoByWant(want: Want, extensionFlags: number, callback: AsyncCallback>): void; + function queryExtensionAbilityInfoByWant(want: Want, extensionFlags: number, userId?: number): Promise>; } export default bundle; \ No newline at end of file diff --git a/api/ability/want.d.ts b/api/ability/want.d.ts index af2183ded2e6bd1db19f78012e18925d70a88482..6935e769631d863e6b09af14c439e1eee7ed7c36 100644 --- a/api/ability/want.d.ts +++ b/api/ability/want.d.ts @@ -102,4 +102,22 @@ export declare interface Want { * @default - */ entities?: Array; + + /** + * The description of a extension ability name in a Want. + * @devices phone, tablet + * @since 8 + * @sysCap AAFwk + * @default - + */ + extensionAbilityName?: string; + + /** + * The description of a extension ability type in a Want. + * @devices phone, tablet + * @since 8 + * @sysCap AAFwk + * @default - + */ + extensionAbilityType?: number; } \ No newline at end of file diff --git a/api/bundle/abilityInfo.d.ts b/api/bundle/abilityInfo.d.ts index a7cf71866bcd08b934e02b1cf224f4d6624c853f..863800d2907cf274a84ff8aeb3ec8a099ea28f64 100644 --- a/api/bundle/abilityInfo.d.ts +++ b/api/bundle/abilityInfo.d.ts @@ -15,6 +15,7 @@ import { ApplicationInfo } from './applicationInfo'; import { CustomizeData } from './customizeData' +import { Metadata } from './metadata' import bundle from './../@ohos.bundle'; /** @@ -248,4 +249,18 @@ export interface AbilityInfo { * @SysCap SystemCapability.Appexecfwk */ readonly metaData: Array; + + /** + * @default Indicates the metadata of ability + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly metadata: Array; + + /** + * @default Indicates the metadata of ability + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly enabled: boolean; } diff --git a/api/bundle/applicationInfo.d.ts b/api/bundle/applicationInfo.d.ts index d57fbd7bc891e561202c1dbc797aa4d1e09fb394..49c2482bfabd24e22a0065449d6dfecea731d8b7 100644 --- a/api/bundle/applicationInfo.d.ts +++ b/api/bundle/applicationInfo.d.ts @@ -15,6 +15,7 @@ import { ModuleInfo } from './moduleInfo'; import { CustomizeData } from './customizeData' +import { Metadata } from './metadata' /** * @name Obtains configuration information about an application @@ -148,12 +149,40 @@ export interface ApplicationInfo { * @since 8 * @SysCap SystemCapability.Appexecfwk */ - readonly metaData: Map>; + readonly metaData: Map>; + + /** + * @default Indicates the metadata of module + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly metadata: Array /** * @default Indicates whether or not this application may be removable * @since 8 * @SysCap SystemCapability.Appexecfwk */ - readonly removable: boolean; + readonly removable: boolean; + + /** + * @default Indicates the access token of the application + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly accessTokenId: number; + + /** + * @default Indicates the uid of the application + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly uid: number; + + /** + * @default Indicates entity type of the application + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly entityType: string; } \ No newline at end of file diff --git a/api/bundle/bundleInfo.d.ts b/api/bundle/bundleInfo.d.ts index 6353eaef993782219ad6861054cf73d4e256c9e2..09072dff6a2d2e6b60767f92f2b4a1ef4c08d08a 100644 --- a/api/bundle/bundleInfo.d.ts +++ b/api/bundle/bundleInfo.d.ts @@ -15,6 +15,7 @@ import { AbilityInfo } from './abilityInfo'; import { ApplicationInfo } from './applicationInfo'; +import { ExtensionAbilityInfo } from './extensionAbilityInfo'; import { HapModuleInfo } from './hapModuleInfo'; /** @@ -234,4 +235,18 @@ export interface BundleInfo { * @SysCap SystemCapability.Appexecfwk */ readonly entryInstallationFree: boolean; + + /** + * @default Indicates whether free installation of the entry is supported + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly reqPermissionStates: Array; + + /** + * @default Obtains configuration information about an ability + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly extensionAbilityInfo: Array; } diff --git a/api/bundle/extensionAbilityInfo.d.ts b/api/bundle/extensionAbilityInfo.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..57888bb5c5801834f3c049385dae13fab73db5d7 --- /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 8 + * @SysCap SystemCapability.Appexecfwk + * @permission NA + * @devices phone, tablet, tv, wearable, car + */ +export interface ExtensionAbilityInfo { + /** + * @default Indicates the name of the bundle + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly bundleName: string; + + /** + * @default Indicates the name of the module + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly moduleName: string; + + /** + * @default Indicates the name of the extension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly name: string; + + /** + * @default Indicates the label id of the entension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly labelId: number; + + /** + * @default Indicates the description id of the entension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly descriptionId: number; + + /** + * @default Indicates the icon id of the entension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly iconId: number; + + /** + * @default Indicates whether the entensionInfo can be visible or not + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly isVisible: boolean; + + /** + * @default Enumerates types of the entension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly extensionAbilityType: bundle.ExtensionAbilityType; + + /** + * @default The permissions that others need to use this extension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly permissions: Array; + + /** + * @default Obtains configuration information about an application + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly applicationInfo: ApplicationInfo; + + /** + * @default Indicates the metadata of bundle + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly metadata: Array; + + /** + * @default Indicates the src language to express extension info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly enabled: boolean; + + /** + * @default Indicates the read permission extension ability info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly readPermission: string; + + /** + * @default Indicates the write permission of extension ability info + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly writePermission: string; +} diff --git a/api/bundle/hapModuleInfo.d.ts b/api/bundle/hapModuleInfo.d.ts index a62a66955d341a076b9600c522bf4c14e2ae7be9..067bc267565489d14a9416fcc2c90ec5df94d19a 100644 --- a/api/bundle/hapModuleInfo.d.ts +++ b/api/bundle/hapModuleInfo.d.ts @@ -14,6 +14,7 @@ */ import { AbilityInfo } from "./abilityInfo"; +import { ExtensionAbilityInfo } from "./extensionAbilityInfo"; /** * @name Obtains configuration information about an module. @@ -113,4 +114,18 @@ export interface HapModuleInfo { * @SysCap SystemCapability.Appexecfwk */ readonly installationFree: boolean; + + /** + * @default Indicates main elementName of the module + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly mainElementName: string; + + /** + * @default Obtains configuration information about extension ability + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + readonly extensionAbilityInfo: 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..43f3dba9ea744431b316ab16dabe74de668e38d1 --- /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 8 + * @SysCap SystemCapability.Appexecfwk + * @permission NA + * @devices phone, tablet, tv, wearable, car + */ + export interface Metadata { + /** + * @default Indicates the metadata name + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + name: string; + + /** + * @default Indicates the metadata value + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + value: string; + + /** + * @default Indicates the metadata resource + * @since 8 + * @SysCap SystemCapability.Appexecfwk + */ + resource: string; + } \ No newline at end of file