): void;
@@ -569,7 +569,7 @@ export declare interface LifecycleData {
* 3. "*/jpg": Obtains files whose subtype is JPG of any main type.
* @param callback function specified by framework to receive the result, developer should call this function to
* return the result to framework.
- * @return -
+ * @returns -
* @FAModelOnly
*/
getFileTypes?(uri: string, mimeTypeFilter: string, callback: AsyncCallback>): void;
@@ -580,7 +580,7 @@ export declare interface LifecycleData {
* @since 7
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param info Indicates the {@code AbilityInfo} object containing information about this ability.
- * @return -
+ * @returns -
* @FAModelOnly
*/
onInitialized?(info: AbilityInfo): void;
@@ -596,7 +596,7 @@ export declare interface LifecycleData {
* @param uri Indicates the uri of the data.
* @param callback function specified by framework to receive the result, developer should call this function to
* return the result to framework.
- * @return -
+ * @returns -
* @FAModelOnly
*/
getType?(uri: string, callback: AsyncCallback): void;
@@ -609,7 +609,7 @@ export declare interface LifecycleData {
* @param ops Indicates the data operation list, which can contain multiple operations on the database.
* @param callback function specified by framework to receive the result, developer should call this function to
* return the result to framework.
- * @return -
+ * @returns -
* @FAModelOnly
*/
executeBatch?(ops: Array, callback: AsyncCallback>): void;
@@ -624,7 +624,7 @@ export declare interface LifecycleData {
* @param extras Indicates the parameter transferred by the method.
* @param callback function specified by framework to receive the result, developer should call this function to
* return the result to framework.
- * @return -
+ * @returns -
* @FAModelOnly
*/
call?(method: string, arg: string, extras: PacMap, callback: AsyncCallback): void;
diff --git a/api/@ohos.Stationary.d.ts b/api/@ohos.Stationary.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..9412317be75d7887f513b5d59e7902fa3ecf2266
--- /dev/null
+++ b/api/@ohos.Stationary.d.ts
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2022 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 { Callback } from "./basic";
+
+/**
+ * Declares a namespace that provides APIs to report the device status.
+ *
+ * @since 9
+ * @syscap SystemCapability.Msdp.DeviceStatus.Stationary
+ */
+declare namespace Stationary {
+ /**
+ * Declares a response interface to receive the device status.
+ *
+ * @syscap SystemCapability.Msdp.DeviceStatus.Stationary
+ * @since 9
+ */
+ interface ActivityResponse {
+ state: ActivityState;
+ }
+
+ /**
+ * Declares the device status type.
+ *
+ * @syscap SystemCapability.Msdp.DeviceStatus.Stationary
+ * @since 9
+ */
+ type ActivityType = 'still' | 'relativeStill';
+
+ /**
+ * Enumerates the device status events.
+ *
+ * @syscap SystemCapability.Msdp.DeviceStatus.Stationary
+ * @since 9
+ */
+ enum ActivityEvent {
+ /**
+ * Event indicating entering device status.
+ */
+ ENTER = 1,
+
+ /**
+ * Event indicating exiting device status.
+ */
+ EXIT = 2,
+
+ /**
+ * Event indicating entering and exiting device status.
+ */
+ ENTER_EXIT = 3
+ }
+
+ /**
+ * Declares a response interface to receive the device status.
+ *
+ * @syscap SystemCapability.Msdp.DeviceStatus.Stationary
+ * @since 9
+ */
+ enum ActivityState {
+ /**
+ * Entering device status.
+ */
+ ENTER = 1,
+
+ /**
+ * Exiting device status.
+ */
+ EXIT = 2
+ }
+
+ /**
+ * Subscribes to the device status.
+ *
+ * @param activity Indicates the device status type. For details, see {@code type: ActivityType}.
+ * @param event Indicates the device status event.
+ * @param reportLatencyNs Indicates the event reporting period.
+ * @param callback Indicates the callback for receiving reported data.
+ * @syscap SystemCapability.Msdp.DeviceStatus.Stationary
+ * @since 9
+ */
+ function on(activity: ActivityType, event: ActivityEvent, reportLatencyNs: number, callback: Callback): void;
+
+ /**
+ * Obtains the device status.
+ *
+ * @param activity Indicates the device status type. For details, see {@code type: ActivityType}.
+ * @param callback Indicates the callback for receiving reported data.
+ * @syscap SystemCapability.Msdp.DeviceStatus.Stationary
+ * @since 9
+ */
+ function once(activity: ActivityType, callback: Callback): void;
+
+ /**
+ * Unsubscribes from the device status.
+ *
+ * @param activity Indicates the device status type. For details, see {@code type: ActivityType}.
+ * @param event Indicates the device status event.
+ * @param callback Indicates the callback for receiving reported data.
+ * @syscap SystemCapability.Msdp.DeviceStatus.Stationary
+ * @since 9
+ */
+ function off(activity: ActivityType, event: ActivityEvent, callback?: Callback): void;
+}
+
+export default deviceStatus;
diff --git a/api/@ohos.WorkSchedulerExtensionAbility.d.ts b/api/@ohos.WorkSchedulerExtensionAbility.d.ts
index df30bd831e426edec007243471ac505d27209e50..e84ee214c257927a1d5e2aa2b3af5e6167f671f4 100644
--- a/api/@ohos.WorkSchedulerExtensionAbility.d.ts
+++ b/api/@ohos.WorkSchedulerExtensionAbility.d.ts
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-import workScheduler from "./@ohos.workScheduler";
+import workScheduler from "./@ohos.resourceschedule.workScheduler";
/**
* Class of the work scheduler extension ability.
diff --git a/api/@ohos.ability.ability.d.ts b/api/@ohos.ability.ability.d.ts
index 44be58f12e8b9ef4cb8065dcefc71c68003f576b..dde29080261399f4c2f9b1ff815d44b17855456e 100755
--- a/api/@ohos.ability.ability.d.ts
+++ b/api/@ohos.ability.ability.d.ts
@@ -26,7 +26,7 @@ import { StartAbilityParameter as _StartAbilityParameter } from './ability/star
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
- * @StageModelOnly
+ * @FAModelOnly
*/
declare namespace ability {
@@ -50,6 +50,7 @@ declare namespace ability {
/**
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @FAModelOnly
*/
export type DataAbilityOperation = _DataAbilityOperation
@@ -57,24 +58,28 @@ declare namespace ability {
* @name DataAbilityResult
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @FAModelOnly
*/
export type DataAbilityResult = _DataAbilityResult
/**
* @since 9
* @syscap SystemCapability.Ability.AbilityBase
+ * @FAModelOnly
*/
export type AbilityResult = _AbilityResult
/**
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @FAModelOnly
*/
export type ConnectOptions = _ConnectOptions
/**
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @FAModelOnly
*/
export type StartAbilityParameter = _StartAbilityParameter
}
diff --git a/api/@ohos.ability.featureAbility.d.ts b/api/@ohos.ability.featureAbility.d.ts
index 944d6d321bf4df658cc2725939bf90ecf744ea0c..1e5ad97bdd522e746d87579f337857477d9009cb 100644
--- a/api/@ohos.ability.featureAbility.d.ts
+++ b/api/@ohos.ability.featureAbility.d.ts
@@ -35,12 +35,12 @@ import window from './@ohos.window';
*/
declare namespace featureAbility {
/**
- * Obtain the want sended from the source ability.
+ * Obtain the want sent from the source ability.
*
* @since 6
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param parameter Indicates the ability to start.
- * @return -
+ * @returns -
* @FAModelOnly
*/
function getWant(callback: AsyncCallback): void;
@@ -52,7 +52,7 @@ declare namespace featureAbility {
* @since 6
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param parameter Indicates the ability to start.
- * @return -
+ * @returns -
* @FAModelOnly
*/
function startAbility(parameter: StartAbilityParameter, callback: AsyncCallback): void;
@@ -62,7 +62,7 @@ declare namespace featureAbility {
* Obtains the application context.
*
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
- * @return Returns the application context.
+ * @returns Returns the application context.
* @since 6
* @FAModelOnly
*/
@@ -74,7 +74,7 @@ declare namespace featureAbility {
* @since 7
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param parameter Indicates the ability to start.
- * @return Returns the {@link AbilityResult}.
+ * @returns Returns the {@link AbilityResult}.
* @FAModelOnly
*/
function startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback): void;
@@ -87,7 +87,7 @@ declare namespace featureAbility {
* @since 7
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param parameter Indicates the result to return.
- * @return -
+ * @returns -
* @FAModelOnly
*/
function terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback): void;
@@ -98,7 +98,7 @@ declare namespace featureAbility {
*
* @since 7
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
- * @return -
+ * @returns -
* @FAModelOnly
*/
function terminateSelf(callback: AsyncCallback): void;
@@ -110,7 +110,7 @@ declare namespace featureAbility {
* @since 7
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the path of the file to open.
- * @return Returns the dataAbilityHelper.
+ * @returns Returns the dataAbilityHelper.
* @FAModelOnly
*/
function acquireDataAbilityHelper(uri: string): DataAbilityHelper;
@@ -120,7 +120,7 @@ declare namespace featureAbility {
*
* @since 7
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
- * @return Returns {@code true} if this ability currently has window focus; returns {@code false} otherwise.
+ * @returns Returns {@code true} if this ability currently has window focus; returns {@code false} otherwise.
* @FAModelOnly
*/
function hasWindowFocus(callback: AsyncCallback): void;
@@ -133,7 +133,7 @@ declare namespace featureAbility {
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param request The element name of the service ability
* @param options The remote object instance
- * @return Returns the number code of the ability connected
+ * @returns Returns the number code of the ability connected
* @FAModelOnly
*/
function connectAbility(request: Want, options:ConnectOptions ): number;
@@ -154,7 +154,7 @@ declare namespace featureAbility {
*
* @since 7
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
- * @return Returns the window corresponding to the current ability.
+ * @returns Returns the window corresponding to the current ability.
* @FAModelOnly
*/
function getWindow(callback: AsyncCallback): void;
@@ -223,7 +223,6 @@ declare namespace featureAbility {
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.Core
- * @import import abilityManager from 'app/context'
* @FAModelOnly
*/
export type Context = _Context
@@ -239,7 +238,6 @@ declare namespace featureAbility {
* @name This class saves process information about an application
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.Core
- * @import import ProcessInfo from 'app/processInfo'
*/
export type ProcessInfo = _ProcessInfo
}
diff --git a/api/@ohos.ability.particleAbility.d.ts b/api/@ohos.ability.particleAbility.d.ts
index 04321ffcd7a9455510aa33a4ccfaa8ab1c040658..9c02954c621e37b40b1c42e6c89e626050ad6536 100644
--- a/api/@ohos.ability.particleAbility.d.ts
+++ b/api/@ohos.ability.particleAbility.d.ts
@@ -35,7 +35,7 @@ declare namespace particleAbility {
* @since 7
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param parameter Indicates the ability to start.
- * @return -
+ * @returns -
* @FAModelOnly
*/
function startAbility(parameter: StartAbilityParameter, callback: AsyncCallback): void;
@@ -46,7 +46,7 @@ declare namespace particleAbility {
*
* @since 7
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
- * @return -
+ * @returns -
* @FAModelOnly
*/
function terminateSelf(callback: AsyncCallback): void;
@@ -58,7 +58,7 @@ declare namespace particleAbility {
* @since 7
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the path of the file to open.
- * @return Returns the dataAbilityHelper.
+ * @returns Returns the dataAbilityHelper.
* @FAModelOnly
*/
function acquireDataAbilityHelper(uri: string): DataAbilityHelper;
@@ -72,7 +72,8 @@ declare namespace particleAbility {
* @param id Identifies the notification bar information.
* @param request Indicates the notificationRequest instance containing information for displaying a notification bar.
* @FAModelOnly
- * @deprecated
+ * @deprecated since 9
+ * @useinstead ohos.resourceschedule.backgroundTaskManager.startBackgroundRunning
*/
function startBackgroundRunning(id: number, request: NotificationRequest, callback: AsyncCallback): void;
function startBackgroundRunning(id: number, request: NotificationRequest): Promise;
@@ -83,7 +84,8 @@ declare namespace particleAbility {
* @since 7
* @syscap SystemCapability.ResourceSchedule.BackgroundTaskManager.ContinuousTask
* @FAModelOnly
- * @deprecated
+ * @deprecated since 9
+ * @useinstead ohos.resourceschedule.backgroundTaskManager.stopBackgroundRunning
*/
function cancelBackgroundRunning(callback: AsyncCallback): void;
function cancelBackgroundRunning(): Promise;
@@ -95,7 +97,7 @@ declare namespace particleAbility {
* @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param request Indicates the Service ability to connect.
* @param options Callback object for the client. If this parameter is null, an exception is thrown.
- * @return unique identifier of the connection between the client and the service side.
+ * @returns unique identifier of the connection between the client and the service side.
* @FAModelOnly
*/
function connectAbility(request: Want, options:ConnectOptions): number;
diff --git a/api/@ohos.ability.wantConstant.d.ts b/api/@ohos.ability.wantConstant.d.ts
index 15ce6b7a38b7e0742efabde7e282d361b7686d59..9947e21351944b18ae6d31b2cbae64c0d4ea35c9 100644
--- a/api/@ohos.ability.wantConstant.d.ts
+++ b/api/@ohos.ability.wantConstant.d.ts
@@ -19,6 +19,8 @@
* @since 6
* @syscap SystemCapability.Ability.AbilityBase
* @permission N/A
+ * @deprecated since 9
+ * @useinstead ohos.app.ability.wantConstant
*/
declare namespace wantConstant {
/**
@@ -219,11 +221,11 @@ declare namespace wantConstant {
ACTION_APP_ACCOUNT_OAUTH = "ohos.account.appAccount.action.oauth",
/**
- * Indicates the action of providing auth service.
+ * Indicates the action of providing the application account auth service.
*
* @since 9
*/
- ACTION_APP_ACCOUNT_AUTH = "account.appAccount.action.auth",
+ ACTION_APP_ACCOUNT_AUTH = "ohos.appAccount.action.auth",
/**
* Indicates the action of an application downloaded from the application market.
@@ -393,7 +395,7 @@ declare namespace wantConstant {
FLAG_INSTALL_ON_DEMAND = 0x00000800,
/**
- * Install the specifiedi ability with background mode if it's not installed.
+ * Install the specified ability with background mode if it's not installed.
*/
FLAG_INSTALL_WITH_BACKGROUND_MODE = 0x80000000,
diff --git a/api/@ohos.abilityAccessCtrl.d.ts b/api/@ohos.abilityAccessCtrl.d.ts
index a8c7a3a08ec7f0037f93a8df44c47a3ffef57c30..23474f7e6ff67c939e779ee0c6a074513fe765d5 100644
--- a/api/@ohos.abilityAccessCtrl.d.ts
+++ b/api/@ohos.abilityAccessCtrl.d.ts
@@ -42,6 +42,14 @@ import { Permissions } from './permissions';
* @useinstead ohos.abilityAccessCtrl.AtManager#checkAccessToken
*/
verifyAccessToken(tokenID: number, permissionName: string): Promise;
+
+ /**
+ * Checks whether a specified application has been granted the given permission.
+ * @param tokenID The tokenId of specified application.
+ * @param permissionName The permission name to be verified. Permissions type only support the valid permission name.
+ * @return Returns permission verify result.
+ * @since 9
+ */
verifyAccessToken(tokenID: number, permissionName: Permissions): Promise;
/**
diff --git a/api/@ohos.accessibility.config.d.ts b/api/@ohos.accessibility.config.d.ts
index 2dfac6d56a12e8b0f7d6f5389a8e05bf6d719822..690c702cff722a9bcc8a12bc1cba09c778ec90e4 100644
--- a/api/@ohos.accessibility.config.d.ts
+++ b/api/@ohos.accessibility.config.d.ts
@@ -77,6 +77,10 @@ declare namespace config {
* Enable the accessibility extension ability.
* @param name Indicates the accessibility extension name, in "bundleName/abilityName" format.
* @param capability Indicates the ability.
+ * @throws { BusinessError } 201 - Permission denied.
+ * @throws { BusinessError } 401 - Input parameter error.
+ * @throws { BusinessError } 9300001 - Invalid bundle name or ability name.
+ * @throws { BusinessError } 9300002 - Target ability already enabled.
*/
function enableAbility(name: string, capability: Array): Promise;
function enableAbility(name: string, capability: Array, callback: AsyncCallback): void;
@@ -84,23 +88,28 @@ declare namespace config {
/**
* Disable the accessibility extension ability.
* @param name Indicates the accessibility extension name, in "bundleName/abilityName" format.
+ * @throws { BusinessError } 201 - Permission denied.
+ * @throws { BusinessError } 401 - Input parameter error.
+ * @throws { BusinessError } 9300001 - Invalid bundle name or ability name.
*/
function disableAbility(name: string): Promise;
function disableAbility(name: string, callback: AsyncCallback): void;
/**
* Register the listener that watches for changes in the enabled status of accessibility extensions.
- * @param type Indicates the enableAbilityListsStateChanged type.
+ * @param type Indicates the type of event.
* @param callback Indicates the listener.
+ * @throws { BusinessError } 401 - Input parameter error.
*/
- function on(type: 'enableAbilityListsStateChanged', callback: Callback): void;
+ function on(type: 'enabledAccessibilityExtensionListChange', callback: Callback): void;
/**
- * Deregister listener that watches for changes in the enabled status of accessibility extensions.
- * @param type Indicates the enableAbilityListsStateChanged type.
+ * Unregister listener that watches for changes in the enabled status of accessibility extensions.
+ * @param type Indicates the type of event.
* @param callback Indicates the listener.
+ * @throws { BusinessError } 401 - Input parameter error.
*/
- function off(type: 'enableAbilityListsStateChanged', callback?: Callback): void;
+ function off(type: 'enabledAccessibilityExtensionListChange', callback?: Callback): void;
/**
* Indicates setting, getting, and listening to changes in configuration.
@@ -109,6 +118,8 @@ declare namespace config {
/**
* Setting configuration value.
* @param value Indicates the value.
+ * @throws { BusinessError } 201 - Permission denied.
+ * @throws { BusinessError } 401 - Input parameter error.
*/
set(value: T): Promise;
set(value: T, callback: AsyncCallback): void;
@@ -122,11 +133,12 @@ declare namespace config {
/**
* Register the listener to listen for configuration changes.
* @param callback Indicates the listener.
+ * @throws { BusinessError } 401 - Input parameter error.
*/
on(callback: Callback): void;
/**
- * Deregister the listener to listen for configuration changes.
+ * Unregister the listener to listen for configuration changes.
* @param callback Indicates the listener.
*/
off(callback?: Callback): void;
diff --git a/api/@ohos.accessibility.d.ts b/api/@ohos.accessibility.d.ts
index 50f45c02511d3221390c5f66ef819796005be0cf..597532bead60ef1044c29d7a2511495dacfca073 100644
--- a/api/@ohos.accessibility.d.ts
+++ b/api/@ohos.accessibility.d.ts
@@ -21,16 +21,21 @@ import { Callback } from './basic';
* @name Accessibility
* @since 7
* @syscap SystemCapability.BarrierFree.Accessibility.Core
- * @import basic,abilityInfo
*/
declare namespace accessibility {
-
/**
* The type of the Ability app.
+ * @type { 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' }
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
- type AbilityType = 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual';
+ /**
+ * The type of the Ability app.
+ * @type { 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' | 'all' }
+ * @syscap SystemCapability.BarrierFree.Accessibility.Core
+ * @since 9
+ */
+ type AbilityType = 'audible' | 'generic' | 'haptic' | 'spoken' | 'visual' | 'all';
/**
* The action that the ability can execute.
@@ -43,12 +48,6 @@ declare namespace accessibility {
/**
* The type of the accessibility event.
- * @note windowsChange
- * @note windowContentChange
- * @note windowStateChange
- * @note announcement
- * @note notificationChange
- * @note textTraversedAtMove
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
@@ -58,7 +57,6 @@ declare namespace accessibility {
/**
* The change type of the windowsChange event.
- * @note It's used when received the {@code windowsChange} event.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
@@ -73,12 +71,6 @@ declare namespace accessibility {
/**
* The ability that accessibility subsystem support.
- * @note touchExplorer: Describes the capability to talkback.
- * magnification: Describes the capability to request to control the display magnification.
- * gesturesSimulation: Describes the capability to request to simulate the gesture.
- * windowContent: Describes the capability to search for the content of the active window.
- * filterKeyEvents: Describes the capability to request to filter key events.
- * fingerprintGesture: Describes the capability to request to fingerprint gesture.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
@@ -86,7 +78,6 @@ declare namespace accessibility {
/**
* The granularity of text move.
- * @note The granularity of text move.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
* @since 7
*/
@@ -97,8 +88,8 @@ declare namespace accessibility {
* @since 7
* @param callback Asynchronous callback interface.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
- * @return Returns {@code true} if the accessibility is enabled; returns {@code false} otherwise.
- */
+ * @returns Returns {@code true} if the accessibility is enabled; returns {@code false} otherwise.
+ */
function isOpenAccessibility(callback: AsyncCallback): void;
function isOpenAccessibility(): Promise;
@@ -107,8 +98,8 @@ declare namespace accessibility {
* @since 7
* @param callback Asynchronous callback interface.
* @syscap SystemCapability.BarrierFree.Accessibility.Vision
- * @return Returns {@code true} if the touch browser is enabled; returns {@code false} otherwise.
- */
+ * @returns Returns {@code true} if the touch browser is enabled; returns {@code false} otherwise.
+ */
function isOpenTouchGuide(callback: AsyncCallback): void;
function isOpenTouchGuide(): Promise;
@@ -118,25 +109,27 @@ declare namespace accessibility {
* @param abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken
* @param stateType The state of the accessibility ability. {@code AbilityState} eg.installed
* @syscap SystemCapability.BarrierFree.Accessibility.Core
- * @return Returns the list of abilityInfos.
- */
+ * @returns Returns the list of abilityInfos.
+ * @deprecated since 9
+ * @useinstead ohos.accessibility#getAccessibilityExtensionList
+ */
function getAbilityLists(abilityType: AbilityType, stateType: AbilityState,
callback: AsyncCallback>): void;
function getAbilityLists(abilityType: AbilityType,
stateType: AbilityState): Promise>;
+
/**
* Queries the list of accessibility abilities.
* @since 9
- * @param abilityType The all type of the accessibility ability.
+ * @param abilityType The type of the accessibility ability. {@code AbilityType} eg.spoken
* @param stateType The state of the accessibility ability. {@code AbilityState} eg.installed
* @syscap SystemCapability.BarrierFree.Accessibility.Core
- * @return Returns the list of abilityInfos.
- */
- function getAbilityLists(abilityType: 'all', stateType: AbilityState,
- callback: AsyncCallback>): void;
- function getAbilityLists(abilityType: 'all',
- stateType: AbilityState): Promise>;
+ * @returns Returns the list of abilityInfos.
+ * @throws { BusinessError } 401 - Input parameter error.
+ */
+ function getAccessibilityExtensionList(abilityType: AbilityType, stateType: AbilityState): Promise>;
+ function getAccessibilityExtensionList(abilityType: AbilityType, stateType: AbilityState, callback: AsyncCallback>): void;
/**
* Send accessibility Event.
@@ -144,47 +137,65 @@ declare namespace accessibility {
* @param event The object of the accessibility {@code EventInfo} .
* @param callback Asynchronous callback interface.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
- * @return Returns {@code true} if success ; returns {@code false} otherwise.
+ * @returns Returns {@code true} if success ; returns {@code false} otherwise.
+ * @deprecated since 9
+ * @useinstead ohos.accessibility#sendAccessibilityEvent
*/
function sendEvent(event: EventInfo, callback: AsyncCallback): void;
function sendEvent(event: EventInfo): Promise;
/**
- * Register the observe of the accessibility state changed.
+ * Send accessibility event.
+ * @since 9
+ * @param event The object of the accessibility {@code EventInfo} .
+ * @param callback Asynchronous callback interface.
+ * @syscap SystemCapability.BarrierFree.Accessibility.Core
+ * @returns Returns {@code true} if success ; returns {@code false} otherwise.
+ * @throws { BusinessError } 401 - Input parameter error.
+ */
+ function sendAccessibilityEvent(event: EventInfo, callback: AsyncCallback): void;
+ function sendAccessibilityEvent(event: EventInfo): Promise;
+
+ /**
+ * Register the observer of the accessibility state changed.
* @since 7
* @param type state event type.
* @param callback Asynchronous callback interface.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
- * @return Returns {@code true} if the register is success ; returns {@code false} otherwise.
+ * @returns Returns {@code true} if the register is success ; returns {@code false} otherwise.
+ * @throws { BusinessError } 401 - Input parameter error.
*/
function on(type: 'accessibilityStateChange', callback: Callback): void;
/**
- * Register the observe of the touchGuide state changed.
+ * Register the observer of the touchGuide state changed.
* @since 7
* @param type state event type.
* @param callback Asynchronous callback interface.
* @syscap SystemCapability.BarrierFree.Accessibility.Vision
- * @return Returns {@code true} if the register is success ; returns {@code false} otherwise.
+ * @returns Returns {@code true} if the register is success ; returns {@code false} otherwise.
+ * @throws { BusinessError } 401 - Input parameter error.
*/
function on(type: 'touchGuideStateChange', callback: Callback): void;
/**
- * Deregister the observe of the accessibility state changed.
+ * Unregister the observer of the accessibility state changed.
* @since 7
* @param type state event type
* @param callback Asynchronous callback interface.
* @syscap SystemCapability.BarrierFree.Accessibility.Core
- * @return Returns {@code true} if the deregister is success ; returns {@code false} otherwise.
+ * @returns Returns {@code true} if the Unregister is success ; returns {@code false} otherwise.
+ * @throws { BusinessError } 401 - Input parameter error.
*/
function off(type: 'accessibilityStateChange', callback?: Callback): void;
/**
- * Deregister the observe of the touchGuide state changed.
+ * Unregister the observer of the touchGuide state changed.
* @since 7
* @param type state event type
* @param callback Asynchronous callback interface.
- * @return Returns {@code true} if the deregister is success ; returns {@code false} otherwise.
+ * @returns Returns {@code true} if the Unregister is success ; returns {@code false} otherwise.
+ * @throws { BusinessError } 401 - Input parameter error.
*/
function off(type: 'touchGuideStateChange', callback?: Callback): void;
@@ -192,7 +203,7 @@ declare namespace accessibility {
* Get the captions manager.
* @syscap SystemCapability.BarrierFree.Accessibility.Hearing
* @since 8
- * @return Returns the captions manager.
+ * @returns Returns the captions manager.
*/
function getCaptionsManager(): CaptionsManager;
@@ -212,19 +223,26 @@ declare namespace accessibility {
style: CaptionsStyle;
/**
- * Register the observe of the enable state.
+ * Register the observer of the enable state.
+ * @throws { BusinessError } 401 - Input parameter error.
*/
on(type: 'enableChange', callback: Callback): void;
+
/**
* Register the observer of the style.
+ * @throws { BusinessError } 401 - Input parameter error.
*/
on(type: 'styleChange', callback: Callback): void;
+
/**
- * Deregister the observe of the enable state.
+ * Unregister the observer of the enable state.
+ * @throws { BusinessError } 401 - Input parameter error.
*/
off(type: 'enableChange', callback?: Callback): void;
+
/**
- * Deregister the observer of the style.
+ * Unregister the observer of the style.
+ * @throws { BusinessError } 401 - Input parameter error.
*/
off(type: 'styleChange', callback?: Callback): void;
}
@@ -383,7 +401,6 @@ declare namespace accessibility {
/**
* The content list.
- * @note
* @since 7
*/
contents?: Array;
@@ -414,7 +431,6 @@ declare namespace accessibility {
/**
* The total of the items.
- * @note talkback used it when scroll.
* @since 7
*/
itemCount?: number;
diff --git a/api/@ohos.account.appAccount.d.ts b/api/@ohos.account.appAccount.d.ts
index c1c808ad92bd76176f2a1a85d9a7947be5cdde77..2d4f53cb3673bc15786d47426c787e0249d0b214 100644
--- a/api/@ohos.account.appAccount.d.ts
+++ b/api/@ohos.account.appAccount.d.ts
@@ -65,8 +65,8 @@ declare namespace appAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name or options.
- * @throws {BusinessError} 12300008 - the account indicated by name already exist.
- * @throws {BusinessError} 12300011 - the account number has reached the upper limit.
+ * @throws {BusinessError} 12300004 - the account indicated by name already exist.
+ * @throws {BusinessError} 12300007 - the account number has reached the upper limit.
* @since 9
*/
createAccount(name: string, callback: AsyncCallback): void;
@@ -95,8 +95,10 @@ declare namespace appAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid owner or options.
- * @throws {BusinessError} 12300011 - the account number has reached the upper limit.
- * @throws {BusinessError} 12400002 - the account authenticator service does not exist.
+ * @throws {BusinessError} 12300007 - the account number has reached the upper limit.
+ * @throws {BusinessError} 12300010 - account service busy.
+ * @throws {BusinessError} 12300113 - the account authenticator service does not exist.
+ * @throws {BusinessError} 12300114 - authenticator service exception.
* @since 9
*/
createAccountImplicitly(owner: string, callback: AuthCallback): void;
@@ -166,7 +168,7 @@ declare namespace appAccount {
* @returns void.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
- * @throws {BusinessError} 12300002 - invalid name or bundlename.
+ * @throws {BusinessError} 12300002 - invalid name or bundle name.
* @throws {BusinessError} 12300003 - the account indicated by localId dose not exist.
* @throws {BusinessError} 12400001 - the application indicated by bundlename does not exist.
* @since 9
@@ -182,9 +184,8 @@ declare namespace appAccount {
* @returns void.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
- * @throws {BusinessError} 12300002 - invalid name or bundlename.
+ * @throws {BusinessError} 12300002 - invalid name or bundle name.
* @throws {BusinessError} 12300003 - the account indicated by localId dose not exist.
- * @throws {BusinessError} 12400001 - the application indicated by bundlename does not exist.
* @since 9
*/
checkAppAccess(name: string, bundleName: string, callback: AsyncCallback): void;
@@ -197,7 +198,7 @@ declare namespace appAccount {
* through the distributed networking. On the connected devices, you can call this method to check
* whether application data can be synchronized.
*
- * @permission ohos.permission.DISTRIBUTED_DATASYNC.
+ * @permission ohos.permission.DISTRIBUTED_DATASYNC
* @param name Indicates the name of the application account.
* @returns Returns {@code true} if application data synchronization is allowed; returns {@code false} otherwise.
* @since 7
@@ -214,7 +215,7 @@ declare namespace appAccount {
* through the distributed networking. On the connected devices, you can call this method to check
* whether application data can be synchronized.
*
- * @permission ohos.permission.DISTRIBUTED_DATASYNC.
+ * @permission ohos.permission.DISTRIBUTED_DATASYNC
* @param name Indicates the name of the application account.
* @returns Returns {@code true} if application data synchronization is allowed; returns {@code false} otherwise.
* @throws {BusinessError} 201 - permission denied.
@@ -249,7 +250,7 @@ declare namespace appAccount {
* @returns void.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
- * @throws {BusinessError} 12300002 - invalid name or credentialType.
+ * @throws {BusinessError} 12300002 - invalid name, credentialType or credential.
* @throws {BusinessError} 12300003 - the account indicated by localId dose not exist.
* @since 9
*/
@@ -267,6 +268,7 @@ declare namespace appAccount {
* @returns void.
* @since 7
* @deprecated since 9
+ * @useinstead appAccount.AppAccountManager#setCustomData
*/
setAccountExtraInfo(name: string, extraInfo: string, callback: AsyncCallback): void;
setAccountExtraInfo(name: string, extraInfo: string): Promise;
@@ -275,7 +277,7 @@ declare namespace appAccount {
* Sets whether a specified application account allows application data synchronization.
*
* If the same OHOS account has logged in to multiple devices, these devices constitute a super device
- * through the distributed networking. On the networked devices, you can call this method to set whether to
+ * through the distributed networking. On the connected devices, you can call this method to set whether to
* allow cross-device data synchronization. If synchronization is allowed, application data can be synchronized
* among these devices in the event of any changes related to the application account.
* If synchronization is not allowed, the application data is stored only on the local device.
@@ -286,7 +288,7 @@ declare namespace appAccount {
* Application data that can be synchronized: application account name, token,
* and data associated with this application account
*
- * @permission ohos.permission.DISTRIBUTED_DATASYNC.
+ * @permission ohos.permission.DISTRIBUTED_DATASYNC
* @param name Indicates the name of the application account.
* @param isEnable Specifies whether to allow application data synchronization.
* @returns void.
@@ -301,7 +303,7 @@ declare namespace appAccount {
* Sets whether a specified application account enables application data synchronization.
*
* If the same OHOS account has logged in to multiple devices, these devices constitute a super device
- * through the distributed networking. On the networked devices, you can call this method to set whether to
+ * through the distributed networking. On the connected devices, you can call this method to set whether to
* enable cross-device data synchronization. If synchronization is enabled, application data can be synchronized
* among these devices in the event of any changes related to the application account.
* If synchronization is not enabled, the application data is stored only on the local device.
@@ -312,7 +314,7 @@ declare namespace appAccount {
* Application data that can be synchronized: application account name, token,
* and data associated with this application account
*
- * @permission ohos.permission.DISTRIBUTED_DATASYNC.
+ * @permission ohos.permission.DISTRIBUTED_DATASYNC
* @param name Indicates the name of the application account.
* @param isEnabled Specifies whether to enable application data synchronization.
* @returns void.
@@ -349,7 +351,7 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name, key or value.
* @throws {BusinessError} 12300003 - the account indicated by name dose not exist.
- * @throws {BusinessError} 12400008 - the number of customized data has reached the upper limit.
+ * @throws {BusinessError} 12400003 - the number of customized data has reached the upper limit.
* @since 9
*/
setCustomData(name: string, key: string, value: string, callback: AsyncCallback): void;
@@ -364,7 +366,7 @@ declare namespace appAccount {
* Accounts of third-party applications. To obtain such information,
* your application must have gained authorization from the third-party applications.
*
- * @permission ohos.permission.GET_ALL_APP_ACCOUNTS.
+ * @permission ohos.permission.GET_ALL_APP_ACCOUNTS
* @returns Returns a list of application accounts.
* @since 7
* @deprecated since 9
@@ -382,7 +384,7 @@ declare namespace appAccount {
* Accounts of third-party applications. To obtain such information,
* your application must have gained authorization from the third-party applications.
*
- * @permission ohos.permission.GET_ALL_APP_ACCOUNTS.
+ * @permission ohos.permission.GET_ALL_APP_ACCOUNTS
* @returns Returns a list of application accounts.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
@@ -401,7 +403,7 @@ declare namespace appAccount {
* Accounts of third-party applications. To obtain such information,
* your application must have gained authorization from the third-party applications.
*
- * @permission ohos.permission.GET_ALL_APP_ACCOUNTS.
+ * @permission ohos.permission.GET_ALL_APP_ACCOUNTS
* @param owner Indicates the account owner of your application or third-party applications.
* @returns Returns a list of application accounts.
* @since 7
@@ -420,14 +422,14 @@ declare namespace appAccount {
* Accounts of third-party applications. To obtain such information,
* your application must have gained authorization from the third-party applications.
*
- * @permission ohos.permission.GET_ALL_APP_ACCOUNTS.
+ * @permission ohos.permission.GET_ALL_APP_ACCOUNTS
* @param owner Indicates the account owner of your application or third-party applications.
* @returns Returns a list of application accounts.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid owner.
- * @throws {BusinessError} 12300003 - the account indicated by owner dose not exist.
+ * @throws {BusinessError} 12400001 - the application indicated by bundle name does not exist.
* @since 9
*/
getAccountsByOwner(owner: string, callback: AsyncCallback>): void;
@@ -454,7 +456,7 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name or credentialType.
* @throws {BusinessError} 12300003 - the account indicated by name dose not exist.
- * @throws {BusinessError} 12300019 - credential does not exist.
+ * @throws {BusinessError} 12300102 - credential does not exist.
* @since 9
*/
getCredential(name: string, credentialType: string, callback: AsyncCallback): void;
@@ -467,6 +469,7 @@ declare namespace appAccount {
* for example, if the account does not exist.
* @since 7
* @deprecated since 9
+ * @useinstead appAccount.AppAccountManager#getCustomData
*/
getAccountExtraInfo(name: string, callback: AsyncCallback): void;
getAccountExtraInfo(name: string): Promise;
@@ -492,7 +495,7 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name or key.
* @throws {BusinessError} 12300003 - the account indicated by name dose not exist.
- * @throws {BusinessError} 12400009 - the customData does not exist.
+ * @throws {BusinessError} 12400002 - the customData does not exist.
* @since 9
*/
getCustomData(name: string, key: string, callback: AsyncCallback): void;
@@ -507,6 +510,7 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name or key.
* @throws {BusinessError} 12300003 - the account indicated by name dose not exist.
+ * @throws {BusinessError} 12400002 - the customData does not exist.
* @since 9
*/
getCustomDataSync(name: string, key: string): string;
@@ -536,8 +540,8 @@ declare namespace appAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid type or owners.
- * @throws {BusinessError} 12300003 - the account indicated by owners dose not exist.
- * @throws {BusinessError} 12300005 - the listener has been registered.
+ * @throws {BusinessError} 12300011 - the callback has been registered.
+ * @throws {BusinessError} 12400001 - the application indicated by owner does not exist.
* @since 9
*/
on(type: 'accountChange', owners: Array, callback: Callback>): void;
@@ -557,7 +561,7 @@ declare namespace appAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid type.
- * @throws {BusinessError} 12300005 - the listener has been registered.
+ * @throws {BusinessError} 12300012 - the callback has not been registered.
* @since 9
*/
off(type: 'accountChange', callback?: Callback>): void;
@@ -588,10 +592,9 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name, owner, authType or options.
* @throws {BusinessError} 12300003 - the account indicated by owner dose not exist.
- * @throws {BusinessError} 12300016 - authentication timeout.
- * @throws {BusinessError} 12300017 - authentication service is busy.
- * @throws {BusinessError} 12300018 - authentication service is locked.
- * @throws {BusinessError} 12400001 - the application indicated by name does not exist.
+ * @throws {BusinessError} 12300010 - account service busy.
+ * @throws {BusinessError} 12300113 - the account authenticator service does not exist.
+ * @throws {BusinessError} 12300114 - authenticator service exception.
* @since 9
*/
auth(name: string, owner: string, authType: string, callback: AuthCallback): void;
@@ -620,8 +623,7 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name, owner or authType.
* @throws {BusinessError} 12300003 - the account indicated by owner dose not exist.
- * @throws {BusinessError} 12300015 - the authType is not supported on current device.
- * @throws {BusinessError} 12400001 - the application indicated by name does not exist.
+ * @throws {BusinessError} 12300107 - the authType is not found.
* @since 9
*/
getAuthToken(name: string, owner: string, authType: string, callback: AsyncCallback): void;
@@ -654,9 +656,7 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name, owner, authType or token.
* @throws {BusinessError} 12300003 - the account indicated by name dose not exist.
- * @throws {BusinessError} 12300015 - the authType is not supported on current device.
- * @throws {BusinessError} 12300019 - credential does not exist.
- * @throws {BusinessError} 12400007 - the number of token has reached the upper limit.
+ * @throws {BusinessError} 12400004 - the number of token has reached the upper limit.
* @since 9
*/
setAuthToken(name: string, authType: string, token: string, callback: AsyncCallback): void;
@@ -691,8 +691,7 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name, owner, authType or token.
* @throws {BusinessError} 12300003 - the account indicated by name dose not exist.
- * @throws {BusinessError} 12300015 - the authType is not supported on current device.
- * @throws {BusinessError} 12300019 - credential does not exist.
+ * @throws {BusinessError} 12300107 - the authType is not found.
* @since 9
*/
deleteAuthToken(name: string, owner: string, authType: string, token: string, callback: AsyncCallback): void;
@@ -727,8 +726,9 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name, authType or bundleName.
* @throws {BusinessError} 12300003 - the account indicated by name dose not exist.
- * @throws {BusinessError} 12300015 - the authType is not supported on current device.
- * @throws {BusinessError} 12300019 - credential does not exist.
+ * @throws {BusinessError} 12300107 - the authType is not found.
+ * @throws {BusinessError} 12400001 - the application indicated by name does not exist.
+ * @throws {BusinessError} 12400005 - the size of authorization list reaches the upper limit.
* @since 9
*/
setAuthTokenVisibility(name: string, authType: string, bundleName: string, isVisible: boolean, callback: AsyncCallback): void;
@@ -761,8 +761,7 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name, authType or bundleName.
* @throws {BusinessError} 12300003 - the account indicated by name dose not exist.
- * @throws {BusinessError} 12300015 - the authType is not supported on current device.
- * @throws {BusinessError} 12300019 - credential does not exist.
+ * @throws {BusinessError} 12300107 - the authType is not found.
* @since 9
*/
checkAuthTokenVisibility(name: string, authType: string, bundleName: string, callback: AsyncCallback): void;
@@ -795,7 +794,7 @@ declare namespace appAccount {
getAllAuthTokens(name: string, owner: string): Promise>;
/**
- * Gets the open authorization list with a specified authentication type for a paticular application account.
+ * Gets the open authorization list with a specified authentication type for a particular application account.
*
* Only the owner of the application account has the permission to call this method.
* @param name Indicates the account name of your application.
@@ -809,7 +808,7 @@ declare namespace appAccount {
getOAuthList(name: string, authType: string): Promise>;
/**
- * Gets the open authorization list with a specified authentication type for a paticular application account.
+ * Gets the open authorization list with a specified authentication type for a particular application account.
*
* Only the owner of the application account has the permission to call this method.
* @param name Indicates the account name of your application.
@@ -819,8 +818,7 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name or authType.
* @throws {BusinessError} 12300003 - the account indicated by name dose not exist.
- * @throws {BusinessError} 12300015 - the authType is not supported on current device.
- * @throws {BusinessError} 12300019 - credential does not exist.
+ * @throws {BusinessError} 12300107 - the authType is not found.
* @since 9
*/
getAuthList(name: string, authType: string, callback: AsyncCallback>): void;
@@ -847,7 +845,8 @@ declare namespace appAccount {
* @returns Returns the authenticator callback related to the session id.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
- * @throws {BusinessError} 12400005 - the session indicated by sessionId does not exist.
+ * @throws {BusinessError} 12300002 - invalid session id.
+ * @throws {BusinessError} 12300108 - the session indicated by sessionId does not exist.
* @since 9
*/
getAuthCallback(sessionId: string, callback: AsyncCallback): void;
@@ -871,23 +870,25 @@ declare namespace appAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid owner.
- * @throws {BusinessError} 12300003 - the account indicated by owner dose not exist.
+ * @throws {BusinessError} 12300113 - the account authenticator service does not exist.
* @since 9
*/
queryAuthenticatorInfo(owner: string, callback: AsyncCallback): void;
queryAuthenticatorInfo(owner: string): Promise;
/**
- * Checks whether a paticular account has all specified labels.
+ * Checks whether a particular account has all specified labels.
* @param name Indicates the account name.
* @param owner Indicates the account owner.
* @param labels Indicates an array of labels to check.
* @returns boolean
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
- * @throws {BusinessError} 12300002 - invalid name or owner.
+ * @throws {BusinessError} 12300002 - invalid name, owner or labels.
* @throws {BusinessError} 12300003 - the account indicated by owner dose not exist.
- * @throws {BusinessError} 12400001 - the application indicated by name does not exist.
+ * @throws {BusinessError} 12300010 - account service busy.
+ * @throws {BusinessError} 12300113 - the account authenticator service does not exist.
+ * @throws {BusinessError} 12300114 - authenticator service exception.
* @since 9
*/
checkAccountLabels(name: string, owner: string, labels: Array, callback: AsyncCallback): void;
@@ -901,9 +902,9 @@ declare namespace appAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name or credentialType.
- * @throws {BusinessError} 12300019 - credential does not exist.
- * @throws {BusinessError} 12400001 - the application indicated by name does not exist.
- * since 9
+ * @throws {BusinessError} 12300003 - the account indicated by name dose not exist.
+ * @throws {BusinessError} 12300102 - credential does not exist.
+ * @since 9
*/
deleteCredential(name: string, credentialType: string, callback: AsyncCallback): void;
deleteCredential(name: string, credentialType: string): Promise;
@@ -915,6 +916,8 @@ declare namespace appAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid options.
+ * @throws {BusinessError} 12300010 - account service busy.
+ * @throws {BusinessError} 12300114 - authenticator service exception.
* @since 9
*/
selectAccountsByOptions(options: SelectAccountsOptions, callback: AsyncCallback>): void;
@@ -931,8 +934,9 @@ declare namespace appAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid name, owner or options.
* @throws {BusinessError} 12300003 - the account indicated by owner dose not exist.
- * @throws {BusinessError} 12400001 - the application indicated by name does not exist.
- * @throws {BusinessError} 12400002 - he account authenticator service does not exist.
+ * @throws {BusinessError} 12300010 - account service busy.
+ * @throws {BusinessError} 12300113 - the account authenticator service does not exist.
+ * @throws {BusinessError} 12300114 - authenticator service exception.
* @since 9
*/
verifyCredential(name: string, owner: string, callback: AuthCallback): void;
@@ -949,8 +953,9 @@ declare namespace appAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid owner or options.
- * @throws {BusinessError} 12300003 - the account indicated by owner dose not exist.
- * @throws {BusinessError} 12400002 - the account authenticator service does not exist.
+ * @throws {BusinessError} 12300010 - account service busy.
+ * @throws {BusinessError} 12300113 - the account authenticator service does not exist.
+ * @throws {BusinessError} 12300114 - authenticator service exception.
* @since 9
*/
setAuthenticatorProperties(owner: string, callback: AuthCallback): void;
@@ -1063,7 +1068,7 @@ declare namespace appAccount {
*/
interface AuthResult {
/**
- * The account infomation.
+ * The account information.
* @since 9
*/
account?: AppAccountInfo;
@@ -1154,7 +1159,7 @@ declare namespace appAccount {
*/
interface VerifyCredentialOptions {
/**
- * The credentail type to be verified.
+ * The credential type to be verified.
* @since 9
*/
credentialType?: string;
@@ -1281,7 +1286,7 @@ declare namespace appAccount {
KEY_ACTION = "action",
/**
- * Indicates the key of authentiaction type.
+ * Indicates the key of authentication type.
*
* @since 8
*/
@@ -1441,6 +1446,8 @@ declare namespace appAccount {
* @param callback Indicates the authenticator callback.
* @returns void.
* @since 8
+ * @deprecated since 9
+ * @useinstead appAccount.Authenticator#createAccountImplicitly
*/
addAccountImplicitly(authType: string, callerBundleName: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void;
@@ -1462,6 +1469,8 @@ declare namespace appAccount {
* @param callback Indicates the authenticator callback.
* @returns void.
* @since 8
+ * @deprecated since 9
+ * @useinstead appAccount.Authenticator#auth
*/
authenticate(name: string, authType: string, callerBundleName: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void;
diff --git a/api/@ohos.account.distributedAccount.d.ts b/api/@ohos.account.distributedAccount.d.ts
index 3e3b41439a0e946fb2ed98c435a39123283fd218..c5deff6f2bd92be14a5bd39595805bc29fc8b4bb 100644
--- a/api/@ohos.account.distributedAccount.d.ts
+++ b/api/@ohos.account.distributedAccount.d.ts
@@ -51,7 +51,7 @@ declare namespace distributedAccount {
/**
* Gets the distributed information of the current OS account.
- * @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS or ohos.permission.GET_DISTRIBUTED_ACCOUNTS or ohos.permission.DISTRIBUTED_DATASYNC.
+ * @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS or ohos.permission.GET_DISTRIBUTED_ACCOUNTS or ohos.permission.DISTRIBUTED_DATASYNC
* @returns The distributed information of the current OS account.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
@@ -63,7 +63,7 @@ declare namespace distributedAccount {
/**
* Updates the distributed information of the OS account.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param accountInfo Indicates the information of the OS account used for a distributed system.
* @returns void
* @since 7
@@ -75,13 +75,14 @@ declare namespace distributedAccount {
/**
* Sets the distributed information of the OS account.
- * @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_DISTRIBUTED_ACCOUNTS
* @param accountInfo Indicates the information of the OS account used for a distributed system.
* @returns void
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid accountInfo.
+ * @throws {BusinessError} 12300003 - the account indicated by accountInfo dose not exist.
* @since 9
*/
setOsAccountDistributedInfo(accountInfo: DistributedInfo, callback: AsyncCallback): void;
diff --git a/api/@ohos.account.osAccount.d.ts b/api/@ohos.account.osAccount.d.ts
index 92a81d4b44d572743e76639447886445cdae8e48..614155cce28ab942f8c7c62af6238e278fcbe23d 100644
--- a/api/@ohos.account.osAccount.d.ts
+++ b/api/@ohos.account.osAccount.d.ts
@@ -44,7 +44,7 @@ declare namespace osAccount {
* to run in the foreground. Then, the OS account originally running in the foreground will be
* switched to the background.
*
- * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION.
+ * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION
* @param localId Indicates the local ID of the OS account.
* @returns void.
* @throws {BusinessError} 201 - permission denied.
@@ -52,8 +52,8 @@ declare namespace osAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid localId.
* @throws {BusinessError} 12300003 - the account indicated by localId dose not exist.
- * @throws {BusinessError} 12300003 - the account indicated by localId has been activated.
- * @throws {BusinessError} 12300010 - account service is busy.
+ * @throws {BusinessError} 12300008 - the localId indicates restricted account.
+ * @throws {BusinessError} 12300009 - the account indicated by localId has been activated.
* @systemapi Hide this for inner system use.
* @since 7
*/
@@ -94,7 +94,7 @@ declare namespace osAccount {
/**
* Checks whether an OS account is activated based on its local ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @returns void
* @throws {BusinessError} 201 - permission denied.
@@ -109,7 +109,7 @@ declare namespace osAccount {
/**
* Checks whether a constraint has been enabled for an OS account based on its local ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @param constraint Indicates the constraint to check. The value can be:
*
@@ -132,7 +132,7 @@ declare namespace osAccount {
/**
* Checks whether a constraint has been enabled for an OS account based on its local ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @param constraint Indicates the constraint to check. The value can be:
*
@@ -151,7 +151,6 @@ declare namespace osAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid localId or constraint.
* @throws {BusinessError} 12300003 - the account indicated by localId dose not exist.
- * @throws {BusinessError} 12300004 - the localId indicates restricted account.
* @since 9
*/
checkConstraintEnabled(localId: number, constraint: string, callback: AsyncCallback): void;
@@ -179,7 +178,7 @@ declare namespace osAccount {
/**
* Checks whether an OS account has been verified based on its local ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @returns Returns {@code true} if the OS account has been verified successfully;
* returns {@code false} otherwise.
@@ -194,7 +193,7 @@ declare namespace osAccount {
/**
* Checks whether an OS account has been verified based on its ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @returns Returns {@code true} if the OS account has been verified successfully;
* returns {@code false} otherwise.
@@ -211,7 +210,7 @@ declare namespace osAccount {
/**
* Removes an OS account based on its local ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @returns void.
* @throws {BusinessError} 201 - permission denied.
@@ -219,7 +218,7 @@ declare namespace osAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid localId.
* @throws {BusinessError} 12300003 - the account indicated by localId dose not exist.
- * @throws {BusinessError} 12300004 - the localId indicates restricted account.
+ * @throws {BusinessError} 12300008 - the localId indicates restricted account.
* @systemapi Hide this for inner system use.
* @since 7
*/
@@ -228,7 +227,7 @@ declare namespace osAccount {
/**
* Sets constraints for an OS account based on its local ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @param constraints Indicates the constraints to set for the OS account. The value can be:
*
@@ -247,7 +246,7 @@ declare namespace osAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid localId or constraints.
* @throws {BusinessError} 12300003 - the account indicated by localId dose not exist.
- * @throws {BusinessError} 12300004 - the localId indicates restricted account.
+ * @throws {BusinessError} 12300008 - the localId indicates restricted account.
* @systemapi Hide this for inner system use.
* @since 7
*/
@@ -257,7 +256,7 @@ declare namespace osAccount {
/**
* Sets the local name for an OS account based on its local ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @param localName Indicates the local name to set for the OS account.
* @returns void.
@@ -266,7 +265,7 @@ declare namespace osAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid localId or localName.
* @throws {BusinessError} 12300003 - the account indicated by localId dose not exist.
- * @throws {BusinessError} 12300004 - the localId indicates restricted account.
+ * @throws {BusinessError} 12300008 - the localId indicates restricted account.
* @systemapi Hide this for inner system use.
* @since 7
*/
@@ -275,7 +274,7 @@ declare namespace osAccount {
/**
* Obtains the number of all OS accounts created on a device.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @returns Returns the number of created OS accounts.
* @since 7
* @deprecated since 9
@@ -286,7 +285,7 @@ declare namespace osAccount {
/**
* Obtains the number of all OS accounts created on a device.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @returns Returns the number of created OS accounts.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
@@ -341,7 +340,7 @@ declare namespace osAccount {
/**
* Queries the local ID of an OS account which is bound to the specified domain account
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param domainInfo Indicates the domain account info.
* @returns Returns the local ID of the OS account.
* @since 8
@@ -354,7 +353,7 @@ declare namespace osAccount {
/**
* Queries the ID of an account which is bound to the specified domain account
*
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param domainInfo Indicates the domain account info.
* @returns Returns the local ID of the OS account.
* @throws {BusinessError} 201 - permission denied.
@@ -379,7 +378,7 @@ declare namespace osAccount {
/**
* Obtains all constraints of an OS account based on its local ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @returns Returns a list of constraints.
* @since 7
@@ -391,7 +390,7 @@ declare namespace osAccount {
/**
* Obtains all constraints of an account based on its ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @returns Returns a list of constraints.
* @throws {BusinessError} 201 - permission denied.
@@ -399,7 +398,6 @@ declare namespace osAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid localId.
* @throws {BusinessError} 12300003 - the account indicated by localId dose not exist.
- * @throws {BusinessError} 12300004 - the localId indicates restricted account.
* @since 9
*/
getOsAccountConstraints(localId: number, callback: AsyncCallback>): void;
@@ -407,7 +405,7 @@ declare namespace osAccount {
/**
* Queries the list of all the OS accounts that have been created in the system.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @returns Returns a list of OS accounts.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
@@ -440,7 +438,7 @@ declare namespace osAccount {
/**
* Creates an OS account using the local name and account type.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param localName Indicates the local name of the OS account to create.
* @param type Indicates the type of the OS account to create.
* {@link OsAccountType} specifies the account types available in the system.
@@ -449,7 +447,9 @@ declare namespace osAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid localName.
- * @throws {BusinessError} 12300003 - the account indicated by localId dose not exist.
+ * @throws {BusinessError} 12300005 - multi-user not supported.
+ * @throws {BusinessError} 12300006 - unsupported account type.
+ * @throws {BusinessError} 12300007 - the number of account reaches the upper limit.
* @systemapi Hide this for inner system use.
* @since 7
*/
@@ -458,7 +458,7 @@ declare namespace osAccount {
/**
* Creates an OS account using the account type and domain account info.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param type Indicates the type of the OS account to create.
* {@link OsAccountType} specifies the account types available in the system.
* @param domainInfo Indicates the domain account info.
@@ -467,6 +467,9 @@ declare namespace osAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid type or domainInfo.
+ * @throws {BusinessError} 12300005 - multi-user not supported.
+ * @throws {BusinessError} 12300006 - unsupported account type.
+ * @throws {BusinessError} 12300007 - the number of account reaches the upper limit.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -475,7 +478,7 @@ declare namespace osAccount {
/**
* Queries information about the current OS account.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @returns Returns information about the current OS account; returns {@code null} if the query fails.
* @since 7
* @deprecated since 9
@@ -486,7 +489,7 @@ declare namespace osAccount {
/**
* Gets information about the current OS account.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @returns Returns information about the current OS account; returns {@code null} if the query fails.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
@@ -494,12 +497,12 @@ declare namespace osAccount {
* @since 9
*/
getCurrentOsAccount(callback: AsyncCallback): void;
- getCurrentOsAccount(): Promise;
+ getCurrentOsAccount(): Promise;
/**
* Queries OS account information based on the local ID.
*
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS or ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION
* @param localId Indicates the local ID of the OS account.
* @returns Returns the OS account information; returns {@code null} if the query fails.
* @throws {BusinessError} 201 - permission denied.
@@ -539,7 +542,7 @@ declare namespace osAccount {
* Obtains the distributed virtual device ID (DVID).
*
* If the same OHOS account has logged in to multiple devices, these devices constitute a super device
- * through the distributed networking. On the networked devices, you can call this method to obtain the DVIDs.
+ * through the distributed networking. On the connected devices, you can call this method to obtain the DVIDs.
* The same application running on different devices obtains the same DVID, whereas different applications
* obtain different DVIDs.
*
@@ -556,11 +559,11 @@ declare namespace osAccount {
* Queries the distributed virtual device ID (DVID).
*
* If the same OHOS account has logged in to multiple devices, these devices constitute a super device
- * through the distributed networking. On the networked devices, you can call this method to obtain the DVIDs.
+ * through the distributed networking. On the connected devices, you can call this method to obtain the DVIDs.
* The same application running on different devices obtains the same DVID, whereas different applications
* obtain different DVIDs.
*
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.DISTRIBUTED_DATASYNC or ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @returns Returns the DVID if obtained; returns an empty string if no OHOS account has logged in.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
@@ -572,7 +575,7 @@ declare namespace osAccount {
/**
* Obtains the profile photo of an OS account based on its local ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @returns Returns the profile photo if obtained;
* returns {@code null} if the profile photo fails to be obtained.
@@ -589,7 +592,7 @@ declare namespace osAccount {
/**
* Sets the profile photo for an OS account based on its local ID.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @param localId Indicates the local ID of the OS account.
* @param photo Indicates the profile photo to set for the OS account.
* @returns void.
@@ -598,6 +601,7 @@ declare namespace osAccount {
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid localId or photo.
* @throws {BusinessError} 12300003 - the account indicated by localId dose not exist.
+ * @throws {BusinessError} 12300008 - the localId indicates restricted account.
* @systemapi Hide this for inner system use.
* @since 7
*/
@@ -621,6 +625,8 @@ declare namespace osAccount {
* @returns localId.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
+ * @throws {BusinessError} 12300002 - invalid serialNumber.
+ * @throws {BusinessError} 12300003 - the account indicated by serialNumber dose not exist.
* @since 9
*/
queryOsAccountLocalIdBySerialNumber(serialNumber: number, callback: AsyncCallback): void;
@@ -662,7 +668,8 @@ declare namespace osAccount {
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
- * @throws {BusinessError} 12300005 - the listener has been registered.
+ * @throws {BusinessError} 12300002 - invalid type or name.
+ * @throws {BusinessError} 12300011 - the callback has been registered.
* @systemapi Hide this for inner system use.
* @since 7
*/
@@ -677,7 +684,8 @@ declare namespace osAccount {
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
- * @throws {BusinessError} 12300006 - the listener has not been registered.
+ * @throws {BusinessError} 12300002 - invalid type or name.
+ * @throws {BusinessError} 12300012 - the callback has not been registered.
* @systemapi Hide this for inner system use.
* @since 7
*/
@@ -698,7 +706,7 @@ declare namespace osAccount {
/**
* Check whether current process belongs to the main account.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @returns Returns {@code true} if current process belongs to the main os account;
* returns {@code false} otherwise.
* @throws {BusinessError} 201 - permission denied.
@@ -712,7 +720,7 @@ declare namespace osAccount {
/**
* Query the constraint source type list of the OS account.
- * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS.
+ * @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS
* @returns Returns the constraint source type infos of the os account;
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
@@ -882,8 +890,6 @@ declare namespace osAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid authType or authTrustLevel.
- * @throws {BusinessError} 12300014 - the authTrustLevel is not supported on current device
- * @throws {BusinessError} 12300015 - the authType is not supported on current device.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -908,7 +914,6 @@ declare namespace osAccount {
* Sets property that can be used to initialize algorithms.
* @permission ohos.permission.ACCESS_USER_AUTH_INTERNAL
* @param request Indicates the request information, including authentication type and the key-value to be set.
- * @returns Returns a number value indicating whether the property setting was successful.
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
@@ -916,8 +921,8 @@ declare namespace osAccount {
* @systemapi Hide this for inner system use.
* @since 8
*/
- setProperty(request: SetPropertyRequest, callback: AsyncCallback): void;
- setProperty(request: SetPropertyRequest): Promise;
+ setProperty(request: SetPropertyRequest, callback: AsyncCallback): void;
+ setProperty(request: SetPropertyRequest): Promise;
/**
* Executes authentication.
@@ -931,12 +936,12 @@ declare namespace osAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid challenge, authType or authTrustLevel.
- * @throws {BusinessError} 12300014 - the authTrustLevel is not supported on current device
- * @throws {BusinessError} 12300015 - the authType is not supported on current device.
- * @throws {BusinessError} 12300016 - authentication timeout.
- * @throws {BusinessError} 12300017 - authentication service is busy.
- * @throws {BusinessError} 12300018 - authentication service is locked.
- * @throws {BusinessError} 12300019 - the credential does not exist.
+ * @throws {BusinessError} 12300101 - token is invalid.
+ * @throws {BusinessError} 12300105 - unsupported authTrustLevel.
+ * @throws {BusinessError} 12300106 - unsupported authType.
+ * @throws {BusinessError} 12300110 - authentication is locked.
+ * @throws {BusinessError} 12300111 - authentication timeout.
+ * @throws {BusinessError} 12300112 - authentication service is busy.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -955,13 +960,12 @@ declare namespace osAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid userId, challenge, authType or authTrustLevel.
- * @throws {BusinessError} 12300003 - the account indicated by userId dose not exist.
- * @throws {BusinessError} 12300014 - the authTrustLevel is not supported on current device
- * @throws {BusinessError} 12300015 - the authType is not supported on current device.
- * @throws {BusinessError} 12300016 - authentication timeout.
- * @throws {BusinessError} 12300017 - authentication service is busy.
- * @throws {BusinessError} 12300018 - authentication service is locked.
- * @throws {BusinessError} 12300019 - the credential does not exist.
+ * @throws {BusinessError} 12300101 - token is invalid.
+ * @throws {BusinessError} 12300105 - unsupported authTrustLevel.
+ * @throws {BusinessError} 12300106 - unsupported authType.
+ * @throws {BusinessError} 12300110 - authentication is locked.
+ * @throws {BusinessError} 12300111 - authentication timeout.
+ * @throws {BusinessError} 12300112 - authentication service is busy.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -974,7 +978,7 @@ declare namespace osAccount {
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
- * @throws {BusinessError} 12300002 - invalid contexId.
+ * @throws {BusinessError} 12300002 - invalid contextId.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -1003,7 +1007,7 @@ declare namespace osAccount {
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
- * @throws {BusinessError} 12300007 - PIN inputer has been registered.
+ * @throws {BusinessError} 12300103 - the credential inputer has been registered.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -1054,7 +1058,7 @@ declare namespace osAccount {
*
* Add user credential information, pass in credential addition method and credential information
* (credential type, subclass, if adding user's non password credentials, pass in password authentication token),
- * and get the result / acquireinfo callback.
+ * and get the result / acquireInfo callback.
* @permission ohos.permission.MANAGE_USER_IDM
* @param credentialInfo Indicates the credential information.
* @param callback Indicates the callback to get results and acquireInfo.
@@ -1062,6 +1066,8 @@ declare namespace osAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid credentialInfo.
+ * @throws {BusinessError} 12300101 - token is invalid.
+ * @throws {BusinessError} 12300106 - unsupported authType.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -1076,6 +1082,8 @@ declare namespace osAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid credentialInfo.
+ * @throws {BusinessError} 12300101 - token is invalid.
+ * @throws {BusinessError} 12300106 - unsupported authType.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -1112,7 +1120,7 @@ declare namespace osAccount {
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
- * @throws {BusinessError} 12300002 - invalid token.
+ * @throws {BusinessError} 12300101 - token is invalid.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -1127,7 +1135,9 @@ declare namespace osAccount {
* @throws {BusinessError} 201 - permission denied.
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
- * @throws {BusinessError} 12300002 - invalid credentialId or token.
+ * @throws {BusinessError} 12300002 - invalid credentialId.
+ * @throws {BusinessError} 12300101 - token is invalid.
+ * @throws {BusinessError} 12300102 - credential not found.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -1143,11 +1153,7 @@ declare namespace osAccount {
* @throws {BusinessError} 401 - the parameter check failed.
* @throws {BusinessError} 12300001 - system service exception.
* @throws {BusinessError} 12300002 - invalid authType.
- * @throws {BusinessError} 12300015 - the authType is not supported on current device.
- * @throws {BusinessError} 12300016 - authentication timeout.
- * @throws {BusinessError} 12300017 - authentication service is busy.
- * @throws {BusinessError} 12300018 - authentication service is locked.
- * @throws {BusinessError} 12300019 - the credential does not exist.
+ * @throws {BusinessError} 12300102 - credential not found.
* @systemapi Hide this for inner system use.
* @since 8
*/
@@ -1207,9 +1213,9 @@ declare namespace osAccount {
* The authentication result code is returned through the callback.
* @param result Indicates the authentication result code.
* @param extraInfo Indicates the specific information for different situation.
- * If the authentication is passed, the authentication token is returned in extrainfo,
- * If the authentication fails, the remaining authentication times are returned in extrainfo,
- * If the authentication executor is locked, the freezing time is returned in extrainfo.
+ * If the authentication is passed, the authentication token is returned in extraInfo,
+ * If the authentication fails, the remaining authentication times are returned in extraInfo,
+ * If the authentication executor is locked, the freezing time is returned in extraInfo.
* @systemapi Hide this for inner system use.
* @since 8
*/
diff --git a/api/@ohos.app.ability.Ability.d.ts b/api/@ohos.app.ability.Ability.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4c0485909b39e2ec2d830a0cdb63e289e8f6c29e
--- /dev/null
+++ b/api/@ohos.app.ability.Ability.d.ts
@@ -0,0 +1,56 @@
+/*
+ * Copyright (c) 2022 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 AbilityConstant from "./@ohos.app.ability.AbilityConstant";
+import { Configuration } from './@ohos.app.ability.Configuration';
+
+/**
+ * The class of an ability.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+export default class Ability {
+ /**
+ * Called when the system configuration is updated.
+ * @param { Configuration } newConfig - Indicates the updated configuration.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onConfigurationUpdate(newConfig: Configuration): void;
+
+ /**
+ * Called when the system has determined to trim the memory, for example, when the ability is running in the
+ * background and there is no enough memory for running as many background processes as possible.
+ * @param { AbilityConstant.MemoryLevel } level - Indicates the memory trim level, which shows the current memory
+ * usage status.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onMemoryLevel(level: AbilityConstant.MemoryLevel): void;
+
+ /**
+ * Called back when an ability prepares to save.
+ * @param reason state type when save.
+ * @param wantParam Indicates the want parameter.
+ * @return 0 if ability agrees to save data successfully, otherwise errcode.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onSaveState(reason: AbilityConstant.StateType, wantParam : {[key: string]: any}): AbilityConstant.OnSaveResult;
+}
diff --git a/api/@ohos.app.ability.AbilityConstant.d.ts b/api/@ohos.app.ability.AbilityConstant.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..4237bb892ad73baa960c10483ebf5ffa07b9aa29
--- /dev/null
+++ b/api/@ohos.app.ability.AbilityConstant.d.ts
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2022 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 definition of AbilityConstant.
+ * @namespace AbilityConstant
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+declare namespace AbilityConstant {
+ /**
+ * Interface of launch param.
+ * @typedef LaunchParam
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ export interface LaunchParam {
+ /**
+ * Indicates launch reason.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ launchReason: LaunchReason;
+
+ /**
+ * Indicates last exit reason.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ lastExitReason: LastExitReason;
+ }
+
+ /**
+ * Type of launch reason.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ export enum LaunchReason {
+ UNKNOWN = 0,
+ START_ABILITY = 1,
+ CALL = 2,
+ CONTINUATION = 3,
+ APP_RECOVERY = 4,
+ }
+
+ /**
+ * Type of last exit reason.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ export enum LastExitReason {
+ UNKNOWN = 0,
+ ABILITY_NOT_RESPONDING = 1,
+ NORMAL = 2,
+ }
+
+ /**
+ * Type of onContinue result.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ export enum OnContinueResult {
+ AGREE = 0,
+ REJECT = 1,
+ MISMATCH = 2,
+ }
+
+ /**
+ * Type of memory level.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ export enum MemoryLevel {
+ MEMORY_LEVEL_MODERATE = 0,
+ MEMORY_LEVEL_LOW = 1,
+ MEMORY_LEVEL_CRITICAL = 2,
+ }
+
+ /**
+ * Type of window mode.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ export enum WindowMode {
+ WINDOW_MODE_UNDEFINED = 0,
+ WINDOW_MODE_FULLSCREEN = 1,
+ WINDOW_MODE_SPLIT_PRIMARY = 100,
+ WINDOW_MODE_SPLIT_SECONDARY = 101,
+ WINDOW_MODE_FLOATING = 102,
+ }
+
+ /**
+ * Type of onSave result.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ export enum OnSaveResult {
+ ALL_AGREE = 0,
+ CONTINUATION_REJECT = 1,
+ CONTINUATION_MISMATCH = 2,
+ RECOVERY_AGREE = 3,
+ RECOVERY_REJECT = 4,
+ ALL_REJECT,
+ }
+
+ /**
+ * Type of save state.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ export enum StateType {
+ CONTINUATION = 0,
+ APP_RECOVERY = 1,
+ }
+}
+
+export default AbilityConstant;
diff --git a/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts b/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..e9ad0881470c1a4ea079e0ae3c6f08919e7ecb3f
--- /dev/null
+++ b/api/@ohos.app.ability.AbilityLifecycleCallback.d.ts
@@ -0,0 +1,111 @@
+/*
+ * Copyright (c) 2022 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 UIAbility from "./@ohos.app.ability.UIAbility";
+import dataAbility from "./@ohos.data.dataAbility";
+import window from './@ohos.window';
+
+/**
+ * The ability lifecycle callback.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+export default class AbilityLifecycleCallback {
+ /**
+ * Called back when an ability is started for initialization.
+ * @param { Ability } ability - Indicates the ability to register for listening.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onAbilityCreate(ability: UIAbility): void;
+
+ /**
+ * Called back when a window stage is created.
+ * @param { Ability } ability - Indicates the ability to register for listening.
+ * @param { window.WindowStage } windowStage - window stage to create
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onWindowStageCreate(ability: UIAbility, windowStage: window.WindowStage): void;
+
+ /**
+ * Called back when a window stage is active.
+ * @param { Ability } ability - Indicates the ability to register for listening.
+ * @param { window.WindowStage } windowStage - window stage to active
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onWindowStageActive(ability: UIAbility, windowStage: window.WindowStage): void;
+
+ /**
+ * Called back when a window stage is inactive.
+ * @param { Ability } ability - Indicates the ability to register for listening.
+ * @param { window.WindowStage } windowStage - window stage to inactive
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onWindowStageInactive(ability: UIAbility, windowStage: window.WindowStage): void;
+
+ /**
+ * Called back when a window stage is destroyed.
+ * @param { Ability } ability - Indicates the ability to register for listening.
+ * @param { window.WindowStage } windowStage - window stage to destroy
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onWindowStageDestroy(ability: UIAbility, windowStage: window.WindowStage): void;
+
+ /**
+ * Called back when an ability is destroyed.
+ * @param { Ability } ability - Indicates the ability to register for listening.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onAbilityDestroy(ability: UIAbility): void;
+
+ /**
+ * Called back when the state of an ability changes to foreground.
+ * @param { Ability } ability - Indicates the ability to register for listening.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onAbilityForeground(ability: UIAbility): void;
+
+ /**
+ * Called back when the state of an ability changes to background.
+ * @param { Ability } ability - Indicates the ability to register for listening.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onAbilityBackground(ability: UIAbility): void;
+
+ /**
+ * Called back when an ability prepares to continue.
+ * @param { Ability } ability - Indicates the ability to register for listening.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onAbilityContinue(ability: UIAbility): void;
+}
\ No newline at end of file
diff --git a/api/@ohos.app.ability.AbilityStage.d.ts b/api/@ohos.app.ability.AbilityStage.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..f0eb477e9dedc531bbad7bfd27aa4e968e7b8423
--- /dev/null
+++ b/api/@ohos.app.ability.AbilityStage.d.ts
@@ -0,0 +1,75 @@
+/*
+ * Copyright (c) 2022 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 AbilityConstant from "./@ohos.app.ability.AbilityConstant";
+import AbilityStageContext from "./application/AbilityStageContext";
+import Want from './@ohos.app.ability.Want';
+import { Configuration } from './@ohos.app.ability.Configuration';
+
+/**
+ * The class of an ability stage.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+export default class AbilityStage {
+ /**
+ * Indicates configuration information about context.
+ * @type { AbilityStageContext }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ context: AbilityStageContext;
+
+ /**
+ * Called back when an ability stage is started for initialization.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ onCreate(): void;
+
+ /**
+ * Called back when start specified ability.
+ * @param { Want } want - Indicates the want info of started ability.
+ * @return { string } The user returns an ability string ID. If the ability of this ID has been started before,
+ * do not create a new instance and pull it back to the top of the stack.
+ * Otherwise, create a new instance and start it.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ onAcceptWant(want: Want): string;
+
+ /**
+ * Called when the system configuration is updated.
+ * @param { Configuration } newConfig - Indicates the updated configuration.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ onConfigurationUpdate(newConfig: Configuration): void;
+
+ /**
+ * Called when the system has determined to trim the memory, for example, when the ability is running in the
+ * background and there is no enough memory for running as many background processes as possible.
+ * @param { AbilityConstant.MemoryLevel } level - Indicates the memory trim level, which shows the current memory usage status.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ onMemoryLevel(level: AbilityConstant.MemoryLevel): void;
+}
diff --git a/api/@ohos.app.ability.Configuration.d.ts b/api/@ohos.app.ability.Configuration.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b5f11c28d254a422316cb7a48353ad53dc13344f
--- /dev/null
+++ b/api/@ohos.app.ability.Configuration.d.ts
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2022 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 ConfigurationConstant from "./@ohos.app.ability.ConfigurationConstant";
+
+/**
+ * configuration item.
+ * @typedef Configuration
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+export interface Configuration {
+ /**
+ * Indicates the current language of the application.
+ * @type { string }
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ language?: string;
+
+ /**
+ * Indicates the current colorMode of the application.
+ * @type { ConfigurationConstant.ColorMode }
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ colorMode?: ConfigurationConstant.ColorMode;
+
+ /**
+ * Indicates the screen direction of the current device.
+ * @type { ConfigurationConstant.Direction }
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ direction?: ConfigurationConstant.Direction;
+
+ /**
+ * Indicates the screen density of the current device.
+ * @type { ConfigurationConstant.ScreenDensity }
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ screenDensity?: ConfigurationConstant.ScreenDensity;
+
+ /**
+ * Indicates the displayId of the current device.
+ * @type { number }
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ displayId?: number;
+
+ /**
+ * Indicates whether a pointer type device has connected.
+ * @type { boolean }
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ hasPointerDevice?: boolean;
+}
diff --git a/api/@ohos.app.ability.ConfigurationConstant.d.ts b/api/@ohos.app.ability.ConfigurationConstant.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..303647c93b6833a7286bb4c86b5de53172822a13
--- /dev/null
+++ b/api/@ohos.app.ability.ConfigurationConstant.d.ts
@@ -0,0 +1,65 @@
+/*
+ * Copyright (c) 2022 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 definition of ConfigurationConstant.
+ * @namespace ConfigurationConstant
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ declare namespace ConfigurationConstant {
+ /**
+ * ColorMode
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ export enum ColorMode {
+ COLOR_MODE_NOT_SET = -1,
+ COLOR_MODE_DARK = 0,
+ COLOR_MODE_LIGHT = 1,
+ }
+
+ /**
+ * Direction
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ export enum Direction {
+ DIRECTION_NOT_SET = -1,
+ DIRECTION_VERTICAL = 0,
+ DIRECTION_HORIZONTAL = 1,
+ }
+
+ /**
+ * ScreenDensity
+ * @name ScreenDensity
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ export enum ScreenDensity {
+ SCREEN_DENSITY_NOT_SET = 0,
+ SCREEN_DENSITY_SDPI = 120,
+ SCREEN_DENSITY_MDPI = 160,
+ SCREEN_DENSITY_LDPI = 240,
+ SCREEN_DENSITY_XLDPI = 320,
+ SCREEN_DENSITY_XXLDPI = 480,
+ SCREEN_DENSITY_XXXLDPI = 640,
+ }
+}
+
+export default ConfigurationConstant
diff --git a/api/@ohos.app.ability.EnvironmentCallback.d.ts b/api/@ohos.app.ability.EnvironmentCallback.d.ts
new file mode 100755
index 0000000000000000000000000000000000000000..8490a059ac392dd3ac58e443ffb04e40bf0e4774
--- /dev/null
+++ b/api/@ohos.app.ability.EnvironmentCallback.d.ts
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2022 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 { Configuration } from './@ohos.app.ability.Configuration';
+
+/**
+ * The environment callback.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+export default class EnvironmentCallback {
+ /**
+ * Called when the system configuration is updated.
+ * @param { Configuration } config - Indicates the updated configuration.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onConfigurationUpdated(config: Configuration): void;
+}
diff --git a/api/@ohos.app.ability.ExtensionAbility.d.ts b/api/@ohos.app.ability.ExtensionAbility.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..13d3d3e7ed69a6a589c5adc31cab7cafc4170ffd
--- /dev/null
+++ b/api/@ohos.app.ability.ExtensionAbility.d.ts
@@ -0,0 +1,25 @@
+/*
+ * Copyright (c) 2022 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 Ability from "./@ohos.app.ability.Ability";
+
+/**
+ * class of extension.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+export default class ExtensionAbility extends Ability {
+}
diff --git a/api/@ohos.app.ability.ServiceExtensionAbility.d.ts b/api/@ohos.app.ability.ServiceExtensionAbility.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..18241e6abd218bd3cde6581bf2697a6d912ec9cd
--- /dev/null
+++ b/api/@ohos.app.ability.ServiceExtensionAbility.d.ts
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2022 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 rpc from "./@ohos.rpc";
+import ServiceExtensionContext from "./application/ServiceExtensionContext";
+import Want from './@ohos.app.ability.Want';
+import { Configuration } from './@ohos.app.ability.Configuration';
+
+/**
+ * class of service extension ability.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @StageModelOnly
+ * @since 9
+ */
+export default class ServiceExtensionAbility {
+ /**
+ * Indicates service extension ability context.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @StageModelOnly
+ * @since 9
+ */
+ context: ServiceExtensionContext;
+
+ /**
+ * Called back when a service extension is started for initialization.
+ * @param { Want } want - Indicates the want of created service extension.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @StageModelOnly
+ * @since 9
+ */
+ onCreate(want: Want): void;
+
+ /**
+ * Called back before a service extension is destroyed.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @StageModelOnly
+ * @since 9
+ */
+ onDestroy(): void;
+
+ /**
+ * Called back when a service extension is started.
+ * @param { Want } want - Indicates the want of service extension to start.
+ * @param { number } startId - Indicates the number of times the service extension has been started.
+ * The {@code startId} is incremented by 1 every time the service extension is started.
+ * For example, if the service extension has been started for six times.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @StageModelOnly
+ * @since 9
+ */
+ onRequest(want: Want, startId: number): void;
+
+ /**
+ * Called back when a service extension is first connected to an ability.
+ * @param { Want } want - Indicates connection information about the Service ability.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @StageModelOnly
+ * @since 9
+ */
+ onConnect(want: Want): rpc.RemoteObject;
+
+ /**
+ * Called back when all abilities connected to a service extension are disconnected.
+ * @param { Want } want - Indicates disconnection information about the service extension.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @StageModelOnly
+ * @since 9
+ */
+ onDisconnect(want: Want): void;
+
+ /**
+ * Called when a new client attempts to connect to a service extension after all previous client connections to it
+ * are disconnected.
+ * @param { Want } want - Indicates the want of the service extension being connected.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @StageModelOnly
+ * @since 9
+ */
+ onReconnect(want: Want): void;
+
+ /**
+ * Called when the system configuration is updated.
+ * @param { Configuration } newConfig - Indicates the updated configuration.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @StageModelOnly
+ * @since 9
+ */
+ onConfigurationUpdate(newConfig: Configuration): void;
+
+ /**
+ * Called when dump client information is required.
+ * It is recommended that developers don't DUMP sensitive information.
+ * @param { Array } params - Indicates the params from command.
+ * @return { Array } The dump info array.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @StageModelOnly
+ * @since 9
+ */
+ onDump(params: Array): Array;
+}
diff --git a/api/bundle/dispatchInfo.d.ts b/api/@ohos.app.ability.StartOptions.d.ts
similarity index 59%
rename from api/bundle/dispatchInfo.d.ts
rename to api/@ohos.app.ability.StartOptions.d.ts
index 2538eb4c831ea6986e6501eec53294e77820b8ba..e89e431242ad3048d404c6ba7b17a7c097b490e2 100644
--- a/api/bundle/dispatchInfo.d.ts
+++ b/api/@ohos.app.ability.StartOptions.d.ts
@@ -14,23 +14,25 @@
*/
/**
- * @name The dispatch info class.
+ * StartOptions is the basic communication component of the system.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
* @since 9
- * @syscap SystemCapability.BundleManager.BundleFramework
- * @systemapi hide this for inner system use
*/
- export interface DispatchInfo {
+export default class StartOptions {
/**
- * @default Indicates the dispatchInfo version
+ * windowMode
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
* @since 9
- * @syscap SystemCapability.BundleManager.BundleFramework
*/
- readonly version: string;
-
+ windowMode?: number;
+
/**
- * @default Indicates the free install interface version number
+ * displayId
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
* @since 9
- * @syscap SystemCapability.BundleManager.BundleFramework
*/
- readonly dispatchAPI: string;
+ displayId?: number;
}
\ No newline at end of file
diff --git a/api/@ohos.app.ability.UIAbility.d.ts b/api/@ohos.app.ability.UIAbility.d.ts
new file mode 100755
index 0000000000000000000000000000000000000000..0d3e8f9bd1dec53208ae1a4c0b5666d211f285ce
--- /dev/null
+++ b/api/@ohos.app.ability.UIAbility.d.ts
@@ -0,0 +1,292 @@
+/*
+ * Copyright (c) 2022 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 Ability from "./@ohos.app.ability.Ability";
+import AbilityConstant from "./@ohos.app.ability.AbilityConstant";
+import UIAbilityContext from "./application/UIAbilityContext";
+import rpc from './@ohos.rpc';
+import Want from './@ohos.app.ability.Want';
+import window from './@ohos.window';
+
+/**
+ * The prototype of the listener function interface registered by the Caller.
+ * @typedef OnReleaseCallback
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+export interface OnReleaseCallback {
+ (msg: string): void;
+}
+
+/**
+ * The prototype of the message listener function interface registered by the Callee.
+ * @typedef CalleeCallback
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+export interface CalleeCallback {
+ (indata: rpc.MessageParcel): rpc.Sequenceable;
+}
+
+/**
+ * The interface of a Caller.
+ * @interface
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+export interface Caller {
+ /**
+ * Notify the server of Sequenceable type data.
+ * @param { string } method - The notification event string listened to by the callee.
+ * @param { rpc.Sequenceable } data - Notification data to the callee.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ call(method: string, data: rpc.Sequenceable): Promise;
+
+ /**
+ * Notify the server of Sequenceable type data and return the notification result.
+ * @param { string } method - The notification event string listened to by the callee.
+ * @param { rpc.Sequenceable } data - Notification data to the callee.
+ * @returns { Promise } Returns the callee's notification result data.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ callWithResult(method: string, data: rpc.Sequenceable): Promise;
+
+ /**
+ * Clear service records.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ release(): void;
+
+ /**
+ * Register death listener notification callback.
+ * @param { OnReleaseCallback } callback - Register a callback function for listening for notifications.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onRelease(callback: OnReleaseCallback): void;
+
+ /**
+ * Register death listener notification callback.
+ * @param { string } type - release.
+ * @param { OnReleaseCallback } callback - Register a callback function for listening for notifications.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ on(type: "release", callback: OnReleaseCallback): void;
+
+ /**
+ * Unregister death listener notification callback.
+ * @param { string } type - release.
+ * @param { OnReleaseCallback } callback - Unregister a callback function for listening for notifications.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ off(type: "release", callback: OnReleaseCallback): void;
+
+ /**
+ * Unregister all death listener notification callback.
+ * @param { string } type - release.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ off(type: "release"): void;
+}
+
+/**
+ * The interface of a Callee.
+ * @interface
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+export interface Callee {
+ /**
+ * Register data listener callback.
+ * @param { string } method - A string registered to listen for notification events.
+ * @param { CalleeCallback } callback - Register a callback function that listens for notification events.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ on(method: string, callback: CalleeCallback): void;
+
+ /**
+ * Unregister data listener callback.
+ * @param { string } method - A string registered to listen for notification events.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ off(method: string): void;
+}
+
+/**
+ * The class of a UI ability.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+export default class UIAbility extends Ability {
+ /**
+ * Indicates configuration information about an ability context.
+ * @type { UIAbilityContext }
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ context: UIAbilityContext;
+
+ /**
+ * Indicates ability launch want.
+ * @type { Want }
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ launchWant: Want;
+
+ /**
+ * Indicates ability last request want.
+ * @type { Want }
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ lastRequestWant: Want;
+
+ /**
+ * Call Service Stub Object.
+ * @type { Callee }
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ callee: Callee;
+
+ /**
+ * Called back when an ability is started for initialization.
+ * @param { Want } want - Indicates the want info of the created ability.
+ * @param { AbilityConstant.LaunchParam } param - Indicates the launch param.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onCreate(want: Want, param: AbilityConstant.LaunchParam): void;
+
+ /**
+ * Called back when an ability window stage is created.
+ * @param { window.WindowStage } windowStage - Indicates the created WindowStage.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onWindowStageCreate(windowStage: window.WindowStage): void;
+
+ /**
+ * Called back when an ability window stage is destroyed.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onWindowStageDestroy(): void;
+
+ /**
+ * Called back when an ability window stage is restored.
+ * @param { window.WindowStage } windowStage - window stage to restore
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onWindowStageRestore(windowStage: window.WindowStage): void;
+
+ /**
+ * Called back before an ability is destroyed.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onDestroy(): void;
+
+ /**
+ * Called back when the state of an ability changes to foreground.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onForeground(): void;
+
+ /**
+ * Called back when the state of an ability changes to background.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onBackground(): void;
+
+ /**
+ * Called back when an ability prepares to continue.
+ * @param { {[key: string]: any} } wantParam - Indicates the want parameter.
+ * @returns { AbilityConstant.OnContinueResult } Return the result of onContinue.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onContinue(wantParam: { [key: string]: any }): AbilityConstant.OnContinueResult;
+
+ /**
+ * Called when the launch mode of an ability is set to singleton.
+ * This happens when you re-launch an ability that has been at the top of the ability stack.
+ * @param { Want } want - Indicates the want info of ability.
+ * @param { AbilityConstant.LaunchParam } launchParams - Indicates the launch parameters.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onNewWant(want: Want, launchParams: AbilityConstant.LaunchParam): void;
+
+ /**
+ * Called when dump client information is required.
+ * It is recommended that developers don't DUMP sensitive information.
+ * @param { Array } params - Indicates the params from command.
+ * @returns { Array } Return the dump info array.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @StageModelOnly
+ * @since 9
+ */
+ onDump(params: Array): Array;
+}
diff --git a/api/@ohos.app.ability.Want.d.ts b/api/@ohos.app.ability.Want.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..39f02017e5703848cbd06d7cd865bc758eea8d3e
--- /dev/null
+++ b/api/@ohos.app.ability.Want.d.ts
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2022 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.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+export default class Want {
+ /**
+ * device id
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ deviceId?: string;
+
+ /**
+ * bundle name
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ bundleName?: string;
+
+ /**
+ * ability name
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ abilityName?: string;
+
+ /**
+ * The description of a URI in a Want.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ uri?: string;
+
+ /**
+ * The description of the type in this Want.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ type?: string;
+
+ /**
+ * The options of the flags in this Want.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ flags?: number;
+
+ /**
+ * The description of an action in an want.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ action?: string;
+
+ /**
+ * The description of the WantParams object in an Want
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ parameters?: {[key: string]: any};
+
+ /**
+ * The description of a entities in a Want.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ entities?: Array;
+
+ /**
+ * The description of an module name in an want.
+ * @syscap SystemCapability.Ability.AbilityBase
+ * @since 9
+ */
+ moduleName?: string;
+}
diff --git a/api/@ohos.app.ability.abilityDelegatorRegistry.d.ts b/api/@ohos.app.ability.abilityDelegatorRegistry.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a3177d986c0fc589bbfc0769d8b6ec098d8c5206
--- /dev/null
+++ b/api/@ohos.app.ability.abilityDelegatorRegistry.d.ts
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2022 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 { AbilityDelegator as _AbilityDelegator } from './application/abilityDelegator';
+import { AbilityDelegatorArgs as _AbilityDelegatorArgs } from './application/abilityDelegatorArgs';
+import { AbilityMonitor as _AbilityMonitor } from './application/abilityMonitor';
+import { ShellCmdResult as _ShellCmdResult } from './application/shellCmdResult';
+
+/**
+ * A global register used to store the AbilityDelegator and AbilityDelegatorArgs objects registered
+ * during application startup.
+ * @namespace abilityDelegatorRegistry
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+declare namespace abilityDelegatorRegistry {
+ /**
+ * Get the AbilityDelegator object of the application.
+ * @returns { AbilityDelegator } Return the AbilityDelegator object initialized when the application is started.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function getAbilityDelegator(): AbilityDelegator;
+
+ /**
+ * Get unit test arguments stored in the AbilityDelegatorArgs object.
+ * @returns { AbilityDelegator } Return the previously registered AbilityDelegatorArgs object.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function getArguments(): AbilityDelegatorArgs;
+
+ /**
+ * Describes all lifecycle states of an ability.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export enum AbilityLifecycleState {
+ UNINITIALIZED,
+ CREATE,
+ FOREGROUND,
+ BACKGROUND,
+ DESTROY,
+ }
+
+ /**
+ * A global test utility interface used for adding AbilityMonitor objects and control lifecycle states of abilities.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export type AbilityDelegator = _AbilityDelegator
+
+ /**
+ * Store unit testing-related parameters, including test case names, and test runner name.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export type AbilityDelegatorArgs = _AbilityDelegatorArgs
+
+ /**
+ * Provide methods for matching monitored Ability objects that meet specified conditions.
+ * The most recently matched Ability objects will be saved in the AbilityMonitor object.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export type AbilityMonitor = _AbilityMonitor
+
+ /**
+ * A object that records the result of shell command executes.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export type ShellCmdResult = _ShellCmdResult
+}
+
+export default abilityDelegatorRegistry;
\ No newline at end of file
diff --git a/api/@ohos.app.ability.abilityManager.d.ts b/api/@ohos.app.ability.abilityManager.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..b7775354d941dea6afb4fe6692f84056445ab1b8
--- /dev/null
+++ b/api/@ohos.app.ability.abilityManager.d.ts
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2022 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 { Configuration } from './@ohos.app.ability.Configuration';
+import { AbilityRunningInfo as _AbilityRunningInfo } from './application/AbilityRunningInfo';
+import { ExtensionRunningInfo as _ExtensionRunningInfo } from './application/ExtensionRunningInfo';
+import { ElementName } from './bundleManager/elementName';
+
+/**
+ * The class of an ability manager.
+ * @namespace abilityManager
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+declare namespace abilityManager {
+ /**
+ * Enum for the ability state
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ export enum AbilityState {
+ INITIAL = 0,
+ FOREGROUND = 9,
+ BACKGROUND = 10,
+ FOREGROUNDING = 11,
+ BACKGROUNDING = 12
+ }
+
+ /**
+ * Updates the configuration by modifying the configuration.
+ * @permission ohos.permission.UPDATE_CONFIGURATION
+ * @param { Configuration } config - Indicates the new configuration.
+ * @param { AsyncCallback } callback - The callback of updateConfiguration.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function updateConfiguration(config: Configuration, callback: AsyncCallback): void;
+
+ /**
+ * Updates the configuration by modifying the configuration.
+ * @permission ohos.permission.UPDATE_CONFIGURATION
+ * @param { Configuration } config - Indicates the new configuration.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function updateConfiguration(config: Configuration): Promise;
+
+ /**
+ * Get information about running abilities
+ * @permission ohos.permission.GET_RUNNING_INFO
+ * @returns { Promise> } Returns the array of AbilityRunningInfo.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getAbilityRunningInfos(): Promise>;
+
+ /**
+ * Get information about the running ability
+ * @permission ohos.permission.GET_RUNNING_INFO
+ * @param { AsyncCallback> } callback - The callback is used to return the array of AbilityRunningInfo.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getAbilityRunningInfos(callback: AsyncCallback>): void;
+
+ /**
+ * Get information about running extensions
+ * @permission ohos.permission.GET_RUNNING_INFO
+ * @param { number } upperLimit - Get the maximum limit of the number of messages.
+ * @returns { Promise> } Returns the array of ExtensionRunningInfo.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getExtensionRunningInfos(upperLimit: number): Promise>;
+
+ /**
+ * Get information about running extensions
+ * @permission ohos.permission.GET_RUNNING_INFO
+ * @param { number } upperLimit - Get the maximum limit of the number of messages.
+ * @param { AsyncCallback> } callback - The callback is used to return the array of ExtensionRunningInfo.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback>): void;
+
+ /**
+ * Get the top ability information of the display.
+ * @returns { Promise } Returns the elementName info of the top ability.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getTopAbility(): Promise;
+
+ /**
+ * Get the top ability information of the display.
+ * @param { AsyncCallback } callback - The callback is used to return the elementName info of the top ability.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getTopAbility(callback: AsyncCallback): void;
+
+ /**
+ * The class of an ability running information.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ export type AbilityRunningInfo = _AbilityRunningInfo
+
+ /**
+ * The class of an extension running information.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ export type ExtensionRunningInfo = _ExtensionRunningInfo
+}
+
+export default abilityManager;
\ No newline at end of file
diff --git a/api/@ohos.app.ability.appManager.d.ts b/api/@ohos.app.ability.appManager.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..ebc1872c806476003af7a702ab638aa3c065cb1a
--- /dev/null
+++ b/api/@ohos.app.ability.appManager.d.ts
@@ -0,0 +1,325 @@
+/*
+ * Copyright (c) 2022 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 * as _ApplicationStateObserver from './application/ApplicationStateObserver';
+import * as _AbilityStateData from './application/AbilityStateData';
+import * as _AppStateData from './application/AppStateData';
+import { ProcessRunningInfo as _ProcessRunningInfo } from './application/ProcessRunningInfo';
+import { ProcessRunningInformation as _ProcessRunningInformation } from './application/ProcessRunningInformation';
+
+/**
+ * This module provides the function of app manager service.
+ * @namespace appManager
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ *
+ */
+declare namespace appManager {
+ /**
+ * Enum for the application state
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ export enum ApplicationState {
+ STATE_CREATE,
+ STATE_FOREGROUND,
+ STATE_ACTIVE,
+ STATE_BACKGROUND,
+ STATE_DESTROY
+ }
+
+ /**
+ * Enum for the process state
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ export enum ProcessState {
+ STATE_CREATE,
+ STATE_FOREGROUND,
+ STATE_ACTIVE,
+ STATE_BACKGROUND,
+ STATE_DESTROY
+ }
+
+ /**
+ * Register application state observer.
+ * @permission ohos.permission.RUNNING_STATE_OBSERVER
+ * @param { string } type - applicationState.
+ * @param { ApplicationStateObserver } observer - The application state observer.
+ * @return { number } Returns the number code of the observer.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function on(type: "applicationState", observer: ApplicationStateObserver): number;
+
+ /**
+ * Register application state observer.
+ * @permission ohos.permission.RUNNING_STATE_OBSERVER
+ * @param { string } type - applicationState.
+ * @param { ApplicationStateObserver } observer - The application state observer.
+ * @param { Array } bundleNameList - The list of bundleName. The max length is 128.
+ * @return { number } Returns the number code of the observer.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function on(type: "applicationState", observer: ApplicationStateObserver, bundleNameList: Array): number;
+
+ /**
+ * Unregister application state observer.
+ * @permission ohos.permission.RUNNING_STATE_OBSERVER
+ * @param { string } type - applicationState.
+ * @param { number } observerId - Indicates the number code of the observer.
+ * @param { AsyncCallback } callback - The callback of off.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function off(type: "applicationState", observerId: number, callback: AsyncCallback): void;
+
+ /**
+ * Unregister application state observer.
+ * @permission ohos.permission.RUNNING_STATE_OBSERVER
+ * @param { string } type - applicationState.
+ * @param { number } observerId - Indicates the number code of the observer.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function off(type: "applicationState", observerId: number): Promise;
+
+ /**
+ * getForegroundApplications.
+ * @permission ohos.permission.GET_RUNNING_INFO
+ * @param { AsyncCallback> } callback - The callback is used to return the list of AppStateData.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getForegroundApplications(callback: AsyncCallback>): void;
+
+ /**
+ * getForegroundApplications.
+ * @permission ohos.permission.GET_RUNNING_INFO
+ * @returns { Promise> } Returns the list of AppStateData.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getForegroundApplications(): Promise>;
+
+ /**
+ * Kill process with account.
+ * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and ohos.permission.CLEAN_BACKGROUND_PROCESSES
+ * @param { string } bundleName - The process bundle name.
+ * @param { number } accountId - The account id.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function killProcessWithAccount(bundleName: string, accountId: number): Promise;
+
+ /**
+ * Kill process with account.
+ * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS and ohos.permission.CLEAN_BACKGROUND_PROCESSES
+ * @param { string } bundleName - The process bundle name.
+ * @param { number } accountId - The account id.
+ * @param { AsyncCallback } callback - The callback of killProcessWithAccount.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCallback): void;
+
+ /**
+ * Is user running in stability test.
+ * @param { AsyncCallback } callback - The callback is used to return true if user is running stability test.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function isRunningInStabilityTest(callback: AsyncCallback): void;
+
+ /**
+ * Is user running in stability test.
+ * @returns { Promise } Returns true if user is running stability test.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function isRunningInStabilityTest(): Promise;
+
+ /**
+ * Kill processes by bundle name
+ * @permission ohos.permission.CLEAN_BACKGROUND_PROCESSES
+ * @param { string } bundleName - bundle name.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function killProcessesByBundleName(bundleName: string): Promise;
+
+ /**
+ * Kill processes by bundle name
+ * @permission ohos.permission.CLEAN_BACKGROUND_PROCESSES
+ * @param { string } bundleName - bundle name.
+ * @param { AsyncCallback } callback - The callback of killProcessesByBundleName.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function killProcessesByBundleName(bundleName: string, callback: AsyncCallback);
+
+ /**
+ * Clear up application data by bundle name
+ * @permission ohos.permission.CLEAN_APPLICATION_DATA
+ * @param { string } bundleName - bundle name.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function clearUpApplicationData(bundleName: string): Promise;
+
+ /**
+ * Clear up application data by bundle name
+ * @permission ohos.permission.CLEAN_APPLICATION_DATA
+ * @param { string } bundleName - bundle name.
+ * @param { AsyncCallback } callback - The callback of clearUpApplicationData.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function clearUpApplicationData(bundleName: string, callback: AsyncCallback);
+
+ /**
+ * Is it a ram-constrained device
+ * @returns { Promise } Returns true if the device is ram-constrained.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function isRamConstrainedDevice(): Promise;
+
+ /**
+ * Is it a ram-constrained device
+ * @param { AsyncCallback } callback - The callback is used to return true if the device is ram-constrained.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function isRamConstrainedDevice(callback: AsyncCallback): void;
+
+ /**
+ * Get the memory size of the application
+ * @returns { Promise } Returns the application memory size.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function getAppMemorySize(): Promise;
+
+ /**
+ * Get the memory size of the application
+ * @param { AsyncCallback } callback - The callback is used to return the application memory size.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function getAppMemorySize(callback: AsyncCallback): void;
+
+ /**
+ * Get information about running processes
+ * @permission ohos.permission.GET_RUNNING_INFO
+ * @returns { Promise> } Returns the array of {@link ProcessRunningInformation}.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getProcessRunningInformation(): Promise>;
+
+ /**
+ * Get information about running processes
+ * @permission ohos.permission.GET_RUNNING_INFO
+ * @param { AsyncCallback> } callback - The callback is used to return the array of {@link ProcessRunningInformation}.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ function getProcessRunningInformation(callback: AsyncCallback>): void;
+
+ /**
+ * The ability or extension state data.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ export type AbilityStateData = _AbilityStateData.default
+
+ /**
+ * The application state data.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ export type AppStateData = _AppStateData.default
+
+ /**
+ * The application state observer.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi
+ * @since 9
+ */
+ export type ApplicationStateObserver = _ApplicationStateObserver.default
+
+ /**
+ * The class of an process running information.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export type ProcessRunningInfo = _ProcessRunningInfo
+
+ /**
+ * The class of a process running information.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export type ProcessRunningInformation = _ProcessRunningInformation
+}
+
+export default appManager;
diff --git a/api/@ohos.app.ability.appRecovery.d.ts b/api/@ohos.app.ability.appRecovery.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..1416c6a89f1886911c71079915ff7a1dde4cabac
--- /dev/null
+++ b/api/@ohos.app.ability.appRecovery.d.ts
@@ -0,0 +1,120 @@
+/*
+ * Copyright (c) 2022 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.
+ */
+
+/**
+ * This module provides the capability to app receovery.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+declare namespace appRecovery {
+ /**
+ * The type of no restart mode.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ enum RestartFlag {
+ /**
+ * NONE: no restart restrictions
+ */
+ ALWAYS_RESTART = 0,
+
+ /**
+ * CPP_CRASH_NO_RESTART: Do not restart if process terminates due to cpp exception
+ */
+ CPP_CRASH_NO_RESTART = 0x0001,
+
+ /**
+ * JS_CRASH_NO_RESTART: Do not restart if process terminates due to js/ts/ets exception
+ */
+ JS_CRASH_NO_RESTART = 0x0002,
+
+ /**
+ * APP_FREEZE_NO_RESTART: Do not restart if process terminates due to appliction not respondong
+ */
+ APP_FREEZE_NO_RESTART = 0x0004,
+
+ /**
+ * NO_RESTART: Do not restart
+ */
+ NO_RESTART = 0xFFFF,
+ }
+
+ /**
+ * The type of when to save.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ enum SaveOccasionFlag {
+ /**
+ * SAVE_WHEN_ERROR is saving when an error occurs.
+ */
+ SAVE_WHEN_ERROR = 0x0001,
+
+ /**
+ * SAVE_WHEN_CREATE is saving on background.
+ */
+ SAVE_WHEN_BACKGROUND = 0x0002,
+ }
+
+ /**
+ * The type of where to save.
+ * @enum { number }
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ enum SaveModeFlag {
+ /**
+ * SAVE_WITH_FILE is saving to file.
+ */
+ SAVE_WITH_FILE = 0x0001,
+
+ /**
+ * SAVE_WITH_SHARED_MEMORY is saving to shared memory.
+ */
+ SAVE_WITH_SHARED_MEMORY = 0x0002,
+ }
+
+ /**
+ * Enable appRecovery and app supports save and restore
+ * @param restart no restart mode
+ * @param saveOccasion The type of When to save
+ * @param saveMode The type of where to save
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ function enableAppRecovery(restart?: RestartFlag, saveOccasion?: SaveOccasionFlag, saveMode?: SaveModeFlag) : void;
+
+ /**
+ * Restart App when called
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ function restartApp(): void;
+
+ /**
+ * Save App state data when called
+ * @return true if save data successfully, otherwise false
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ function saveAppState(): boolean;
+}
+
+export default appRecovery;
\ No newline at end of file
diff --git a/api/@ohos.app.ability.common.d.ts b/api/@ohos.app.ability.common.d.ts
new file mode 100755
index 0000000000000000000000000000000000000000..0661aafb085f73cc58af79e159fd10a7bbcfec58
--- /dev/null
+++ b/api/@ohos.app.ability.common.d.ts
@@ -0,0 +1,152 @@
+/*
+ * Copyright (c) 2022 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 * as _UIAbilityContext from './application/UIAbilityContext';
+import * as _AbilityStageContext from './application/AbilityStageContext';
+import * as _ApplicationContext from './application/ApplicationContext';
+import * as _BaseContext from './application/BaseContext';
+import * as _Context from './application/Context';
+import * as _ExtensionContext from './application/ExtensionContext';
+import * as _FormExtensionContext from './application/FormExtensionContext';
+import * as _EventHub from './application/EventHub';
+import * as _PermissionRequestResult from './application/PermissionRequestResult';
+import { PacMap as _PacMap } from "./ability/dataAbilityHelper";
+import { AbilityResult as _AbilityResult } from "./ability/abilityResult";
+import { ConnectOptions as _ConnectOptions } from "./ability/connectOptions";
+
+/**
+ * The context of an application. It allows access to application-specific resources.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+declare namespace common {
+
+ /**
+ * The context of an ability. It allows access to ability-specific resources.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ export type UIAbilityContext = _UIAbilityContext.default
+
+ /**
+ * The context of an abilityStage. It allows access to abilityStage-specific resources.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ export type AbilityStageContext = _AbilityStageContext.default
+
+ /**
+ * The context of an application. It allows access to application-specific resources.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ export type ApplicationContext = _ApplicationContext.default
+
+ /**
+ * The base context of 'app.Context' for FA Mode or 'application.Context' for Stage Mode.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export type BaseContext = _BaseContext.default
+
+ /**
+ * The base context of an ability or an application. It allows access to
+ * application-specific resources.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ export type Context = _Context.default
+
+ /**
+ * The context of an extension. It allows access to extension-specific resources.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ export type ExtensionContext = _ExtensionContext.default
+
+ /**
+ * The context of form extension. It allows access to
+ * formExtension-specific resources.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ export type FormExtensionContext = _FormExtensionContext.default
+
+ /**
+ * File area mode
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ export enum AreaMode {
+ /**
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ */
+ EL1 = 0,
+ /**
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ */
+ EL2 = 1
+ }
+
+ /**
+ * The event center of a context, support the subscription and publication of events.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ export type EventHub = _EventHub.default
+
+ /**
+ * The result of requestPermissionsFromUser with asynchronous callback.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ export type PermissionRequestResult = _PermissionRequestResult.default
+
+ /**
+ * Defines a PacMap object for storing a series of values.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ export type PacMap = _PacMap
+
+ /**
+ * Indicates the result of startAbility.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ export type AbilityResult = _AbilityResult
+
+ /**
+ * Indicates the callback of connection
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ * @since 9
+ */
+ export type ConnectOptions = _ConnectOptions
+}
+
+export default common;
diff --git a/api/@ohos.uiAppearance.d.ts b/api/@ohos.app.ability.contextConstant.d.ts
similarity index 40%
rename from api/@ohos.uiAppearance.d.ts
rename to api/@ohos.app.ability.contextConstant.d.ts
index 5a65a569d5106e0c737b7aa6d57bfb22f4bfea58..fef30c258137c93aa886274469405968c2b1e884 100644
--- a/api/@ohos.uiAppearance.d.ts
+++ b/api/@ohos.app.ability.contextConstant.d.ts
@@ -13,45 +13,35 @@
* limitations under the License.
*/
-import { AsyncCallback, Callback } from './basic';
-
/**
- * Provide APIs to set system uiAppearance.
- * @syscap SystemCapability.ArkUI.UiAppearance
- * @import import uiAppearance from '@ohos.uiAppearance';
+ * The context of an application. It allows access to application-specific resources.
+ *
* @since 9
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
*/
-declare namespace uiAppearance {
+ declare namespace contextConstant {
+
/**
- * Enumerates dark-mode.
+ * File area mode
+ *
+ * @since 9
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
*/
- enum DarkMode {
+ export enum AreaMode {
/**
- * Always display with dark mode.
+ * System level device encryption area
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
*/
- ALWAYS_DARK = 0,
+ EL1 = 0,
/**
- * Always display with light mode.
+ * User credential encryption area
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
*/
- ALWAYS_LIGHT = 1
+ EL2 = 1
}
-
- /**
- * Set the system dark-mode.
- * @param mode Indicates the dark-mode to set
- * @permission ohos.permission.UPDATE_CONFIGURATION
- * @systemapi Hide this for inner system use
- */
- function setDarkMode(mode: DarkMode, callback: AsyncCallback): void;
- function setDarkMode(mode: DarkMode): Promise;
-
- /**
- * Acquire the current dark-mode.
- * @return current dark-mode.
- * @permission ohos.permission.UPDATE_CONFIGURATION
- * @systemapi Hide this for inner system use
- */
- function getDarkMode(): DarkMode;
}
-export default uiAppearance;
\ No newline at end of file
+
+export default contextConstant;
\ No newline at end of file
diff --git a/api/@ohos.app.ability.errorManager.d.ts b/api/@ohos.app.ability.errorManager.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..10573f876d2656e024b895b74ab3b8210e0b2bad
--- /dev/null
+++ b/api/@ohos.app.ability.errorManager.d.ts
@@ -0,0 +1,67 @@
+/*
+ * Copyright (c) 2022 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 * as _ErrorObserver from './application/ErrorObserver';
+
+/**
+ * This module provides the function of error manager.
+ * @namespace errorManager
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+declare namespace errorManager {
+ /**
+ * Register error observer.
+ * @param { string } type - error.
+ * @param { ErrorObserver } observer - The error observer.
+ * @returns { number } Returns the number code of the observer.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function on(type: "error", observer: ErrorObserver): number;
+
+ /**
+ * Unregister error observer.
+ * @param { string } type - error.
+ * @param { number } observerId - Indicates the number code of the observer.
+ * @param { AsyncCallback } callback - The callback of off.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function off(type: "error", observerId: number, callback: AsyncCallback): void;
+
+ /**
+ * Unregister error observer.
+ * @param { string } type - error.
+ * @param { number } observerId - Indicates the number code of the observer.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ function off(type: "error", observerId: number): Promise;
+
+ /**
+ * The observer will be called by system when an error occurs.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @since 9
+ */
+ export type ErrorObserver = _ErrorObserver.default
+}
+
+export default errorManager;
diff --git a/api/@ohos.app.ability.missionManager.d.ts b/api/@ohos.app.ability.missionManager.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..898b5b42d1dd88cf27fb4467eba6ad01d7294382
--- /dev/null
+++ b/api/@ohos.app.ability.missionManager.d.ts
@@ -0,0 +1,287 @@
+/*
+ * Copyright (c) 2022 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 { MissionInfo as _MissionInfo } from './application/MissionInfo';
+import { MissionListener as _MissionListener } from './application/MissionListener';
+import { MissionSnapshot as _MissionSnapshot } from './application/MissionSnapshot';
+import StartOptions from "./@ohos.app.ability.StartOptions";
+
+/**
+ * This module provides the capability to manage abilities and obtaining system task information.
+ * @permission ohos.permission.MANAGE_MISSIONS
+ * @namespace missionManager
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @systemapi
+ * @since 9
+ */
+declare namespace missionManager {
+ /**
+ * Register the missionListener to ams.
+ * @param { string } type - mission.
+ * @param { MissionListener } listener - Indicates the MissionListener to be registered.
+ * @returns { number } Returns the index number of the MissionListener.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function on(type: "mission", listener: MissionListener): number;
+
+ /**
+ * Unregister the missionListener to ams.
+ * @param { string } type - mission.
+ * @param { number } listenerId - Indicates the listener id to be unregistered.
+ * @param { AsyncCallback } callback - The callback of off.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function off(type: "mission", listenerId: number, callback: AsyncCallback): void;
+
+ /**
+ * Unregister the missionListener to ams.
+ * @param { string } type - mission.
+ * @param { number } listenerId - Indicates the listener id to be unregistered.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function off(type: "mission", listenerId: number): Promise;
+
+ /**
+ * Get the missionInfo with the given missionId.
+ * @param { string } deviceId - Indicates the device to be queried.
+ * @param { number } missionId - Indicates mission id to be queried.
+ * @param { AsyncCallback } callback - The callback is used to return the MissionInfo of the given id.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback): void;
+
+ /**
+ * Get the missionInfo with the given missionId.
+ * @param { string } deviceId - Indicates the device to be queried.
+ * @param { number } missionId - Indicates mission id to be queried.
+ * @returns { Promise } Returns the MissionInfo of the given id.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function getMissionInfo(deviceId: string, missionId: number): Promise;
+
+ /**
+ * Get the missionInfo with the given missionId.
+ * @param { string } deviceId - Indicates the device to be queried.
+ * @param { number } numMax - Indicates the maximum number of returned missions.
+ * @param { AsyncCallback> } callback - The callback is used to return the array of the MissionInfo.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback>): void;
+
+ /**
+ * Get the missionInfo with the given missionId.
+ * @param { string } deviceId - Indicates the device to be queried.
+ * @param { number } numMax - Indicates the maximum number of returned missions.
+ * @returns { Promise> } Returns the array of the MissionInfo.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function getMissionInfos(deviceId: string, numMax: number): Promise>;
+
+ /**
+ * Get the mission snapshot with the given missionId.
+ * @param { string } deviceId - Indicates the device to be queried.
+ * @param { number } missionId - Indicates mission id to be queried.
+ * @param { AsyncCallback } callback - The callback is used to return the MissionSnapshot of the given id.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback): void;
+
+ /**
+ * Get the mission snapshot with the given missionId.
+ * @param { string } deviceId - Indicates the device to be queried.
+ * @param { number } missionId - Indicates mission id to be queried.
+ * @returns { Promise } Returns the MissionSnapshot of the given id.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function getMissionSnapShot(deviceId: string, missionId: number): Promise;
+
+ /**
+ * Get the mission low resolution snapshot with the given missionId.
+ * @param { string } deviceId - Indicates the device to be queried.
+ * @param { number } missionId - Indicates mission id to be queried.
+ * @param { AsyncCallback } callback - The callback is used to return the MissionSnapshot of the given id.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function getLowResolutionMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback): void;
+
+ /**
+ * Get the mission low resolution snapshot with the given missionId.
+ * @param { string } deviceId - Indicates the device to be queried.
+ * @param { number } missionId - Indicates mission id to be queried.
+ * @returns { Promise } Returns the MissionSnapshot of the given id.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function getLowResolutionMissionSnapShot(deviceId: string, missionId: number): Promise;
+
+ /**
+ * Lock the mission.
+ * @param { number } missionId - Indicates mission id to be locked.
+ * @param { AsyncCallback } callback - The callback of lockMission.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function lockMission(missionId: number, callback: AsyncCallback): void;
+
+ /**
+ * Lock the mission.
+ * @param { number } missionId - Indicates mission id to be locked.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function lockMission(missionId: number): Promise;
+
+ /**
+ * Unlock the mission.
+ * @param { number } missionId - Indicates mission id to be unlocked.
+ * @param { AsyncCallback } callback - The callback of unlockMission.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function unlockMission(missionId: number, callback: AsyncCallback): void;
+
+ /**
+ * Unlock the mission.
+ * @param { number } missionId - Indicates mission id to be unlocked.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function unlockMission(missionId: number): Promise;
+
+ /**
+ * Clear the given mission in the ability manager service.
+ * @param { number } missionId - Indicates mission id to be cleared.
+ * @param { AsyncCallback } callback - The callback of clearMission.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function clearMission(missionId: number, callback: AsyncCallback): void;
+
+ /**
+ * Clear the given mission in the ability manager service.
+ * @param { number } missionId - Indicates mission id to be cleared.
+ * @returns { Promise } The promise returned by the function.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function clearMission(missionId: number): Promise;
+
+ /**
+ * Clear all missions in the ability manager service.
+ * @param { AsyncCallback } callback - The callback of clearAllMissions.
+ * @throws { BusinessError } 401 - If the input parameter is not valid parameter.
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @since 9
+ */
+ function clearAllMissions(callback: AsyncCallback