From be7a9286ba5f26b6db5f784476b21029ae7fc8f3 Mon Sep 17 00:00:00 2001 From: zhaoyuan17 Date: Wed, 8 Sep 2021 10:45:09 +0800 Subject: [PATCH] update applicationFramework d.ts files Signed-off-by: zhaoyuan17 --- api/@ohos.ability.featureAbility.d.ts | 101 ++++++ ....ts => @ohos.ability.particleAbility.d.ts} | 95 ++--- api/@ohos.ability.wantConstant.d.ts | 341 ++++++++++++++++++ api/@ohos.app.abilityManager.d.ts | 90 +++++ api/@ohos.bundle_mgr.d.ts | 116 ------ ...ommonevent.d.ts => @ohos.commonEvent.d.ts} | 49 +-- api/@ohos.napi_ability_manager.d.ts | 189 ---------- api/@ohos.wantAgent.d.ts | 77 ++++ .../abilityResult.d.ts} | 48 +-- .../startAbilityParameter.d.ts} | 40 +- .../want.d.ts} | 176 +++++---- api/app/abilityMissionInfo.d.ts | 57 +++ api/app/abilityinfo.d.ts | 253 ------------- api/app/abilitymissioninfo.d.ts | 132 ------- ...rocessinfo.d.ts => activeProcessInfo.d.ts} | 54 ++- api/app/applicationinfo.d.ts | 246 ------------- api/app/bundleinfo.d.ts | 266 -------------- api/app/context.d.ts | 105 ++++++ api/app/installresult.d.ts | 35 -- api/app/want.d.ts | 81 ----- .../commonEventData.d.ts} | 21 +- .../commonEventPublishData.d.ts} | 29 +- .../commonEventSubscribeInfo.d.ts} | 25 +- .../commonEventSubscriber.d.ts} | 188 ++++++++-- .../wantAgentInfo.d.ts} | 25 +- 25 files changed, 1188 insertions(+), 1651 deletions(-) create mode 100644 api/@ohos.ability.featureAbility.d.ts rename api/{app/elementname.d.ts => @ohos.ability.particleAbility.d.ts} (46%) mode change 100755 => 100644 create mode 100644 api/@ohos.ability.wantConstant.d.ts create mode 100644 api/@ohos.app.abilityManager.d.ts delete mode 100755 api/@ohos.bundle_mgr.d.ts rename api/{@ohos.commonevent.d.ts => @ohos.commonEvent.d.ts} (97%) mode change 100755 => 100644 delete mode 100755 api/@ohos.napi_ability_manager.d.ts create mode 100644 api/@ohos.wantAgent.d.ts rename api/{app/moduleinfo.d.ts => ability/abilityResult.d.ts} (51%) mode change 100755 => 100644 rename api/{app/appprocessstate.ts => ability/startAbilityParameter.d.ts} (54%) mode change 100755 => 100644 rename api/{@ohos.feature_ability.d.ts => ability/want.d.ts} (36%) mode change 100755 => 100644 create mode 100644 api/app/abilityMissionInfo.d.ts delete mode 100755 api/app/abilityinfo.d.ts delete mode 100755 api/app/abilitymissioninfo.d.ts rename api/app/{processinfo.d.ts => activeProcessInfo.d.ts} (52%) mode change 100755 => 100644 delete mode 100755 api/app/applicationinfo.d.ts delete mode 100755 api/app/bundleinfo.d.ts create mode 100644 api/app/context.d.ts delete mode 100755 api/app/installresult.d.ts delete mode 100755 api/app/want.d.ts rename api/{commonevent/commoneventdata.d.ts => commonEvent/commonEventData.d.ts} (78%) mode change 100755 => 100644 rename api/{commonevent/commoneventpublishdata.d.ts => commonEvent/commonEventPublishData.d.ts} (78%) mode change 100755 => 100644 rename api/{commonevent/commoneventsubscribeinfo.d.ts => commonEvent/commonEventSubscribeInfo.d.ts} (81%) mode change 100755 => 100644 rename api/{commonevent/commoneventsubscriber.d.ts => commonEvent/commonEventSubscriber.d.ts} (32%) mode change 100755 => 100644 rename api/{app/common.d.ts => wantAgent/wantAgentInfo.d.ts} (57%) mode change 100755 => 100644 diff --git a/api/@ohos.ability.featureAbility.d.ts b/api/@ohos.ability.featureAbility.d.ts new file mode 100644 index 0000000000..062abd922a --- /dev/null +++ b/api/@ohos.ability.featureAbility.d.ts @@ -0,0 +1,101 @@ +/* + * 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 { Want } from './ability/want'; +import { StartAbilityParameter } from './ability/startAbilityParameter'; +import { AbilityResult } from './ability/abilityResult'; +import { Context } from './app/context'; + +/** + * A Feature Ability represents an ability with a UI and is designed to interact with users. + * @name featureAbility + * @since 6 + * @sysCap AAFwk + * @devices phone, tablet + * @permission N/A + */ +declare namespace featureAbility { + /** + * Obtain the want sended from the source ability. + * @devices phone, tablet + * @since 6 + * @sysCap AAFwk + * @param parameter Indicates the ability to start. + * @return - + */ + function getWant(callback: AsyncCallback): void; + function getWant(): Promise; + + /** + * Starts a new ability. + * @devices phone, tablet + * @since 6 + * @sysCap AAFwk + * @param parameter Indicates the ability to start. + * @return - + */ + function startAbility(parameter: StartAbilityParameter, callback: AsyncCallback): void; + function startAbility(parameter: StartAbilityParameter): Promise; + + /** + * Obtains the application context. + * + * @return Returns the application context. + * @since 6 + */ + function getContext(): Context; + + /** + * 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 - + */ + function startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback): void; + function startAbilityForResult(parameter: StartAbilityParameter): Promise; + + /** + * 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 + * @param parameter Indicates the result to return. + * @return - + */ + function terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback): void; + function terminateSelfWithResult(parameter: AbilityResult): Promise; + + /** + * Destroys this Page ability. + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + * @return - + */ + function terminateSelf(callback: AsyncCallback): void; + + /** + * Checks whether the main window of this ability has window focus. + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + */ + function hasWindowFocus(callback: AsyncCallback): void; + function hasWindowFocus(): Promise; +} +export default featureAbility; \ No newline at end of file diff --git a/api/app/elementname.d.ts b/api/@ohos.ability.particleAbility.d.ts old mode 100755 new mode 100644 similarity index 46% rename from api/app/elementname.d.ts rename to api/@ohos.ability.particleAbility.d.ts index e0da17167a..fda9282af1 --- a/api/app/elementname.d.ts +++ b/api/@ohos.ability.particleAbility.d.ts @@ -1,55 +1,40 @@ -/* - * 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 - * @testapi - **/ -export interface ElementName { - - /** - * device id - * @default - - * @devices phone, tablet - * @since 6 - * @sysCap AAFwk - */ - deviceId: string; - - /** - * bundle name - * @default - - * @devices phone, tablet - * @since 6 - * @sysCap AAFwk - */ - bundleName: string; - - /** - * ability name - * @default - - * @devices phone, tablet - * @since 6 - * @sysCap AAFwk - */ - abilityName: 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 { AsyncCallback } from './basic'; +import { StartAbilityParameter } from './ability/startAbilityParameter'; + +/** + * A Particle Ability represents an ability with service. + * @name particleAbility + * @since 7 + * @sysCap AAFwk + * @devices phone, tablet + * @permission N/A + */ +declare namespace particleAbility { + + /** + * Service ability uses this method to start a specific ability. + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + * @param parameter Indicates the ability to start. + * @return - + */ + function startAbility(parameter: StartAbilityParameter, callback: AsyncCallback): void; + function startAbility(parameter: StartAbilityParameter): Promise; + +} +export default particleAbility; diff --git a/api/@ohos.ability.wantConstant.d.ts b/api/@ohos.ability.wantConstant.d.ts new file mode 100644 index 0000000000..edae0e993c --- /dev/null +++ b/api/@ohos.ability.wantConstant.d.ts @@ -0,0 +1,341 @@ +/* + * 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. + */ + +/** + * the constant for action and entity in the want + * @name wantConstant + * @since 6 + * @sysCap aafwk + * @devices phone, tablet + * @permission N/A + */ +declare namespace wantConstant { + /** + * the constant for action of the want + * @name Action + * @since 6 + * @sysCap aafwk + * @devices phone, tablet + * @permission N/A + */ + export enum Action { + /** + * Indicates the action of backing home. + * + * @since 1 + */ + ACTION_HOME = "ohos.want.action.home", + + /** + * Indicates the action of starting a Page ability that displays a keypad. + * + * @since 6 + */ + ACTION_DIAL = "ohos.want.action.dial", + + /** + * Indicates the action of starting a Page ability for search. + * + * @since 6 + */ + ACTION_SEARCH = "ohos.want.action.search", + + /** + * Indicates the action of starting a Page ability that provides wireless network settings, for example, + * Wi-Fi options. + * + * @since 6 + */ + ACTION_WIRELESS_SETTINGS = "ohos.settings.wireless", + + /** + * Indicates the action of starting a Page ability that manages installed applications. + * + * @since 6 + */ + ACTION_MANAGE_APPLICATIONS_SETTINGS = "ohos.settings.manage.applications", + + /** + * Indicates the action of starting a Page ability that displays details of a specified application. + * + *

You must specify the application bundle name in the {@code package} attribute of the {@code Intent} + * containing this action. + * + * @since 6 + */ + ACTION_APPLICATION_DETAILS_SETTINGS = "ohos.settings.application.details", + + /** + * Indicates the action of starting a Page ability for setting an alarm clock. + * + * @since 6 + */ + ACTION_SET_ALARM = "ohos.want.action.setAlarm", + + /** + * Indicates the action of starting a Page ability that displays all alarm + * clocks. + * + * @since 6 + */ + ACTION_SHOW_ALARMS = "ohos.want.action.showAlarms", + + /** + * Indicates the action of starting a Page ability for snoozing an alarm clock. + * + * @since 6 + */ + ACTION_SNOOZE_ALARM = "ohos.want.action.snoozeAlarm", + + /** + * Indicates the action of starting a Page ability for deleting an alarm clock. + * + * @since 6 + */ + ACTION_DISMISS_ALARM = "ohos.want.action.dismissAlarm", + + /** + * Indicates the action of starting a Page ability for dismissing a timer. + * + * @since 6 + */ + ACTION_DISMISS_TIMER = "ohos.want.action.dismissTimer", + + /** + * Indicates the action of starting a Page ability for sending a sms. + * + * @since 6 + */ + ACTION_SEND_SMS = "ohos.want.action.sendSms", + + /** + * Indicates the action of starting a Page ability for opening contacts or pictures. + * + * @since 6 + */ + ACTION_CHOOSE = "ohos.want.action.choose", + + /** + * Indicates the action of showing the application selection dialog box. + * + * @since 6 + */ + ACTION_SELECT = "ohos.want.action.select", + + /** + * Indicates the action of sending a single data record. + * + * @since 6 + */ + ACTION_SEND_DATA = "ohos.want.action.sendData", + + /** + * Indicates the action of sending multiple data records. + * + * @since 6 + */ + ACTION_SEND_MULTIPLE_DATA = "ohos.want.action.sendMultipleData", + + /** + * Indicates the action of requesting the media scanner to scan files and adding the files to the media library. + * + * @since 6 + */ + ACTION_SCAN_MEDIA_FILE = "ohos.want.action.scanMediaFile", + + /** + * Indicates the action of viewing data. + * + * @since 6 + */ + ACTION_VIEW_DATA = "ohos.want.action.viewData", + + /** + * Indicates the action of editing data. + * + * @since 6 + */ + ACTION_EDIT_DATA = "ohos.want.action.editData", + + /** + * Indicates the choices you will show with {@link #ACTION_PICKER}. + * + * @since 6 + */ + INTENT_PARAMS_INTENT = "ability.want.params.INTENT", + + /** + * Indicates the CharSequence dialog title when used with a {@link #ACTION_PICKER}. + * + * @since 6 + */ + INTENT_PARAMS_TITLE = "ability.want.params.TITLE", + + /** + * Indicates the action of select file. + * + * @since 7 + */ + ACTION_FILE_SELECT = "ohos.action.fileSelect", + + /** + * Indicates the URI holding a stream of data associated with the Intent when used with a {@link #ACTION_SEND_DATA}. + * + * @since 7 + */ + PARAMS_STREAM = "ability.params.stream", + } + + /** + * the constant for Entity of the want + * @name Action + * @since 6 + * @sysCap aafwk + * @devices phone, tablet + * @permission N/A + */ + export enum Entity { + /** + * Indicates the default entity, which is used if the entity is not specified. + * + * @since 6 + */ + ENTITY_DEFAULT = "entity.system.default", + + /** + * Indicates the home screen entity. + * + * @since 6 + */ + ENTITY_HOME = "entity.system.home", + + /** + * Indicates the voice interaction entity. + * + * @since 6 + */ + ENTITY_VOICE = "entity.system.voice", + + /** + * Indicates the browser category. + * + * @since 6 + */ + ENTITY_BROWSABLE = "entity.system.browsable", + + /** + * Indicates the video category. + */ + ENTITY_VIDEO = "entity.system.video" + } + + export enum Flags { + /** + * Indicates the grant to perform read operations on the URI. + * + * @hide + */ + FLAG_AUTH_READ_URI_PERMISSION = 0x00000001, + + /** + * Indicates the grant to perform write operations on the URI. + * + * @hide + */ + FLAG_AUTH_WRITE_URI_PERMISSION = 0x00000002, + + /** + * Returns the result to the source ability. + */ + FLAG_ABILITY_FORWARD_RESULT = 0x00000004, + + /** + * Determines whether an ability on the local device can be migrated to a remote device. + */ + FLAG_ABILITY_CONTINUATION = 0x00000008, + + /** + * Specifies whether a component does not belong to OHOS. + */ + FLAG_NOT_OHOS_COMPONENT = 0x00000010, + + /** + * Specifies whether an ability is started. + */ + FLAG_ABILITY_FORM_ENABLED = 0x00000020, + + /** + * Indicates the grant for possible persisting on the URI. + * + * @hide + */ + FLAG_AUTH_PERSISTABLE_URI_PERMISSION = 0x00000040, + + /** + * Returns the result to the source ability slice. + * + * @hide + */ + FLAG_AUTH_PREFIX_URI_PERMISSION = 0x00000080, + + /** + * Supports multi-device startup in the distributed scheduling system. + */ + FLAG_ABILITYSLICE_MULTI_DEVICE = 0x00000100, + + /** + * Indicates that an ability using the Service template is started regardless of whether the host application has + * been started. + */ + FLAG_START_FOREGROUND_ABILITY = 0x00000200, + + /** + * Indicates the continuation is reversible. + * + * @hide + */ + FLAG_ABILITY_CONTINUATION_REVERSIBLE = 0x00000400, + + /** + * Install the specified ability if it's not installed. + */ + FLAG_INSTALL_ON_DEMAND = 0x00000800, + + /** + * Install the specifiedi ability with background mode if it's not installed. + */ + FLAG_INSTALL_WITH_BACKGROUND_MODE = 0x80000000, + + /** + * Indicates the operation of clearing other missions. This flag can be set for the {@code Intent} passed to + * {@link ohos.app.Context#startAbility} and must be used together with {@link FLAG_ABILITY_NEW_MISSION}. + */ + FLAG_ABILITY_CLEAR_MISSION = 0x00008000, + + /** + * Indicates the operation of creating a task on the historical mission stack. + */ + FLAG_ABILITY_NEW_MISSION = 0x10000000, + + /** + * Indicates that the existing instance of the ability to start will be reused if it is already at the top of + * the mission stack. Otherwise, a new ability instance will be created. + * + */ + FLAG_ABILITY_MISSION_TOP = 0x20000000 + } +} + +export default wantConstant; \ No newline at end of file diff --git a/api/@ohos.app.abilityManager.d.ts b/api/@ohos.app.abilityManager.d.ts new file mode 100644 index 0000000000..f9393afbaf --- /dev/null +++ b/api/@ohos.app.abilityManager.d.ts @@ -0,0 +1,90 @@ +/* + * 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 { AbilityMissionInfo } from './app/abilityMissionInfo'; +import { ActiveProcessInfo } from './app/activeProcessInfo'; + +/** + * This module provides the capability to manage abilities and obtaining system task information. + * + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @devices phone, tablet, tv, wearable + * @import import abilityManager from '@ohos.app.abilityManager' + * @permission N/A + */ +declare namespace abilityManager { + + enum ProcessErrCode { + NO_ERROR = 0, + CRASHED, + NO_RESPONSE, + } + + + /** + * Get information about running processes + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @devices phone, tablet, tv, wearable + * @return a list of ActiveProcessInfo records describing each process. + * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION + * @systemapi hide this for inner system use + */ + function getActiveProcessInfos(): Promise>; + function getActiveProcessInfos(callback: AsyncCallback>): void; + + /** + * Get information about the running ability missions + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @devices phone, tablet, tv, wearable + * @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; + + /** + * Get information about recently run missions + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @devices phone, tablet, tv, wearable + * @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 + * @systemapi hide this for inner system use + */ + function getPreviousAbilityMissionInfos(upperLimit: number): Promise>; + function getPreviousAbilityMissionInfos(upperLimit: number, callback: AsyncCallback>): void; + + /** + * Delete the specified missions + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @devices phone, tablet, tv, wearable + * @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_mgr.d.ts b/api/@ohos.bundle_mgr.d.ts deleted file mode 100755 index b3dfe740e8..0000000000 --- a/api/@ohos.bundle_mgr.d.ts +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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 './app/applicationinfo'; -import { Want } from './app/want'; -import { AbilityInfo } from './app/abilityinfo'; -import { BundleInfo } from './app/bundleinfo'; -import { InstallResult } from './app/installresult'; - -/** - * @name BundleMgr - * @since 6 - * @SysCap appexecfwk - * @import NA - * @permission NA - * @devices phone - * @testapi - */ -declare namespace bundleMgr { - /** - * Obtains the ApplicationInfo based on a given application name. - * - * @devices phone - * @since 6 - * @SysCap appexecfwk - * @param appName Indicates the application name. - * @return ApplicationInfo. - * @testapi - */ - function getApplicationInfo(appName: string): Promise; - - /** - * Obtains BundleInfo of all bundles available in the system. - * - * @devices phone - * @since 6 - * @SysCap appexecfwk - * @param NA - * @return Array of BundleInfo. - * @testapi - */ - function getBundleInfos(): Promise>; - - /** - * Obtains BundleInfo based on a given bundle name. - * - * @devices phone - * @since 6 - * @SysCap appexecfwk - * @param bundleName Indicates the bundle name. - * @return BundleInfo. - * @testapi - */ - function getBundleInfo(bundleName: string): Promise; - - /** - * Obtains information about all installed applications. - * - * @devices phone - * @since 6 - * @SysCap appexecfwk - * @param NA - * @return Array of ApplicationInfo. - * @testapi - */ - function getApplicationInfos(): Promise>; - - /** - * Query the AbilityInfo by the given Want. - * - * @devices phone - * @since 6 - * @SysCap appexecfwk - * @param want Indicates the Want for the ability to be queried. - * @return AbilityInfo. - * @testapi - */ - function queryAbilityInfo(want: Want): Promise; - - /** - * Install an application in a HAP. - * - * @devices phone - * @since 6 - * @SysCap appexecfwk - * @param hapFilePath Indicates the path of the HAP. - * @return InstallResult - * @testapi - */ - function install(hapFilePath: string): Promise; - - /** - * Uninstall an application. - * - * @devices phone - * @since 6 - * @SysCap appexecfwk - * @param hapFilePath Indicates the path of the HAP. - * @return InstallResult - * @testapi - */ - function uninstall(bundleName: string): Promise; -} -export default bundleMgr; diff --git a/api/@ohos.commonevent.d.ts b/api/@ohos.commonEvent.d.ts old mode 100755 new mode 100644 similarity index 97% rename from api/@ohos.commonevent.d.ts rename to api/@ohos.commonEvent.d.ts index 53027cf967..cff53acc23 --- a/api/@ohos.commonevent.d.ts +++ b/api/@ohos.commonEvent.d.ts @@ -13,43 +13,35 @@ * limitations under the License. */ import { AsyncCallback } from './basic'; -import { CommonEventData } from './commonevent/commoneventdata'; -import { CommonEventSubscriber } from './commonevent/commoneventsubscriber'; -import { CommonEventSubscribeInfo } from './commonevent/commoneventsubscribeinfo'; -import { CommonEventPublishData } from './commonevent/commoneventpublishdata'; +import { CommonEventData } from './commonEvent/commonEventData'; +import { CommonEventSubscriber } from './commonEvent/commonEventSubscriber' +import { CommonEventSubscribeInfo } from './commonEvent/commonEventSubscribeInfo'; +import { CommonEventPublishData } from './commonEvent/commonEventPublishData'; /** * the defination for commonevent * @name commonEvent - * @since 6 - * @sysCap ces - * @devices phone, tablet + * @since 7 * @permission N/A */ declare namespace commonEvent { /** * Publishes an ordered, sticky, or standard common event. * - * @devices phone - * @since 6 - * @SysCap ces + * @since 7 * @param data Indicate the CommonEventPublishData containing the common event content and attributes. * @param callback Specified callback method. * @return - - * @testapi */ function publish(event: string, callback: AsyncCallback): void; /** * Publishes an ordered, sticky, or standard common event. * - * @devices phone - * @since 6 - * @SysCap ces + * @since 7 * @param data Indicate the CommonEventPublishData containing the common event content and attributes. * @param callback Specified callback method. * @return - - * @testapi */ function publish(event: string, options: CommonEventPublishData, callback: AsyncCallback): void; @@ -57,63 +49,48 @@ declare namespace commonEvent { /** * create the CommonEventSubscriber for the SubscriberInfo. * - * @devices phone - * @since 6 - * @SysCap ces + * @since 7 * @param subscribeInfo Indicate the information of the subscriber. * @param callback Specified callback method. * @return - - * @testapi */ function createSubscriber(subscribeInfo: CommonEventSubscribeInfo, callback: AsyncCallback): void; /** * create the CommonEventSubscriber for the SubscriberInfo. * - * @devices phone - * @since 6 - * @SysCap ces + * @since 7 * @param subscribeInfo Indicate the information of the subscriber. * @param callback Specified callback method. * @return - - * @testapi */ function createSubscriber(subscribeInfo: CommonEventSubscribeInfo): Promise; /** * subscribe an ordered, sticky, or standard common event. * - * @devices phone - * @since 6 - * @SysCap ces + * @since 7 * @param subscriber Indicate the subscriber of the common event. * @param callback Specified callback method. * @return - - * @testapi */ function subscribe(subscriber: CommonEventSubscriber, callback: AsyncCallback): void; /** * unsubscribe an ordered, sticky, or standard common event. * - * @devices phone - * @since 6 - * @SysCap ces + * @since 7 * @param subscriber Indicate the subscriber of the common event. * @param callback Specified callback method. * @return - - * @testapi */ function unsubscribe(subscriber: CommonEventSubscriber, callback?: AsyncCallback): void; /** * the event type that the commonEvent supported * @name Support - * @since 6 - * @sysCap ces - * @devices phone + * @since 7 * @permission N/A - * @testapi */ export enum Support { /** @@ -966,7 +943,7 @@ declare namespace commonEvent { /** * Only for test case. */ - COMMON_EVENT_TEST_ACTION2 = "usual.event.test2", + COMMON_EVENT_TEST_ACTION2 = "usual.event.test2" } } diff --git a/api/@ohos.napi_ability_manager.d.ts b/api/@ohos.napi_ability_manager.d.ts deleted file mode 100755 index d4f8d8a546..0000000000 --- a/api/@ohos.napi_ability_manager.d.ts +++ /dev/null @@ -1,189 +0,0 @@ -/* - * 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 { AbilityMissionInfo } from './app/abilitymissioninfo'; -import { ProcessInfo } from './app/processinfo'; -import { AsyncCallback } from './app/common'; -import { AppProcessState as _AppProcessState } from './app/appprocessstate'; - -declare namespace abilityManager { - export import AppProcessState = _AppProcessState; - /** - * Obtains information about application processes that are running on the device. - * - * @default - - * @devices phone - * @since 6 - * @SysCap appexecfwk - * @returns Returns a list of running processes. - * @testapi - */ - function getAllRunningProcesses(): Promise>; - - /** - * Obtains information about the application process running on the device through callback. - * - * @default - - * @devices phone - * @since 6 - * @SysCap appexecfwk - * @param callback Specified callback method. - * @testapi - */ - function getAllRunningProcesses( - callback: AsyncCallback>, - ): void; - - /** - * Queries information about the running Ability Mission. - * - * @default - - * @devices phone - * @since 6 - * @SysCap appexecfwk - * @returns Returns the AbilityMissionInfos. - * @testapi - */ - function queryRunningAbilityMissionInfos(): Promise< - Array - >; - - /** - * Queries information about the running Ability Mission through callback. - * - * @default - - * @devices phone - * @since 6 - * @SysCap appexecfwk - * @param callback Specified callback method. - * @testapi - */ - function queryRunningAbilityMissionInfos( - callback: AsyncCallback>, - ): void; - - /** - * Queries information about the recent Ability Mission. - * - * @default - - * @devices phone - * @since 6 - * @SysCap appexecfwk - * @returns Returns the AbilityMissionInfos. - * @testapi - */ - function queryRecentAbilityMissionInfos(): Promise>; - - /** - * Queries information about the recent Ability Mission. - * - * @default - - * @devices phone - * @since 6 - * @SysCap appexecfwk - * @param callback Specified callback method. - * @testapi - */ - function queryRecentAbilityMissionInfos( - callback: AsyncCallback>, - ): void; - - /** - * Specifies that the task associated with the given task ID is removed from the stack. - * - * @default - - * @devices phone - * @since 6 - * @SysCap appexecfwk - * @param missionId Indicates the mission ID - * @returns Returns 0 for success, return non-0 for failure. - * @testapi - */ - function removeMission(missionId: number): Promise; - - /** - * Specifies that the task associated with the given task ID is removed from the stack through callback. - * - * @default - - * @devices phone - * @since 6 - * @SysCap appexecfwk - * @param missionId Indicates the mission ID - * @param callback Specified callback method - * @testapi - */ - function removeMission( - missionId: number, - callback: AsyncCallback, - ): void; - - /** - * Removes the specified mission stack by stack ID. - * - * @default - - * @devices phone - * @since 6 - * @SysCap appexecfwk - * @param stackId Indicates the stack ID - * @returns Returns 0 for success, return non-0 for failure. - * @testapi - */ - function removeStack(stackId: number): Promise; - - /** - * Removes the specified mission stack by stack ID. - * - * @default - - * @devices phone - * @since 6 - * @SysCap appexecfwk - * @param stackId Indicates the stack ID - * @param callback Specified callback method. - * @testapi - */ - function removeStack(stackId: number, callback: AsyncCallback): void; - - /** - * Ask that the mission associated with a given mission ID be moved to the - * front of the stack. - * - * @default - - * @devices phone - * @since 6 - * @SysCap appexecfwk - * @param missionId Indicates the mission ID - * @returns Returns 0 for success, return non-0 for failure. - * @testapi - */ - function moveMissionToTop(missionId: number): Promise; - - /** - * Ask that the mission associated with a given mission ID be moved to the - * front of the stack. - * - * @default - - * @devices phone - * @since 6 - * @SysCap appexecfwk - * @param missionId Indicates the mission ID - * @param callback Specified callback method. - * @testapi - */ - function moveMissionToTop( - missionId: number, - callback: AsyncCallback, - ): void; -} -export default abilityManager; diff --git a/api/@ohos.wantAgent.d.ts b/api/@ohos.wantAgent.d.ts new file mode 100644 index 0000000000..383a2ea493 --- /dev/null +++ b/api/@ohos.wantAgent.d.ts @@ -0,0 +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 { AsyncCallback , Callback} from './basic'; +import { Want } from './ability/want'; +import { WantAgentInfo } from './wantAgent/wantAgentInfo'; + +/** + * Provide the method obtain trigger, cancel, and compare and to obtain + * the bundle name, UID of an {@link WantAgent} object. + * + * @name wantAgent + * @since 7 + * @devices phone, tablet + * @permission N/A + */ +declare namespace wantAgent { + /** + * Obtains an {@link WantAgent} object. + * + * @param info Indicates the {@link WantAgentInfo} object that contains parameters of the + * {@link WantAgent} object to create. + * @return Returns the created {@link WantAgent} object. + * + * @since 7 + */ + function getWantAgent(info: WantAgentInfo, callback: AsyncCallback): void; + function getWantAgent(info: WantAgentInfo): Promise; + + /** + * Enumerates flags for using an {@link WantAgent}. + * + * @since 7 + */ + export enum WantAgentFlags { + ONE_TIME_FLAG = 0, + NO_BUILD_FLAG, + CANCEL_PRESENT_FLAG, + UPDATE_PRESENT_FLAG, + CONSTANT_FLAG, + REPLACE_ELEMENT, + REPLACE_ACTION, + REPLACE_URI, + REPLACE_ENTITIES, + REPLACE_BUNDLE + } + + /** + * Identifies the operation for using an {@link WantAgent}, such as starting an ability or sending a common event. + * + * @since 7 + */ + export enum OperationType { + UNKNOWN_TYPE = 0, + START_ABILITY, + START_ABILITIES, + START_SERVICE, + SEND_COMMON_EVENT, + START_FOREGROUND_SERVICE + } +} + +export type WantAgent = object; + +export default wantAgent; \ No newline at end of file diff --git a/api/app/moduleinfo.d.ts b/api/ability/abilityResult.d.ts old mode 100755 new mode 100644 similarity index 51% rename from api/app/moduleinfo.d.ts rename to api/ability/abilityResult.d.ts index 9c6c608b3d..834f9b505d --- a/api/app/moduleinfo.d.ts +++ b/api/ability/abilityResult.d.ts @@ -12,34 +12,26 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { Want } from './want'; -/** - * @name ModuleInfo - * @since 6 - * @SysCap appexecfwk - * @import NA - * @permission NA - * @devices phone - * @testapi - */ -export interface ModuleInfo { - /** - * The module name. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - moduleName: string; +export interface AbilityResult { + /** + * Indicates the result code returned after the ability is destroyed. You can define the result + * code to identify an error. + * @default - + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + */ + resultCode: number; - /** - * The module source path. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - moduleSourceDir: string; + /** + * Indicates the data returned after the ability is destroyed. You can define the data returned. + * This parameter can be null. + * @default - + * @devices phone, tablet + * @since 7 + * @sysCap AAFwk + */ + want?: Want; } \ No newline at end of file diff --git a/api/app/appprocessstate.ts b/api/ability/startAbilityParameter.d.ts old mode 100755 new mode 100644 similarity index 54% rename from api/app/appprocessstate.ts rename to api/ability/startAbilityParameter.d.ts index 8fa104c9b8..9d99dcb38d --- a/api/app/appprocessstate.ts +++ b/api/ability/startAbilityParameter.d.ts @@ -12,23 +12,27 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +import { Want } from './want'; + +export interface StartAbilityParameter { + /** + * Indicates the Want containing information about the target ability to start. + * + * @default - + * @devices phone, tablet + * @since 3 + * @SysCap aafwk + */ + want: Want; + + /** + * Indicates the special start setting used in starting ability. + * + * @default - + * @devices phone, tablet + * @since 3 + * @SysCap aafwk + */ + abilityStartSetting?: {[key: string]: any}; -/** - * @name AppProcessState - * @since 6 - * @SysCap appexecfwk - * @import NA - * @permission NA - * @devices phone - * @testapi - */ -export enum AppProcessState { - APP_STATE_BEGIN = 0, - APP_STATE_CREATE = APP_STATE_BEGIN, - APP_STATE_READY, - APP_STATE_FOREGROUND, - APP_STATE_BACKGROUND, - APP_STATE_SUSPENDED, - APP_STATE_TERMINATED, - APP_STATE_END, } \ No newline at end of file diff --git a/api/@ohos.feature_ability.d.ts b/api/ability/want.d.ts old mode 100755 new mode 100644 similarity index 36% rename from api/@ohos.feature_ability.d.ts rename to api/ability/want.d.ts index 38b5a4d604..af2183ded2 --- a/api/@ohos.feature_ability.d.ts +++ b/api/ability/want.d.ts @@ -1,71 +1,105 @@ -/* - * 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 './app/common'; - -declare namespace featureAbility { - /** - * Destroys the current ability. - * @devices phone - * @since 6 - * @sysCap AAFwk - * @param - - * @return - - * @testapi - */ - function terminateAbility(callback: AsyncCallback): void; - - /** - * Destroys the current ability. - * @devices phone - * @since 6 - * @sysCap AAFwk - * @param - - * @return - - * @testapi - */ - function terminateAbility(): Promise; - - /** - * Starts a new ability. - * @devices phone - * @since 6 - * @sysCap AAFwk - * @param param Indicates the ability to start. - * @return - - * @testapi - */ - function startAbility( - param: StartAbilityParameter, - callback: AsyncCallback, - ): void; - - /** - * Starts a new ability. - * @devices phone - * @since 6 - * @sysCap AAFwk - * @param param Indicates the ability to start. - * @return - - * @testapi - */ - function startAbility(param: StartAbilityParameter): Promise; - - export interface StartAbilityParameter { - want: object; - abilityStartSetting?: object; - } -} -export default featureAbility; +/* + * 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. + */ + +/** + * Want is the basic communication component of the system. + * @name Want + * @since 6 + * @sysCap AAFwk + * @devices phone, tablet + * @permission N/A + */ +export declare interface Want { + /** + * device id + * @default - + * @devices phone, tablet + * @since 6 + * @sysCap AAFwk + */ + deviceId?: string; + + /** + * bundle name + * @default - + * @devices phone, tablet + * @since 6 + * @sysCap AAFwk + */ + bundleName?: string; + + /** + * ability name + * @default - + * @devices phone, tablet + * @since 6 + * @sysCap AAFwk + */ + abilityName?: string; + + /** + * The description of a URI in a Want. + * @devices phone, tablet + * @since 6 + * @sysCap AAFwk + * @default - + */ + uri?: string; + + /** + * The description of the type in this Want. + * @devices phone, tablet + * @since 6 + * @sysCap AAFwk + * @default - + */ + type?: string; + + /** + * The options of the flags in this Want. + * @devices phone, tablet + * @since 6 + * @sysCap AAFwk + * @default - + */ + flags?: number; + + /** + * The description of an action in an want. + * @devices phone, tablet + * @since 6 + * @sysCap AAFwk + * @default - + */ + action?: string; + + /** + * The description of the WantParams object in an Want + * @devices phone, tablet + * @since 6 + * @sysCap AAFwk + * @default - + */ + parameters?: {[key: string]: any}; + + /** + * The description of a entities in a Want. + * @devices phone, tablet + * @since 6 + * @sysCap AAFwk + * @default - + */ + entities?: Array; +} \ No newline at end of file diff --git a/api/app/abilityMissionInfo.d.ts b/api/app/abilityMissionInfo.d.ts new file mode 100644 index 0000000000..eb7d23cb39 --- /dev/null +++ b/api/app/abilityMissionInfo.d.ts @@ -0,0 +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 { ElementName } from '../bundle/elementName'; + +/** + * @name Mission information corresponding to ability + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @import import AbilityMissionInfo from 'app/abilityMissionInfo' + * @permission N/A + * @devices phone, tablet, tv, wearable + */ +export interface AbilityMissionInfo { + /** + * @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 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; +} + diff --git a/api/app/abilityinfo.d.ts b/api/app/abilityinfo.d.ts deleted file mode 100755 index 5a6cde1249..0000000000 --- a/api/app/abilityinfo.d.ts +++ /dev/null @@ -1,253 +0,0 @@ -/* - * 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" - -/** - * @name AbilityInfo - * @since 6 - * @SysCap appexecfwk - * @import NA - * @permission NA - * @devices phone - * @testapi - */ -export interface AbilityInfo { - /** - * The ability name, only the main class name. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - name: string; - - /** - * The label of this ability. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - label: string; - - /** - * The description of this ability. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - description: string; - - /** - * The path of the icon of this ability. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - iconPath: string; - - /** - * Whether the ability can be invoked by other applications. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - visible: boolean; - - /** - * The ability category: page, service, data. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - kind: string; - - /** - * The type of this ability, 0 means UNKNOWN, 1 means PAGE, 2 means SERVICE, 3 means DATA. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - type: number; - - /** - * The display orientation of this ability: 0 means UNSPECIFIED, 1 means LANDSCAPE, 2 means PORTRAIT, 3 means FOLLOWRECENT. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - orientation: number; - - /** - * The launch mode of this ability: 0 means SINGLETON, 1 means SINGLETOP, 2 means STANDARD. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - launchMode: number; - - /** - * Represents Ability of another application The permission that needs to be applied when this Ability is invoked. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - permissions: Array; - - /** - * The process name of this ability. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - process: string; - - /** - * The supported device types of this ability. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - deviceTypes: Array; - - /** - * The ability of the device to limit. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - deviceCapabilities: Array; - - /** - * Uniform resource identifier representing Ability. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - uri: string; - - /** - * The application information of this ability. - * @devices phone - */ - applicationInfo: ApplicationInfo; - - /** - * The "module.package" in config.json. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - package: string; - - /** - * The bundle name of this ability. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - bundleName: string; - - /** - * The "module.name" in config.json of this ability. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - moduleName: string; - - /** - * The "bundleName" in config.json of this ability. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - applicationName: string; - - /** - * The device id. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - deviceId: string; - - /** - * The main code path of this ability. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - codePath: string; - - /** - * The resource path of this ability - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - resourcePath: string; - - /** - * The library path of this ability - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - libPath: string; -} \ No newline at end of file diff --git a/api/app/abilitymissioninfo.d.ts b/api/app/abilitymissioninfo.d.ts deleted file mode 100755 index db792d7fc1..0000000000 --- a/api/app/abilitymissioninfo.d.ts +++ /dev/null @@ -1,132 +0,0 @@ -/* - * 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 "./elementname" -import { Want } from "./want" - -/** - * @name Task stack information corresponding to ability - * @since 6 - * @SysCap appexecfwk - * @import import AbilityMissionInfo from '@ohos.AbilityMissionInfo' - * @permission N/A - * @devices phone - * @testapi - */ -export interface AbilityMissionInfo { - /** - * Unique identification of task stack information corresponding to ability - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap appexecfwk - */ - id: number; - - /** - * If this job is currently running, this is the identifier for it - * If it is not running, this will be -1 - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap appexecfwk - */ - runingState: number; - - /** - * The original Intent used to launch the task stack - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap appexecfwk - */ - baseWant: Want; - - /** - * The component launched as the first ability in the task stack - * This can be considered the "application" of this task stack - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap appexecfwk - */ - baseAbility: ElementName; - - /** - * The ability component at the top of the history stack of the task - * This is what the user is currently doing - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap appexecfwk - */ - topAbility: ElementName; - - /** - * Size of abilities in this task - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap appexecfwk - */ - size: number; - - /** - * The corresponding ability description information in the task stack - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap appexecfwk - */ - missionDescription: MissionDescriptionInfo; -} - -/** - * @name Task stack description information - * @since 6 - * @SysCap appexecfwk - * @import import app from '@system.app' - * @permission N/A - * @devices phone, tablet - */ - -export interface MissionDescriptionInfo { - /** - * The label of the specified ability in the task stack - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap appexecfwk - */ - label: string; - - /** - * The path to the icon that specifies the ability in the task stack - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap appexecfwk - */ - iconPath: string; -} \ No newline at end of file diff --git a/api/app/processinfo.d.ts b/api/app/activeProcessInfo.d.ts old mode 100755 new mode 100644 similarity index 52% rename from api/app/processinfo.d.ts rename to api/app/activeProcessInfo.d.ts index 8865b22cc7..b2034d7b17 --- a/api/app/processinfo.d.ts +++ b/api/app/activeProcessInfo.d.ts @@ -13,46 +13,40 @@ * limitations under the License. */ -import { AppProcessState } from "./appprocessstate" - /** * @name This class saves process information about an application - * @since 6 - * @SysCap appexecfwk - * @import N/A + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @import import app from 'app/activeProcessInfo' * @permission N/A - * @devices phone - * @testapi + * @devices phone, tablet, tv, wearable */ +export interface ActiveProcessInfo { + /** + * @default process id + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + pid: number; - export interface ProcessInfo { /** - * The name of the current process - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap appexecfwk + * @default user id + * @since 7 + * @SysCap SystemCapability.Appexecfwk */ - processName: string; + uid: number; /** - * The id of the current process - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap appexecfwk + * @default the name of the process + * @since 7 + * @SysCap SystemCapability.Appexecfwk */ - pid: number; + processName: string; /** - * Obtains the state of the current applicaiton process - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap appexecfwk + * @default an array of the bundleNames running in the process + * @since 7 + * @SysCap SystemCapability.Appexecfwk */ - appProcessState: AppProcessState; -} \ No newline at end of file + bundleNames: Array; +} diff --git a/api/app/applicationinfo.d.ts b/api/app/applicationinfo.d.ts deleted file mode 100755 index 77a91c38dc..0000000000 --- a/api/app/applicationinfo.d.ts +++ /dev/null @@ -1,246 +0,0 @@ -/* - * 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 appexecfwk - * @import NA - * @permission NA - * @devices phone - * @testapi - */ -export interface ApplicationInfo { - /** - * The application name. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - name: string; - - /** - * The bundleName is same to the application name. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - bundleName: string; - - /** - * The description of this application. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - description: string; - - /** - * The icon path of this application. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - iconPath: string; - - /** - * The label of this application. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - label: string; - - /** - * The label resource ID of this application. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - labelId : number; - - /** - * The icon resource ID of this application. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - iconId : number; - - /** - * The description resource ID of this application. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - descriptionId : number; - - /** - * The device id of this application. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - deviceId: string; - - /** - * The public key info of this application. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - signatureKey: string; - - /** - * Whether this application is a system application. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - isSystemApp: boolean; - - /** - * Whether this application is a launcher application. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - isLauncherApp: boolean; - - /** - * Whether the application support the driving mode, 0 means not support. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - supportedModes: number; - - /** - * The process of this application. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - process: string; - - /** - * The permissions of this application. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - permissions: Array; - - /** - * The module source directories of this application. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - moduleSourceDirs: Array; - - /** - * The module information of this application. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - moduleInfos: Array; - - /** - * The entry module path of this application. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - entryDir: string; - - /** - * The code path of this application. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - codePath: string; - - /** - * The data directory of this application. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - dataDir: string; - - /** - * The data base directory of this application. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - dataBaseDir: string; - - /** - * The cache directory of this application. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - cacheDir: string; -} \ No newline at end of file diff --git a/api/app/bundleinfo.d.ts b/api/app/bundleinfo.d.ts deleted file mode 100755 index c8d8b4c42b..0000000000 --- a/api/app/bundleinfo.d.ts +++ /dev/null @@ -1,266 +0,0 @@ -/* - * 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 BundleInfo - * @since 6 - * @SysCap appexecfwk - * @import NA - * @permission NA - * @devices phone - * @testapi - */ -export interface BundleInfo { - /** - * The bundle name. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - name: string; - - /** - * The label of this bundle. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - label: string; - - /** - * The description of this bundle. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - description: string; - - /** - * The vendor of this bundle. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - vendor: string; - - /** - * The version code of this bundle. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - versionCode: number; - - /** - * The version name of this bundle. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - versionName: string; - - /** - * The jointUserId of this bundle. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - jointUserId: string; - - /** - * The min SDK version of this bundle. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - minSdkVersion: number; - - /** - * The max SDK version of this bundle. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - maxSdkVersion: number; - - /** - * The main entry path of this bundle. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - mainEntry: string; - - /** - * The cpuAbi of this bundle. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - cpuAbi:string; - - /** - * The appId of this bundle. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - appId:string; - - /** - * The compatible version of this bundle. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - compatibleVersion: number; - - /** - * The target version of this bundle. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - targetVersion: number; - - /** - * The release type of this bundle. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - releaseType: string; - - /** - * The uid of this bundle. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - uid: number; - - /** - * The gid of this bundle. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - gid: number; - - /** - * The seInfo of this bundle. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - seInfo: string; - - /** - * The entry module name of this bundle. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - entryModuleName: string; - - /** - * Whether the bundle is keep alive. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - isKeepAlive: boolean; - - /** - * Whether the bundle is a native application. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - isNativeApp: boolean; - - /** - * The install time of this bundle. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - installTime: number; - - /** - * The update time of this bundle. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - updateTime: number; - - /** - * The information of the abilities in this bundle. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - abilityInfos: Array; -} \ No newline at end of file diff --git a/api/app/context.d.ts b/api/app/context.d.ts new file mode 100644 index 0000000000..6cd07ed04b --- /dev/null +++ b/api/app/context.d.ts @@ -0,0 +1,105 @@ +/* +* 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'; + +/** + * The context of anability 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 + * @import import abilityManager from 'app/context' + * @permission N/A + */ +export interface Context { + /** + * Verify whether the specified permission is allowed for a particular + * pid and uid running in the system. + * @param permission The name of the specified permission + * @param pid process id + * @param uid user id + * @note Pid and uid are optional. If you do not pass in pid and uid, + * it will check your own permission. + * @since 7 + * @sysCap SystemCapability.Appexecfwk + * @devices phone, tablet, tv, wearable + * @return asynchronous callback with {@code 0} if the PID + * and UID have the permission; callback with {@code -1} otherwise. + */ + verifyPermission(permission: string, options?: PermissionOptions): Promise; + verifyPermission(permission: string, options: PermissionOptions, callback: AsyncCallback): void; + verifyPermission(permission: string, callback: AsyncCallback): void; + + /** + * Requests certain permissions from the system. + * @param permissions Indicates the list of permissions to be requested. This parameter cannot be null. + * @param requestCode Indicates the request code to be passed to the PermissionRequestResult + * @since 7 + * @sysCap SystemCapability.Appexecfwk + * @devices phone, tablet, tv, wearable + */ + requestPermissionsFromUser(permissions: Array, requestCode: number, resultCallback: AsyncCallback): void; + requestPermissionsFromUser(permissions: Array, requestCode: number): Promise; + +} + +/** + * @name the result of requestPermissionsFromUser with asynchronous callback + * @since 7 + * @SysCap SystemCapability.Appexecfwk + * @permission N/A + * @devices phone, tablet, tv, wearable + */ +interface PermissionRequestResult { + /** + * @default The request code passed in by the user + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + requestCode: number; + + /** + * @default The permissions passed in by the user + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + permissions: Array; + + /** + * @default The results for the corresponding request permissions + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + authResults: Array; +} + +interface PermissionOptions { + /** + * @default The process id + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + pid?: number; + + /** + * @default The user id + * @since 7 + * @SysCap SystemCapability.Appexecfwk + */ + uid?: number; +} \ No newline at end of file diff --git a/api/app/installresult.d.ts b/api/app/installresult.d.ts deleted file mode 100755 index 625cb1c815..0000000000 --- a/api/app/installresult.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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 InstallResult - * @since 6 - * @SysCap appexecfwk - * @import NA - * @permission NA - * @devices phone - * @testapi - */ -export interface InstallResult { - /** - * The install result string message. - * - * @default - - * @devices phone, tablet - * @since 6 - * @SysCap BMS - */ - installResultMsg: string; -} diff --git a/api/app/want.d.ts b/api/app/want.d.ts deleted file mode 100755 index a1b19122d7..0000000000 --- a/api/app/want.d.ts +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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 "./elementname" - -/** - * Want is the basic communication component of the system. - * @name Want - * @since 6 - * @sysCap aafwk - * @devices phone - * @permission N/A - * @testapi - **/ -export declare interface Want { - /** - * The description of the type in this Want. - * @devices phone, tablet - * @since 6 - * @sysCap AAFwk - * @default - - */ - type: string; - - /** - * The description of the flags in this Want. - * @devices phone, tablet - * @since 6 - * @sysCap AAFwk - * @default - - */ - flags: number; - - /** - * The description of an action in an want. - * @devices phone, tablet - * @since 6 - * @sysCap AAFwk - * @default - - */ - action: string; - - /** - * The description of the WantParams object in an Want - * @devices phone, tablet - * @since 6 - * @sysCap AAFwk - * @default - - */ - want_param?: object - - /** - * The description of a entities in a Want. - * @devices phone, tablet - * @since 6 - * @sysCap AAFwk - * @default - - */ - entities: Array; - - /** - * The description of an elementname in a Want. - * @devices phone, tablet - * @since 6 - * @sysCap AAFwk - * @default - - */ - elementName: ElementName; -} \ No newline at end of file diff --git a/api/commonevent/commoneventdata.d.ts b/api/commonEvent/commonEventData.d.ts old mode 100755 new mode 100644 similarity index 78% rename from api/commonevent/commoneventdata.d.ts rename to api/commonEvent/commonEventData.d.ts index 0d8f039d36..6447604ca6 --- a/api/commonevent/commoneventdata.d.ts +++ b/api/commonEvent/commonEventData.d.ts @@ -16,28 +16,21 @@ /** * the data of the commonEvent * @name CommonEventData - * @since 6 - * @sysCap ces - * @devices phone + * @since 7 * @permission N/A - * @testapi */ export interface CommonEventData { /** * event type * @default - - * @devices phone, tablet - * @since 6 - * @sysCap AAFwk + * @since 7 */ event: string /** * bundle name * @default - - * @devices phone, tablet - * @since 6 - * @sysCap AAFwk + * @since 7 */ bundleName?: string; @@ -45,9 +38,7 @@ export interface CommonEventData { * The custom result code of the common event. * * @default 0 - * @devices phone, tablet - * @since 6 - * @SysCap ces + * @since 7 */ code?: number; @@ -55,9 +46,7 @@ export interface CommonEventData { * The custom result data of the common event. * * @default "" - * @devices phone, tablet - * @since 6 - * @SysCap ces + * @since 7 */ data?: string; } diff --git a/api/commonevent/commoneventpublishdata.d.ts b/api/commonEvent/commonEventPublishData.d.ts old mode 100755 new mode 100644 similarity index 78% rename from api/commonevent/commoneventpublishdata.d.ts rename to api/commonEvent/commonEventPublishData.d.ts index e15adc931a..b9e46b93b0 --- a/api/commonevent/commoneventpublishdata.d.ts +++ b/api/commonEvent/commonEventPublishData.d.ts @@ -16,19 +16,14 @@ /** * containing the common event content and attributes * @name CommonEventPublishData - * @since 6 - * @sysCap ces - * @devices phone + * @since 7 * @permission N/A - * @testapi */ export interface CommonEventPublishData { /** * bundle name * @default - - * @devices phone, tablet - * @since 6 - * @sysCap AAFwk + * @since 7 */ bundleName?: string; @@ -36,9 +31,7 @@ export interface CommonEventPublishData { * The custom result code of the common event. * * @default 0 - * @devices phone, tablet - * @since 6 - * @SysCap ces + * @since 7 */ code?: number; @@ -46,9 +39,7 @@ export interface CommonEventPublishData { * The custom result data of the common event. * * @default "" - * @devices phone, tablet - * @since 6 - * @SysCap ces + * @since 7 */ data?: string; @@ -56,9 +47,7 @@ export interface CommonEventPublishData { * The permissions for subscribers. Only subscribers with required permissions can receive published common events. * * @default - - * @devices phone, tablet - * @since 6 - * @SysCap ces + * @since 7 */ subscriberPermissions?: Array; @@ -66,9 +55,7 @@ export interface CommonEventPublishData { * Whether the type of a common event is ordered or not. * * @default false - * @devices phone, tablet - * @since 6 - * @SysCap ces + * @since 7 */ isOrdered?: boolean; @@ -76,9 +63,7 @@ export interface CommonEventPublishData { * Whether the type of a common event is sticky or not. * * @default false - * @devices phone, tablet - * @since 6 - * @SysCap ces + * @since 7 */ isSticky?: boolean; } \ No newline at end of file diff --git a/api/commonevent/commoneventsubscribeinfo.d.ts b/api/commonEvent/commonEventSubscribeInfo.d.ts old mode 100755 new mode 100644 similarity index 81% rename from api/commonevent/commoneventsubscribeinfo.d.ts rename to api/commonEvent/commonEventSubscribeInfo.d.ts index 98e82a6477..32ff8798fb --- a/api/commonevent/commoneventsubscribeinfo.d.ts +++ b/api/commonEvent/commonEventSubscribeInfo.d.ts @@ -16,11 +16,8 @@ /** * the information of the subscriber * @name CommonEventSubscribeInfo - * @since 6 - * @sysCap ces - * @devices phone + * @since 7 * @permission N/A - * @testapi */ export interface CommonEventSubscribeInfo { /** @@ -28,9 +25,7 @@ export interface CommonEventSubscribeInfo { * This subscriber receives only common events sent by publishers granted with this permission. * * @default "" - * @devices phone, tablet - * @since 6 - * @SysCap ces + * @since 7 */ events: Array @@ -39,9 +34,7 @@ export interface CommonEventSubscribeInfo { * This subscriber receives only common events sent by publishers granted with this permission. * * @default "" - * @devices phone, tablet - * @since 6 - * @SysCap ces + * @since 7 */ publisherPermission?: string; @@ -49,9 +42,7 @@ export interface CommonEventSubscribeInfo { * deviceId Indicates the device ID. The value must be an existing device ID on the same ohos network. * * @default "" - * @devices phone, tablet - * @since 6 - * @SysCap ces + * @since 7 */ publisherDeviceId?: string; @@ -60,9 +51,7 @@ export interface CommonEventSubscribeInfo { * current user. If this parameter is specified, the value must be an existing user ID in the system. * * @default "" - * @devices phone, tablet - * @since 6 - * @SysCap ces + * @since 7 */ userId?: number; @@ -70,9 +59,7 @@ export interface CommonEventSubscribeInfo { * Indicates the subscriber priority. The value ranges from -100 to 1000. * * @default "" - * @devices phone, tablet - * @since 6 - * @SysCap ces + * @since 7 */ priority?: number; } \ No newline at end of file diff --git a/api/commonevent/commoneventsubscriber.d.ts b/api/commonEvent/commonEventSubscriber.d.ts old mode 100755 new mode 100644 similarity index 32% rename from api/commonevent/commoneventsubscriber.d.ts rename to api/commonEvent/commonEventSubscriber.d.ts index 4a7b64c3d7..65e5aba353 --- a/api/commonevent/commoneventsubscriber.d.ts +++ b/api/commonEvent/commonEventSubscriber.d.ts @@ -13,88 +13,218 @@ * limitations under the License. */ import { AsyncCallback } from './../basic'; -import { CommonEventSubscribeInfo } from './commoneventsubscribeinfo'; +import { CommonEventSubscribeInfo } from './commonEventSubscribeInfo'; /** * the subscriber of common event * @name CommonEventSubscriber - * @since 6 - * @sysCap ces - * @devices phone + * @since 7 * @permission N/A - * @testapi */ export interface CommonEventSubscriber { + /** + * Obtains the result code of the current ordered common event. + * + * @since 7 + * @param callback Indicate the callback funtion to receive the common event. + * @return - + */ + getCode(callback: AsyncCallback): void; + + /** + * Obtains the result code of the current ordered common event. + * + * @since 7 + * @param callback Indicate the callback funtion to receive the common event. + * @return - + */ + getCode(): Promise; + + /** + * Sets the result code of the current ordered common event. + * + * @since 7 + * @param code Indicates the custom result code to set. You can set it to any value. + * @param callback Indicate the callback funtion to receive the common event. + * @return - + */ + setCode(code: number, callback: AsyncCallback): void; + + /** + * Sets the result code of the current ordered common event. + * + * @since 7 + * @param code Indicates the custom result code to set. You can set it to any value. + * @param callback Indicate the callback funtion to receive the common event. + * @return - + */ + setCode(code: number): Promise; + + /** + * Obtains the result data of the current ordered common event. + * + * @since 7 + * @param callback Indicate the callback funtion to receive the common event. + * @return - + */ + getData(callback: AsyncCallback): void; + + /** + * Obtains the result data of the current ordered common event. + * + * @since 7 + * @param callback Indicate the callback funtion to receive the common event. + * @return - + */ + getData(): Promise; + + /** + * Sets the result data of the current ordered common event. + * + * @since 7 + * @param data Indicates the custom result data to set. You can set it to any character string. + * @param callback Indicate the callback funtion to receive the common event. + * @return - + */ + setData(data: string, callback: AsyncCallback): void; + + /** + * Sets the result data of the current ordered common event. + * + * @since 7 + * @param data Indicates the custom result data to set. You can set it to any character string. + * @param callback Indicate the callback funtion to receive the common event. + * @return - + */ + setData(data: string): Promise; + + /** + * Sets the result of the current ordered common event. + * + * @since 7 + * @param code Indicates the custom result code to set. You can set it to any value. + * @param data Indicates the custom result data to set. You can set it to any character string. + * @param callback Indicate the callback funtion to receive the common event. + * @return - + */ + setCodeAndData(code: number, data: string, callback: AsyncCallback): void; + + /** + * Sets the result of the current ordered common event. + * + * @since 7 + * @param code Indicates the custom result code to set. You can set it to any value. + * @param data Indicates the custom result data to set. You can set it to any character string. + * @param callback Indicate the callback funtion to receive the common event. + * @return - + */ + setCodeAndData(code: number, data: string): Promise; /** * Checks whether the current common event is an ordered common event. * - * @devices phone - * @since 6 - * @SysCap ces + * @since 7 * @param callback Indicate the callback funtion to receive the common event. * @return - - * @testapi */ isOrderedCommonEvent(callback: AsyncCallback): void; /** * Checks whether the current common event is an ordered common event. * - * @devices phone - * @since 6 - * @SysCap ces + * @since 7 * @param callback Indicate the callback funtion to receive the common event. * @return - - * @testapi */ isOrderedCommonEvent(): Promise; /** * Checks whether the current common event is a sticky common event. * - * @devices phone - * @since 6 - * @SysCap ces + * @since 7 * @param callback Indicate the callback funtion to receive the common event. * @return - - * @testapi */ isStickyCommonEvent(callback: AsyncCallback): void; /** * Checks whether the current common event is a sticky common event. * - * @devices phone - * @since 6 - * @SysCap ces + * @since 7 * @param callback Indicate the callback funtion to receive the common event. * @return - - * @testapi */ isStickyCommonEvent(): Promise; + /** + * Aborts the current ordered common event. + * + * @since 7 + * @param callback Indicate the callback funtion to receive the common event. + * @return - + */ + abortCommonEvent(callback: AsyncCallback): void; + + /** + * Aborts the current ordered common event. + * + * @since 7 + * @param callback Indicate the callback funtion to receive the common event. + * @return - + */ + abortCommonEvent(): Promise; + + /** + * Clears the abort state of the current ordered common event + * + * @since 7 + * @param callback Indicate the callback funtion to receive the common event. + * @return - + */ + clearAbortCommonEvent(callback: AsyncCallback): void; + + /** + * Clears the abort state of the current ordered common event + * + * @since 7 + * @param callback Indicate the callback funtion to receive the common event. + * @return - + */ + clearAbortCommonEvent(): Promise; + + /** + * Checks whether the current ordered common event should be aborted. + * + * @since 7 + * @param callback Indicate the callback funtion to receive the common event. + * @return - + */ + getAbortCommonEvent(callback: AsyncCallback): void; + + /** + * Checks whether the current ordered common event should be aborted. + * + * @since 7 + * @param callback Indicate the callback funtion to receive the common event. + * @return - + */ + getAbortCommonEvent(): Promise; + /** * get the CommonEventSubscribeInfo of this CommonEventSubscriber. * - * @devices phone - * @since 6 - * @SysCap ces + * @since 7 * @param callback Indicate the callback funtion to receive the common event. * @return - - * @testapi */ getSubscribeInfo(callback: AsyncCallback): void; /** * get the CommonEventSubscribeInfo of this CommonEventSubscriber. * - * @devices phone - * @since 6 - * @SysCap ces + * @since 7 * @param callback Indicate the callback funtion to receive the common event. * @return - - * @testapi */ getSubscribeInfo(): Promise; } diff --git a/api/app/common.d.ts b/api/wantAgent/wantAgentInfo.d.ts old mode 100755 new mode 100644 similarity index 57% rename from api/app/common.d.ts rename to api/wantAgent/wantAgentInfo.d.ts index 4c1137574f..4cc5aa2948 --- a/api/app/common.d.ts +++ b/api/wantAgent/wantAgentInfo.d.ts @@ -4,7 +4,7 @@ * 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 + * 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, @@ -13,15 +13,22 @@ * limitations under the License. */ +import { Want } from '../ability/want'; +import wantAgent from '../@ohos.wantAgent' + /** - * @name The ability callback. - * @since 6 - * @SysCap aafwk + * the info of WantAgent + * + * @name WantAgentInfo + * @since 7 + * @sysCap ans + * @devices phone, tablet * @permission N/A - * @devices phone - * @testapi */ -export interface AsyncCallback { - (data: T): void; - (err: number): void; +export interface WantAgentInfo { + wants: Array; + operationType: wantAgent.OperationType; + requestCode: number; + wantAgentFlags?: Array; + extraInfo?: {[key: string]: any}; } \ No newline at end of file -- Gitee