From 572b52820a6785af1b8ee3074fc68872a8e105c8 Mon Sep 17 00:00:00 2001 From: zhaoyuan17 Date: Tue, 14 Sep 2021 22:43:58 +0800 Subject: [PATCH] update d.ts files about framework and notification Signed-off-by: zhaoyuan17 --- api/@ohos.ability.dataUriUtils.d.ts | 72 +++++ api/@ohos.ability.featureAbility.d.ts | 61 ++++- api/@ohos.ability.particleAbility.d.ts | 25 +- api/@ohos.app.abilityManager.d.ts | 16 +- api/@ohos.bundle.d.ts | 365 +++++++++++++++++++++++++ api/ability/dataAbilityHelper.d.ts | 215 +++++++++++++++ api/ability/dataAbilityOperation.d.ts | 93 +++++++ api/ability/dataAbilityResult.d.ts | 34 +++ api/ability/startAbilityParameter.d.ts | 12 + api/app/abilityMissionInfo.d.ts | 54 ++-- api/app/activeProcessInfo.d.ts | 2 +- api/app/context.d.ts | 85 +++++- api/app/missionSnapshot.d.ts | 37 +++ api/app/processInfo.d.ts | 44 +++ api/bundle/abilityInfo.d.ts | 244 +++++++++++++++++ api/bundle/applicationInfo.d.ts | 138 ++++++++++ api/bundle/bundleInfo.d.ts | 237 ++++++++++++++++ api/bundle/bundleInstaller.d.ts | 107 ++++++++ api/bundle/customizeData.d.ts | 37 +++ api/bundle/elementName.d.ts | 71 +++++ api/bundle/hapModuleInfo.d.ts | 116 ++++++++ api/bundle/moduleInfo.d.ts | 43 +++ api/bundle/moduleUsageRecord.d.ts | 103 +++++++ api/bundle/shortcutInfo.d.ts | 107 ++++++++ 24 files changed, 2271 insertions(+), 47 deletions(-) create mode 100644 api/@ohos.ability.dataUriUtils.d.ts create mode 100644 api/@ohos.bundle.d.ts create mode 100644 api/ability/dataAbilityHelper.d.ts create mode 100644 api/ability/dataAbilityOperation.d.ts create mode 100644 api/ability/dataAbilityResult.d.ts create mode 100644 api/app/missionSnapshot.d.ts create mode 100644 api/app/processInfo.d.ts create mode 100644 api/bundle/abilityInfo.d.ts create mode 100644 api/bundle/applicationInfo.d.ts create mode 100644 api/bundle/bundleInfo.d.ts create mode 100644 api/bundle/bundleInstaller.d.ts create mode 100644 api/bundle/customizeData.d.ts create mode 100644 api/bundle/elementName.d.ts create mode 100644 api/bundle/hapModuleInfo.d.ts create mode 100644 api/bundle/moduleInfo.d.ts create mode 100644 api/bundle/moduleUsageRecord.d.ts create mode 100644 api/bundle/shortcutInfo.d.ts diff --git a/api/@ohos.ability.dataUriUtils.d.ts b/api/@ohos.ability.dataUriUtils.d.ts new file mode 100644 index 0000000000..671b784787 --- /dev/null +++ b/api/@ohos.ability.dataUriUtils.d.ts @@ -0,0 +1,72 @@ +/* + * 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. + */ + +/** + * A utility class used for handling objects that use the DataAbilityHelper scheme. + * @name dataUriUtils + * @since 7 + * @sysCap AAFwk + * @devices phone, tablet + * @permission N/A + */ +declare namespace dataUriUtils { + /** + * Obtains the ID attached to the end of the path component of the given uri. + * + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + * @param uri Indicates the uri object from which the ID is to be obtained. + * @return Returns the ID attached to the end of the path component; + */ + function getId(uri: string): number + + /** + * Attaches the given ID to the end of the path component of the given uri. + * + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + * @param uri Indicates the uri string from which the ID is to be obtained. + * @param id Indicates the ID to attach. + * @return Returns the uri object with the given ID attached. + */ + function attachId(uri: string, id: number): string + + /** + * Deletes the ID from the end of the path component of the given uri. + * + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + * @param uri Indicates the uri object from which the ID is to be deleted. + * @return Returns the uri object with the ID deleted. + */ + function deleteId(uri: string): string + + /** + * Updates the ID in the specified uri + * + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + * @param uri Indicates the uri object to be updated. + * @param id Indicates the new ID. + * @return Returns the updated uri object. + */ + function updateId(uri: string, id: number): string + +} +export default dataUriUtils; \ No newline at end of file diff --git a/api/@ohos.ability.featureAbility.d.ts b/api/@ohos.ability.featureAbility.d.ts index 062abd922a..e6a0b227b8 100644 --- a/api/@ohos.ability.featureAbility.d.ts +++ b/api/@ohos.ability.featureAbility.d.ts @@ -17,7 +17,7 @@ import { Want } from './ability/want'; import { StartAbilityParameter } from './ability/startAbilityParameter'; import { AbilityResult } from './ability/abilityResult'; import { Context } from './app/context'; - +import { DataAbilityHelper } from './ability/dataAbilityHelper'; /** * A Feature Ability represents an ability with a UI and is designed to interact with users. * @name featureAbility @@ -29,6 +29,7 @@ import { Context } from './app/context'; declare namespace featureAbility { /** * Obtain the want sended from the source ability. + * * @devices phone, tablet * @since 6 * @sysCap AAFwk @@ -40,6 +41,7 @@ declare namespace featureAbility { /** * Starts a new ability. + * * @devices phone, tablet * @since 6 * @sysCap AAFwk @@ -59,11 +61,12 @@ declare namespace featureAbility { /** * Starts an ability and returns the execution result when the ability is destroyed. + * * @devices phone, tablet * @since 7 * @sysCap AAFwk * @param parameter Indicates the ability to start. - * @return - + * @return Returns the {@link AbilityResult}. */ function startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback): void; function startAbilityForResult(parameter: StartAbilityParameter): Promise; @@ -71,6 +74,7 @@ declare namespace featureAbility { /** * Sets the result code and data to be returned by this Page ability to the caller * and destroys this Page ability. + * * @devices phone, tablet * @since 7 * @sysCap AAFwk @@ -82,20 +86,69 @@ declare namespace featureAbility { /** * Destroys this Page ability. + * * @devices phone, tablet * @since 7 * @sysCap AAFwk * @return - */ function terminateSelf(callback: AsyncCallback): void; + function terminateSelf(): Promise; + + /** + * Obtains the dataAbilityHelper. + * + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + * @param uri Indicates the path of the file to open. + * @return Returns the dataAbilityHelper. + */ + function acquireDataAbilityHelper(uri: string): DataAbilityHelper; /** * Checks whether the main window of this ability has window focus. + * * @devices phone, tablet * @since 7 * @sysCap AAFwk + * @return Returns {@code true} if this ability currently has window focus; returns {@code false} otherwise. */ - function hasWindowFocus(callback: AsyncCallback): void; - function hasWindowFocus(): Promise; + function hasWindowFocus(callback: AsyncCallback): void; + function hasWindowFocus(): Promise; + + export enum AbilityWindowConfiguration { + WINDOW_MODE_UNDEFINED = 0, + WINDOW_MODE_FULLSCREEN = 1, + WINDOW_MODE_SPLIT_PRIMARY = 100, + WINDOW_MODE_SPLIT_SECONDARY = 101, + WINDOW_MODE_FLOATING = 102 + } + + export enum AbilityStartSetting { + BOUNDS_KEY = "abilityBounds", + WINDOW_MODE_KEY = "windowMode", + DISPLAY_ID_KEY = "displayId" + } + + export enum ErrorCode { + NO_ERROR = 0, + INVALID_PARAMETER = -1, + ABILITY_NOT_FOUND = -2, + PERMISSION_DENY = -3 + } + + export enum ContinuationState { + LOCAL_RUNNING = 0, + REMOTE_RUNNING = 1, + REPLICA_RUNNING = 2 + } + + export enum DataAbilityOperationType { + TYPE_INSERT = 1, + TYPE_UPDATE = 2, + TYPE_DELETE = 3, + TYPE_ASSERT = 4, + } } export default featureAbility; \ No newline at end of file diff --git a/api/@ohos.ability.particleAbility.d.ts b/api/@ohos.ability.particleAbility.d.ts index fda9282af1..74ff162975 100644 --- a/api/@ohos.ability.particleAbility.d.ts +++ b/api/@ohos.ability.particleAbility.d.ts @@ -12,8 +12,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + import { AsyncCallback } from './basic'; import { StartAbilityParameter } from './ability/startAbilityParameter'; +import { DataAbilityHelper } from './ability/dataAbilityHelper'; /** * A Particle Ability represents an ability with service. @@ -24,9 +26,9 @@ import { StartAbilityParameter } from './ability/startAbilityParameter'; * @permission N/A */ declare namespace particleAbility { - /** * Service ability uses this method to start a specific ability. + * * @devices phone, tablet * @since 7 * @sysCap AAFwk @@ -36,5 +38,26 @@ declare namespace particleAbility { function startAbility(parameter: StartAbilityParameter, callback: AsyncCallback): void; function startAbility(parameter: StartAbilityParameter): Promise; + /** + * Destroys this service ability. + * + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + * @return - + */ + function terminateSelf(callback: AsyncCallback): void; + function terminateSelf(): Promise; + + /** + * Obtains the dataAbilityHelper. + * + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + * @param uri Indicates the path of the file to open. + * @return Returns the dataAbilityHelper. + */ + function acquireDataAbilityHelper(uri: string): DataAbilityHelper; } export default particleAbility; diff --git a/api/@ohos.app.abilityManager.d.ts b/api/@ohos.app.abilityManager.d.ts index f9393afbaf..69380fc7d5 100644 --- a/api/@ohos.app.abilityManager.d.ts +++ b/api/@ohos.app.abilityManager.d.ts @@ -16,13 +16,14 @@ import { AsyncCallback } from './basic'; import { AbilityMissionInfo } from './app/abilityMissionInfo'; import { ActiveProcessInfo } from './app/activeProcessInfo'; +import { MissionSnapshot } from './app/missionSnapshot'; /** * This module provides the capability to manage abilities and obtaining system task information. * * @since 7 * @SysCap SystemCapability.Appexecfwk - * @devices phone, tablet, tv, wearable + * @devices phone, tablet, tv, wearable, car * @import import abilityManager from '@ohos.app.abilityManager' * @permission N/A */ @@ -39,7 +40,7 @@ declare namespace abilityManager { * Get information about running processes * @since 7 * @SysCap SystemCapability.Appexecfwk - * @devices phone, tablet, tv, wearable + * @devices phone, tablet, tv, wearable, car * @return a list of ActiveProcessInfo records describing each process. * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION * @systemapi hide this for inner system use @@ -51,20 +52,20 @@ declare namespace abilityManager { * Get information about the running ability missions * @since 7 * @SysCap SystemCapability.Appexecfwk - * @devices phone, tablet, tv, wearable + * @devices phone, tablet, tv, wearable, car * @param upperLimit The maximum number of mission infos to return in the array. * @return an array of AbilityMissionInfo records describing each active mission. * @permission ohos.permission.ACCESS_MISSIONS * @systemapi hide this for inner system use */ - function getActiveAbilityMissionInfos(upperLimit: number): Promise>; - function getActiveAbilityMissionInfos(upperLimit: number, callback: AsyncCallback>): void; + function getActiveAbilityMissionInfos(upperLimit: number): Promise>; + function getActiveAbilityMissionInfos(upperLimit: number, callback: AsyncCallback>): void; /** * Get information about recently run missions * @since 7 * @SysCap SystemCapability.Appexecfwk - * @devices phone, tablet, tv, wearable + * @devices phone, tablet, tv, wearable, car * @param upperLimit The maximum number of previous mission infos to return in the array. * @return an array of AbilityMissionInfo records describing each of the previous mission. * @permission ohos.permission.ACCESS_MISSIONS_EXTRA @@ -77,14 +78,13 @@ declare namespace abilityManager { * Delete the specified missions * @since 7 * @SysCap SystemCapability.Appexecfwk - * @devices phone, tablet, tv, wearable + * @devices phone, tablet, tv, wearable, car * @param missionIds An array of missions, representing the missions that need to be deleted. * @permission ohos.permission.DELETE_MISSIONS * @systemapi hide this for inner system use */ function deleteMissions(missionIds: Array): Promise; function deleteMissions(missionIds: Array, callback: AsyncCallback): void; - } export default abilityManager; diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts new file mode 100644 index 0000000000..3969625681 --- /dev/null +++ b/api/@ohos.bundle.d.ts @@ -0,0 +1,365 @@ +/* + * 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, Callback } 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 { ElementName } from './bundle/elementName'; +import { ShortcutInfo } from './bundle/shortcutInfo'; +import { ModuleUsageRecord } from './bundle/moduleUsageRecord'; + +/** + * bundle. + * @name bundle + * @since 7 + * @sysCap SystemCapability.Appexecfwk + * @devices phone, tablet, tv, wearable + * @permission NA + */ +declare namespace bundle { + +/** + * @name BundleFlag + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @import NA + * @permission NA + * @devices phone, tablet, tv, wearable + */ + enum BundleFlag { + GET_BUNDLE_DEFAULT = 0x00000000, + GET_BUNDLE_WITH_ABILITIES = 0x00000001, + GET_APPLICATION_INFO_WITH_PERMISSION = 0x00000008, + } + +/** + * @name GrantStatus + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @import NA + * @permission NA + * @devices phone, tablet, tv, wearable + */ + export enum GrantStatus { + PERMISSION_DENIED = -1, + PERMISSION_GRANTED = 0, + } + + /** + * @name AbilityType + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @import NA + * @permission NA + * @devices phone, tablet, tv, wearable + */ + export enum AbilityType { + /** + * @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 + */ + PAGE, + + /** + * @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 + */ + DATA, + } + + /** + * @name AbilitySubType + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @import NA + * @permission NA + * @devices phone, tablet, tv, wearable + */ + export enum AbilitySubType { + UNSPECIFIED = 0, + CA = 1, + } + + /** + * @name DisplayOrientation + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @import NA + * @permission NA + * @devices phone, tablet, tv, wearable + */ + export enum DisplayOrientation { + /** + * @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 + */ + LANDSCAPE, + + /** + * @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 + */ + FOLLOW_RECENT, + } + + /** + * @name LaunchMode + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @import NA + * @permission NA + * @devices phone, tablet, tv, wearable + */ + export enum LaunchMode { + /** + * @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 + */ + STANDARD = 1, + } + + /** + * @name InstallErrorCode + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @import NA + * @permission NA + * @devices phone, tablet, tv, wearable + */ + 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 based on a given networkId and bundle name. + * + * @devices phone, tablet, tv, wearable + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @param networkId Indicates the device networkId in area network. + * @param bundleName Indicates the application bundle name to be queried. + * @param flags Indicates the flag used to specify information contained in that will be + * returned. + * @return Returns the BundleInfo object. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED,ohos.permission.GET_BUNDLE_INFO + */ + function getBundleInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback): void; + function getBundleInfo(bundleName: string, bundleFlags: number): Promise; + + /** + * Obtains the interface used to install bundles. + * + * @devices phone, tablet, tv, wearable + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @return Returns the IBundleInstaller interface. + * @permission ohos.permission.INSTALL_BUNDLE + */ + function getBundleInstaller(callback: AsyncCallback): void; + function getBundleInstaller(): Promise; + + /** + * Obtains based on a given bundle name. + * + * @devices phone, tablet, tv, wearable + * @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 + * that will be returned. + * @param userId Indicates the user ID. + * @return Returns the ApplicationInfo object. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO + */ + function getApplicationInfo(bundleName: string, bundleFlags: number, userId: number, callback: AsyncCallback) : void; + function getApplicationInfo(bundleName: string, bundleFlags: number, userId: number) : Promise; + + /** + * Checks whether a specified bundle has been granted a specific permission. + * + * @devices phone, tablet, tv, wearable + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @param bundleName Indicates the name of the bundle to check. + * @param permission Indicates the permission to check. + * @return Returns 0 if the bundle has the permission; returns -1 otherwise. + */ + function checkPermission(bundleName: string, permission: string, callback: AsyncCallback): void; + function checkPermission(bundleName: string, permission: string): Promise; + + /** + * Query the AbilityInfo by the given Want. + * + * @devices phone, tablet, tv, wearable + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @param intent Indicates the Intent containing the application bundle name to + * be queried. + * @param flags 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. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO + */ + function queryAbilityByWant(want: Want, bundleFlags: number, userId: number, callback: AsyncCallback>): void; + function queryAbilityByWant(want: Want, bundleFlags: number, userId:number): Promise>; + + /** + * Obtains BundleInfo of all bundles available in the system. + * + * @devices phone, tablet, tv, wearable + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @param flags Indicates the flag used to specify information contained in the BundleInfo that will be + * returned. + * @return Returns a list of BundleInfo objects. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + */ + function getAllBundleInfo(bundlelFlag: BundleFlag, callback: AsyncCallback>) : void; + function getAllBundleInfo(bundlelFlag: BundleFlag) : Promise>; + + /** + * Obtains information about all installed applications of a specified user. + * + * @devices phone, tablet, tv, wearable + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @param flags 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. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + */ + function getAllApplicationInfo(bundleFlags: number, userId: number, callback: AsyncCallback>) : void; + function getAllApplicationInfo(bundleFlags: number, userId: number) : Promise>; + + /** + * Obtains information about an application bundle contained in an ohos Ability Package (HAP). + * + * @devices phone, tablet, tv, wearable + * @since 7 + * @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 + * returned. + * @return Returns the BundleInfo object. + */ + function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback) : void + function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number) : Promise; + + /** + + /** + * Obtains the Intent 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 + * 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 + * the given bundle does not exist or does not contain any main ability. + * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED + */ + function getLaunchWantForBundle(bundleName: string, callback: AsyncCallback): void; + function getLaunchWantForBundle(bundleName: string): Promise; + + * Obtains information about the shortcuts of the application. + * + * @devices phone, tablet, tv, wearable + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @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. + * + * @devices phone, tablet, tv, wearable + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @param maxNum the return size of the records, must be in range of 1 to 1000. + * @return Returns ability usage record list. + * @systemapi hide this for inner system use + */ + function getModuleUsageRecords(maxNum: number, callback: AsyncCallback>): void; + function getModuleUsageRecords(maxNum: number): Promise>; +} + +export default bundle; diff --git a/api/ability/dataAbilityHelper.d.ts b/api/ability/dataAbilityHelper.d.ts new file mode 100644 index 0000000000..c451d85683 --- /dev/null +++ b/api/ability/dataAbilityHelper.d.ts @@ -0,0 +1,215 @@ +/* +* 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 { ResultSet } from '../data/rdb/resultSet'; +import { DataAbilityOperation } from './dataAbilityOperation'; +import { DataAbilityResult } from './dataAbilityResult'; +import dataAbility from '../@ohos.data.dataAbility'; +import rdb from '../@ohos.data.rdb'; + +/** + * DataAbilityHelper + * @devices phone, tablet + * + * @since 7 + */ +export interface DataAbilityHelper { + /** + * Opens a file in a specified remote path. + * + * @devices phone, tablet + * @since 7 + * @SysCap AAFwk + * @param uri Indicates the path of the file to open. + * @param mode Indicates the file open mode, which can be "r" for read-only access, "w" for write-only access + * (erasing whatever data is currently in the file), "wt" for write access that truncates any existing + * file, "wa" for write-only access to append to any existing data, "rw" for read and write access on + * any existing data, or "rwt" for read and write access that truncates any existing file. + * @param callback Indicates the callback when openfile success + * @return Returns the file descriptor. + */ + openFile(uri: string, mode: string, callback: AsyncCallback): void; + openFile(uri: string, mode: string): Promise; + + /** + * Registers an observer to observe data specified by the given uri. + * + * @devices phone, tablet + * @since 7 + * @SysCap AAFwk + * @param type dataChange. + * @param uri Indicates the path of the data to operate. + * @param callback Indicates the callback when dataChange. + * @return - + */ + on(type: 'dataChange', uri: string, callback: AsyncCallback): void; + + /** + * Deregisters an observer used for monitoring data specified by the given uri. + * + * @devices phone, tablet + * @since 7 + * @SysCap AAFwk + * @param type dataChange. + * @param uri Indicates the path of the data to operate. + * @param callback Indicates the registered callback. + * @return - + */ + off(type: 'dataChange', uri: string, callback?: AsyncCallback): void; + + /** + * Calls the method defined by the Data ability. + * + * @devices phone, tablet + * @since 7 + * @SysCap AAFwk + * @param uri Indicates the Data ability to process. + * @param method Indicates the method name. + * @param arg Indicates the parameter of the String type. + * @param extras Indicates the parameter of the object type. + * @return Returns the value returned by the called method. + */ + call(uri: string, method: string, arg: string, extras: object, callback: AsyncCallback): void; + call(uri: string, method: string, arg: string, extras: object): Promise; + + /** + * Obtains the MIME type of the date specified by the given URI. + * + * @devices phone, tablet + * @since 7 + * @SysCap AAFwk + * @param uri Indicates the path of the data to operate. + * @return Returns the MIME type that matches the data specified by uri. + */ + getType(uri: string, callback: AsyncCallback): void; + getType(uri: string): Promise; + + /** + * Obtains the MIME types of files supported. + * + * @devices phone, tablet + * @since 7 + * @SysCap AAFwk + * @param uri Indicates the path of the files to obtain. + * @param mimeTypeFilter Indicates the MIME types of the files to obtain. + * @return Returns the matched MIME types Array. + */ + getFileTypes(uri: string, mimeTypeFilter: string, callback: AsyncCallback>): void; + getFileTypes(uri: string, mimeTypeFilter: string): Promise>; + + /** + * Converts the given uri that refers to the Data ability into a normalized uri. + * + * @devices phone, tablet + * @since 7 + * @SysCap AAFwk + * @param uri Indicates the uri object to normalize. + * @return Returns the normalized uri object if the Data ability supports URI normalization or null. + */ + normalizeUri(uri: string, callback: AsyncCallback): void; + normalizeUri(uri: string): Promise; + + /** + * Converts the given normalized uri generated by normalizeUri(uri) into a denormalized one. + * + * @devices phone, tablet + * @since 7 + * @SysCap AAFwk + * @param uri Indicates the uri object to normalize. + * @return Returns the denormalized uri object if the denormalization is successful. + */ + denormalizeUri(uri: string, callback: AsyncCallback): void; + denormalizeUri(uri: string): Promise; + + /** + * Notifies the registered observers of a change to the data resource specified by uri. + * + * @devices phone, tablet + * @since 7 + * @SysCap AAFwk + * @param uri Indicates the path of the data to operate. + * @return - + */ + notifyChange(uri: string, callback: AsyncCallback): void; + notifyChange(uri: string): Promise; + + /** + * Inserts a single data record into the database. + * + * @devices phone, tablet + * @since 7 + * @SysCap AAFwk + * @param uri Indicates the path of the data to insert. + * @param valuesBucket Indicates the data record to insert. If this parameter is null, a blank row will be inserted. + * @return Returns the index of the inserted data record. + */ + insert(uri: string, valuesBucket: rdb.ValuesBucket, callback: AsyncCallback): void; + insert(uri: string, valuesBucket: rdb.ValuesBucket): Promise; + + /** + * Inserts multiple data records into the database. + * + * @devices phone, tablet + * @since 7 + * @SysCap AAFwk + * @param uri Indicates the path of the data to batchInsert. + * @param valuesBuckets Indicates the data records to insert. + * @return Returns the number of data records inserted. + */ + batchInsert(uri: string, valuesBuckets: Array, callback: AsyncCallback): void; + batchInsert(uri: string, valuesBuckets: Array): Promise; + + /** + * Deletes one or more data records from the database. + * + * @devices phone, tablet + * @since 7 + * @SysCap AAFwk + * @param uri Indicates the path of the data to delete. + * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. + * @return Returns the number of data records deleted. + */ + delete(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; + delete(uri: string, predicates: dataAbility.DataAbilityPredicates): Promise; + + /** + * Updates data records in the database. + * + * @devices phone, tablet + * @since 7 + * @SysCap AAFwk + * @param uri Indicates the path of data to update. + * @param valuesBucket Indicates the data to update. + * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. + * @return Returns the number of data records updated. + */ + update(uri: string, valuesBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; + update(uri: string, valuesBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates): Promise; + + /** + * Queries data in the database. + * + * @devices phone, tablet + * @since 7 + * @SysCap AAFwk + * @param uri Indicates the path of data to query. + * @param columns Indicates the columns to query. If this parameter is null, all columns are queried. + * @param predicates Indicates filter criteria. You should define the processing logic when this parameter is null. + * @return Returns the query result {@link ResultSet}. + */ + query(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void; + query(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates): Promise; +} diff --git a/api/ability/dataAbilityOperation.d.ts b/api/ability/dataAbilityOperation.d.ts new file mode 100644 index 0000000000..2d045916a1 --- /dev/null +++ b/api/ability/dataAbilityOperation.d.ts @@ -0,0 +1,93 @@ +/* + * 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 featureAbility from '../@ohos.ability.featureAbility'; +import dataAbility from '../@ohos.data.dataAbility'; +import rdb from '../@ohos.data.rdb'; + +export interface DataAbilityOperation { + /** + * Indicates the path of data to operate. + * @default - + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + */ + uri: string; + + /** + * Indicates a operation type. + * @default - + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + */ + type: featureAbility.DataAbilityOperationType; + + /** + * Indicates the data values to be set. + * @default - + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + */ + valuesBucket?: rdb.ValuesBucket; + + /** + * Indicates the valuesBucket object containing a set of key-value pairs. + * @default - + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + */ + valueBackReferences?: rdb.ValuesBucket; + + /** + * Indicates the filter criteria to set. If this parameter is null, all data records + * will be operated by default. + * @default - + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + */ + predicates?: dataAbility.DataAbilityPredicates; + + /** + * Indicates the back reference to be used as a filter criterion in predicates. + * @default - + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + */ + predicatesBackReferences?: Map; + + /** + * Specifies whether a batch operation can be interrupted. + * @default - + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + */ + interrupted?: boolean; + + /** + * Indicates the expected number of rows to update or delete. + * @default - + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + */ + expectedCount?: number; +} \ No newline at end of file diff --git a/api/ability/dataAbilityResult.d.ts b/api/ability/dataAbilityResult.d.ts new file mode 100644 index 0000000000..fc5878a672 --- /dev/null +++ b/api/ability/dataAbilityResult.d.ts @@ -0,0 +1,34 @@ +/* + * 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. + */ + +export interface DataAbilityResult { + /** + * Indicates the path of data to operate. + * @default - + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + */ + uri?: string; + + /** + * Indicates the number of rows affected by the operation. + * @default - + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + */ + count?:number; +} \ No newline at end of file diff --git a/api/ability/startAbilityParameter.d.ts b/api/ability/startAbilityParameter.d.ts index 9d99dcb38d..b70b1ce241 100644 --- a/api/ability/startAbilityParameter.d.ts +++ b/api/ability/startAbilityParameter.d.ts @@ -13,6 +13,7 @@ * limitations under the License. */ import { Want } from './want'; +import { TaskSyncAnimationOptions } from './taskSyncAnimator' export interface StartAbilityParameter { /** @@ -35,4 +36,15 @@ export interface StartAbilityParameter { */ abilityStartSetting?: {[key: string]: any}; + /** + * Indicates the special start setting used in starting ability with TaskSyncAnimation. + *

Requires Permission: {@code ohos.permission.CONTROL_TASK_SYNC_ANIMATOR} + * + * @default - + * @devices phone, tablet + * @permission ohos.permission.CONTROL_TASK_SYNC_ANIMATOR + * @since 7 + * @SysCap aafwk + */ + taskSyncAnimationOptions?: TaskSyncAnimationOptions; } \ No newline at end of file diff --git a/api/app/abilityMissionInfo.d.ts b/api/app/abilityMissionInfo.d.ts index eb7d23cb39..0bb23da716 100644 --- a/api/app/abilityMissionInfo.d.ts +++ b/api/app/abilityMissionInfo.d.ts @@ -21,37 +21,37 @@ import { ElementName } from '../bundle/elementName'; * @SysCap SystemCapability.Appexecfwk * @import import AbilityMissionInfo from 'app/abilityMissionInfo' * @permission N/A - * @devices phone, tablet, tv, wearable + * @devices phone, tablet, tv, wearable, car */ export interface AbilityMissionInfo { - /** - * @default Unique identification of task stack information corresponding to ability - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ - missionId: number; + /** + * @default Unique identification of task stack information corresponding to ability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + missionId: number; - /** - * @default The component launched as the first ability in the task stack - * This can be considered the "application" of this task stack - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ - bottomAbility: ElementName; + /** + * @default The component launched as the first ability in the task stack + * This can be considered the "application" of this task stack + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + bottomAbility: ElementName; - /** - * @default The ability component at the top of the history stack of the task - * This is what the user is currently doing - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ - topAbility: ElementName; + /** + * @default The ability component at the top of the history stack of the task + * This is what the user is currently doing + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + topAbility: ElementName; - /** - * @default The corresponding ability description information in the task stack - * @since 7 - * @SysCap SystemCapability.Appexecfwk - */ - windowMode: number; + /** + * @default The corresponding ability description information in the task stack + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + windowMode: number; } diff --git a/api/app/activeProcessInfo.d.ts b/api/app/activeProcessInfo.d.ts index b2034d7b17..4ab5a6aa3d 100644 --- a/api/app/activeProcessInfo.d.ts +++ b/api/app/activeProcessInfo.d.ts @@ -19,7 +19,7 @@ * @SysCap SystemCapability.Appexecfwk * @import import app from 'app/activeProcessInfo' * @permission N/A - * @devices phone, tablet, tv, wearable + * @devices phone, tablet, tv, wearable, car */ export interface ActiveProcessInfo { /** diff --git a/api/app/context.d.ts b/api/app/context.d.ts index 6cd07ed04b..61a6d65f7a 100644 --- a/api/app/context.d.ts +++ b/api/app/context.d.ts @@ -14,19 +14,40 @@ */ import { AsyncCallback } from '../basic'; +import { ApplicationInfo } from '../bundle/applicationInfo'; +import { HapModuleInfo } from '../bundle/hapModuleInfo'; +import { ProcessInfo } from './processInfo'; +import { AppVersionInfo } from './appVersionInfo'; +import { DisplayOrientation } from '../@ohos.bundle'; +import { ElementName } from '../bundle/elementName'; +import { DisplayOrientation } from '../@ohos.bundle'; /** - * The context of anability or an application. It allows access to + * The context of an ability or an application. It allows access to * application-specific resources, request and verification permissions. * Can only be obtained through the ability. * * @since 6 * @SysCap SystemCapability.Appexecfwk - * @devices phone, tablet, tv, wearable + * @devices phone, tablet, tv, wearable, car * @import import abilityManager from 'app/context' * @permission N/A */ export interface Context { + + /** + * Get the local root dir of an app. If it is the first call, the dir + * will be created. + * @note If in the context of the ability, return the root dir of + * the ability; if in the context of the application, return the + * root dir of the application. + * @since 7 + * @sysCap SystemCapability.Appexecfwk + * @devices phone, tablet, tv, wearable, car + * @return the root dir + */ + getOrCreateLocalDir(): Promise; + getOrCreateLocalDir(callback: AsyncCallback): void; /** * Verify whether the specified permission is allowed for a particular * pid and uid running in the system. @@ -37,7 +58,7 @@ export interface Context { * it will check your own permission. * @since 7 * @sysCap SystemCapability.Appexecfwk - * @devices phone, tablet, tv, wearable + * @devices phone, tablet, tv, wearable, car * @return asynchronous callback with {@code 0} if the PID * and UID have the permission; callback with {@code -1} otherwise. */ @@ -51,11 +72,63 @@ export interface Context { * @param requestCode Indicates the request code to be passed to the PermissionRequestResult * @since 7 * @sysCap SystemCapability.Appexecfwk - * @devices phone, tablet, tv, wearable + * @devices phone, tablet, tv, wearable, car */ requestPermissionsFromUser(permissions: Array, requestCode: number, resultCallback: AsyncCallback): void; - requestPermissionsFromUser(permissions: Array, requestCode: number): Promise; + /** + * Obtains information about the current application. + * @since 7 + * @sysCap SystemCapability.Appexecfwk + * @devices phone, tablet, tv, wearable + */ + getApplicationInfo(callback: AsyncCallback): void + getApplicationInfo(): Promise; + + /** + * Obtains the bundle name of the current ability. + * @since 7 + * @sysCap SystemCapability.Appexecfwk + * @devices phone, tablet, tv, wearable + */ + getBundleName(callback: AsyncCallback): void + getBundleName(): Promise; + + /** + * Obtains information about the current process, including the process ID and name. + * @since 7 + * @sysCap SystemCapability.Appexecfwk + * @devices phone, tablet, tv, wearable + */ + getProcessInfo(callback: AsyncCallback): void + getProcessInfo(): Promise; + + /** + * Obtains the ohos.bundle.ElementName object of the current ability. This method is available only to Page abilities. + * @since 7 + * @sysCap SystemCapability.Appexecfwk + * @devices phone, tablet, tv, wearable + */ + getElementName(callback: AsyncCallback): void + getElementName(): Promise; + + /** + * Obtains the name of the current process. + * @since 7 + * @sysCap SystemCapability.Appexecfwk + * @devices phone, tablet, tv, wearable + */ + getProcessName(callback: AsyncCallback): void + getProcessName(): Promise; + + /** + * Obtains the bundle name of the ability that called the current ability. + * @since 7 + * @sysCap SystemCapability.Appexecfwk + * @devices phone, tablet, tv, wearable + */ + getCallingBundle(callback: AsyncCallback): void + getCallingBundle(): Promise; } /** @@ -63,7 +136,7 @@ export interface Context { * @since 7 * @SysCap SystemCapability.Appexecfwk * @permission N/A - * @devices phone, tablet, tv, wearable + * @devices phone, tablet, tv, wearable, car */ interface PermissionRequestResult { /** diff --git a/api/app/missionSnapshot.d.ts b/api/app/missionSnapshot.d.ts new file mode 100644 index 0000000000..01ae787ee8 --- /dev/null +++ b/api/app/missionSnapshot.d.ts @@ -0,0 +1,37 @@ +/* + * 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 { ElementName } from '../bundle/elementName'; +import { image } from '../@ohos.multimedia.image'; + +/** + * @name This class represents a mission snapshot. + * @since 7 + * @SysCap appexecfwk + * @import import MissionSnapshot from 'app/missionSnapshot' + * @devices phone, tablet + * @systemapi hide this for inner system use + */ +export interface MissionSnapshot { + /** + * @default The top ability in this mission snapshot + */ + topAbility: ElementName; + + /** + * @default The entity of snapshot + */ + snapshot: image.PixelMap; +} diff --git a/api/app/processInfo.d.ts b/api/app/processInfo.d.ts new file mode 100644 index 0000000000..b98ef59b9b --- /dev/null +++ b/api/app/processInfo.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 This class saves process information about an application + * @since 7 + * @SysCap appexecfwk + * @import import ProcessInfo from 'app/processInfo' + * @permission N/A + * @devices phone, tablet, tv, wearable + */ +export interface ProcessInfo { + /** + * The id of the current process + * + * @default - + * @devices phone, tablet, tv, wearable + * @since 7 + * @SysCap appexecfwk + */ + pid: number; + + /** + * The name of the current process + * + * @default - + * @devices phone, tablet, tv, wearable + * @since 7 + * @SysCap appexecfwk + */ + processName: string; +} \ No newline at end of file diff --git a/api/bundle/abilityInfo.d.ts b/api/bundle/abilityInfo.d.ts new file mode 100644 index 0000000000..7e6904ab2e --- /dev/null +++ b/api/bundle/abilityInfo.d.ts @@ -0,0 +1,244 @@ +/* + * 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 { CustomizeData } from './customizeData' +import bundle from './../@ohos.bundle'; + +/** + * @name Obtains configuration information about an ability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @permission NA + * @devices phone, tablet, tv, wearable, car + */ +export interface AbilityInfo { + /** + * @default Indicates the name of the bundle containing the ability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly bundleName: string; + + /** + * @default Ability simplified class name + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly name: string; + + /** + * @default Indicates the label of the ability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly label: string; + + /** + * @default Describes the ability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly description: string; + + /** + * @default Indicates the icon of the ability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly icon: string; + + /** + * @default Indicates the label id of the ability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly labelId: number; + + /** + * @default Indicates the description id of the ability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly descriptionId: number; + + /** + * @default Indicates the icon id of the ability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly iconId: number; + + /** + * @default Indicates the name of the .hap package to which the capability belongs + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly moduleName: string; + + /** + * @default Process of ability, if user do not set it ,the value equal application process + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly process: string; + + /** + * @default Info about which ability is this nick point to + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly targetAbility: string; + + /** + * @default Indicates the background service addressing a specific usage scenario + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly backgroundModes: number; + + /** + * @default Indicates whether an ability can be called by other abilities + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly isVisible: boolean; + + /** + * @default Indicates whether the ability provides the embedded card capability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly formEnabled: boolean; + + /** + * @default Enumerates types of templates that can be used by an ability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly type: bundle.AbilityType; + + /** + * @default Enumerates the subType of templates used by an ability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly subType: bundle.AbilitySubType; + + /** + * @default Enumerates ability display orientations + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly orientation: bundle.DisplayOrientation; + + /** + * @default Enumerates ability launch modes + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly launchMode: bundle.LaunchMode; + + /** + * @default The permissions that others need to launch this ability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly permissions: Array; + + /** + * @default The device types that this ability can run on + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly deviceTypes: Array; + + /** + * @default The device capability that this ability needs + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly deviceCapabilities: Array; + + /** + * @default Indicates the permission required for reading ability data + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly readPermission: string; + + /** + * @default Indicates the permission required for writing data to the ability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly writePermission: string; + + /** + * @default Obtains configuration information about an application + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly applicationInfo: ApplicationInfo; + + /** + * @default Where form can be displayed + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly formEntity: number; + + /** + * @default Minimum height of ability. + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly minFormHeight: number; + + /** + * @default Default height of ability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly defaultFormHeight: number; + + /** + * @default Minimum width of ability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly minFormWidth: number; + + /** + * @default Default width of ability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly defaultFormWidth: number; + + /** + * @default Uri of ability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly uri: string; + + /** + * @default Indicates the custom metadata of ability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + customizeData: Map>; +} diff --git a/api/bundle/applicationInfo.d.ts b/api/bundle/applicationInfo.d.ts new file mode 100644 index 0000000000..4820474ef8 --- /dev/null +++ b/api/bundle/applicationInfo.d.ts @@ -0,0 +1,138 @@ +/* + * 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'; +import { CustomizeData } from './customizeData' + +/** + * @name Obtains configuration information about an application + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @permission NA + * @devices phone, tablet, tv, wearable, car + */ +export interface ApplicationInfo { + /** + * @default Indicates the application name, which is the same as {@code bundleName} + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly name: string; + + /** + * @default Description of application + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly description: string; + + /** + * @default Indicates the description id of the application + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly descriptionId: number; + + /** + * @default Indicates whether the application is a system application + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly systemApp: boolean; + + /** + * @default Indicates whether or not this application may be instantiated + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly enabled: boolean; + + /** + * @default Indicates the label of the application + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly label: string; + + /** + * @default Indicates the label id of the application + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly labelId: string; + + /** + * @default Indicates the icon of the application + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly icon: string; + + /** + * @default Indicates the icon id of the application + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly iconId: string; + + /** + * @default Process of application, if user do not set it ,the value equal bundleName + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly process: string; + + /** + * @default Indicates the running mode supported by the application + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly supportedModes: number; + + /** + * @default Indicates the path storing the module resources of the application + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly moduleSourceDirs: Array; + + /** + * @default Indicates the permissions required for accessing the application. + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly permissions: Array; + + /** + * @default Indicates module information about an application + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly moduleInfo: Array; + + /** + * @default Indicates the path where the {@code Entry.hap} file of the application is saved + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly entryDir: string; + + /** + * @default Indicates the custom metadata of the application + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + customizeData: Map; +} \ No newline at end of file diff --git a/api/bundle/bundleInfo.d.ts b/api/bundle/bundleInfo.d.ts new file mode 100644 index 0000000000..6353eaef99 --- /dev/null +++ b/api/bundle/bundleInfo.d.ts @@ -0,0 +1,237 @@ +/* + * 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 The scene which is used + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @permission NA + * @devices phone, tablet, tv, wearable, car + */ +export interface UsedScene { + /** + * @default Indicates the abilities that need the permission + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + abilities: Array; + + /** + * @default Indicates the time when the permission is used + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + when: string; +} + +/** + * @name Indicates the required permissions details defined in file config.json + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @permission NA + * @devices phone, tablet, tv, wearable, car + */ +export interface ReqPermissionDetail { + /** + * @default Indicates the name of this required permissions + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + name: string; + + /** + * @default Indicates the reason of this required permissions + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + reason: string; + + /** + * @default Indicates the used scene of this required permissions + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + usedScene: UsedScene; +} + +/** + * @name Obtains configuration information about a bundle + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @permission NA + * @devices phone, tablet, tv, wearable, car + */ +export interface BundleInfo { + /** + * @default Indicates the name of this bundle + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly name: string; + + /** + * @default Indicates the name of this original bundle + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly type: string; + + /** + * @default Indicates the ID of the application to which this bundle belongs + * The application ID uniquely identifies an application. It is determined by the bundle name and signature + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly appId: string; + + /** + * @default Indicates the UID of the application to which this bundle belongs + * The UID uniquely identifies an application. It is determined by the process and user IDs of the application + * After an application is installed, its UID remains unchanged unless it is uninstalled and then reinstalled + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly uid: number; + + /** + * @default Indicates the hap install time + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly installTime: number; + + /** + * @default Indicates the hap update time + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly updateTime: number; + + /** + * @default Obtains configuration information about an application + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly appInfo: ApplicationInfo; + + /** + * @default Obtains configuration information about an ability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly abilityInfo: Array; + + /** + * @default Indicates the required permissions name defined in file config.json + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly reqPermissions: Array; + + /** + * @default Indicates the required permissions details defined in file config.json + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly reqPermissionDetails: Array; + + /** + * @default Describes the bundle vendor + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly vendor: string; + + /** + * @default Indicates the version number of the bundle + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly versionCode: number; + + /** + * @default Indicates the text description of the bundle version + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly versionName: string; + + /** + * @default Indicates the compatible version number of the bundle + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly compatibleVersion: number; + + /** + * @default Indicates the target version number of the bundle + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly targetVersion: number; + + /** + * @default Indicates is compress native libs + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly isCompressNativeLibs: boolean; + + /** + * @default Obtains configuration information about an module + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly hapModuleInfo: Array; + + /** + * @default Indicates entry module name + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly entryModuleName: string; + + /** + * @default Indicates the cpuAbi information of this bundle. + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly cpuAbi: string; + + /** + * @default Indicates is silent installation + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly isSilentInstallation: string; + + /** + * @default Indicates the earliest historical version compatible with the bundle + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly minCompatibleVersionCode: number; + + /** + * @default Indicates whether free installation of the entry is supported + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly entryInstallationFree: boolean; +} diff --git a/api/bundle/bundleInstaller.d.ts b/api/bundle/bundleInstaller.d.ts new file mode 100644 index 0000000000..5cdfc48f78 --- /dev/null +++ b/api/bundle/bundleInstaller.d.ts @@ -0,0 +1,107 @@ +/* + * 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 Provides parameters required for installing or uninstalling an application. + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @permission NA + * @devices phone, tablet, tv, wearable, car + */ +export interface InstallParam { + /** + * @default Indicates the user id + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + userId: number; + + /** + * @default Indicates the install flag + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + installFlag: number; + + /** + * @default Indicates whether the param has data + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + isKeepData: boolean; +} + +/** + * @name Indicates the install or uninstall status + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @permission NA + * @devices phone, tablet, tv, wearable, car + */ +export interface InstallStatus { + + /** + * @default Indicates the install or uninstall error code + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + status: bundle.InstallErrorCode; + + /** + * @default Indicates the install or uninstall result string message + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + statusMessage: string; +} + +/** + * @name Offers install, upgrade, and remove bundles on the devices. + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @permission NA + * @devices phone, tablet, tv, wearable, car + */ +export interface BundleInstaller { + /** + * Install an application in a HAP. + * + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @devices phone, tablet, tv, wearable, car + * @param bundleFilePaths Indicates the path where the bundle of the application is stored. The path should be the + * relative path to the data directory of the current application. + * @param installParam Indicates other parameters required for the installation. + * @return InstallStatus + * @permission ohos.permission.INSTALL_BUNDLE + */ + install(bundleFilePaths: Array, param: InstallParam, callback: AsyncCallback): void; + + /** + * Uninstall an application. + * + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @devices phone, tablet, tv, wearable, car + * @param bundleName Indicates the bundle name of the application to be uninstalled. + * @param installParam Indicates other parameters required for the uninstallation. + * @return InstallStatus + * @permission ohos.permission.INSTALL_BUNDLE + */ + uninstall(bundleName: string, param: InstallParam, callback: AsyncCallback): void; +} \ No newline at end of file diff --git a/api/bundle/customizeData.d.ts b/api/bundle/customizeData.d.ts new file mode 100644 index 0000000000..17393229f1 --- /dev/null +++ b/api/bundle/customizeData.d.ts @@ -0,0 +1,37 @@ +/* + * 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 custom metadata + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @permission NA + * @devices phone, tablet, tv, wearable, car + */ +export interface CustomizeData { + /** + * @default Indicates the custom metadata name + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + name: string; + + /** + * @default Indicates the custom metadata value + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + value: string; +} \ No newline at end of file diff --git a/api/bundle/elementName.d.ts b/api/bundle/elementName.d.ts new file mode 100644 index 0000000000..68fe8ddda3 --- /dev/null +++ b/api/bundle/elementName.d.ts @@ -0,0 +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 Contains basic Ability information, which uniquely identifies an ability + * @since 7 + * @sysCap SystemCapability.Appexecfwk + * @devices phone, tablet, tv, wearable, car + * @permission N/A + */ +export interface ElementName { + /** + * device id + * @default - + * @devices phone, tablet, tv, wearable, car + * @since 7 + * @sysCap SystemCapability.Appexecfwk + */ + deviceId?: string; + + /** + * bundle name + * @default - + * @devices phone, tablet, tv, wearable, car + * @since 7 + * @sysCap SystemCapability.Appexecfwk + */ + bundleName: string; + + /** + * ability name + * @default ability class name. + * @devices phone, tablet, tv, wearable, car + * @since 7 + * @sysCap SystemCapability.Appexecfwk + */ + abilityName: string; + + /** + * uri + * @default - + * @devices phone, tablet, tv, wearable, car + * @since 7 + * @sysCap SystemCapability.Appexecfwk + */ + uri?: string; + + /** + * shortName + * @default - + * @devices phone, tablet, tv, wearable, car + * @since 7 + * @sysCap SystemCapability.Appexecfwk + */ + shortName?: string; +} diff --git a/api/bundle/hapModuleInfo.d.ts b/api/bundle/hapModuleInfo.d.ts new file mode 100644 index 0000000000..a62a66955d --- /dev/null +++ b/api/bundle/hapModuleInfo.d.ts @@ -0,0 +1,116 @@ +/* + * 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 Obtains configuration information about an module. + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @permission NA + * @devices phone, tablet, tv, wearable, car + */ +export interface HapModuleInfo { + /** + * @default Indicates the name of this hapmodule + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly name: string; + /** + * @default Describes the hapmodule + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly description: string; + /** + * @default Indicates the description of this hapmodule + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly descriptionId: number; + /** + * @default Indicates the icon of this hapmodule + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly icon: string; + /** + * @default Indicates the label of this hapmodule + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly label: string; + /** + * @default Indicates the label id of this hapmodule + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly labelId: number; + /** + * @default Indicates the icon id of this hapmodule + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly iconId: number; + /** + * @default Indicates the background img of this hapmodule + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly backgroundImg: string; + /** + * @default Indicates the supported modes of this hapmodule + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly supportedModes: number; + /** + * @default Indicates the req capabilities of this hapmodule + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly reqCapabilities: Array; + /** + * @default The device types that this hapmodule can run on + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly deviceTypes: Array; + /** + * @default Obtains configuration information about ability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly abilityInfo: Array; + /** + * @default Indicates the name of the .hap package to which the capability belongs + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly moduleName: string; + /** + * @default Indicates the main ability name of this hapmodule + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly mainAbilityName: string; + /** + * @default Indicates whether free installation of the hapmodule is supported + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly installationFree: boolean; +} \ No newline at end of file diff --git a/api/bundle/moduleInfo.d.ts b/api/bundle/moduleInfo.d.ts new file mode 100644 index 0000000000..437ca90fa9 --- /dev/null +++ b/api/bundle/moduleInfo.d.ts @@ -0,0 +1,43 @@ +/* + * 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 Stores module information about an application. + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @permission NA + * @devices phone, tablet, tv, wearable, car + */ +export interface ModuleInfo { + /** + * The module name. + * + * @default Indicates the name of the .hap package to which the capability belongs + * @devices phone, tablet, tv, wearable, car + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly moduleName: string; + + /** + * The module source path. + * + * @default Indicates the module source dir of this module + * @devices phone, tablet, tv, wearable, car + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly moduleSourceDir: string; +} \ No newline at end of file diff --git a/api/bundle/moduleUsageRecord.d.ts b/api/bundle/moduleUsageRecord.d.ts new file mode 100644 index 0000000000..0bc3620102 --- /dev/null +++ b/api/bundle/moduleUsageRecord.d.ts @@ -0,0 +1,103 @@ +/* + * 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 Stores FA usage information. + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @permission NA + * @devices phone, tablet, tv, wearable, car + * @systemapi hide this for inner system use + */ +export interface ModuleUsageRecord { + /** + * @default Indicates the name of the bundle containing the module + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly bundleName: string; + /** + * @default Indicates the app label id of this module + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly appLabelId: number; + /** + * @default Indicates the name of this module + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly name: string; + /** + * @default Indicates the label id of this module + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly labelId: number; + /** + * @default Indicates the description id of this module + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly descriptionId: number; + /** + * @default Indicates the ability name of this module + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly abilityName: string; + /** + * @default Indicates the ability label id of this module + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly abilityLabelId: number; + /** + * @default Indicates the ability description id of this module + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly abilityDescriptionId: number; + /** + * @default Indicates the ability icon id of this module + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly abilityIconId: number; + /** + * @default Indicates the launched count of this module + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly launchedCount: number; + /** + * @default Indicates the last launch time of this module + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly lastLaunchTime: number; + /** + * @default Indicates whether the module is removed + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly isRemoved: boolean; + /** + * @default Indicates whether free installation of the module is supported + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly installationFreeSupported: boolean; +} \ No newline at end of file diff --git a/api/bundle/shortcutInfo.d.ts b/api/bundle/shortcutInfo.d.ts new file mode 100644 index 0000000000..0caaa90458 --- /dev/null +++ b/api/bundle/shortcutInfo.d.ts @@ -0,0 +1,107 @@ +/* + * 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 Provides methods for obtaining information about the ability that a shortcut will start, including the target + * bundle name and ability class name. + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @permission NA + * @devices phone, tablet, tv, wearable, car + */ +export interface ShortcutWant{ + /** + * @default Indicates the target bundle of the shortcut want + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly targetBundle: string; + /** + * @default Indicates the target class of the shortcut want + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly targetClass: string; +} + + /** + * @name Provides information about a shortcut, including the shortcut ID and label. + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @permission NA + * @devices phone, tablet, tv, wearable, car + */ +export interface ShortcutInfo { + /** + * @default Indicates the ID of the application to which this shortcut belongs + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly id: string; + /** + * @default Indicates the name of the bundle containing the shortcut + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly bundleName: string; + /** + * @default Indicates the host ability of the shortcut + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly hostAbility: string; + /** + * @default Indicates the icon of the shortcut + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly icon: string; + /** + * @default Indicates the label of the shortcut + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly label: string; + /** + * @default Indicates the disableMessage of the shortcut + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly disableMessage: string; + /** + * @default Indicates the wants of the shortcut + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly wants: Array; + /** + * @default Indicates whether the shortcut is static + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly isStatic?: boolean + /** + * @default Indicates whether the shortcut is homeshortcut + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly isHomeShortcut?: boolean; + /** + * @default Indicates whether the shortcut is enabled + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + readonly isEnabled?: boolean; +} \ No newline at end of file -- Gitee