diff --git a/interfaces/kits/js/@ohos.ability.featureability.d.ts b/interfaces/kits/js/@ohos.ability.featureability.d.ts index 1672c635aa09ffb0713fc6f63d48eb185e905272..8cb481abddf578a2bb283a488dd17a5ec5731bfa 100755 --- a/interfaces/kits/js/@ohos.ability.featureability.d.ts +++ b/interfaces/kits/js/@ohos.ability.featureability.d.ts @@ -12,8 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { AsyncCallback } from './.basic'; -import { Context } from './app/context'; +import { AsyncCallback } from './basic'; import { Want } from './ability/want'; import { StartAbilityParameter, StartAbilityForResultParameter } from './ability/startabilityparameter'; import { AbilityResult, StartAbilityResult } from './ability/abilityresult'; @@ -21,16 +20,16 @@ import { AbilityResult, StartAbilityResult } from './ability/abilityresult'; /** * A Feature Ability represents an ability with a UI and is designed to interact with users. * @name featureAbility - * @since 3 + * @since 6 * @sysCap AAFwk - * @devices phone, tablet + * @devices phone * @permission N/A */ declare namespace featureAbility { /** * Checks whether the main window of this ability has window focus. - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @sysCap AAFwk * @param - * @return Returns true if this ability currently has window focus; returns false otherwise. @@ -40,8 +39,8 @@ declare namespace featureAbility { /** * Destroys the current ability. - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @sysCap AAFwk * @param - * @return - @@ -51,8 +50,8 @@ declare namespace featureAbility { /** * Obtain the want sended from the source ability. - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @sysCap AAFwk * @param parameter Indicates the ability to start. * @return - @@ -62,8 +61,8 @@ declare namespace featureAbility { /** * Starts a new ability. - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @sysCap AAFwk * @param parameter Indicates the ability to start. * @return - @@ -73,8 +72,8 @@ declare namespace featureAbility { /** * Starts a new ability, onAbilityResult will be called after this new ability is terminated. - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @sysCap AAFwk * @param parameter Indicates the ability to start. * @return - @@ -86,8 +85,8 @@ declare namespace featureAbility { /** * Sets the result code and data to be returned by this Feature ability to the caller. - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @sysCap AAFwk * @param AbilityResult Indicates the result code returned after the ability is destroyed. * You can define the result code to identify an error. diff --git a/interfaces/kits/js/@ohos.ability.wantconstant.d.ts b/interfaces/kits/js/@ohos.ability.wantconstant.d.ts index 467cad638fe3ec4b5742628a5ed7839ac26a9501..1255d54626b47d6307d47341e0e859020bddb5c6 100644 --- a/interfaces/kits/js/@ohos.ability.wantconstant.d.ts +++ b/interfaces/kits/js/@ohos.ability.wantconstant.d.ts @@ -16,18 +16,18 @@ /** * the constant for action and entity in the want * @name wantConstant - * @since 3 + * @since 6 * @sysCap aafwk - * @devices phone, tablet + * @devices phone * @permission N/A */ declare namespace wantConstant { /** * the constant for action of the want * @name Action - * @since 3 + * @since 6 * @sysCap aafwk - * @devices phone, tablet + * @devices phone * @permission N/A */ export enum Action { @@ -238,9 +238,9 @@ declare namespace wantConstant { /** * the constant for Entity of the want * @name Action - * @since 3 + * @since 6 * @sysCap aafwk - * @devices phone, tablet + * @devices phone * @permission N/A */ export enum Entity { diff --git a/interfaces/kits/js/@ohos.app.abilitymanager.d.ts b/interfaces/kits/js/@ohos.app.abilitymanager.d.ts index 62d3db4238259f3dbf1243533ab553fb55074259..11cd65e965aa65f76e16a779fe9122eb54548810 100644 --- a/interfaces/kits/js/@ohos.app.abilitymanager.d.ts +++ b/interfaces/kits/js/@ohos.app.abilitymanager.d.ts @@ -15,14 +15,14 @@ import { AbilityMissionInfo } from './app/abilitymissioninfo'; import { RunningProcessInfo } from './app/runningprocessinfo'; -import { AsyncCallback } from './.basic'; +import { AsyncCallback } from './basic'; /** * Obtains running process and memory information about an application. * @name abilityManager - * @since 3 + * @since 6 * @sysCap appexecfwk - * @devices phone, tablet + * @devices phone * @permission N/A */ declare namespace abilityManager { @@ -43,8 +43,8 @@ declare namespace abilityManager { * Obtains information about application processes that are running on the device. * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk * @returns Returns a list of running processes. */ @@ -54,8 +54,8 @@ declare namespace abilityManager { * Obtains information about the application process running on the device through callback. * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk * @param callback Specified callback method. */ @@ -65,8 +65,8 @@ declare namespace abilityManager { * Queries information about the running Ability Mission. * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk * @returns Returns the AbilityMissionInfos. */ @@ -76,8 +76,8 @@ declare namespace abilityManager { * Queries information about the running Ability Mission through callback. * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk * @param callback Specified callback method. */ @@ -87,8 +87,8 @@ declare namespace abilityManager { * Queries information about the recent Ability Mission. * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk * @returns Returns the AbilityMissionInfos. */ @@ -98,8 +98,8 @@ declare namespace abilityManager { * Queries information about the recent Ability Mission. * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk * @param callback Specified callback method. */ @@ -109,8 +109,8 @@ declare namespace abilityManager { * Remove the mission associated with the given mission ID. * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk * @param missionId Indicates the mission ID * @returns Returns 0 for success, return non-0 for failure. @@ -121,8 +121,8 @@ declare namespace abilityManager { * Remove the mission associated with the given mission ID. * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk * @param missionId Indicates the mission ID * @param callback Specified callback method @@ -133,8 +133,8 @@ declare namespace abilityManager { * Remove the missions associated with the given array of the mission ID. * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk * @param missionIds Indicates the array of the mission ID * @returns Returns 0 for success, return non-0 for failure. @@ -145,8 +145,8 @@ declare namespace abilityManager { * Remove the missions associated with the given array of the mission ID. * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk * @param missionIds Indicates the array of the mission ID * @param callback Specified callback method @@ -157,8 +157,8 @@ declare namespace abilityManager { * Removes all the recent missions * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk * @returns Returns 0 for success, return non-0 for failure. */ @@ -168,8 +168,8 @@ declare namespace abilityManager { * Removes all the recent missions * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk * @param callback Specified callback method. */ @@ -180,8 +180,8 @@ declare namespace abilityManager { * front of the stack. * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk * @param missionId Indicates the mission ID * @returns Returns 0 for success, return non-0 for failure. @@ -193,8 +193,8 @@ declare namespace abilityManager { * front of the stack. * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk * @param missionId Indicates the mission ID * @param callback Specified callback method. @@ -205,8 +205,8 @@ declare namespace abilityManager { * Kills all background processes associated with a specified bundle. * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk * @param bundleName Indicates the bundle name * @returns Returns 0 for success, return non-0 for failure. @@ -217,8 +217,8 @@ declare namespace abilityManager { * Kills all background processes associated with a specified bundle through callback. * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk * @param bundleName Indicates the bundle name * @param callback Specified callback method diff --git a/interfaces/kits/js/@ohos.bundle.d.ts b/interfaces/kits/js/@ohos.bundle.d.ts index 537a609d62b2b5b57cfddb7e518cc56b1d6b5671..02a16d3a241d4b5f7d4bef1424146c93fd5133a9 100644 --- a/interfaces/kits/js/@ohos.bundle.d.ts +++ b/interfaces/kits/js/@ohos.bundle.d.ts @@ -1,345 +1,324 @@ -/* - * 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 { AsyncCallback } from './.basic'; -import { ApplicationInfo } from './bundle/applicationinfo'; -import { BundleInfo } from './bundle/bundleinfo'; -import { AbilityInfo } from './bundle/abilityinfo'; -import { Want } from './ability/want'; -import { BundleInstaller } from './bundle/bundleinstaller'; -import permission from './@ohos.security.permission'; - -/** - * @name BundleFlag - * @since 3 - * @SysCap BMS - * @import NA - * @permission NA - * @devices phone, tablet - */ -export declare interface BundleFlag { - getBundleDefault: boolean; - getBundleWithAbilities: boolean; - getAbilityInfoWithPermission: boolean; - getAbilityInfoWithApplication: boolean; - getApplicationInfoWithPermission: boolean; - getBundleWithRequestedPermission: boolean; - getAllApplicationInfo: boolean; -} - -export declare interface QueryParameter { - flags?: number; - userId?: string; -} - -/** - * bundle. - * @name bundle - * @since 3 - * @sysCap appexecfwk - * @devices phone, tablet - * @permission N/A - */ -declare namespace bundle { - export enum ModuleUpdateFlag { - FLAG_MODULE_UPGRADE_CHECK = 0, - FLAG_MODULE_UPGRADE_INSTALL = 1, - FLAG_MODULE_UPGRADE_INSTALL_WITH_CONFIG_WINDOWS = 2, - } - - export enum FormType { - JAVA = 0, - JS = 1, - } - - export enum ColorMode { - AUTO_MODE = -1, - DARK_MODE = 0, - LIGHT_MODE = 1, - } - - export enum GrantStatus { - PERMISSION_DENIED = -1, - PERMISSION_GRANTED = 0, - } - - export enum ModuleRemoveFlag { - FLAG_MODULE_NOT_USED_BY_FORM = 0, - FLAG_MODULE_USED_BY_FORM = 1, - FLAG_MODULE_NOT_USED_BY_SHORTCUT = 2, - FLAG_MODULE_USED_BY_SHORTCUT = 3, - } - - export enum SignatureCompareResult { - SIGNATURE_MATCHED = 0, - SIGNATURE_NOT_MATCHED = 1, - SIGNATURE_UNKNOWN_BUNDLE = 2, - } - - export enum ShortcutExistence { - SHORTCUT_EXISTENCE_EXISTS = 0, - SHORTCUT_EXISTENCE_NOT_EXISTS = 1, - SHORTCUT_EXISTENCE_UNKNOW = 2, - } - - export enum QueryShortCutFlag { - QUERY_SHORTCUT_HOME = 0, - } - - /** - * @name AbilityType - * @since 3 - * @SysCap BMS - * @import NA - * @permission NA - * @devices phone, tablet - */ - export enum AbilityType { - UNKNOWN, - PAGE, - SERVICE, - DATA, - } - - /** - * @name AbilitySubType - * @since 3 - * @SysCap BMS - * @import NA - * @permission NA - * @devices phone, tablet - */ - export enum AbilitySubType { - UNSPECIFIED = 0, - CA = 1, - } - - /** - * @name DisplayOrientation - * @since 3 - * @SysCap BMS - * @import NA - * @permission NA - * @devices phone, tablet - */ - export enum DisplayOrientation { - UNSPECIFIED, - LANDSCAPE, - PORTRAIT, - FOLLOWRECENT, - } - - /** - * @name LaunchMode - * @since 3 - * @SysCap BMS - * @import NA - * @permission NA - * @devices phone, tablet - */ - export enum LaunchMode { - SINGLETON = 0, - STANDARD = 1, - } - - export enum InstallErrorCode{ - SUCCESS = 0, - STATUS_INSTALL_FAILURE = 1, - STATUS_INSTALL_FAILURE_ABORTED = 2, - STATUS_INSTALL_FAILURE_INVALID = 3, - STATUS_INSTALL_FAILURE_CONFLICT = 4, - STATUS_INSTALL_FAILURE_STORAGE = 5, - STATUS_INSTALL_FAILURE_INCOMPATIBLE = 6, - STATUS_UNINSTALL_FAILURE = 7, - STATUS_UNINSTALL_FAILURE_BLOCKED = 8, - STATUS_UNINSTALL_FAILURE_ABORTED = 9, - STATUS_UNINSTALL_FAILURE_CONFLICT = 10, - STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT = 0x0B, - STATUS_INSTALL_FAILURE_DOWNLOAD_FAILED = 0x0C, - STATUS_ABILITY_NOT_FOUND = 0x40, - STATUS_BMS_SERVICE_ERROR = 0x41 - } - - /** - * Obtains BundleInfo based on a given bundle name. - * - * @devices phone, tablet - * @since 3 - * @SysCap BMS - * @param bundleName Indicates the bundle name. - * @param callback Specified callback method. - */ - function getBundleInfo(bundleName: string, flags: number, callback: AsyncCallback) : void; - - /** - * Obtains BundleInfo based on a given bundle name. - * - * @devices phone, tablet - * @since 3 - * @SysCap BMS - * @param bundleName Indicates the bundle name. - * @return BundleInfo. - */ - function getBundleInfo(bundleName: string, flags: number) : Promise; - - /** - * Obtains Bundle installer to install or uninstall hap. - * - * @devices phone, tablet - * @since 3 - * @SysCap BMS - * @return BundleInstaller. - */ - function getBundleInstaller(callback: AsyncCallback): void; - - /** - * Obtains Bundle installer to install or uninstall hap. - * - * @devices phone, tablet - * @since 3 - * @SysCap BMS - * @return BundleInstaller. - */ - function getBundleInstaller(): Promise; - - /** - * Obtains the ApplicationInfo based on a given application name. - * - * @devices phone, tablet - * @since 3 - * @SysCap BMS - * @param bundleName Indicates the application name. - * @param callback Specified callback method. - */ - function getApplicationInfo(bundleName: string, flags: number, userId: number, callback: AsyncCallback) : void; - - /** - * Obtains the ApplicationInfo based on a given application name. - * - * @devices phone, tablet - * @since 3 - * @SysCap BMS - * @param bundleName Indicates the application name. - * @return ApplicationInfo. - */ - function getApplicationInfo(bundleName: string, flags: number, userId: number) : Promise; - - /** - * Query the AbilityInfo by the given Want. - * - * @devices phone, tablet - * @since 3 - * @SysCap BMS - * @param want Indicates the Want for the ability to be queried. - * @param callback Specified callback method. - */ - function queryAbilityByWant(want: Want, params: QueryParameter, callback: AsyncCallback>): void; - - /** - * Query the AbilityInfo by the given Want. - * - * @devices phone, tablet - * @since 3 - * @SysCap BMS - * @param want Indicates the Want for the ability to be queried. - * @return AbilityInfo. - */ - function queryAbilityByWant(want: Want, params: QueryParameter): Promise; - - /** - * Obtains BundleInfo of all bundles available in the system. - * - * @devices phone, tablet - * @since 3 - * @SysCap BMS - * @param callback Specified callback method. - */ - function getBundleInfos(flags: BundleFlag, callback: AsyncCallback>) : void; - - /** - * Obtains BundleInfo of all bundles available in the system. - * - * @devices phone, tablet - * @since 3 - * @SysCap BMS - * @return Array of BundleInfo. - */ - function getBundleInfos(flags: BundleFlag) : Promise>; - - /** - * Obtains information about all installed applications. - * - * @devices phone, tablet - * @since 3 - * @SysCap BMS - * @param callback Specified callback method. - */ - function getApplicationInfos(flags: number, userId: number, callback: AsyncCallback>) : void; - - /** - * Obtains information about all installed applications. - * - * @devices phone, tablet - * @since 3 - * @SysCap BMS - * @param NA - * @return Array of ApplicationInfo. - */ - function getApplicationInfos(flags: number, userId: number) : Promise>; - - /** - * Obtains information about a bundle contained in a HAP. - * - * @devices phone, tablet - * @since 3 - * @SysCap BMS - * @param hapFilePath Indicates the path of the HAP. - * @param callback Specified callback method. - */ - function getBundleArchiveInfo(hapFilePath: string, flags: number, callback: AsyncCallback) : void; - - /** - * Obtains information about a bundle contained in a HAP. - * - * @devices phone, tablet - * @since 3 - * @SysCap BMS - * @param hapFilePath Indicates the path of the HAP. - * @return BundleInfo. - */ - function getBundleArchiveInfo(hapFilePath: string, flags: number) : Promise; - - /** - * Obtains detailed information about a specified permission. - * - * @devices phone, tablet - * @since 3 - * @SysCap BMS - * @param permissionName Indicates the name of the permission. - * @param callback Specified callback method. - */ - function getPermissionDef(permissionName: string, callback: AsyncCallback) : void; - /** - * Obtains detailed information about a specified permission. - * - * @devices phone, tablet - * @since 3 - * @SysCap BMS - * @param permissionName Indicates the name of the permission. - * @return PermissionDef. - */ - function getPermissionDef(permissionName: string) : Promise; -} - +/* + * 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 { AsyncCallback } from './basic'; +import { ApplicationInfo } from './bundle/applicationinfo'; +import { BundleInfo } from './bundle/bundleinfo'; +import { AbilityInfo } from './bundle/abilityinfo'; +import { Want } from './ability/want'; +import { BundleInstaller } from './bundle/bundleinstaller'; + +/** + * @name BundleFlag + * @since 6 + * @SysCap BMS + * @import N/A + * @permission N/A + * @devices phone + */ +export declare interface BundleFlag { + getBundleDefault: boolean; + getBundleWithAbilities: boolean; + getAbilityInfoWithPermission: boolean; + getAbilityInfoWithApplication: boolean; + getApplicationInfoWithPermission: boolean; + getBundleWithRequestedPermission: boolean; + getAllApplicationInfo: boolean; +} + +export declare interface QueryParameter { + flags?: number; + userId?: string; +} + +/** + * bundle. + * @name bundle + * @since 6 + * @sysCap appexecfwk + * @devices phone + * @permission N/A + */ +declare namespace bundle { + export enum ModuleUpdateFlag { + FLAG_MODULE_UPGRADE_CHECK = 0, + FLAG_MODULE_UPGRADE_INSTALL = 1, + FLAG_MODULE_UPGRADE_INSTALL_WITH_CONFIG_WINDOWS = 2, + } + + export enum FormType { + JAVA = 0, + JS = 1, + } + + export enum ColorMode { + AUTO_MODE = -1, + DARK_MODE = 0, + LIGHT_MODE = 1, + } + + export enum GrantStatus { + PERMISSION_DENIED = -1, + PERMISSION_GRANTED = 0, + } + + export enum ModuleRemoveFlag { + FLAG_MODULE_NOT_USED_BY_FORM = 0, + FLAG_MODULE_USED_BY_FORM = 1, + FLAG_MODULE_NOT_USED_BY_SHORTCUT = 2, + FLAG_MODULE_USED_BY_SHORTCUT = 3, + } + + export enum SignatureCompareResult { + SIGNATURE_MATCHED = 0, + SIGNATURE_NOT_MATCHED = 1, + SIGNATURE_UNKNOWN_BUNDLE = 2, + } + + export enum ShortcutExistence { + SHORTCUT_EXISTENCE_EXISTS = 0, + SHORTCUT_EXISTENCE_NOT_EXISTS = 1, + SHORTCUT_EXISTENCE_UNKNOW = 2, + } + + export enum QueryShortCutFlag { + QUERY_SHORTCUT_HOME = 0, + } + + /** + * @name AbilityType + * @since 6 + * @SysCap BMS + * @import N/A + * @permission N/A + * @devices phone + */ + export enum AbilityType { + UNKNOWN, + PAGE, + SERVICE, + DATA, + } + + /** + * @name AbilitySubType + * @since 6 + * @SysCap BMS + * @import N/A + * @permission N/A + * @devices phone + */ + export enum AbilitySubType { + UNSPECIFIED = 0, + CA = 1, + } + + /** + * @name DisplayOrientation + * @since 6 + * @SysCap BMS + * @import N/A + * @permission N/A + * @devices phone + */ + export enum DisplayOrientation { + UNSPECIFIED, + LANDSCAPE, + PORTRAIT, + FOLLOWRECENT, + } + + /** + * @name LaunchMode + * @since 6 + * @SysCap BMS + * @import N/A + * @permission N/A + * @devices phone + */ + export enum LaunchMode { + SINGLETON = 0, + STANDARD = 1, + } + + export enum InstallErrorCode{ + SUCCESS = 0, + STATUS_INSTALL_FAILURE = 1, + STATUS_INSTALL_FAILURE_ABORTED = 2, + STATUS_INSTALL_FAILURE_INVALID = 3, + STATUS_INSTALL_FAILURE_CONFLICT = 4, + STATUS_INSTALL_FAILURE_STORAGE = 5, + STATUS_INSTALL_FAILURE_INCOMPATIBLE = 6, + STATUS_UNINSTALL_FAILURE = 7, + STATUS_UNINSTALL_FAILURE_BLOCKED = 8, + STATUS_UNINSTALL_FAILURE_ABORTED = 9, + STATUS_UNINSTALL_FAILURE_CONFLICT = 10, + STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT = 0x0B, + STATUS_INSTALL_FAILURE_DOWNLOAD_FAILED = 0x0C, + STATUS_ABILITY_NOT_FOUND = 0x40, + STATUS_BMS_SERVICE_ERROR = 0x41 + } + + /** + * Obtains BundleInfo based on a given bundle name. + * + * @devices phone + * @since 6 + * @SysCap BMS + * @param bundleName Indicates the bundle name. + * @param callback Specified callback method. + */ + function getBundleInfo(bundleName: string, flags: number, callback: AsyncCallback) : void; + + /** + * Obtains BundleInfo based on a given bundle name. + * + * @devices phone + * @since 6 + * @SysCap BMS + * @param bundleName Indicates the bundle name. + * @return BundleInfo. + */ + function getBundleInfo(bundleName: string, flags: number) : Promise; + + /** + * Obtains Bundle installer to install or uninstall hap. + * + * @devices phone + * @since 6 + * @SysCap BMS + * @return BundleInstaller. + */ + function getBundleInstaller(callback: AsyncCallback): void; + + /** + * Obtains Bundle installer to install or uninstall hap. + * + * @devices phone + * @since 6 + * @SysCap BMS + * @return BundleInstaller. + */ + function getBundleInstaller(): Promise; + + /** + * Obtains the ApplicationInfo based on a given application name. + * + * @devices phone + * @since 6 + * @SysCap BMS + * @param bundleName Indicates the application name. + * @param callback Specified callback method. + */ + function getApplicationInfo(bundleName: string, flags: number, userId: number, callback: AsyncCallback) : void; + + /** + * Obtains the ApplicationInfo based on a given application name. + * + * @devices phone + * @since 6 + * @SysCap BMS + * @param bundleName Indicates the application name. + * @return ApplicationInfo. + */ + function getApplicationInfo(bundleName: string, flags: number, userId: number) : Promise; + + /** + * Query the AbilityInfo by the given Want. + * + * @devices phone + * @since 6 + * @SysCap BMS + * @param want Indicates the Want for the ability to be queried. + * @param callback Specified callback method. + */ + function queryAbilityByWant(want: Want, params: QueryParameter, callback: AsyncCallback>): void; + + /** + * Query the AbilityInfo by the given Want. + * + * @devices phone + * @since 6 + * @SysCap BMS + * @param want Indicates the Want for the ability to be queried. + * @return AbilityInfo. + */ + function queryAbilityByWant(want: Want, params: QueryParameter): Promise; + + /** + * Obtains BundleInfo of all bundles available in the system. + * + * @devices phone + * @since 6 + * @SysCap BMS + * @param callback Specified callback method. + */ + function getBundleInfos(flags: BundleFlag, callback: AsyncCallback>) : void; + + /** + * Obtains BundleInfo of all bundles available in the system. + * + * @devices phone + * @since 6 + * @SysCap BMS + * @return Array of BundleInfo. + */ + function getBundleInfos(flags: BundleFlag) : Promise>; + + /** + * Obtains information about all installed applications. + * + * @devices phone + * @since 6 + * @SysCap BMS + * @param callback Specified callback method. + */ + function getApplicationInfos(flags: number, userId: number, callback: AsyncCallback>) : void; + + /** + * Obtains information about all installed applications. + * + * @devices phone + * @since 6 + * @SysCap BMS + * @param N/A + * @return Array of ApplicationInfo. + */ + function getApplicationInfos(flags: number, userId: number) : Promise>; + + /** + * Obtains information about a bundle contained in a HAP. + * + * @devices phone + * @since 6 + * @SysCap BMS + * @param hapFilePath Indicates the path of the HAP. + * @param callback Specified callback method. + */ + function getBundleArchiveInfo(hapFilePath: string, flags: number, callback: AsyncCallback) : void; + + /** + * Obtains information about a bundle contained in a HAP. + * + * @devices phone + * @since 6 + * @SysCap BMS + * @param hapFilePath Indicates the path of the HAP. + * @return BundleInfo. + */ + function getBundleArchiveInfo(hapFilePath: string, flags: number) : Promise; + +} + export default bundle; \ No newline at end of file diff --git a/interfaces/kits/js/ability/abilityresult.d.ts b/interfaces/kits/js/ability/abilityresult.d.ts index f1c5907cfb64cc4f63689f011307b9a05ab3364f..ffbb2e26d4409a33eddfa9f11ac464cadda9de48 100644 --- a/interfaces/kits/js/ability/abilityresult.d.ts +++ b/interfaces/kits/js/ability/abilityresult.d.ts @@ -19,8 +19,8 @@ export interface AbilityResult { * Indicates result code for startAbilityResult. * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap aafwk */ resultCode: number; @@ -29,8 +29,8 @@ export interface AbilityResult { * Indicates the data returned after the ability is started. You can define the data returned. * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap aafwk */ want?: Want; @@ -41,8 +41,8 @@ export interface StartAbilityResult extends AbilityResult { * Indicates the Want containing information about the target ability to start. * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap aafwk */ requestCode: number; diff --git a/interfaces/kits/js/ability/startabilityparameter.d.ts b/interfaces/kits/js/ability/startabilityparameter.d.ts index 0fef01822218de7269151d285ce298de27330672..e6bd5d6aaa2d980c26704ed7e8709da4849836c3 100644 --- a/interfaces/kits/js/ability/startabilityparameter.d.ts +++ b/interfaces/kits/js/ability/startabilityparameter.d.ts @@ -19,8 +19,8 @@ export interface StartAbilityParameter { * Indicates the Want containing information about the target ability to start. * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap aafwk */ want: Want; @@ -29,8 +29,8 @@ export interface StartAbilityParameter { * Indicates the special start setting used in starting ability. * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap aafwk */ abilityStartSetting?: {[key: string]: any}; @@ -41,8 +41,8 @@ export interface StartAbilityForResultParameter extends StartAbilityParameter { * Indicates the Want containing information about the target ability to start. * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap aafwk */ requestCode: number; diff --git a/interfaces/kits/js/ability/want.d.ts b/interfaces/kits/js/ability/want.d.ts index fbbd63b92b6cd984253ba4c5013daa1aad5d9803..2e5a130aa3578124dd74482bf2d01b2c90b23b7d 100644 --- a/interfaces/kits/js/ability/want.d.ts +++ b/interfaces/kits/js/ability/want.d.ts @@ -15,11 +15,11 @@ /** * @name WantOptions - * @since 3 + * @since 6 * @SysCap AAFwk * @import * @permission N/A - * @devices phone, tablet + * @devices phone */ export declare interface WantOptions { // indicates the grant to perform read operations on the URI @@ -66,17 +66,17 @@ export declare interface WantOptions { /** * Want is the basic communication component of the system. * @name Want - * @since 3 + * @since 6 * @sysCap AAFwk - * @devices phone, tablet + * @devices phone * @permission N/A */ export declare interface Want { /** * device id * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @sysCap AAFwk */ deviceId?: string; @@ -84,8 +84,8 @@ export declare interface Want { /** * bundle name * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @sysCap AAFwk */ bundleName?: string; @@ -93,16 +93,16 @@ export declare interface Want { /** * ability name * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @sysCap AAFwk */ abilityName?: string; /** * The description of a URI in a Want. - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @sysCap AAFwk * @default - */ @@ -110,8 +110,8 @@ export declare interface Want { /** * The description of the type in this Want. - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @sysCap AAFwk * @default - */ @@ -119,8 +119,8 @@ export declare interface Want { /** * The options of the flags in this Want. - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @sysCap AAFwk * @default - */ @@ -128,8 +128,8 @@ export declare interface Want { /** * The description of an action in an want. - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @sysCap AAFwk * @default - */ @@ -137,8 +137,8 @@ export declare interface Want { /** * The description of the WantParams object in an Want - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @sysCap AAFwk * @default - */ @@ -146,8 +146,8 @@ export declare interface Want { /** * The description of a entities in a Want. - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @sysCap AAFwk * @default - */ diff --git a/interfaces/kits/js/app/abilitymissioninfo.d.ts b/interfaces/kits/js/app/abilitymissioninfo.d.ts index 75a376e6865c332a157336100b172519fe35edbf..3b64be448f22f7a83f959e45a68e8a15e313624c 100644 --- a/interfaces/kits/js/app/abilitymissioninfo.d.ts +++ b/interfaces/kits/js/app/abilitymissioninfo.d.ts @@ -16,19 +16,19 @@ import { ElementName } from '../bundle/elementname'; /** * @name Task stack information corresponding to ability - * @since 3 + * @since 6 * @SysCap appexecfwk * @import import AbilityMissionInfo from '@ohos.AbilityMissionInfo' * @permission N/A - * @devices phone, tablet + * @devices phone */ export interface AbilityMissionInfo { /** * Unique identification of task stack information corresponding to ability * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk */ id: number; @@ -38,8 +38,8 @@ export interface AbilityMissionInfo { * This can be considered the "application" of this task stack * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk */ baseAbility: ElementName; @@ -49,8 +49,8 @@ export interface AbilityMissionInfo { * This is what the user is currently doing * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk */ topAbility: ElementName; @@ -59,8 +59,8 @@ export interface AbilityMissionInfo { * The corresponding ability description information in the task stack * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk */ missionDescription: MissionDescriptionInfo; @@ -68,19 +68,19 @@ export interface AbilityMissionInfo { /** * @name Task stack description information - * @since 3 + * @since 6 * @SysCap appexecfwk * @import import app from '@system.app' * @permission N/A - * @devices phone, tablet + * @devices phone */ export interface MissionDescriptionInfo { /** * The label of the specified ability in the task stack * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk */ label: string; @@ -89,8 +89,8 @@ export interface MissionDescriptionInfo { * The path to the icon that specifies the ability in the task stack * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk */ iconPath: string; diff --git a/interfaces/kits/js/app/context.d.ts b/interfaces/kits/js/app/context.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..a48c333654d2f6d23d51050be62fdb896431998d --- /dev/null +++ b/interfaces/kits/js/app/context.d.ts @@ -0,0 +1,85 @@ +/* +* 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 { AsyncCallback } from '../basic'; + +/** + * Provides the context of an object in the application and obtains application environment information. + * @name Context + * @since 6 + * @sysCap AAFwk + * @devices phone + * @permission N/A + */ +export interface Context { + /** + * Checks whether the calling or current process has the given permission. + * @devices phone + * @since 6 + * @sysCap AAFwk + * @param - + * @return Returns 0 if the calling or current process has the permission; returns -1 otherwise. + */ + verifyCallingOrSelfPermission(permission: string, callback: AsyncCallback): void; + verifyCallingOrSelfPermission(permission: string): Promise; + + /** + * Checks whether the calling process for inter-process communication has the given permission. + * @devices phone + * @since 6 + * @sysCap AAFwk + * @param - + * @return Returns 0 if the calling process has the permission; returns -1 otherwise. + */ + verifyCallingPermission(permission: string, callback: AsyncCallback): void; + verifyCallingPermission(permission: string): Promise; + + /** + * Checks whether a process ID (PID) and user ID (UID) have the given permission. + * @devices phone + * @since 6 + * @sysCap AAFwk + * @param - + * @return Returns 0 if the PID and UID have the permission; returns -1 otherwise. + */ + verifyPermission(permission: string, pid: number, uid: number, callback: AsyncCallback): void; + verifyPermission(permission: string, pid: number, uid: number): Promise; + + /** + * Checks whether the current process has the given permission. + * @devices phone + * @since 6 + * @sysCap AAFwk + * @param - + * @return Returns 0 if the current process has the permission; returns -1 otherwise. + */ + verifySelfPermission(permission: string, callback: AsyncCallback): void; + verifySelfPermission(permission: string): Promise; + + /** + * Confirms with the permission management module to check whether a request prompt is + * required for granting a certain permission. + * @devices phone + * @since 6 + * @sysCap AAFwk + * @param - + * @return Returns true if the current application does not have the permission and the user does not + * turn off further requests; returns false if the current application already has the permission, + * the permission is rejected by the system, or the permission is denied by the user and + * the user has turned off further requests. + */ + canRequestPermission(permission: string, callback: AsyncCallback): void; + canRequestPermission(permission: string): Promise; +} \ No newline at end of file diff --git a/interfaces/kits/js/app/processinfo.d.ts b/interfaces/kits/js/app/processinfo.d.ts index f249df8e46d1286e76db2e8fadba15b78650965a..cf1c3989bf3d76e0d5bb75aa411835e293a4e812 100644 --- a/interfaces/kits/js/app/processinfo.d.ts +++ b/interfaces/kits/js/app/processinfo.d.ts @@ -15,19 +15,19 @@ /** * @name This class saves process information about an application - * @since 3 + * @since 6 * @SysCap appexecfwk * @import import app from '@system.app' * @permission N/A - * @devices phone, tablet + * @devices phone */ export interface ProcessInfo { /** * The id of the current process * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk */ pid: number; @@ -36,8 +36,8 @@ export interface ProcessInfo { * The name of the current process * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk */ processName: string; diff --git a/interfaces/kits/js/app/runningprocessinfo.d.ts b/interfaces/kits/js/app/runningprocessinfo.d.ts index aae749e1b6b9319d31659e0a1e7f99bd1997d041..71d35e2864c84f20a7c8e6cd118d42b0005d21d4 100755 --- a/interfaces/kits/js/app/runningprocessinfo.d.ts +++ b/interfaces/kits/js/app/runningprocessinfo.d.ts @@ -16,19 +16,19 @@ import abilityManager from './../@ohos.app.abilitymanager'; /** * @name This class saves process information about an application - * @since 3 + * @since 6 * @SysCap appexecfwk * @import import app from '@system.app' * @permission N/A - * @devices phone, tablet + * @devices phone */ export interface RunningProcessInfo { /** * The id of the current process * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk */ pid: number; @@ -37,8 +37,8 @@ import abilityManager from './../@ohos.app.abilitymanager'; * The name of the current process * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk */ processName: string; @@ -47,8 +47,8 @@ import abilityManager from './../@ohos.app.abilitymanager'; * The list of packaget in the current process * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk */ pkgList: Array; @@ -57,8 +57,8 @@ import abilityManager from './../@ohos.app.abilitymanager'; * The uid of the current process * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk */ uid: number; @@ -67,8 +67,8 @@ import abilityManager from './../@ohos.app.abilitymanager'; * the memory level of the current process * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk */ lastMemoryLevel: number; @@ -77,8 +77,8 @@ import abilityManager from './../@ohos.app.abilitymanager'; * the weight of the current process * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk */ weight: number; @@ -87,8 +87,8 @@ import abilityManager from './../@ohos.app.abilitymanager'; * the ReasonCode of weight for the current process * * @default - - * @devices phone, tablet - * @since 3 + * @devices phone + * @since 6 * @SysCap appexecfwk */ weightReasonCode: abilityManager.WeightReasonCode; diff --git a/interfaces/kits/js/bundle/abilityinfo.d.ts b/interfaces/kits/js/bundle/abilityinfo.d.ts index 106ad326f82611ee2863b768d8b1a40fc370d649..2117aa3daa7ff7ba4a5b22efb62af2d61b64a3b7 100644 --- a/interfaces/kits/js/bundle/abilityinfo.d.ts +++ b/interfaces/kits/js/bundle/abilityinfo.d.ts @@ -1,57 +1,57 @@ -/* - * 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 bundle from './../@ohos.bundle'; - -/** - * @name AbilityInfo - * @since 3 - * @SysCap BMS - * @import NA - * @permission NA - * @devices phone, tablet - */ -export interface AbilityInfo { - readonly bundleName: string; - readonly name: string; - readonly label: string; - readonly description: string; - readonly icon: string; - readonly labelId: number; - readonly descriptionId: number; - readonly iconId: number; - readonly moduleName: string; - readonly process: string; - readonly targetAbility: string; - readonly backgroundModes: number; - readonly isVisible: boolean; - readonly formEnabled: boolean; - readonly type: bundle.AbilityType; - readonly subType: bundle.AbilitySubType; - readonly orientation: bundle.DisplayOrientation; - readonly launchMode: bundle.LaunchMode; - readonly permissions: Array; - readonly deviceTypes: Array; - readonly deviceCapabilities: Array; - readonly readPermission: string; - readonly writePermission: string; - readonly applicationInfo: ApplicationInfo; - readonly formEntity: number; - readonly minFormHeight: number; - readonly defaultFormHeight: number; - readonly minFormWidth: number; - readonly defaultFormWidth: number; - readonly uri: string; +/* + * 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 bundle from './../@ohos.bundle'; + +/** + * @name AbilityInfo + * @since 6 + * @SysCap BMS + * @import N/A + * @permission N/A + * @devices phone + */ +export interface AbilityInfo { + readonly bundleName: string; + readonly name: string; + readonly label: string; + readonly description: string; + readonly icon: string; + readonly labelId: number; + readonly descriptionId: number; + readonly iconId: number; + readonly moduleName: string; + readonly process: string; + readonly targetAbility: string; + readonly backgroundModes: number; + readonly isVisible: boolean; + readonly formEnabled: boolean; + readonly type: bundle.AbilityType; + readonly subType: bundle.AbilitySubType; + readonly orientation: bundle.DisplayOrientation; + readonly launchMode: bundle.LaunchMode; + readonly permissions: Array; + readonly deviceTypes: Array; + readonly deviceCapabilities: Array; + readonly readPermission: string; + readonly writePermission: string; + readonly applicationInfo: ApplicationInfo; + readonly formEntity: number; + readonly minFormHeight: number; + readonly defaultFormHeight: number; + readonly minFormWidth: number; + readonly defaultFormWidth: number; + readonly uri: string; } \ No newline at end of file diff --git a/interfaces/kits/js/bundle/applicationinfo.d.ts b/interfaces/kits/js/bundle/applicationinfo.d.ts index 50ccc0058d544d0061d2efdec8d3bfb729a05705..af3e1e6531ff9391eebdfb492f16a7309c040992 100644 --- a/interfaces/kits/js/bundle/applicationinfo.d.ts +++ b/interfaces/kits/js/bundle/applicationinfo.d.ts @@ -1,42 +1,42 @@ -/* - * 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 { ModuleInfo } from './moduleinfo'; - -/** - * @name ApplicationInfo - * @since 3 - * @SysCap BMS - * @import NA - * @permission NA - * @devices phone, tablet - */ -export interface ApplicationInfo { - readonly name: string; - readonly description: string; - readonly descriptionId: number; - readonly systemApp: boolean; - readonly enabled: boolean; - readonly label: string; - readonly labelId: string; - readonly icon: string; - readonly iconId: string; - readonly process: string; - readonly supportedModes: number; - readonly moduleSourceDirs: Array; - readonly permissions: Array; - readonly moduleInfos: Array; - flags: number; - readonly entryDir: string; +/* + * 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 { ModuleInfo } from './moduleinfo'; + +/** + * @name ApplicationInfo + * @since 6 + * @SysCap BMS + * @import N/A + * @permission N/A + * @devices phone + */ +export interface ApplicationInfo { + readonly name: string; + readonly description: string; + readonly descriptionId: number; + readonly systemApp: boolean; + readonly enabled: boolean; + readonly label: string; + readonly labelId: string; + readonly icon: string; + readonly iconId: string; + readonly process: string; + readonly supportedModes: number; + readonly moduleSourceDirs: Array; + readonly permissions: Array; + readonly moduleInfos: Array; + flags: number; + readonly entryDir: string; } \ No newline at end of file diff --git a/interfaces/kits/js/bundle/bundleinfo.d.ts b/interfaces/kits/js/bundle/bundleinfo.d.ts index 2ec1b7df6af21cb4929bf43c94d72729ce317e39..2dbb3e406506e4b8d621f4b370d19088b46061f2 100644 --- a/interfaces/kits/js/bundle/bundleinfo.d.ts +++ b/interfaces/kits/js/bundle/bundleinfo.d.ts @@ -1,77 +1,77 @@ -/* - * 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 { AbilityInfo } from './abilityinfo'; -import { ApplicationInfo } from './applicationinfo'; -import { HapModuleInfo } from './hapmoduleinfo'; - -/** - * @name UsedScene - * @since 3 - * @SysCap BMS - * @import NA - * @permission NA - * @devices phone, tablet - */ -export interface UsedScene { - abilities: Array; - when: string; -} - -/** - * @name ReqPermissionDetail - * @since 3 - * @SysCap BMS - * @import NA - * @permission NA - * @devices phone, tablet - */ -export interface ReqPermissionDetail { - name: string; - reason: string; - usedScene: UsedScene; -} - -/** - * @name BundleInfo - * @since 3 - * @SysCap BMS - * @import NA - * @permission NA - * @devices phone, tablet - */ -export interface BundleInfo { - readonly name: string; - readonly type: string; - readonly appId: string; - readonly uid: number; - readonly installTime: number; - readonly updateTime: number; - readonly appInfo: ApplicationInfo; - readonly abilityInfos: Array; - readonly reqPermissions: Array; - readonly reqPermissionDetails: Array; - readonly vendor: string; - readonly versionCode: number; - readonly versionName: string; - readonly compatibleVersion: number; - readonly targetVersion: number; - readonly isCompressNativeLibs: boolean; - readonly hapModuleInfos: Array; - readonly entryModuleName: string; - readonly cpuAbi: string; - readonly isSilentInstallation: string; - readonly minCompatibleVersionCode: number; - readonly entryInstallationFree: boolean; +/* + * 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 { AbilityInfo } from './abilityinfo'; +import { ApplicationInfo } from './applicationinfo'; +import { HapModuleInfo } from './hapmoduleinfo'; + +/** + * @name UsedScene + * @since 6 + * @SysCap BMS + * @import N/A + * @permission N/A + * @devices phone + */ +export interface UsedScene { + abilities: Array; + when: string; +} + +/** + * @name ReqPermissionDetail + * @since 6 + * @SysCap BMS + * @import N/A + * @permission N/A + * @devices phone + */ +export interface ReqPermissionDetail { + name: string; + reason: string; + usedScene: UsedScene; +} + +/** + * @name BundleInfo + * @since 6 + * @SysCap BMS + * @import N/A + * @permission N/A + * @devices phone + */ +export interface BundleInfo { + readonly name: string; + readonly type: string; + readonly appId: string; + readonly uid: number; + readonly installTime: number; + readonly updateTime: number; + readonly appInfo: ApplicationInfo; + readonly abilityInfos: Array; + readonly reqPermissions: Array; + readonly reqPermissionDetails: Array; + readonly vendor: string; + readonly versionCode: number; + readonly versionName: string; + readonly compatibleVersion: number; + readonly targetVersion: number; + readonly isCompressNativeLibs: boolean; + readonly hapModuleInfos: Array; + readonly entryModuleName: string; + readonly cpuAbi: string; + readonly isSilentInstallation: string; + readonly minCompatibleVersionCode: number; + readonly entryInstallationFree: boolean; } \ No newline at end of file diff --git a/interfaces/kits/js/bundle/bundleinstaller.d.ts b/interfaces/kits/js/bundle/bundleinstaller.d.ts index fe2f5200df7ad1b11e6d3dc47b28c8653099b029..36b2ef289b97d29eb9d9d5492274ccd53c0233eb 100644 --- a/interfaces/kits/js/bundle/bundleinstaller.d.ts +++ b/interfaces/kits/js/bundle/bundleinstaller.d.ts @@ -1,86 +1,86 @@ -/* - * 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 { AsyncCallback } from './../.basic'; -import bundle from './../@ohos.bundle'; - -/** - * @name InstallParam - * @since 3 - * @SysCap BMS - * @import NA - * @permission NA - * @devices phone, tablet - */ -export interface InstallParam { - userId: number; - installFlag: number; - isKeepData: boolean; -} - -/** - * @name InstallStatus - * @since 3 - * @SysCap BMS - * @import NA - * @permission NA - * @devices phone, tablet - */ -export interface InstallStatus { - status: bundle.InstallErrorCode; - /** - * The install result string message. - * - * @default - - * @devices phone, tablet - * @since 3 - * @SysCap BMS - */ - statusMessage: string; -} - -/** - * @name BundleInstaller - * @since 3 - * @SysCap BMS - * @import NA - * @permission NA - * @devices phone, tablet - */ -export interface BundleInstaller { - /** - * Install an application in a HAP. - * - * @devices phone, tablet - * @since 3 - * @SysCap BMS - * @param bundleFilePaths Indicates the paths of the HAP. - * @param InstallParam Indicates the userId and whether keep data. - * @return InstallStatus - */ - install(bundleFilePaths: Array, param: InstallParam, callback: AsyncCallback): void; - - /** - * Uninstall an application. - * - * @devices phone, tablet - * @since 3 - * @SysCap BMS - * @param bundleName Indicates the bundle name. - * @param InstallParam Indicates the userId and whether keep data. - * @return InstallStatus - */ - uninstall(bundleName: string, param: InstallParam, callback: AsyncCallback): void; +/* + * 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 { AsyncCallback } from './../basic'; +import bundle from './../@ohos.bundle'; + +/** + * @name InstallParam + * @since 6 + * @SysCap BMS + * @import N/A + * @permission N/A + * @devices phone + */ +export interface InstallParam { + userId: number; + installFlag: number; + isKeepData: boolean; +} + +/** + * @name InstallStatus + * @since 6 + * @SysCap BMS + * @import N/A + * @permission N/A + * @devices phone + */ +export interface InstallStatus { + status: bundle.InstallErrorCode; + /** + * The install result string message. + * + * @default - + * @devices phone + * @since 6 + * @SysCap BMS + */ + statusMessage: string; +} + +/** + * @name BundleInstaller + * @since 6 + * @SysCap BMS + * @import N/A + * @permission N/A + * @devices phone + */ +export interface BundleInstaller { + /** + * Install an application in a HAP. + * + * @devices phone + * @since 6 + * @SysCap BMS + * @param bundleFilePaths Indicates the paths of the HAP. + * @param InstallParam Indicates the userId and whether keep data. + * @return InstallStatus + */ + install(bundleFilePaths: Array, param: InstallParam, callback: AsyncCallback): void; + + /** + * Uninstall an application. + * + * @devices phone + * @since 6 + * @SysCap BMS + * @param bundleName Indicates the bundle name. + * @param InstallParam Indicates the userId and whether keep data. + * @return InstallStatus + */ + uninstall(bundleName: string, param: InstallParam, callback: AsyncCallback): void; } \ No newline at end of file diff --git a/interfaces/kits/js/bundle/elementname.d.ts b/interfaces/kits/js/bundle/elementname.d.ts index fa0552f70496e774aad1720f453da050d9d13c26..5e4072de1a0ab84dfc457928935c4d69e46e71b6 100644 --- a/interfaces/kits/js/bundle/elementname.d.ts +++ b/interfaces/kits/js/bundle/elementname.d.ts @@ -1,71 +1,71 @@ -/* - * 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. - */ - -/** - * Contains basic Ability information, which uniquely identifies an ability. - * You can use this class to obtain values of the fields set in an element, - * such as the device ID, bundle name, and ability name. - * @name ElementName - * @since 3 - * @sysCap AAFwk - * @devices phone, tablet - * @permission N/A - */ -export interface ElementName { - /** - * device id - * @default - - * @devices phone, tablet - * @since 3 - * @sysCap AAFwk - */ - deviceId?: string; - - /** - * bundle name - * @default - - * @devices phone, tablet - * @since 3 - * @sysCap AAFwk - */ - bundleName: string; - - /** - * ability name - * @default - - * @devices phone, tablet - * @since 3 - * @sysCap AAFwk - */ - abilityName: string; - - /** - * shortName name - * @default - - * @devices phone, tablet - * @since 3 - * @sysCap AAFwk - */ - uri?: string; - - /** - * shortName name - * @default - - * @devices phone, tablet - * @since 3 - * @sysCap AAFwk - */ - shortName?: string; -} +/* + * 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. + */ + +/** + * Contains basic Ability information, which uniquely identifies an ability. + * You can use this class to obtain values of the fields set in an element, + * such as the device ID, bundle name, and ability name. + * @name ElementName + * @since 6 + * @sysCap AAFwk + * @devices phone + * @permission N/A + */ +export interface ElementName { + /** + * device id + * @default - + * @devices phone + * @since 6 + * @sysCap AAFwk + */ + deviceId?: string; + + /** + * bundle name + * @default - + * @devices phone + * @since 6 + * @sysCap AAFwk + */ + bundleName: string; + + /** + * ability name + * @default - + * @devices phone + * @since 6 + * @sysCap AAFwk + */ + abilityName: string; + + /** + * shortName name + * @default - + * @devices phone + * @since 6 + * @sysCap AAFwk + */ + uri?: string; + + /** + * shortName name + * @default - + * @devices phone + * @since 6 + * @sysCap AAFwk + */ + shortName?: string; +} diff --git a/interfaces/kits/js/bundle/hapmoduleinfo.d.ts b/interfaces/kits/js/bundle/hapmoduleinfo.d.ts index 161fbef399741ac659ad5f14ab4a72400a996d02..39422cdc78195bf84a849a57930bf0de2add0ec5 100644 --- a/interfaces/kits/js/bundle/hapmoduleinfo.d.ts +++ b/interfaces/kits/js/bundle/hapmoduleinfo.d.ts @@ -1,41 +1,41 @@ -/* - * 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 {AbilityInfo} from "./abilityinfo"; - -/** - * @name HapModuleInfo - * @since 3 - * @SysCap BMS - * @import NA - * @permission NA - * @devices phone, tablet - */ -export interface HapModuleInfo { - readonly name: string; - readonly description: string; - readonly descriptionId: number; - readonly icon: string; - readonly label: string; - readonly labelId: number; - readonly iconId: number; - readonly backgroundImg: string; - readonly supportedModes: number; - readonly reqCapabilities: Array; - readonly deviceTypes: Array; - readonly abilityInfos: Array; - readonly moduleName: string; - readonly mainAbilityName: string; - readonly installationFree: boolean; +/* + * 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 {AbilityInfo} from "./abilityinfo"; + +/** + * @name HapModuleInfo + * @since 6 + * @SysCap BMS + * @import N/A + * @permission N/A + * @devices phone + */ +export interface HapModuleInfo { + readonly name: string; + readonly description: string; + readonly descriptionId: number; + readonly icon: string; + readonly label: string; + readonly labelId: number; + readonly iconId: number; + readonly backgroundImg: string; + readonly supportedModes: number; + readonly reqCapabilities: Array; + readonly deviceTypes: Array; + readonly abilityInfos: Array; + readonly moduleName: string; + readonly mainAbilityName: string; + readonly installationFree: boolean; } \ No newline at end of file diff --git a/interfaces/kits/js/bundle/moduleinfo.d.ts b/interfaces/kits/js/bundle/moduleinfo.d.ts index b856a0042b9f10d4cef082b49d9a68280bcf3b1d..1f8ea57a0d0db8a340c110fd48bcb7d9aca72958 100644 --- a/interfaces/kits/js/bundle/moduleinfo.d.ts +++ b/interfaces/kits/js/bundle/moduleinfo.d.ts @@ -1,44 +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 ModuleInfo - * @since 3 - * @SysCap BMS - * @import NA - * @permission NA - * @devices phone, tablet - */ -export interface ModuleInfo { - /** - * The module name. - * - * @default - - * @devices phone, tablet - * @since 3 - * @SysCap BMS - */ - readonly moduleName: string; - - /** - * The module source path. - * - * @default - - * @devices phone, tablet - * @since 3 - * @SysCap BMS - */ - readonly moduleSourceDir: string; +/* + * 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 ModuleInfo + * @since 6 + * @SysCap BMS + * @import N/A + * @permission N/A + * @devices phone + */ +export interface ModuleInfo { + /** + * The module name. + * + * @default - + * @devices phone + * @since 6 + * @SysCap BMS + */ + readonly moduleName: string; + + /** + * The module source path. + * + * @default - + * @devices phone + * @since 6 + * @SysCap BMS + */ + readonly moduleSourceDir: string; } \ No newline at end of file