;
/**
- * Sets the oauth token visibility of the specifed authentication type to a third-party application.
+ * Sets the oauth token visibility of the specified authentication type to a third-party application.
*
* Only the owner of the application account has the permission to call this method.
*
@@ -341,7 +341,7 @@ declare namespace appAccount {
setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVisible: boolean): Promise;
/**
- * Checks the oauth token visibility of the specifed authentication type for a third-party application.
+ * Checks the oauth token visibility of the specified authentication type for a third-party application.
*
* Only the owner of the application account has the permission to call this method.
*
diff --git a/api/@ohos.account.distributedAccount.d.ts b/api/@ohos.account.distributedAccount.d.ts
index 33ba7f02e20789e9f61c298cf7834330eba5caef..38a0fa43bd19d003d967e3f1c7759eefd2c32ec5 100644
--- a/api/@ohos.account.distributedAccount.d.ts
+++ b/api/@ohos.account.distributedAccount.d.ts
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Copyright (c) 2021-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
diff --git a/api/@ohos.account.osAccount.d.ts b/api/@ohos.account.osAccount.d.ts
index 9229e35f59653bda9ede893ff9f339062254852a..703c36b1f37f2cf19e6223ba85f07080dac6bfc9 100644
--- a/api/@ohos.account.osAccount.d.ts
+++ b/api/@ohos.account.osAccount.d.ts
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Copyright (c) 2021-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
@@ -64,11 +64,11 @@ declare namespace osAccount {
isMultiOsAccountEnable(): Promise;
/**
- * Checks whether an OS account is actived based on its local ID.
+ * Checks whether an OS account is activated based on its local ID.
*
* @since 7
* @param localId Indicates the local ID of the OS account.
- * @return Returns {@code true} if the OS account is actived; returns {@code false} otherwise.
+ * @return Returns {@code true} if the OS account is activated; returns {@code false} otherwise.
* @permission ohos.permission.MANAGE_LOCAL_ACCOUNTS/ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS
*/
isOsAccountActived(localId: number, callback: AsyncCallback): void;
@@ -466,7 +466,7 @@ declare namespace osAccount {
serialNumber: number;
/**
- * Os account is actived or not.
+ * Os account is activated or not.
* @since 8
*/
isActived: boolean;
diff --git a/api/@ohos.animator.d.ts b/api/@ohos.animator.d.ts
index 2f306abcc6f27540380af20e75ef2238c5f37250..3f4360181c446781c2a3284436bcfc7dc5f5265a 100644
--- a/api/@ohos.animator.d.ts
+++ b/api/@ohos.animator.d.ts
@@ -14,14 +14,14 @@
*/
/**
- * @devices phone, tablet, wearable, tv, car
+ * Defines the animator options.
+ * @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 6
*/
export interface AnimatorOptions {
/**
* Duration of the animation, in milliseconds.
* The default value is 0.
- * @devices phone, tablet, wearable, tv, car
* @since 6
*/
duration: number;
@@ -44,7 +44,6 @@ export interface AnimatorOptions {
* cubic-bezier(x1, y1, x2, y2) You can customize an animation speed curve in the cubic-bezier() function. The x and y values of each input parameter must be between 0 and 1.
* Step curve. The number must be set and only an integer is supported, step-position is optional. It can be set to start or end. The default value is end.
* The default value is ease.
- * @devices phone, tablet, wearable, tv, car
* @since 6
*/
easing: string;
@@ -52,7 +51,6 @@ export interface AnimatorOptions {
/**
* Delay for the animation start. The default value indicates no delay.
* The default value is 0.
- * @devices phone, tablet, wearable, tv, car
* @since 6
*/
delay: number;
@@ -61,7 +59,6 @@ export interface AnimatorOptions {
* Whether to resume to the initial state after the animation is executed.
* none: The initial state is restored after the animation is executed.
* forwards: The state at the end of the animation (defined in the last key frame) is retained after the animation is executed.
- * @devices phone, tablet, wearable, tv, car
* @since 6
*/
fill: "none" | "forwards" | "backwards" | "both";
@@ -69,7 +66,6 @@ export interface AnimatorOptions {
/**
* The animation playback mode.
* The default value is "normal".
- * @devices phone, tablet, wearable, tv, car
* @since 6
*/
direction: "normal" | "reverse" | "alternate" | "alternate-reverse";
@@ -77,7 +73,6 @@ export interface AnimatorOptions {
/**
* Number of times the animation will be played. number indicates a fixed number of playback operations, and -1 an unlimited number of playback operations.
* The default value is 1.
- * @devices phone, tablet, wearable, tv, car
* @since 6
*/
iterations: number;
@@ -85,7 +80,6 @@ export interface AnimatorOptions {
/**
* Starting point of animator interpolation.
* The default value is 0.
- * @devices phone, tablet, wearable, tv, car
* @since 6
*/
begin: number;
@@ -93,77 +87,74 @@ export interface AnimatorOptions {
/**
* Ending point of Dynamic Interpolation
* The default value is 1.
- * @devices phone, tablet, wearable, tv, car
* @since 6
*/
end: number;
}
+/**
+ * Defines the Animator result interface.
+ * @syscap SystemCapability.ArkUI.ArkUI.Full
+ * @since 6
+ */
export interface AnimatorResult {
/**
* Update the options for current animator.
* @param options Options.
+ * @since 6
*/
update(options: AnimatorOptions): void;
/**
* Starts the animation.
- * @devices phone, tablet, wearable, tv, car
* @since 6
*/
play(): void;
/**
* Ends the animation.
- * @devices phone, tablet, wearable, tv, car
* @since 6
*/
finish(): void;
/**
* Pauses the animation.
- * @devices phone, tablet, wearable, tv, car
* @since 6
*/
pause(): void;
/**
* Cancels the animation.
- * @devices phone, tablet, wearable, tv, car
* @since 6
*/
cancel(): void;
/**
* Plays the animation in reverse direction.
- * @devices phone, tablet, wearable, tv, car
* @since 6
*/
reverse(): void;
/**
* Trigger when vsync callback.
* @param progress The current progress of animtion
- * @devices phone, tablet, wearable, tv, car
* @since 6
*/
onframe: (progress: number) => void;
/**
* The animation is finished.
- * @devices phone, tablet, wearable, tv, car
* @since 6
*/
onfinish: () => void;
/**
* The animation is canceled.
- * @devices phone, tablet, wearable, tv, car
* @since 6
*/
oncancel: () => void;
/**
* The animation is repeated.
- * @devices phone, tablet, wearable, tv, car
* @since 6
*/
onrepeat: () => void;
}
/**
- * @devices phone, tablet, wearable, tv, car
+ * Defines the Animator class.
+ * @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 6
* @import prompt from '@ohos.animator';
*/
@@ -171,7 +162,6 @@ export default class Animator {
/**
* Create an animator object for custum animation.
* @param options Options.
- * @devices phone, tablet, wearable, tv, car
* @since 6
*/
static createAnimator(options: AnimatorOptions): AnimatorResult;
diff --git a/api/@ohos.app.abilityManager.d.ts b/api/@ohos.app.abilityManager.d.ts
deleted file mode 100644
index 9b430de3ca7765df86929782bae19ee36ffc4cc4..0000000000000000000000000000000000000000
--- a/api/@ohos.app.abilityManager.d.ts
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- * Copyright (c) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import { AsyncCallback } from './basic';
-import { AbilityMissionInfo } from './app/abilityMissionInfo';
-import { ActiveProcessInfo } from './app/activeProcessInfo';
-import { MissionSnapshot } from './app/missionSnapshot';
-
-/**
- * This module provides the capability to manage abilities and obtaining system task information.
- *
- * @since 7
- * @SysCap SystemCapability.Ability.AbilityRuntime.Core
- * @import import abilityManager from '@ohos.app.abilityManager'
- * @permission N/A
- */
-declare namespace abilityManager {
-
- enum ProcessErrCode {
- NO_ERROR = 0,
- CRASHED,
- NO_RESPONSE,
- }
-
-
- /**
- * Get information about running processes
- * @since 7
- * @SysCap SystemCapability.Ability.AbilityRuntime.Core
- * @return a list of ActiveProcessInfo records describing each process.
- * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS_EXTENSION
- * @systemapi hide this for inner system use
- */
- function getActiveProcessInfos(): Promise>;
- function getActiveProcessInfos(callback: AsyncCallback>): void;
-
- /**
- * Get information about the running ability missions
- * @since 7
- * @SysCap SystemCapability.Ability.AbilityRuntime.Core
- * @param upperLimit The maximum number of mission infos to return in the array.
- * @return an array of AbilityMissionInfo records describing each active mission.
- * @permission ohos.permission.ACCESS_MISSIONS
- * @systemapi hide this for inner system use
- */
- function getActiveAbilityMissionInfos(upperLimit: number): Promise>;
- function getActiveAbilityMissionInfos(upperLimit: number, callback: AsyncCallback>): void;
-
- /**
- * Get information about recently run missions
- * @since 7
- * @SysCap SystemCapability.Ability.AbilityRuntime.Core
- * @param upperLimit The maximum number of previous mission infos to return in the array.
- * @return an array of AbilityMissionInfo records describing each of the previous mission.
- * @permission ohos.permission.ACCESS_MISSIONS_EXTRA
- * @systemapi hide this for inner system use
- */
- function getPreviousAbilityMissionInfos(upperLimit: number): Promise>;
- function getPreviousAbilityMissionInfos(upperLimit: number, callback: AsyncCallback>): void;
-
- /**
- * Delete the specified missions
- * @since 7
- * @SysCap SystemCapability.Ability.AbilityRuntime.Core
- * @param missionIds An array of missions, representing the missions that need to be deleted.
- * @permission ohos.permission.DELETE_MISSIONS
- * @systemapi hide this for inner system use
- */
- function deleteMissions(missionIds: Array): Promise;
- function deleteMissions(missionIds: Array, callback: AsyncCallback): void;
-}
-
-export default abilityManager;
diff --git a/api/@ohos.application.Ability.d.ts b/api/@ohos.application.Ability.d.ts
index 65963be527b5e0901076ed6d413728e4407f4a79..d215c92832cdbe48891097ca7d1c575d5aecaf02 100755
--- a/api/@ohos.application.Ability.d.ts
+++ b/api/@ohos.application.Ability.d.ts
@@ -20,21 +20,51 @@ import window from './@ohos.window';
import { Configuration } from './@ohos.application.Configuration';
import rpc from '/@ohos.rpc';
+/**
+ * The prototype of the listener function interface registered by the Caller.
+ *
+ * @since 9
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @permission N/A
+ * @param msg Monitor status notification information.
+ * @return -
+ * @StageModelOnly
+ */
+export interface OnReleaseCallBack {
+ (msg: string): void;
+}
+
+/**
+ * The prototype of the message listener function interface registered by the Callee.
+ *
+ * @since 9
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @permission N/A
+ * @param indata Notification data notified from the caller.
+ * @return rpc.Sequenceable
+ * @StageModelOnly
+ */
+export interface CaleeCallBack {
+ (indata: rpc.MessageParcel): rpc.Sequenceable;
+}
+
/**
* The interface of a Caller.
*
* @since 9
- * @sysCap AAFwk
- * @devices phone, tablet, tv, wearable, car
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @permission N/A
* @StageModelOnly
*/
- interface Caller {
+export interface Caller {
/**
* Notify the server of Sequenceable type data.
*
* @since 9
- * @sysCap AAFwk
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @param method The notification event string listened to by the callee.
+ * @param data Notification data to the callee.
+ * @return -
* @StageModelOnly
*/
call(method: string, data: rpc.Sequenceable): Promise;
@@ -43,8 +73,10 @@ import rpc from '/@ohos.rpc';
* Notify the server of Sequenceable type data and return the notification result.
*
* @since 9
- * @sysCap AAFwk
- * return Sequenceable data
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @param method The notification event string listened to by the callee.
+ * @param data Notification data to the callee.
+ * @return Returns the callee's notification result data on success, and returns undefined on failure.
* @StageModelOnly
*/
callWithResult(method: string, data: rpc.Sequenceable): Promise;
@@ -53,8 +85,8 @@ import rpc from '/@ohos.rpc';
* Clear service records.
*
* @since 9
- * @sysCap AAFwk
- * return Sequenceable data
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @return -
* @StageModelOnly
*/
release(): void;
@@ -63,38 +95,43 @@ import rpc from '/@ohos.rpc';
* Register death listener notification callback.
*
* @since 9
- * @sysCap AAFwk
- * return Sequenceable data
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @param callback Register a callback function for listening for notifications.
+ * @return -
* @StageModelOnly
*/
- onRelease(callback: function): void;
+ onRelease(callback: OnReleaseCallBack): void;
}
/**
* The interface of a Callee.
*
* @since 9
- * @sysCap AAFwk
- * @devices phone, tablet, tv, wearable, car
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @permission N/A
* @StageModelOnly
*/
- interface Callee {
+export interface Callee {
/**
* Register data listener callback.
*
* @since 9
- * @sysCap AAFwk
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @param method A string registered to listen for notification events.
+ * @param callback Register a callback function that listens for notification events.
+ * @return -
* @StageModelOnly
*/
- on(method: string, callback: function): void;
+ on(method: string, callback: CaleeCallBack): void;
/**
* Unregister data listener callback.
*
* @since 9
- * @sysCap AAFwk
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @param method A string registered to listen for notification events.
+ * @return -
* @StageModelOnly
*/
off(method: string): void;
@@ -104,7 +141,7 @@ import rpc from '/@ohos.rpc';
* The class of an ability.
*
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @permission N/A
* @StageModelOnly
*/
@@ -113,7 +150,7 @@ export default class Ability {
* Indicates configuration information about an ability context.
*
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @StageModelOnly
*/
context: AbilityContext;
@@ -122,7 +159,7 @@ export default class Ability {
* Indicates ability launch want.
*
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @StageModelOnly
*/
launchWant: Want;
@@ -131,7 +168,7 @@ export default class Ability {
* Indicates ability last request want.
*
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @StageModelOnly
*/
lastRequestWant: Want;
@@ -140,7 +177,7 @@ export default class Ability {
* Call Service Stub Object.
*
* @since 9
- * @sysCap AAFwk
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @StageModelOnly
*/
callee: Callee;
@@ -149,7 +186,9 @@ export default class Ability {
* Called back when an ability is started for initialization.
*
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @param want Indicates the want info of the created ability.
+ * @param param Indicates the launch param.
* @return -
* @StageModelOnly
*/
@@ -159,7 +198,8 @@ export default class Ability {
* Called back when an ability window stage is created.
*
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @param windowStage Indicates the created WindowStage.
* @return -
* @StageModelOnly
*/
@@ -169,17 +209,28 @@ export default class Ability {
* Called back when an ability window stage is destroyed.
*
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @return -
* @StageModelOnly
*/
onWindowStageDestroy(): void;
+ /**
+ * Called back when an ability window stage is restored.
+ *
+ * @since 9
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @param windowStage window stage to restore
+ * @return -
+ * @StageModelOnly
+ */
+ onWindowStageRestore(windowStage: window.WindowStage): void;
+
/**
* Called back before an ability is destroyed.
*
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @return -
* @StageModelOnly
*/
@@ -189,7 +240,7 @@ export default class Ability {
* Called back when the state of an ability changes to foreground.
*
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @return -
* @StageModelOnly
*/
@@ -199,29 +250,30 @@ export default class Ability {
* Called back when the state of an ability changes to background.
*
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @return -
* @StageModelOnly
*/
onBackground(): void;
/**
- * Called back when an ability prepares to migrate.
+ * Called back when an ability prepares to continue.
*
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore
- * @return true if ability agrees to migrate and saves data successfully, otherwise false.
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @param wantParam Indicates the want parameter.
+ * @return 0 if ability agrees to continue and saves data successfully, otherwise errcode.
* @StageModelOnly
*/
- onContinue(wantParam : {[key: string]: any}): boolean;
+ 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.
*
- * @devices phone, tablet, tv, wearable, car
* @since 9
- * @sysCap AAFwk
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @param want Indicates the want info of ability.
* @return -
* @StageModelOnly
*/
@@ -230,9 +282,9 @@ export default class Ability {
/**
* Called when the system configuration is updated.
*
- * @devices phone, tablet, tv, wearable, car
* @since 9
- * @sysCap AAFwk
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @param config Indicates the updated configuration.
* @return -
* @StageModelOnly
*/
diff --git a/api/@ohos.application.AbilityConstant.d.ts b/api/@ohos.application.AbilityConstant.d.ts
index d2691c2e98cdb1048738e380ceffe927876e5dfb..518bac32dcb318c7c88a66077af0fa0d356de421 100644
--- a/api/@ohos.application.AbilityConstant.d.ts
+++ b/api/@ohos.application.AbilityConstant.d.ts
@@ -17,7 +17,7 @@
* The definition of AbilityConstant.
*
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @permission N/A
* @StageModelOnly
*/
@@ -26,7 +26,7 @@ declare namespace AbilityConstant {
* Interface of launch param.
*
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
*/
export interface LaunchParam {
@@ -34,7 +34,7 @@ declare namespace AbilityConstant {
* Indicates launch reason.
*
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
*/
launchReason: LaunchReason;
@@ -43,7 +43,7 @@ declare namespace AbilityConstant {
* Indicates last exit reason.
*
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
*/
lastExitReason: LastExitReason;
@@ -53,7 +53,7 @@ declare namespace AbilityConstant {
* Type of launch reason.
*
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
*/
export enum LaunchReason {
@@ -67,7 +67,7 @@ declare namespace AbilityConstant {
* Type of last exit reason.
*
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
*/
export enum LastExitReason {
@@ -75,6 +75,19 @@ declare namespace AbilityConstant {
ABILITY_NOT_RESPONDING = 1,
NORMAL = 2,
}
+
+ /**
+ * Type of onContinue result.
+ *
+ * @since 9
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @StageModelOnly
+ */
+ export enum OnContinueResult {
+ AGREE = 0,
+ REJECT = 1,
+ MISMATCH = 2,
+ }
}
export default AbilityConstant
diff --git a/api/@ohos.application.AbilityStage.d.ts b/api/@ohos.application.AbilityStage.d.ts
index 7d1762c145c62798083d80e1da61e1aae9809520..ae3a53612f466a5b9de20467dde06bd0733cb572 100644
--- a/api/@ohos.application.AbilityStage.d.ts
+++ b/api/@ohos.application.AbilityStage.d.ts
@@ -48,10 +48,12 @@ export default class AbilityStage {
/**
* Called back when start specified ability.
*
- * @devices phone, tablet, tv, wearable, car
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.Core
- * @return -
+ * @param want Indicates the want info of startd ability.
+ * @return 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.
* @StageModelOnly
*/
onAcceptWant(want: Want): string;
@@ -61,6 +63,7 @@ export default class AbilityStage {
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @param config Indicates the updated configuration.
* @return -
* @StageModelOnly
*/
diff --git a/api/@ohos.application.Configuration.d.ts b/api/@ohos.application.Configuration.d.ts
index 9acbda4fa5ba669522f1ead499705f9fb036064e..f00b528ddf7fa6039c6e630a6571f830b40793a0 100644
--- a/api/@ohos.application.Configuration.d.ts
+++ b/api/@ohos.application.Configuration.d.ts
@@ -43,7 +43,7 @@ export interface Configuration {
/**
* Indicates the screen direction of the current device.
*
- * @since 8
+ * @since 9
* @syscap SystemCapability.Ability.AbilityBase
*/
direction: ConfigurationConstant.Direction;
@@ -51,7 +51,7 @@ export interface Configuration {
/**
* Indicates the screen density of the current device.
*
- * @since 8
+ * @since 9
* @syscap SystemCapability.Ability.AbilityBase
*/
screenDensity: ConfigurationConstant.ScreenDensity;
@@ -59,7 +59,7 @@ export interface Configuration {
/**
* Indicates the displayId of the current device.
*
- * @since 8
+ * @since 9
* @syscap SystemCapability.Ability.AbilityBase
*/
displayId: number;
diff --git a/api/@ohos.application.ConfigurationConstant.d.ts b/api/@ohos.application.ConfigurationConstant.d.ts
index b9ed5f3e19e620af0b740b26577a639825afa721..cdf3b32724869aa6705e85d53a58b7dddbff196f 100644
--- a/api/@ohos.application.ConfigurationConstant.d.ts
+++ b/api/@ohos.application.ConfigurationConstant.d.ts
@@ -35,7 +35,7 @@
/**
* @name Direction
- * @since 8
+ * @since 9
* @syscap SystemCapability.Ability.AbilityBase
* @permission N/A
*/
@@ -47,7 +47,7 @@
/**
* @name ScreenDensity
- * @since 8
+ * @since 9
* @syscap SystemCapability.Ability.AbilityBase
* @permission N/A
*/
diff --git a/api/@ohos.application.DataShareExtensionAbility.d.ts b/api/@ohos.application.DataShareExtensionAbility.d.ts
index dce6c206a8ff9926c35894233dfb8fa8da70de1d..495ac85091bc5345c5e121f2de3f95345f4b063e 100644
--- a/api/@ohos.application.DataShareExtensionAbility.d.ts
+++ b/api/@ohos.application.DataShareExtensionAbility.d.ts
@@ -62,7 +62,7 @@ export default class DataShareExtensionAbility {
* @systemapi Hide this for inner system use.
* @return Returns the MIME type of the matched files; returns null if there is no type that matches the Data
*/
- getFileTypes?(uri: string, mimeTypeFilter: string): Array;
+ getFileTypes?(uri: string, mimeTypeFilter: string, callback: AsyncCallback>): void;
/**
* Inserts a data record into the database. This method should be implemented by a data share.
@@ -74,7 +74,7 @@ export default class DataShareExtensionAbility {
* @systemapi Hide this for inner system use.
* @return Returns the index of the newly inserted data record.
*/
- insert?(uri: string, valueBucket: rdb.ValuesBucket): number;
+ insert?(uri: string, valueBucket: rdb.ValuesBucket, callback: AsyncCallback): void;
/**
* Updates one or more data records in the database. This method should be implemented by a data share.
@@ -88,7 +88,8 @@ export default class DataShareExtensionAbility {
* @systemapi Hide this for inner system use.
* @return Returns the number of data records updated.
*/
- update?(uri: string, valueBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates): number;
+ update?(uri: string, valueBucket: rdb.ValuesBucket, predicates: dataAbility.DataAbilityPredicates,
+ callback: AsyncCallback): void;
/**
* Deletes one or more data records. This method should be implemented by a data share.
@@ -101,7 +102,7 @@ export default class DataShareExtensionAbility {
* @systemapi Hide this for inner system use.
* @return Returns the number of data records deleted.
*/
- delete?(uri: string, predicates: dataAbility.DataAbilityPredicates): number;
+ delete?(uri: string, predicates: dataAbility.DataAbilityPredicates, callback: AsyncCallback): void;
/**
* Queries one or more data records in the database. This method should be implemented by a data share.
@@ -116,7 +117,8 @@ export default class DataShareExtensionAbility {
* @systemapi Hide this for inner system use.
* @return Returns the queried data.
*/
- query?(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates): ResultSet;
+ query?(uri: string, columns: Array, predicates: dataAbility.DataAbilityPredicates,
+ callback: AsyncCallback): void;
/**
* Obtains the MIME type matching the data specified by the URI of the data share. This method should be
@@ -130,7 +132,7 @@ export default class DataShareExtensionAbility {
* @systemapi Hide this for inner system use.
* @return Returns the MIME type that matches the data specified by {@code uri}.
*/
- getType?(uri: string): string;
+ getType?(uri: string, callback: AsyncCallback): void;
/**
* Inserts multiple data records into the database. This method should be implemented by a data share.
@@ -142,7 +144,7 @@ export default class DataShareExtensionAbility {
* @systemapi Hide this for inner system use.
* @return Returns the number of data records inserted.
*/
- batchInsert?(uri: string, valueBuckets: Array): number;
+ batchInsert?(uri: string, valueBuckets: Array, callback: AsyncCallback): void;
/**
* Converts the given {@code uri} that refer to the data share into a normalized URI. A normalized URI can be
@@ -155,7 +157,7 @@ export default class DataShareExtensionAbility {
* @systemapi Hide this for inner system use.
* @return Returns the normalized uri if the data share supports URI normalization;
*/
- normalizeUri?(uri: string): string;
+ normalizeUri?(uri: string, callback: AsyncCallback): void;
/**
* Converts the given normalized {@code uri} generated by {@link #normalizeUri(uri)} into a denormalized one.
@@ -169,5 +171,5 @@ export default class DataShareExtensionAbility {
* {@code uri} passed to this method if there is nothing to do; returns {@code null} if the data identified by
* the original {@code uri} cannot be found in the current environment.
*/
- denormalizeUri?(uri: string): string;
+ denormalizeUri?(uri: string, callback: AsyncCallback): void;
}
\ No newline at end of file
diff --git a/api/@ohos.application.FormExtension.d.ts b/api/@ohos.application.FormExtension.d.ts
index 63862c0c221b5e3524fc49735c6fe848bad82b3f..166674ad6086c4989d89385e42d80839c3e322ca 100644
--- a/api/@ohos.application.FormExtension.d.ts
+++ b/api/@ohos.application.FormExtension.d.ts
@@ -118,6 +118,7 @@ export default class FormExtension {
*
* @since 9
* @syscap SystemCapability.Ability.Form
+ * @param system configuration, such as language and color mode.
* @return -
* @StageModelOnly
*/
diff --git a/api/@ohos.application.ServiceExtAbility.d.ts b/api/@ohos.application.ServiceExtAbility.d.ts
deleted file mode 100644
index 57a549082fc195e6c9f0ce9c98d039428b4dfdab..0000000000000000000000000000000000000000
--- a/api/@ohos.application.ServiceExtAbility.d.ts
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * Copyright (c) 2021 Huawei Device Co., Ltd.
- * Licensed under the Apache License, Version 2.0 (the "License"),
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import rpc from "./@ohos.rpc";
-import ServiceExtAbilityContext from "./application/ServiceExtAbilityContext";
-import Want from './@ohos.application.Want';
-
-/**
- * class of service extension ability.
- *
- * @since 9
- * @sysCap AAFwk
- * @devices phone, tablet, tv, wearable, car
- * @systemapi hide for inner use.
- * @StageModelOnly
- */
-export default class ServiceExtAbility {
- /**
- * Indicates service extension ability context.
- *
- * @since 9
- * @sysCap AAFwk
- * @systemapi hide for inner use.
- * @StageModelOnly
- */
- context: ServiceExtAbilityContext;
-
- /**
- * Called back when a service extension is started for initialization.
- *
- * @devices phone, tablet, tv, wearable, car
- * @since 9
- * @sysCap AAFwk
- * @systemapi hide for inner use.
- * @return -
- * @StageModelOnly
- */
- onCreate(want: Want): void;
-
- /**
- * Called back before a service extension is destroyed.
- *
- * @devices phone, tablet, tv, wearable, car
- * @since 9
- * @sysCap AAFwk
- * @systemapi hide for inner use.
- * @return -
- * @StageModelOnly
- */
- onDestroy(): void;
-
- /**
- * Called back when a service extension is started.
- *
- * @devices phone, tablet, tv, wearable, car
- * @since 9
- * @sysCap AAFwk
- * @param want Indicates the want of service extension to start.
- * @param 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.
- * @systemapi hide for inner use.
- * @return -
- * @StageModelOnly
- */
- onRequest(want: Want, startId: number): void;
-
- /**
- * Called back when a service extension is first connected to an ability.
- *
- * @devices phone, tablet, tv, wearable, car
- * @since 9
- * @sysCap AAFwk
- * @param want Indicates connection information about the Service ability.
- * @systemapi hide for inner use.
- * @return Returns the proxy of the Service ability.
- * @StageModelOnly
- */
- onConnect(want: Want): rpc.RemoteObject;
-
- /**
- * Called back when all abilities connected to a service extension are disconnected.
- *
- * @devices phone, tablet, tv, wearable, car
- * @since 9
- * @sysCap AAFwk
- * @param want Indicates disconnection information about the service extension.
- * @systemapi hide for inner use.
- * @return -
- * @StageModelOnly
- */
- 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.
- *
- * @devices phone, tablet, tv, wearable, car
- * @since 9
- * @sysCap AAFwk
- * @param want Indicates the want of the service extension being connected.
- * @systemapi hide for inner use.
- * @return -
- * @StageModelOnly
- */
- onReconnect(want: Want): void;
-}
-
diff --git a/api/@ohos.application.ServiceExtension.d.ts b/api/@ohos.application.ServiceExtensionAbility.d.ts
similarity index 92%
rename from api/@ohos.application.ServiceExtension.d.ts
rename to api/@ohos.application.ServiceExtensionAbility.d.ts
index 002684069a63fda834df098140a46b339d008254..d4d06bc4049ed66d3da2a102513a14cb640bc907 100644
--- a/api/@ohos.application.ServiceExtension.d.ts
+++ b/api/@ohos.application.ServiceExtensionAbility.d.ts
@@ -19,16 +19,16 @@ import Want from './@ohos.application.Want';
import { Configuration } from './@ohos.application.Configuration';
/**
- * class of service extension.
+ * class of service extension ability.
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi hide for inner use.
* @StageModelOnly
*/
-export default class ServiceExtension {
+export default class ServiceExtensionAbility {
/**
- * Indicates service extension context.
+ * Indicates service extension ability context.
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.Core
@@ -42,6 +42,7 @@ export default class ServiceExtension {
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @param want Indicates the want of created service extension.
* @systemapi hide for inner use.
* @return -
* @StageModelOnly
@@ -116,9 +117,10 @@ export default class ServiceExtension {
*
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @param config Indicates the updated configuration.
* @return -
* @StageModelOnly
*/
- onConfigurationUpdated(config: Configuration): void;
+ onConfigurationUpdated(config: Configuration): void;
}
diff --git a/api/@ohos.application.StartOptions.d.ts b/api/@ohos.application.StartOptions.d.ts
index 5c0b9e7d041e9e27f562824297483e010cc21b6e..b4cd41bbceab5748d8c933e5331f968ec393817e 100644
--- a/api/@ohos.application.StartOptions.d.ts
+++ b/api/@ohos.application.StartOptions.d.ts
@@ -18,7 +18,7 @@
*
* @name StartOptions
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @permission N/A
* @StageModelOnly
*/
@@ -27,7 +27,7 @@ export default class StartOptions {
* windowMode
* @default -
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
*/
windowMode?: number;
@@ -35,9 +35,8 @@ export default class StartOptions {
/**
* displayId
* @default -
- * @devices phone, tablet
* @since 9
- * @sysCap AAFwk
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @StageModelOnly
*/
displayId?: number;
diff --git a/api/application/ExtAbilityContext.d.ts b/api/@ohos.application.StaticSubscriberExtensionAbility.d.ts
similarity index 55%
rename from api/application/ExtAbilityContext.d.ts
rename to api/@ohos.application.StaticSubscriberExtensionAbility.d.ts
index c8cccfb6b2d788463029406016e348d5eca01d97..ebd6484ac6fee62f5cfe1c91699ec6a662c9de96 100644
--- a/api/application/ExtAbilityContext.d.ts
+++ b/api/@ohos.application.StaticSubscriberExtensionAbility.d.ts
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * 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
@@ -13,26 +13,25 @@
* limitations under the License.
*/
-import { HapModuleInfo } from "../bundle/hapModuleInfo";
-import Context from "./Context";
+import CommonEventData from "./commonEvent/commonEventData";
/**
- * The context of an extension. It allows access to extension-specific resources.
+ * class of static subscriber extension ability.
*
* @since 9
- * @sysCap AAFwk
- * @devices phone, tablet, tv, wearable, car
- * @permission N/A
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi hide for inner use.
* @StageModelOnly
*/
-export default class ExtAbilityContext extends Context {
-
+export default class StaticSubscriberExtensionAbility {
/**
- * Indicates configuration information about an module.
+ * Called back when a specific common event is published.
*
* @since 9
- * @sysCap AAFwk
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @systemapi hide for inner use.
+ * @return -
* @StageModelOnly
*/
- currentHapModuleInfo: HapModuleInfo;
+ onReceiveEvent(event: CommonEventData): void;
}
\ No newline at end of file
diff --git a/api/@ohos.application.Want.d.ts b/api/@ohos.application.Want.d.ts
index 337e376ae1577c1a1cedb04d5fed5b48fc7d4f4e..6b2c2b0ae671dc0d0f36a7f79506d7801fa7e39d 100644
--- a/api/@ohos.application.Want.d.ts
+++ b/api/@ohos.application.Want.d.ts
@@ -18,7 +18,7 @@
*
* @name Want
* @since 8
- * @sysCap SystemCapability.Ability.AbilityBase
+ * @syscap SystemCapability.Ability.AbilityBase
* @permission N/A
*/
export default class Want {
@@ -26,7 +26,7 @@ export default class Want {
* device id
* @default -
* @since 8
- * @sysCap SystemCapability.Ability.AbilityBase
+ * @syscap SystemCapability.Ability.AbilityBase
*/
deviceId?: string;
@@ -34,7 +34,7 @@ export default class Want {
* bundle name
* @default -
* @since 8
- * @sysCap SystemCapability.Ability.AbilityBase
+ * @syscap SystemCapability.Ability.AbilityBase
*/
bundleName?: string;
@@ -42,14 +42,14 @@ export default class Want {
* ability name
* @default -
* @since 8
- * @sysCap SystemCapability.Ability.AbilityBase
+ * @syscap SystemCapability.Ability.AbilityBase
*/
abilityName?: string;
/**
* The description of a URI in a Want.
* @since 8
- * @sysCap SystemCapability.Ability.AbilityBase
+ * @syscap SystemCapability.Ability.AbilityBase
* @default -
*/
uri?: string;
@@ -57,7 +57,7 @@ export default class Want {
/**
* The description of the type in this Want.
* @since 8
- * @sysCap SystemCapability.Ability.AbilityBase
+ * @syscap SystemCapability.Ability.AbilityBase
* @default -
*/
type?: string;
@@ -65,7 +65,7 @@ export default class Want {
/**
* The options of the flags in this Want.
* @since 8
- * @sysCap SystemCapability.Ability.AbilityBase
+ * @syscap SystemCapability.Ability.AbilityBase
* @default -
*/
flags?: number;
@@ -73,7 +73,7 @@ export default class Want {
/**
* The description of an action in an want.
* @since 8
- * @sysCap SystemCapability.Ability.AbilityBase
+ * @syscap SystemCapability.Ability.AbilityBase
* @default -
*/
action?: string;
@@ -81,7 +81,7 @@ export default class Want {
/**
* The description of the WantParams object in an Want
* @since 8
- * @sysCap SystemCapability.Ability.AbilityBase
+ * @syscap SystemCapability.Ability.AbilityBase
* @default -
*/
parameters?: {[key: string]: any};
@@ -89,7 +89,7 @@ export default class Want {
/**
* The description of a entities in a Want.
* @since 8
- * @sysCap SystemCapability.Ability.AbilityBase
+ * @syscap SystemCapability.Ability.AbilityBase
* @default -
*/
entities?: Array;
diff --git a/api/@ohos.application.abilityDelegatorRegistry.d.ts b/api/@ohos.application.abilityDelegatorRegistry.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..c2fa8b68e6bd28f59065e8c2208ac58e34295bf9
--- /dev/null
+++ b/api/@ohos.application.abilityDelegatorRegistry.d.ts
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { AbilityDelegator } from './application/abilityDelegator'
+import { AbilityDelegatorArgs } from './application/abilityDelegatorArgs'
+
+/**
+ * A global register used to store the AbilityDelegator and AbilityDelegatorArgs objects registered
+ * during application startup.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @import import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry'
+ * @permission N/A
+ */
+declare namespace abilityDelegatorRegistry {
+ /**
+ * Get the AbilityDelegator object of the application.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @return the AbilityDelegator object initialized when the application is started.
+ */
+ function getAbilityDelegator(): AbilityDelegator;
+
+ /**
+ * Get unit test parameters stored in the AbilityDelegatorArgs object.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @return the previously registered AbilityDelegatorArgs object.
+ */
+ function getArguments(): AbilityDelegatorArgs;
+
+ /**
+ * Describes all lifecycle states of an ability.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ */
+ export enum AbilityLifecycleState {
+ UNINITIALIZED,
+ CREATE,
+ FOREGROUND,
+ BACKGROUND,
+ DESTROY,
+ }
+}
+
+export default abilityDelegatorRegistry;
\ No newline at end of file
diff --git a/api/@ohos.application.abilityManager.d.ts b/api/@ohos.application.abilityManager.d.ts
index ff2426a5e7bc9e4598d977d2e6bd62e604fb6fba..5221fc08a0d6a920ccbb6bd401a8b2387372b4ad 100644
--- a/api/@ohos.application.abilityManager.d.ts
+++ b/api/@ohos.application.abilityManager.d.ts
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Copyright (c) 2021-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
@@ -22,7 +22,7 @@ import { ExtensionRunningInfo } from './application/ExtensionRunningInfo';
* The class of an ability manager.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @permission N/A
*/
declare namespace abilityManager {
@@ -30,7 +30,7 @@ declare namespace abilityManager {
/**
* @name AbilityState
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @permission N/A
*/
export enum AbilityState {
@@ -45,10 +45,11 @@ declare namespace abilityManager {
* Updates the configuration by modifying the configuration.
*
* @since 8
- * @SysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @param config Indicates the new configuration.
* @systemapi Hide this for inner system use.
* @return -
+ * @permission ohos.permission.UPDATE_CONFIGURATION
*/
function updateConfiguration(config: Configuration, callback: AsyncCallback): void;
function updateConfiguration(config: Configuration): Promise;
@@ -57,21 +58,23 @@ declare namespace abilityManager {
* Get information about running abilitys
*
* @since 8
- * @SysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi Hide this for inner system use.
- * @return -
+ * @return Returns the array of {@link AbilityRunningInfo}.
+ * @permission ohos.permission.GET_RUNNING_INFO
*/
function getAbilityRunningInfos(): Promise>;
function getAbilityRunningInfos(callback: AsyncCallback>): void;
-
+
/**
* Get information about running extensions
*
* @since 9
- * @SysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @param upperLimit Get the maximum limit of the number of messages
* @systemapi Hide this for inner system use.
- * @return -
+ * @return Returns the array of {@link ExtensionRunningInfo}.
+ * @permission ohos.permission.GET_RUNNING_INFO
*/
function getExtensionRunningInfos(upperLimit: number): Promise>;
function getExtensionRunningInfos(upperLimit: number, callback: AsyncCallback>): void;
diff --git a/api/@ohos.application.appManager.d.ts b/api/@ohos.application.appManager.d.ts
index dcb6dca86ab862ac726dd65add9cc4c67820639f..eb086aec2838d5ac416242f732b174a7fde2c75e 100644
--- a/api/@ohos.application.appManager.d.ts
+++ b/api/@ohos.application.appManager.d.ts
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Copyright (c) 2021-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
@@ -22,7 +22,7 @@ import { ProcessRunningInfo } from './application/ProcessRunningInfo';
* This module provides the function of app manager service.
*
* @since 8
- * @SysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @import import appManager from '@ohos.application.appManager'
* @permission N/A
*/
@@ -32,10 +32,11 @@ declare namespace appManager {
*
* @default -
* @since 8
- * @SysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @param observer The application state observer.
* @systemapi hide this for inner system use
* @return Returns the number code of the observer.
+ * @permission ohos.permission.RUNNING_STATE_OBSERVER
*/
function registerApplicationStateObserver(observer: ApplicationStateObserver): number;
@@ -43,10 +44,11 @@ declare namespace appManager {
* Unregister application state observer.
*
* @since 8
- * @SysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @param observerId Indicates the number code of the observer.
* @systemapi hide this for inner system use
* @return -
+ * @permission ohos.permission.RUNNING_STATE_OBSERVER
*/
function unregisterApplicationStateObserver(observerId: number, callback: AsyncCallback): void;
function unregisterApplicationStateObserver(observerId: number): Promise;
@@ -55,9 +57,10 @@ declare namespace appManager {
* getForegroundApplications.
*
* @since 8
- * @SysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi hide this for inner system use
* @return Returns the list of AppStateData.
+ * @permission ohos.permission.GET_RUNNING_INFO
*/
function getForegroundApplications(callback: AsyncCallback>): void;
function getForegroundApplications(): Promise>;
@@ -66,11 +69,12 @@ declare namespace appManager {
* Kill process with account.
*
* @since 8
- * @SysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @param bundleName The process bundle name.
* @param accountId The account id.
* @systemapi hide this for inner system use
* @return -
+ * @permission ohos.permission.INTERACT_ACROSS_LOCAL_ACCOUNTS, ohos.permission.CLEAN_BACKGROUND_PROCESSES
*/
function killProcessWithAccount(bundleName: string, accountId: number): Promise;
function killProcessWithAccount(bundleName: string, accountId: number, callback: AsyncCallback): void;
@@ -79,7 +83,7 @@ declare namespace appManager {
* Is user running in stability test.
*
* @since 8
- * @SysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @return Returns true if user is running stability test.
*/
function isRunningInStabilityTest(callback: AsyncCallback): void;
@@ -89,9 +93,10 @@ declare namespace appManager {
* Get information about running processes
*
* @since 8
- * @SysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi Hide this for inner system use.
- * @return -
+ * @return Returns the array of {@link ProcessRunningInfo}.
+ * @permission ohos.permission.GET_RUNNING_INFO
*/
function getProcessRunningInfos(): Promise>;
function getProcessRunningInfos(callback: AsyncCallback>): void;
@@ -99,11 +104,10 @@ declare namespace appManager {
/**
* Kill processes by bundle name
* @since 8
- * @SysCap SystemCapability.Appexecfwk
- * @devices phone, tablet, tv, wearable, car
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @param bundleName bundle name.
- * @permission ohos.permission.DELETE_MISSIONS
* @systemapi hide this for inner system use
+ * @permission ohos.permission.CLEAN_BACKGROUND_PROCESSES
*/
function killProcessesByBundleName(bundleName: string): Promise;
function killProcessesByBundleName(bundleName: string, callback: AsyncCallback);
@@ -111,14 +115,31 @@ declare namespace appManager {
/**
* Clear up application data by bundle name
* @since 8
- * @SysCap SystemCapability.Appexecfwk
- * @devices phone, tablet, tv, wearable, car
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @param bundleName bundle name.
- * @permission ohos.permission.DELETE_MISSIONS
* @systemapi hide this for inner system use
+ * @permission ohos.permission.CLEAN_APPLICATION_DATA
*/
function clearUpApplicationData(bundleName: string): Promise;
function clearUpApplicationData(bundleName: string, callback: AsyncCallback);
+
+ /**
+ * Is it a ram-constrained device
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @return whether a ram-constrained device.
+ */
+ function isRamConstrainedDevice(): Promise;
+ function isRamConstrainedDevice(callback: AsyncCallback): void;
+
+ /**
+ * Get the memory size of the application
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @return application memory size.
+ */
+ function getAppMemorySize(): Promise;
+ function getAppMemorySize(callback: AsyncCallback): void;
}
export default appManager;
diff --git a/api/@ohos.application.formBindingData.d.ts b/api/@ohos.application.formBindingData.d.ts
index ad398765917917ecc7774d2e0ff1cda7225c41e0..f961244748da0e4ed4a16aaff2012a08081f3737 100644
--- a/api/@ohos.application.formBindingData.d.ts
+++ b/api/@ohos.application.formBindingData.d.ts
@@ -18,19 +18,24 @@
*
* @name formBindingData
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.Form
*/
declare namespace formBindingData {
/**
* Create an FormBindingData instance.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.Form
* @param obj Indicates the FormBindingData instance data.
* @return Returns the {@link FormBindingData} instance.
*/
function createFormBindingData(obj?: Object | string): FormBindingData;
+ /**
+ * Defines the createFormBindingData result interface.
+ * @syscap SystemCapability.Ability.Form
+ * @since 8
+ */
interface FormBindingData {
data: Object
}
diff --git a/api/@ohos.application.formError.d.ts b/api/@ohos.application.formError.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..df34a39ea9755735e56420596301f5f32f395847
--- /dev/null
+++ b/api/@ohos.application.formError.d.ts
@@ -0,0 +1,225 @@
+/*
+ * 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.
+ */
+
+/**
+ * interface of formError.
+ *
+ * @name formError
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+declare namespace formError {
+ /**
+ * Error of form.
+ *
+ * @name FormError
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ enum FormError {
+ /**
+ * A common internal error occurs during form processing.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_COMMON = 1,
+
+ /**
+ * The application does not have permission to use forms.
+ * Ensure that the application is granted with the ohos.permission.REQUIRE_FORM
+ * and ohos.permission.GET_BUNDLE_INFO_PRIVILEGED permissions.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_PERMISSION_DENY = 2,
+
+ /**
+ * Failed to obtain the configuration information about the form specified by the
+ * request parameters. Ensure that the parameters of the form to be added are
+ * consistent with those provided by the form provider.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_GET_INFO_FAILED = 4,
+
+ /**
+ * Failed to obtain the bundle to which the form belongs based on the request parameters.
+ * Ensure that the bundle to which the form to be added belongs is available.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_GET_BUNDLE_FAILED = 5,
+
+ /**
+ * Failed to initialize the form layout based on the request parameters.
+ * Ensure that the grid style of the form is supported by the form provider.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_GET_LAYOUT_FAILED = 6,
+
+ /**
+ * Invalid input parameter during form operation. Ensure that all input
+ * parameters are valid.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_ADD_INVALID_PARAM = 7,
+
+ /**
+ * The form configuration to be obtained using an existing form ID is
+ * different from that obtained for the first time.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_CFG_NOT_MATCH_ID = 8,
+
+ /**
+ * The ID of the form to be operated does not exist in the Form Manager Service.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_NOT_EXIST_ID = 9,
+
+ /**
+ * Failed to bind the Form Manager Service to the provider service.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_BIND_PROVIDER_FAILED = 10,
+
+ /**
+ * The total number of added forms exceeds the maximum allowed by the system.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_MAX_SYSTEM_FORMS = 11,
+
+ /**
+ * The number of form instances generated using the same form configuration
+ * exceeds the maximum allowed by the system.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_MAX_INSTANCES_PER_FORM = 12,
+
+ /**
+ * The form being requested was added by other applications and cannot be
+ * operated by the current application.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_OPERATION_FORM_NOT_SELF = 13,
+
+ /**
+ * The Form Manager Service failed to instruct the form provider to delete the form.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_PROVIDER_DEL_FAIL = 14,
+
+ /**
+ * The total number of added forms exceeds the maximum per client.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_MAX_FORMS_PER_CLIENT = 15,
+
+ /**
+ * The total number of added temp forms exceeds the maximum in system.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_MAX_SYSTEM_TEMP_FORMS = 16,
+
+ /**
+ * The module can not be find in system.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_FORM_NO_SUCH_MODULE = 17,
+
+ /**
+ * The ability can not be find in system.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_FORM_NO_SUCH_ABILITY = 18,
+
+ /**
+ * The dimension is not exist in the form.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_FORM_NO_SUCH_DIMENSION = 19,
+
+ /**
+ * The ability is not installed.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_FORM_FA_NOT_INSTALLED = 20,
+
+ /**
+ * Failed to obtain the RPC object of the Form Manager Service because
+ * the service is not started.Please try again after the service is started.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_SYSTEM_RESPONSES_FAILED = 30,
+
+ /**
+ * Failed to obtain the form requested by the client because another form
+ * with the same form ID is in use. Forms in use cannot have the same ID.
+ * To obtain and display a form that has the same configuration as an in-use
+ * form in the same application, you are advised to set the form ID to 0 in
+ * the request parameters.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_FORM_DUPLICATE_ADDED = 31,
+
+ /**
+ * The form is being restored. Perform operations on the form only after
+ * the restoration is complete.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ ERR_IN_RECOVERY = 36
+ }
+}
+export default formError;
\ No newline at end of file
diff --git a/api/@ohos.application.formHost.d.ts b/api/@ohos.application.formHost.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..412c4b23a84554e757818c18c4889ed43809d0f4
--- /dev/null
+++ b/api/@ohos.application.formHost.d.ts
@@ -0,0 +1,277 @@
+/*
+ * 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 { Callback } from "./basic";
+import Want from './@ohos.application.Want';
+import formInfo from './@ohos.application.formInfo'
+
+/**
+ * interface of formHost.
+ *
+ * @name formHost
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ * @systemapi hide for inner use.
+ */
+declare namespace formHost {
+ /**
+ * Deletes an obtained form by its ID.
+ *
+ * After this method is called, the form won't be available for use by the application and the Form Manager
+ * Service no longer keeps the cache information about the form.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ * @param formId Indicates the form ID
+ * @return -
+ * @permission ohos.permission.REQUIRE_FORM
+ */
+ function deleteForm(formId: string, callback: AsyncCallback): void;
+ function deleteForm(formId: string): Promise;
+
+ /**
+ * Releases an obtained form by its ID.
+ *
+ * After this method is called, the form won't be available for use by the application, but the Form Manager
+ * Service still keeps the cache information about the form, so that the application can quickly obtain it based on
+ * the {@code formId}.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ * @param formId Indicates the form ID
+ * @param isReleaseCache Indicates whether or not release cache
+ * @return -
+ * @permission ohos.permission.REQUIRE_FORM
+ */
+ function releaseForm(formId: string, callback: AsyncCallback): void;
+ function releaseForm(formId: string, isReleaseCache: boolean, callback: AsyncCallback): void;
+ function releaseForm(formId: string, isReleaseCache?: boolean): Promise;
+
+ /**
+ * Requests for form update.
+ *
+ * This method must be called when the application has detected that a system setting item (such as the language,
+ * resolution, or screen orientation) being listened for has changed. Upon receiving the update request, the form
+ * provider automatically updates the form data (if there is any update) through the form framework, with the update
+ * process being unperceivable by the application.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ * @param formId Indicates the ID of the form to update.
+ * @return -
+ * @permission ohos.permission.REQUIRE_FORM
+ */
+ function requestForm(formId: string, callback: AsyncCallback): void;
+ function requestForm(formId: string): Promise;
+
+ /**
+ * Converts a specified temporary form that has been obtained by the application into a normal form.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ * @param formId Indicates the ID of the temporary form to convert.
+ * @return -
+ * @permission ohos.permission.REQUIRE_FORM
+ */
+ function castTempForm(formId: string, callback: AsyncCallback): void;
+ function castTempForm(formId: string): Promise;
+
+ /**
+ * Sends a notification to the form framework to make the specified forms visible.
+ *
+ * After this method is successfully called, onVisibilityChange will be called to notify the form provider of
+ * the form visibility change event.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ * @param formIds Indicates the IDs of the forms to be made visible.
+ * @return -
+ * @permission ohos.permission.REQUIRE_FORM
+ */
+ function notifyVisibleForms(formIds: Array, callback: AsyncCallback): void;
+ function notifyVisibleForms(formIds: Array): Promise;
+
+ /**
+ * Sends a notification to the form framework to make the specified forms invisible.
+ *
+ * After this method is successfully called, onVisibilityChange will be called to notify the form provider of
+ * the form visibility change event.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ * @param formIds Indicates the IDs of the forms to be made invisible.
+ * @return -
+ * @permission ohos.permission.REQUIRE_FORM
+ */
+ function notifyInvisibleForms(formIds: Array, callback: AsyncCallback): void;
+ function notifyInvisibleForms(formIds: Array): Promise;
+
+ /**
+ * Notify the form framework to make the specified forms updatable.
+ *
+ * You can use this method to set form refresh state to true, the form can receive new
+ * update from service.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ * @param formIds Indicates the IDs of the forms to be made invisible.
+ * @return -
+ * @permission ohos.permission.REQUIRE_FORM
+ */
+ function enableFormsUpdate(formIds: Array, callback: AsyncCallback): void;
+ function enableFormsUpdate(formIds: Array): Promise;
+
+ /**
+ * Notifys the form framework to make the specified forms non updatable.
+ *
+ * You can use this method to set form refresh state to false, the form do not receive
+ * new update from service.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ * @param formIds Indicates the IDs of the forms to be made invisible.
+ * @return -
+ * @permission ohos.permission.REQUIRE_FORM
+ */
+ function disableFormsUpdate(formIds: Array, callback: AsyncCallback): void;
+ function disableFormsUpdate(formIds: Array): Promise;
+
+ /**
+ * Checks whether the system is ready.
+ *
+ * You can use this method to obtain the system is ready
+ * new update from service.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ * @return -
+ */
+ function isSystemReady(callback: AsyncCallback): void;
+ function isSystemReady(): Promise;
+
+ /**
+ * Obtains the FormInfo objects provided by all applications on the device.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ * @return Returns the {@link FormInfo}
+ * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
+ */
+ function getAllFormsInfo(callback: AsyncCallback>): void;
+ function getAllFormsInfo(): Promise>;
+
+ /**
+ * Obtains the FormInfo objects provided by a specified application on the device.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ * @param bundleName Indicates the bundle name of the application.
+ * @param moduleName Indicates the module name of the application.
+ * @return Returns the {@link FormInfo}
+ * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
+ */
+ function getFormsInfo(bundleName: string, callback: AsyncCallback>): void;
+ function getFormsInfo(bundleName: string, moduleName: string, callback: AsyncCallback>): void;
+ function getFormsInfo(bundleName: string, moduleName?: string): Promise>;
+
+ /**
+ * Deletes invalid forms of the application in the Form Manager Service based on the list of.
+ *
+ * You can use this method to delete invalid forms of the application
+ * new update from service.
+ *
+ * @since 8
+ * @sysCap SystemCapability.Ability.Form
+ * @param formIds Indicates the specify form id.
+ * @return Returns the number of invalid forms deleted by the Form Manager Service
+ * @permission ohos.permission.REQUIRE_FORM.
+ */
+ function deleteInvalidForms(formIds: Array, callback: AsyncCallback): void;
+ function deleteInvalidForms(formIds: Array): Promise;
+
+ /**
+ * Obtains the Form state.
+ *
+ * You can use this method to obtains the form state
+ * new update from service.
+ *
+ * @since 8
+ * @sysCap SystemCapability.Ability.Form
+ * @param want Indicates want of the form.
+ * @return Returns form state {@link FormStateInfo}
+ * @permission ohos.permission.GET_BUNDLE_INFO, ohos.permission.GET_BUNDLE_INFO_PRIVILEGED.
+ */
+ function acquireFormState(want: Want, callback: AsyncCallback): void;
+ function acquireFormState(want: Want): Promise;
+
+ /**
+ * Listens to the event of uninstall form.
+ *
+ * You can use this method to listen to the event of uninstall form
+ * new update from service.
+ *
+ * @since 8
+ * @sysCap SystemCapability.Ability.Form
+ * @param type Indicates event type.
+ * @return -
+ */
+ function on(type: "formUninstall", callback: Callback): void;
+
+ /**
+ * Cancels listening to the event of uninstall form.
+ *
+ * You can use this method to cancel listening to the event of uninstall form
+ * new update from service.
+ *
+ * @since 8
+ * @sysCap SystemCapability.Ability.Form
+ * @param type Indicates event type.
+ * @return -
+ */
+ function off(type: "formUninstall", callback?: Callback): void;
+
+ /**
+ * notify form is Visible
+ *
+ * You can use this method to notify form visible state.
+ *
+ * @since 8
+ * @sysCap SystemCapability.Ability.Form
+ * @param formIds Indicates the specify form id.
+ * @param isVisible Indicates whether visible.
+ * @return -
+ * @permission ohos.permission.REQUIRE_FORM.
+ */
+ function notifyFormsVisible(formIds: Array, isVisible: boolean, callback: AsyncCallback): void;
+ function notifyFormsVisible(formIds: Array, isVisible: boolean): Promise;
+
+ /**
+ * notify form enable update state.
+ *
+ * You can use this method to notify form enable update state.
+ *
+ * @devices phone, tablet, tv, wearable, car
+ * @since 8
+ * @sysCap SystemCapability.Ability.Form
+ * @param formIds Indicates the specify form id.
+ * @param isEnableUpdate Indicates whether enable update.
+ * @return -
+ * @permission ohos.permission.REQUIRE_FORM.
+ */
+ function notifyFormsEnableUpdate(formIds: Array, isEnableUpdate: boolean, callback: AsyncCallback): void;
+ function notifyFormsEnableUpdate(formIds: Array, isEnableUpdate: boolean): Promise;
+}
+export default formHost;
\ No newline at end of file
diff --git a/api/@ohos.application.formInfo.d.ts b/api/@ohos.application.formInfo.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..92d3fd28a8b6ba0af510a015c93305bbb9682edd
--- /dev/null
+++ b/api/@ohos.application.formInfo.d.ts
@@ -0,0 +1,390 @@
+/*
+ * 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 Want from './@ohos.application.Want';
+
+/**
+ * interface of formInfo.
+ *
+ * @name formInfo
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+declare namespace formInfo {
+ /**
+ * Provides information about a form.
+ *
+ * @name FormInfo
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ interface FormInfo {
+ /**
+ * Obtains the bundle name of the application to which this form belongs.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ bundleName: string;
+
+ /**
+ * Obtains the name of the application module to which this form belongs.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ moduleName: string;
+
+ /**
+ * Obtains the class name of the ability to which this form belongs.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ abilityName: string;
+
+ /**
+ * Obtains the name of this form.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ name: string;
+
+ /**
+ * Obtains the name of this form.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ description: string;
+
+ /**
+ * Obtains the type of this form. Currently, JS forms are supported.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ type: FormType;
+
+ /**
+ * Obtains the JS component name of this JS form.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ jsComponentName: string;
+
+ /**
+ * Obtains the color mode of this form.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ colorMode: ColorMode;
+
+ /**
+ * Checks whether this form is a default form.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ isDefault: boolean;
+
+ /**
+ * Obtains the updateEnabled.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ updateEnabled: boolean;
+
+ /**
+ * Obtains whether notify visible of this form.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ formVisibleNotify: boolean;
+
+ /**
+ * Obtains the bundle relatedBundleName of the application to which this form belongs.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ relatedBundleName: string;
+
+ /**
+ * Obtains the scheduledUpdateTime.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ scheduledUpdateTime: string;
+
+ /**
+ * Obtains the form config ability about this form.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ formConfigAbility: string;
+
+ /**
+ * Obtains the updateDuration.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ updateDuration: number;
+
+ /**
+ * Obtains the default grid style of this form.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ defaultDimension: number;
+
+ /**
+ * Obtains the grid styles supported by this form.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ supportDimensions: Array;
+
+ /**
+ * Obtains the custom data defined in this form.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ customizeData: {[key: string]: [value: string]};
+ }
+
+ /**
+ * Type of form.
+ *
+ * @name FormType
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ enum FormType {
+ /**
+ * JS form.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ JS = 1
+ }
+
+ /**
+ * Color mode.
+ *
+ * @name ColorMode
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ enum ColorMode {
+ /**
+ * Automatic mode.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ MODE_AUTO = -1,
+
+ /**
+ * Dark mode.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ MODE_DARK = 0,
+
+ /**
+ * Light mode.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+ MODE_LIGHT = 1
+ }
+
+ /**
+ * Provides state information about a form.
+ *
+ * @name FormStateInfo
+ * @since 8
+ * @sysCap SystemCapability.Ability.Form
+ */
+ interface FormStateInfo {
+ /**
+ * Obtains the form state.
+ *
+ * @since 8
+ * @sysCap SystemCapability.Ability.Form
+ */
+ formState: FormState;
+
+ /**
+ * Obtains the want form .
+ *
+ * @since 8
+ * @sysCap SystemCapability.Ability.Form
+ */
+ want: Want;
+ }
+
+ /**
+ * Provides state about a form.
+ *
+ * @name FormState
+ * @since 8
+ * @sysCap SystemCapability.Ability.Form
+ */
+ enum FormState {
+ /**
+ * Indicates that the form status is unknown due to an internal error.
+ *
+ * @since 8
+ * @sysCap SystemCapability.Ability.Form
+ */
+ UNKNOWN = -1,
+
+ /**
+ * Indicates that the form is in the default state.
+ *
+ * @since 8
+ * @sysCap SystemCapability.Ability.Form
+ */
+ DEFAULT = 0,
+
+ /**
+ * Indicates that the form is ready.
+ *
+ * @since 8
+ * @sysCap SystemCapability.Ability.Form
+ */
+ READY = 1,
+ }
+
+ /**
+ * Parameter of form.
+ *
+ * @name FormParam
+ * @since 8
+ * @sysCap SystemCapability.Ability.Form
+ */
+ enum FormParam {
+ /**
+ * Indicates the key specifying the ID of the form to be obtained, which is represented as
+ * want: {
+ * "parameters": {
+ * IDENTITY_KEY: 1L
+ * }
+ * }.
+ *
+ * @since 8
+ * @sysCap SystemCapability.Ability.Form
+ * @systemapi hide for inner use.
+ */
+ IDENTITY_KEY = "ohos.extra.param.key.form_identity",
+
+ /**
+ * Indicates the key specifying the grid style of the form to be obtained, which is represented as
+ * want: {
+ * "parameters": {
+ * DIMENSION_KEY: 1
+ * }
+ * }.
+ *
+ * @since 8
+ * @sysCap SystemCapability.Ability.Form
+ */
+ DIMENSION_KEY = "ohos.extra.param.key.form_dimension",
+
+ /**
+ * Indicates the key specifying the name of the form to be obtained, which is represented as
+ * want: {
+ * "parameters": {
+ * NAME_KEY: "formName"
+ * }
+ * }.
+ *
+ * @since 8
+ * @sysCap SystemCapability.Ability.Form
+ */
+ NAME_KEY = "ohos.extra.param.key.form_name",
+
+ /**
+ * Indicates the key specifying the name of the module to which the form to be obtained belongs, which is
+ * represented as
+ * want: {
+ * "parameters": {
+ * MODULE_NAME_KEY: "formEntry"
+ * }
+ * }
+ * This constant is mandatory.
+ *
+ * @since 8
+ * @sysCap SystemCapability.Ability.Form
+ */
+ MODULE_NAME_KEY = "ohos.extra.param.key.module_name",
+
+ /**
+ * Indicates the key specifying the width of the form to be obtained, which is represented as
+ * want: {
+ * "parameters": {
+ * WIDTH_KEY: 800
+ * }
+ * }
+ *
+ * @since 8
+ * @sysCap SystemCapability.Ability.Form
+ */
+ WIDTH_KEY = "ohos.extra.param.key.form_width",
+
+ /**
+ * Indicates the key specifying the height of the form to be obtained, which is represented as
+ * want: {
+ * "parameters": {
+ * HEIGHT_KEY: 400
+ * }
+ * }
+ *
+ * @since 8
+ * @sysCap SystemCapability.Ability.Form
+ */
+ HEIGHT_KEY = "ohos.extra.param.key.form_height",
+
+ /**
+ * Indicates the key specifying whether a form is temporary, which is represented as
+ * want: {
+ * "parameters": {
+ * TEMPORARY_KEY: true
+ * }
+ * }
+ *
+ * @since 8
+ * @sysCap SystemCapability.Ability.Form
+ */
+ TEMPORARY_KEY = "ohos.extra.param.key.form_temporary"
+ }
+}
+export default formInfo;
\ No newline at end of file
diff --git a/api/@ohos.application.formProvider.d.ts b/api/@ohos.application.formProvider.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..6802a00aba62c6e011ec18aa06f0f292a3263f18
--- /dev/null
+++ b/api/@ohos.application.formProvider.d.ts
@@ -0,0 +1,53 @@
+/*
+ * 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 formBindingData from "./@ohos.application.formBindingData";
+
+/**
+ * interface of formProvider.
+ *
+ * @name formProvider
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ */
+declare namespace formProvider {
+ /**
+ * Set next update time for a specified form.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ * @param formId Indicates the form ID.
+ * @param minute Indicates duration minute before next update.
+ * @return -
+ */
+ function setFormNextRefreshTime(formId: string, minute: number, callback: AsyncCallback): void;
+ function setFormNextRefreshTime(formId: string, minute: number): Promise;
+
+ /**
+ * Update a specified form.
+ *
+ * Client to communication with FormManagerService.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.Form
+ * @param formId Indicates the form ID
+ * @return -
+ */
+ function updateForm(formId: string, formBindingData: formBindingData.FormBindingData,
+ callback: AsyncCallback): void;
+ function updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Promise;
+}
+export default formProvider;
\ No newline at end of file
diff --git a/api/@ohos.application.missionManager.d.ts b/api/@ohos.application.missionManager.d.ts
index 94f172f8e5fc096eaf834b759b95bc4de2195a7c..dc6a871c31938cc604ca2c107fa0cf98cf7731fd 100644
--- a/api/@ohos.application.missionManager.d.ts
+++ b/api/@ohos.application.missionManager.d.ts
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Huawei Device Co., Ltd.
+ * Copyright (c) 2021-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
@@ -24,8 +24,8 @@ import StartOptions from "./@ohos.application.StartOptions";
*
* @name missionManager
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Mission
- * @permission N/A
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @permission ohos.permission.MANAGE_MISSIONS
* @systemapi hide for inner use.
*/
declare namespace missionManager {
@@ -33,7 +33,8 @@ declare namespace missionManager {
* Register the missionListener to ams.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Mission
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @param listener Indicates the MissionListener to be registered.
* @return The index number of the MissionListener.
*/
function registerMissionListener(listener: MissionListener): number;
@@ -42,7 +43,8 @@ declare namespace missionManager {
* Unrgister the missionListener to ams.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Mission
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @param listenerId Indicates the listener id to be unregistered.
* @return -
*/
function unregisterMissionListener(listenerId: number, callback: AsyncCallback): void;
@@ -52,7 +54,9 @@ declare namespace missionManager {
* Get the missionInfo with the given missionId.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Mission
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @param deviceId Indicates the device to be queried.
+ * @param missionId Indicates mission id to be queried.
* @return the {@link MissionInfo} of the given id.
*/
function getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback): void;
@@ -62,7 +66,9 @@ declare namespace missionManager {
* Get the missionInfo with the given missionId.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Mission
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @param deviceId Indicates the device to be queried.
+ * @param numMax Indicates the maximum number of returned missions.
* @return The array of the {@link MissionInfo}.
*/
function getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback>): void;
@@ -72,7 +78,9 @@ declare namespace missionManager {
* Get the mission snapshot with the given missionId.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Mission
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @param deviceId Indicates the device to be queried.
+ * @param missionId Indicates mission id to be queried.
* @return The {@link MissionSnapshot} of the given id.
*/
function getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback): void;
@@ -82,7 +90,8 @@ declare namespace missionManager {
* Lock the mission.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Mission
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @param missionId Indicates mission id to be locked.
* @return -
*/
function lockMission(missionId: number, callback: AsyncCallback): void;
@@ -92,7 +101,8 @@ declare namespace missionManager {
* Unlock the mission.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Mission
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @param missionId Indicates mission id to be unlocked.
* @return -
*/
function unlockMission(missionId: number, callback: AsyncCallback): void;
@@ -102,7 +112,8 @@ declare namespace missionManager {
* Clear the given mission in the ability manager service.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Mission
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @param missionId Indicates mission id to be cleared.
* @return -
*/
function clearMission(missionId: number, callback: AsyncCallback): void;
@@ -112,7 +123,7 @@ declare namespace missionManager {
* Clear all missions in the ability manager service.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Mission
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
* @return -
*/
function clearAllMissions(callback: AsyncCallback): void;
@@ -122,7 +133,9 @@ declare namespace missionManager {
* Schedule the given mission to foreground.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Mission
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
+ * @param missionId Indicates mission id to be moved to foreground.
+ * @param options Indicates the start options.
* @return -
*/
function moveMissionToFront(missionId: number, callback: AsyncCallback): void;
diff --git a/api/ability/continueAbilityOptions.d.ts b/api/@ohos.application.testRunner.d.ts
old mode 100755
new mode 100644
similarity index 47%
rename from api/ability/continueAbilityOptions.d.ts
rename to api/@ohos.application.testRunner.d.ts
index 32c09d141425de7df7c76477511658ea6505d8c6..dc8e559d3f4cde6916a2d229946f69e6a9d74a49
--- a/api/ability/continueAbilityOptions.d.ts
+++ b/api/@ohos.application.testRunner.d.ts
@@ -13,30 +13,31 @@
* limitations under the License.
*/
- /**
- * @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
+/**
+ * Base class for the test framework.
+ * If you want to implement your own unit test framework, you must inherit this class and overrides all its methods.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ * @import import TestRunner from '@ohos.application.testRunner'
* @permission N/A
*/
-export interface ContinueAbilityOptions {
- /**
- * Indicates the ID of the target device where this ability will be migrated to.
- *
- * @default -
- * @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
- * @FAModelOnly
- */
- deviceId: string;
+export interface TestRunner {
+ /**
+ * Prepare the unit testing environment for running test cases.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ */
+ onPrepare(): void;
+
+ /**
+ * Run all test cases.
+ *
+ * @since 8
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ */
+ onRun(): void;
+}
- /**
- * Indicates whether the ability to be migrated back to the local device through
- * This is a reserved field.
- *
- * @default -
- * @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
- * @FAModelOnly
- */
- reversible?: boolean;
-}
\ No newline at end of file
+export default TestRunner;
\ No newline at end of file
diff --git a/api/@ohos.application.UriPermissionManager.d.ts b/api/@ohos.application.uriPermissionManager.d.ts
similarity index 72%
rename from api/@ohos.application.UriPermissionManager.d.ts
rename to api/@ohos.application.uriPermissionManager.d.ts
index f79c74100803bf19b1987cf5a266b915bff2f50b..37cd85441c8e8f9653759a09967c58e6a360c5be 100644
--- a/api/@ohos.application.UriPermissionManager.d.ts
+++ b/api/@ohos.application.uriPermissionManager.d.ts
@@ -20,20 +20,22 @@ import wantConstant from "./@ohos.ability.wantConstant";
* The management class for uri of file.
*
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @permission N/A
*/
-export default class UriPermissionManager {
+declare namespace uriPermissionManager {
/**
* Check whether the application corresponding to the accesstokenID has access rights to the URI.
*
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @param uri File URI.
* @param flag wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION or wantConstant.Flags.FLAG_AUTH_WRITE_URI_PERMISSION
* @param accessTokenId Indicates the access token of the application.
* @return Returns 0 if the verification is successful, otherwise returns -1.
*/
- verifyUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number, callback: AsyncCallback): void;
- verifyUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number): Promise;
+ function verifyUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number, callback: AsyncCallback): void;
+ function verifyUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number): Promise;
}
+
+export default uriPermissionManager;
\ No newline at end of file
diff --git a/api/@ohos.batteryinfo.d.ts b/api/@ohos.batteryInfo.d.ts
similarity index 93%
rename from api/@ohos.batteryinfo.d.ts
rename to api/@ohos.batteryInfo.d.ts
index a139929f6d85cb3fb8640a99e1fc7d45eabf1762..05b49542cab99d5f5d03e94aee99683880b67428 100644
--- a/api/@ohos.batteryinfo.d.ts
+++ b/api/@ohos.batteryInfo.d.ts
@@ -19,7 +19,7 @@
* Battery information includes the remaining battery power,
* voltage, temperature, model, and charger type.
*
- * @sysCap SystemCapability.PowerManager.BatteryManage.Core
+ * @syscap SystemCapability.PowerManager.BatteryManager.Core
* @since 6
*/
declare namespace batteryInfo {
@@ -74,7 +74,7 @@ declare namespace batteryInfo {
/**
* Indicates the charger type of a device.
*
- * @sysCap SystemCapability.PowerManager.BatteryManage.Core
+ * @syscap SystemCapability.PowerManager.BatteryManager.Core
* @since 6
*/
export enum BatteryPluggedType {
@@ -103,7 +103,7 @@ declare namespace batteryInfo {
/**
* Indicates the battery charging status of a device.
*
- * @sysCap SystemCapability.PowerManager.BatteryManage.Core
+ * @syscap SystemCapability.PowerManager.BatteryManager.Core
* @since 6
*/
export enum BatteryChargeState {
@@ -132,7 +132,7 @@ declare namespace batteryInfo {
/**
* Indicates the battery health status of a device.
*
- * @sysCap SystemCapability.PowerManager.BatteryManage.Core
+ * @syscap SystemCapability.PowerManager.BatteryManager.Core
* @since 6
*/
export enum BatteryHealthState {
diff --git a/api/@ohos.bluetooth.d.ts b/api/@ohos.bluetooth.d.ts
index 155520f1577dba21ce71d391fa7fe83da1f8805c..38e7044b419687b8c9cff20d0c70fc809787a041 100644
--- a/api/@ohos.bluetooth.d.ts
+++ b/api/@ohos.bluetooth.d.ts
@@ -18,19 +18,20 @@ import { AsyncCallback, Callback } from "./basic";
/**
* Provides methods to operate or manage Bluetooth.
* @since 7
+ * @import import bluetooth frome '@ohos.bluetooth';
* @syscap SystemCapability.Communication.Bluetooth.Core
*/
declare namespace bluetooth {
- /**
- * Obtains the Bluetooth status of a device.
- *
- * @return Returns the Bluetooth status, which can be {@link BluetoothState#STATE_OFF},
- * {@link BluetoothState#STATE_TURNING_ON}, {@link BluetoothState#STATE_ON}, {@link BluetoothState#STATE_TURNING_OFF},
- * {@link BluetoothState#STATE_BLE_TURNING_ON}, {@link BluetoothState#STATE_BLE_ON},
- * or {@link BluetoothState#STATE_BLE_TURNING_OFF}.
- * @since 7
- * @permission ohos.permission.USE_BLUETOOTH
- */
+ /**
+ * Obtains the Bluetooth status of a device.
+ *
+ * @return Returns the Bluetooth status, which can be {@link BluetoothState#STATE_OFF},
+ * {@link BluetoothState#STATE_TURNING_ON}, {@link BluetoothState#STATE_ON}, {@link BluetoothState#STATE_TURNING_OFF},
+ * {@link BluetoothState#STATE_BLE_TURNING_ON}, {@link BluetoothState#STATE_BLE_ON},
+ * or {@link BluetoothState#STATE_BLE_TURNING_OFF}.
+ * @since 7
+ * @permission ohos.permission.USE_BLUETOOTH
+ */
function getState(): BluetoothState;
/**
@@ -121,6 +122,16 @@ declare namespace bluetooth {
*/
function getPairedDevices(): Array;
+ /**
+ * Obtains the connection state of profile.
+ *
+ * @param profileId The profile id.
+ * @return Returns the connection state.
+ * @since 8
+ * @permission ohos.permission.USE_BLUETOOTH
+ */
+ function getProfileConnState(profileId: ProfileId): ProfileConnectionState;
+
/**
* Sets the confirmation of pairing with a certain device.
*
@@ -336,6 +347,134 @@ declare namespace bluetooth {
*/
function off(type: "sppRead", clientSocket: number, callback?: Callback): void;
+ /**
+ * Obtains the instance of profile.
+ *
+ * @param profileId The profile id..
+ * @return Returns instance of profile.
+ * @since 8
+ */
+ function getProfile(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfile;
+
+ /**
+ * Base interface of profile.
+ */
+ interface BaseProfile {
+ /**
+ * Obtains the connected devices list of profile.
+ *
+ * @return Returns the address of connected devices list.
+ * @since 8
+ * @permission ohos.permission.USE_BLUETOOTH
+ */
+ getConnectionDevices(): Array;
+
+ /**
+ * Obtains the profile state of device.
+ *
+ * @param device The address of bluetooth device.
+ * @return Returns {@link ProfileConnectionState} of device.
+ * @since 8
+ * @permission ohos.permission.USE_BLUETOOTH
+ */
+ getDeviceState(device: string): ProfileConnectionState;
+ }
+
+ /**
+ * Manager a2dp source profile.
+ */
+ interface A2dpSourceProfile extends BaseProfile {
+ /**
+ * Connect to device with a2dp.
+ *
+ * @param device The address of the remote device to connect.
+ * @return Returns {@code true} if the connect is in process; returns {@code false} otherwise.
+ * @since 8
+ * @permission permission ohos.permission.DISCOVER_BLUETOOTH
+ */
+ connect(device: string): boolean;
+
+ /**
+ * Disconnect to device with a2dp.
+ *
+ * @param device The address of the remote device to disconnect.
+ * @return Returns {@code true} if the disconnect is in process; returns {@code false} otherwise.
+ * @since 8
+ * @permission permission ohos.permission.DISCOVER_BLUETOOTH
+ */
+ disconnect(device: string): boolean;
+
+ /**
+ * Subscribe the event reported when the profile connection state changes .
+ *
+ * @param type Type of the profile connection state changes event to listen for .
+ * @param callback Callback used to listen for event.
+ * @since 8
+ */
+ on(type: "connectionStateChange", callback: Callback): void;
+
+ /**
+ * Unsubscribe the event reported when the profile connection state changes .
+ *
+ * @param type Type of the profile connection state changes event to listen for .
+ * @param callback Callback used to listen for event.
+ * @since 8
+ */
+ off(type: "connectionStateChange", callback?: Callback): void;
+
+ /**
+ * Obtains the playing state of device.
+ *
+ * @param device The address of the remote device.
+ * @return Returns {@link PlayingState} of the remote device.
+ *
+ */
+ getPlayingState(device: string): PlayingState;
+ }
+
+ /**
+ * Manager handsfree AG profile.
+ */
+ interface HandsFreeAudioGatewayProfile extends BaseProfile {
+ /**
+ * Connect to device with hfp.
+ *
+ * @param device The address of the remote device to connect.
+ * @return Returns {@code true} if the connect is in process; returns {@code false} otherwise.
+ * @since 8
+ * @permission permission ohos.permission.DISCOVER_BLUETOOTH
+ */
+ connect(device: string): boolean;
+
+ /**
+ * Disconnect to device with hfp.
+ *
+ * @param device The address of the remote device to disconnect.
+ * @return Returns {@code true} if the disconnect is in process; returns {@code false} otherwise.
+ * @since 8
+ * @permission permission ohos.permission.DISCOVER_BLUETOOTH
+ */
+ disconnect(device: string): boolean;
+
+ /**
+ * Subscribe the event reported when the profile connection state changes .
+ *
+ * @param type Type of the profile connection state changes event to listen for .
+ * @param callback Callback used to listen for event.
+ * @since 8
+ */
+ on(type: "connectionStateChange", callback: Callback): void;
+
+ /**
+ * Unsubscribe the event reported when the profile connection state changes .
+ *
+ * @param type Type of the profile connection state changes event to listen for .
+ * @param callback Callback used to listen for event.
+ * @since 8
+ */
+ off(type: "connectionStateChange", callback?: Callback): void;
+ }
+
namespace BLE {
/**
* create a JavaScript Gatt server instance.
@@ -411,7 +550,6 @@ declare namespace bluetooth {
* Manages GATT server. Before calling an Gatt server method, you must use {@link createGattServer} to create an GattServer instance.
*/
interface GattServer {
-
/**
* Starts BLE advertising.
*
@@ -781,9 +919,9 @@ declare namespace bluetooth {
/** The UUID of the {@link GattService} instance to which the characteristic belongs */
serviceUuid: string;
/** The UUID of a BLECharacteristic instance */
- characteristicUuid: string;
+ characteristicUuid: string;
/** The value of a BLECharacteristic instance */
- characteristicValue: ArrayBuffer;
+ characteristicValue: ArrayBuffer;
/** The list of {@link BLEDescriptor} contained in the characteristic */
descriptors: Array;
}
@@ -1306,6 +1444,39 @@ declare namespace bluetooth {
HEALTH_GENERIC_HEALTH_MANAGER = 0x0938,
HEALTH_PERSONAL_MOBILITY_DEVICE = 0x093C,
}
+
+ /**
+ * Profile state change parameters.
+ *
+ * @since 8
+ */
+ interface StateChangeParam {
+ /** The address of device */
+ deviceId: string;
+
+ /** Profile state value */
+ state: ProfileConnectionState;
+ }
+
+ /**
+ * The enum of a2dp playing state.
+ *
+ * @since 8
+ */
+ enum PlayingState {
+ STATE_NOT_PLAYING,
+ STATE_PLAYING,
+ }
+
+ /**
+ * The enum of profile id.
+ *
+ * @since 8
+ */
+ enum ProfileId {
+ PROFILE_A2DP_SOURCE = 1,
+ PROFILE_HANDS_FREE_AUDIO_GATEWAY = 4,
+ }
}
export default bluetooth;
diff --git a/api/@ohos.brightness.d.ts b/api/@ohos.brightness.d.ts
index f12bc7a706745b47aa73eda3fb6a1c0ad3745153..bb8b0988049e37d66b524897ad8c45d672ee5326 100644
--- a/api/@ohos.brightness.d.ts
+++ b/api/@ohos.brightness.d.ts
@@ -18,7 +18,7 @@ import { AsyncCallback } from './basic';
/**
* Provides interfaces to control the power of display.
*
- * @sysCap SystemCapability.PowerManager.DisplayPowerManager
+ * @syscap SystemCapability.PowerManager.DisplayPowerManager
* @since 7
*/
declare namespace brightness {
@@ -26,7 +26,6 @@ declare namespace brightness {
* Sets the screen brightness.
*
* @param value Brightness value, ranging from 0 to 255.
- * @sysCap SystemCapability.PowerManager.DisplayPowerManager
* @systemapi
* @since 7
*/
diff --git a/api/@ohos.bundle.d.ts b/api/@ohos.bundle.d.ts
index 8d2be229f4907e7bfdafb13592a25f9d9f47a9b2..2bacf03f784be27d20c3f122c9f2bbedc670762a 100644
--- a/api/@ohos.bundle.d.ts
+++ b/api/@ohos.bundle.d.ts
@@ -20,9 +20,9 @@ import { AbilityInfo } from './bundle/abilityInfo';
import { ExtensionAbilityInfo } from './bundle/extensionAbilityInfo';
import { Want } from './ability/want';
import { BundleInstaller } from './bundle/bundleInstaller';
-import { ShortcutInfo } from './bundle/shortcutInfo';
import { ModuleUsageRecord } from './bundle/moduleUsageRecord';
import { PermissionDef } from './bundle/PermissionDef';
+import image from './@ohos.multimedia.image';
/**
* bundle.
@@ -384,6 +384,19 @@ declare namespace bundle {
*/
function getBundleInstaller(callback: AsyncCallback): void;
function getBundleInstaller(): Promise;
+
+ /**
+ * Obtains information about the current ability.
+ *
+ * @since 7
+ * @syscap SystemCapability.BundleManager.BundleFramework
+ * @param bundleName Indicates the application bundle name to be queried.
+ * @param abilityName Indicates the ability name.
+ * @return Returns the AbilityInfo object for the current ability.
+ * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO
+ */
+ function getAbilityInfo(bundleName: string, abilityName: string, callback: AsyncCallback): void;
+ function getAbilityInfo(bundleName: string, abilityName: string): Promise;
/**
* Obtains based on a given bundle name.
@@ -393,12 +406,13 @@ declare namespace bundle {
* @param bundleName Indicates the application bundle name to be queried.
* @param bundleFlags Indicates the flag used to specify information contained in the ApplicationInfo object
* that will be returned.
- * @param userId Indicates the user ID.
+ * @param userId Indicates the user ID or do not pass user ID.
* @return Returns the ApplicationInfo object.
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO
*/
function getApplicationInfo(bundleName: string, bundleFlags: number, userId: number, callback: AsyncCallback) : void;
- function getApplicationInfo(bundleName: string, bundleFlags: number, userId: number) : Promise;
+ function getApplicationInfo(bundleName: string, bundleFlags: number, callback: AsyncCallback) : void;
+ function getApplicationInfo(bundleName: string, bundleFlags: number, userId?: number) : Promise;
/**
* Query the AbilityInfo by the given Want.
@@ -439,12 +453,13 @@ declare namespace bundle {
* @syscap SystemCapability.BundleManager.BundleFramework
* @param bundleFlags Indicates the flag used to specify information contained in the ApplicationInfo objects
* that will be returned.
- * @param userId Indicates the user ID.
+ * @param userId Indicates the user ID or do not pass user ID.
* @return Returns a list of ApplicationInfo objects.
* @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
*/
function getAllApplicationInfo(bundleFlags: number, userId: number, callback: AsyncCallback>) : void;
- function getAllApplicationInfo(bundleFlags: number, userId: number) : Promise>;
+ function getAllApplicationInfo(bundleFlags: number, callback: AsyncCallback>) : void;
+ function getAllApplicationInfo(bundleFlags: number, userId?: number) : Promise>;
/**
* Obtains bundle name by the given uid.
@@ -467,12 +482,11 @@ declare namespace bundle {
* @param bundleFlags Indicates the flag used to specify information contained in the BundleInfo object to be
* returned.
* @return Returns the BundleInfo object.
+ * @systemapi Hide this for inner system use
*/
function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number, callback: AsyncCallback) : void
function getBundleArchiveInfo(hapFilePath: string, bundleFlags: number) : Promise;
- /**
-
/**
* Obtains the Want for starting the main ability of an application based on the
* given bundle name. The main ability of an application is the ability that has the
@@ -489,18 +503,6 @@ declare namespace bundle {
function getLaunchWantForBundle(bundleName: string, callback: AsyncCallback): void;
function getLaunchWantForBundle(bundleName: string): Promise;
- /**
- * Obtains information about the shortcuts of the application.
- *
- * @since 7
- * @syscap SystemCapability.BundleManager.BundleFramework
- * @param bundleName Indicates the bundle name of the application.
- * @return Returns a list of ShortcutInfo objects containing shortcut information about the application.
- * @permission ohos.permission.MANAGE_SHORTCUTS
- */
- function getAllShortcutInfo(bundleName: string, callback: AsyncCallback>): void;
- function getAllShortcutInfo(bundleName: string): Promise>;
-
/**
* get module usage record list in descending order of lastLaunchTime.
*
@@ -582,6 +584,54 @@ declare namespace bundle {
*/
function getPermissionDef(permissionName: string, callback: AsyncCallback): void;
function getPermissionDef(permissionName: string): Promise;
+
+ /**
+ * Obtains the label of a specified ability.
+ *
+ * @since 8
+ * @syscap SystemCapability.BundleManager.BundleFramework
+ * @param bundleName Indicates the bundle name of the application to which the ability belongs.
+ * @param abilityName Indicates the ability name.
+ * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO
+ * @return Returns the label representing the label of the specified ability.
+ */
+ function getAbilityLabel(bundleName: string, abilityName: string, callback: AsyncCallback): void;
+ function getAbilityLabel(bundleName: string, abilityName: string): Promise;
+
+ /**
+ * Obtains the icon of a specified ability.
+ *
+ * @since 8
+ * @syscap SystemCapability.BundleManager.BundleFramework
+ * @param bundleName Indicates the bundle name of the application to which the ability belongs.
+ * @param abilityName Indicates the ability name.
+ * @return Returns the PixelMap object representing the icon of the specified ability.
+ * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED, ohos.permission.GET_BUNDLE_INFO
+ */
+ function getAbilityIcon(bundleName: string, abilityName: string, callback: AsyncCallback): void;
+ function getAbilityIcon(bundleName: string, abilityName: string): Promise;
+
+ /**
+ * Checks whether a specified ability is enabled.
+ *
+ * @since 8
+ * @syscap SystemCapability.BundleManager.BundleFramework
+ * @param info Indicates information about the ability to check.
+ * @returns Returns true if the ability is enabled; returns false otherwise.
+ */
+ function isAbilityEnabled(info: AbilityInfo, callback: AsyncCallback): void;
+ function isAbilityEnabled(info: AbilityInfo): Promise;
+
+ /**
+ * Checks whether a specified application is enabled.
+ *
+ * @since 8
+ * @syscap SystemCapability.BundleManager.BundleFramework
+ * @param bundleName Indicates the bundle name of the application.
+ * @returns Returns true if the application is enabled; returns false otherwise.
+ */
+ function isApplicationEnabled(bundleName: string, callback: AsyncCallback): void;
+ function isApplicationEnabled(bundleName: string): Promise;
}
export default bundle;
diff --git a/api/@ohos.bundleState.d.ts b/api/@ohos.bundleState.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..0734372b77c45a6e0346c9da414c196ed23e4d51
--- /dev/null
+++ b/api/@ohos.bundleState.d.ts
@@ -0,0 +1,249 @@
+/*
+ * 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';
+
+/**
+ * Provides methods for managing bundle usage statistics,
+ * including the methods for querying bundle usage information and state data.
+ *
+ * You can use the methods defined in this class to query
+ * the usage history and states of bundles in a specified period.
+ * The system stores the query result in a {@link BundleStateInfo} or {@link BundleActiveState} instance and
+ * then returns it to you.
+ *
+ * @since 7
+ */
+declare namespace bundleState {
+
+ /**
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
+ */
+ interface BundleStateInfo {
+ /**
+ * the identifier of BundleStateInfo.
+ */
+ id: number;
+ /**
+ * the total duration, in milliseconds.
+ */
+ abilityInFgTotalTime?: number;
+ /**
+ * the last time when the application was accessed, in milliseconds.
+ */
+ abilityPrevAccessTime?: number;
+ /**
+ * the last time when the application was visible in the foreground, in milliseconds.
+ */
+ abilityPrevSeenTime?: number;
+ /**
+ * the total duration, in milliseconds.
+ */
+ abilitySeenTotalTime?: number;
+ /**
+ * the bundle name of the application.
+ */
+ bundleName?: string;
+ /**
+ * the total duration, in milliseconds.
+ */
+ fgAbilityAccessTotalTime?: number;
+ /**
+ * the last time when the foreground application was accessed, in milliseconds.
+ */
+ fgAbilityPrevAccessTime?: number;
+ /**
+ * the time of the first bundle usage record in this {@code BundleActiveInfo} object,
+ * in milliseconds.
+ */
+ infosBeginTime?: number;
+ /**
+ * the time of the last bundle usage record in this {@code BundleActiveInfo} object,
+ * in milliseconds.
+ */
+ infosEndTime?: number;
+
+ /**
+ * Merges a specified {@link BundleActiveInfo} object with this {@link BundleActiveInfo} object.
+ * The bundle name of both objects must be the same.
+ *
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
+ * @param toMerge Indicates the {@link BundleActiveInfo} object to merge.
+ * if the bundle names of the two {@link BundleActiveInfo} objects are different.
+ */
+ merge(toMerge: BundleStateInfo): void;
+ }
+
+ /**
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
+ */
+ interface BundleActiveState {
+ /**
+ * the usage priority group of the application.
+ */
+ appUsagePriorityGroup?: number;
+ /**
+ * the bundle name.
+ */
+ bundleName?: string;
+ /**
+ * the shortcut ID.
+ */
+ indexOfLink?: string;
+ /**
+ * the class name.
+ */
+ nameOfClass?: string;
+ /**
+ * the time when this state occurred, in milliseconds.
+ */
+ stateOccurredTime?: number;
+ /**
+ * the state type.
+ */
+ stateType?: number;
+ }
+
+ /**
+ * Checks whether the application with a specified bundle name is in the idle state.
+ *
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
+ * @param bundleName Indicates the bundle name of the application to query.
+ * @return Returns {@code true} if the application is idle in a particular period;
+ * returns {@code false} otherwise. The time range of the particular period is defined by the system,
+ * which may be hours or days.
+ */
+ function isIdleState(bundleName: string, callback: AsyncCallback): void;
+ function isIdleState(bundleName: string): Promise;
+
+ /**
+ * Queries the usage priority group of the calling application.
+ *
+ * The priority defined in a priority group restricts the resource usage of an application,
+ * for example, restricting the running of background tasks.
+ *
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.AppGroup
+ * @return Returns the usage priority group of the calling application.
+ */
+ function queryAppUsagePriorityGroup(callback: AsyncCallback): void;
+ function queryAppUsagePriorityGroup(): Promise;
+
+ /**
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
+ */
+ interface BundleActiveInfoResponse {
+ [key: string]: BundleStateInfo;
+ }
+
+ /**
+ * Queries usage information about each bundle within a specified period.
+ *
+ * This method queries usage information at the {@link #BY_OPTIMIZED} interval by default.
+ *
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
+ * @permission ohos.permission.BUNDLE_ACTIVE_INFO
+ * @systemapi Hide this for inner system use.
+ * @param begin Indicates the start time of the query period, in milliseconds.
+ * @param end Indicates the end time of the query period, in milliseconds.
+ * @return Returns the {@link BundleActiveInfoResponse} objects containing the usage information about each bundle.
+ */
+ function queryBundleStateInfos(begin: number, end: number, callback: AsyncCallback): void;
+ function queryBundleStateInfos(begin: number, end: number): Promise;
+
+ /**
+ * Declares interval type.
+ *
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
+ */
+ export enum IntervalType {
+ /**
+ * Indicates the interval type that will determine the optimal interval based on the start and end time.
+ */
+ BY_OPTIMIZED = 0,
+
+ /**
+ * Indicates the daily interval.
+ */
+ BY_DAILY = 1,
+
+ /**
+ * Indicates the weekly interval.
+ */
+ BY_WEEKLY = 2,
+
+ /**
+ * Indicates the monthly interval.
+ */
+ BY_MONTHLY = 3,
+
+ /**
+ * Indicates the annually interval.
+ */
+ BY_ANNUALLY = 4
+ }
+
+ /**
+ * Queries usage information about each bundle within a specified period at a specified interval.
+ *
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
+ * @permission ohos.permission.BUNDLE_ACTIVE_INFO
+ * @systemapi Hide this for inner system use.
+ * @param byInterval Indicates the interval at which the usage statistics are queried.
+ * The value can be {@link #BY_OPTIMIZED}, {@link #BY_DAILY},
+ * {@link #BY_WEEKLY}, {@link #BY_MONTHLY}, or {@link #BY_ANNUALLY}.
+ * @param begin Indicates the start time of the query period, in milliseconds.
+ * @param end Indicates the end time of the query period, in milliseconds.
+ * @return Returns the list of {@link BundleStateInfo} objects containing the usage information about each bundle.
+ */
+ function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number, callback: AsyncCallback>): void;
+ function queryBundleStateInfoByInterval(byInterval: IntervalType, begin: number, end: number): Promise>;
+
+ /**
+ * Queries state data of all bundles within a specified period identified by the start and end time.
+ *
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
+ * @permission ohos.permission.BUNDLE_ACTIVE_INFO
+ * @systemapi Hide this for inner system use.
+ * @param begin Indicates the start time of the query period, in milliseconds.
+ * @param end Indicates the end time of the query period, in milliseconds.
+ * @return Returns the list of {@link BundleActiveState} objects containing the state data of all bundles.
+ */
+ function queryBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void;
+ function queryBundleActiveStates(begin: number, end: number): Promise>;
+
+ /**
+ * Queries state data of the current bundle within a specified period.
+ *
+ * @since 7
+ * @syscap SystemCapability.ResourceSchedule.UsageStatistics.App
+ * @param begin Indicates the start time of the query period, in milliseconds.
+ * @param end Indicates the end time of the query period, in milliseconds.
+ * @return Returns the {@link BundleActiveState} object Array containing the state data of the current bundle.
+ */
+ function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback>): void;
+ function queryCurrentBundleActiveStates(begin: number, end: number): Promise>;
+}
+
+export default bundleState;
\ No newline at end of file
diff --git a/api/@ohos.commonEvent.d.ts b/api/@ohos.commonEvent.d.ts
index e9b04424dc98e1dddef6814796df654253435606..f6a59b218ee165e505f7d5d10e5377df6ffa9614 100644
--- a/api/@ohos.commonEvent.d.ts
+++ b/api/@ohos.commonEvent.d.ts
@@ -170,6 +170,12 @@ declare namespace commonEvent {
*/
COMMON_EVENT_SCREEN_ON = "usual.event.SCREEN_ON",
+ /**
+ * this commonEvent means when the thermal state level change
+ * @since 8
+ */
+ COMMON_EVENT_THERMAL_LEVEL_CHANGED = "usual.event.THERMAL_LEVEL_CHANGED",
+
/**
* this commonEvent means when the user is present after the device waked up.
*/
@@ -890,35 +896,35 @@ declare namespace commonEvent {
/**
* The external storage was removed.
* This is a protected common event that can only be sent by system.
- * @since 8
+ * @since 9
*/
COMMON_EVENT_VOLUME_REMOVED = "usual.event.data.VOLUME_REMOVED",
/**
* The external storage was unmounted.
* This is a protected common event that can only be sent by system.
- * @since 8
+ * @since 9
*/
COMMON_EVENT_VOLUME_UNMOUNTED = "usual.event.data.VOLUME_UNMOUNTED",
/**
* The external storage was mounted.
* This is a protected common event that can only be sent by system.
- * @since 8
+ * @since 9
*/
COMMON_EVENT_VOLUME_MOUNTED = "usual.event.data.VOLUME_MOUNTED",
/**
* The external storage was bad removal.
* This is a protected common event that can only be sent by system.
- * @since 8
+ * @since 9
*/
COMMON_EVENT_VOLUME_BAD_REMOVAL = "usual.event.data.VOLUME_BAD_REMOVAL",
/**
* The external storage was eject.
* This is a protected common event that can only be sent by system.
- * @since 8
+ * @since 9
*/
COMMON_EVENT_VOLUME_EJECT = "usual.event.data.VOLUME_EJECT",
diff --git a/api/@ohos.configPolicy.d.ts b/api/@ohos.configPolicy.d.ts
index 32ef672ca08824e798623f0eccb68857b4f4b5f3..d12690c30faca84069c5fedcbef457ed789f20f1 100644
--- a/api/@ohos.configPolicy.d.ts
+++ b/api/@ohos.configPolicy.d.ts
@@ -19,7 +19,7 @@ import {AsyncCallback} from "./basic";
* Provides file path related APIS.
*
* @since 8
- * @sysCap SystemCapability.Customization.ConfigPolicy
+ * @syscap SystemCapability.Customization.ConfigPolicy
*/
declare namespace configPolicy {
/**
@@ -27,7 +27,7 @@ declare namespace configPolicy {
*
* @since 8
* @systemapi Hide this for inner system use.
- * @sysCap SystemCapability.Customization.ConfigPolicy
+ * @syscap SystemCapability.Customization.ConfigPolicy
* @param relPath the relative path of the config file.
* @return Returns the path of the highest priority config file.
*/
@@ -39,7 +39,7 @@ declare namespace configPolicy {
*
* @since 8
* @systemapi Hide this for inner system use.
- * @sysCap SystemCapability.Customization.ConfigPolicy
+ * @syscap SystemCapability.Customization.ConfigPolicy
* @param relPath the relative path of the config file.
* @return Returns paths of config files.
*/
@@ -51,7 +51,7 @@ declare namespace configPolicy {
*
* @since 8
* @systemapi Hide this for inner system use.
- * @sysCap SystemCapability.Customization.ConfigPolicy
+ * @syscap SystemCapability.Customization.ConfigPolicy
* @return Returns paths of config directories.
*/
function getCfgDirList(callback: AsyncCallback>);
diff --git a/api/@ohos.connectedTag.d.ts b/api/@ohos.connectedTag.d.ts
new file mode 100755
index 0000000000000000000000000000000000000000..96fb3d93c9de31ac560822fab5aed9284cef2dca
--- /dev/null
+++ b/api/@ohos.connectedTag.d.ts
@@ -0,0 +1,108 @@
+/*
+ * 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, Callback } from './basic';
+
+/**
+ * Provides methods to operate or manage Connected Tag.
+ *
+ * @since 8
+ * @syscap SystemCapability.Communication.ConnectedTag
+ * @import import connectedTag from '@ohos.connectedTag';
+ */
+declare namespace connectedTag {
+ /**
+ * Initializes Connected Tag.
+ *
+ * @return Returns true or false.
+ * @permissions ohos.permission.NFC_TAG
+ *
+ * @since 8
+ */
+ function init(): boolean;
+
+ /**
+ * UnInitializes Connected Tag.
+ *
+ * @return Returns true or false.
+ * @permissions ohos.permission.NFC_TAG
+ *
+ * @since 8
+ */
+ function uninit(): boolean;
+
+ /**
+ * Reads the NDEF Data.
+ *
+ * @return Returns the NDEF Data.
+ * @permissions ohos.permission.NFC_TAG
+ *
+ * @since 8
+ */
+ function readNdefTag(): Promise;
+ function readNdefTag(callback: AsyncCallback): void;
+
+ /**
+ * Writes the NDEF Data.
+ *
+ * @param data The Data to write.
+ * @return Returns true or false.
+ * @permissions ohos.permission.NFC_TAG
+ *
+ * @since 8
+ */
+ function writeNdefTag(data: string): Promise;
+ function writeNdefTag(data: string, callback: AsyncCallback): void;
+
+ /**
+ * Subscribes NFC RF status change events.
+ *
+ * @type The callback type.
+ * @param callback The callback function to be registered.
+ * @return Returns NFC_RF_LEAVE or NFC_RF_ENTER
+ * @permissions ohos.permission.NFC_TAG
+ *
+ * @since 8
+ */
+ function on(type: "notify", callback: Callback): void;
+
+ /**
+ * Unsubscribes NFC RF status change events.
+ *
+ * All callback functions will be deregistered If there is no specific callback parameter.
+ *
+ * @type The callback type.
+ * @param callback The callback function to be unregistered.
+ * @permissions ohos.permission.NFC_TAG
+ *
+ * @since 8
+ */
+ function off(type: "notify", callback?:Callback): void;
+
+ /**
+ * Describes the NFC RF type.
+ *
+ * @since 8
+ */
+ enum NfcRfType {
+ /** NFC RF LEAVE */
+ NFC_RF_LEAVE = 0;
+
+ /** NFC RF ENTER */
+ NFC_RF_ENTER = 1;
+ }
+}
+
+export default connectedTag;
diff --git a/api/ohos.contact.d.ts b/api/@ohos.contact.d.ts
similarity index 100%
rename from api/ohos.contact.d.ts
rename to api/@ohos.contact.d.ts
diff --git a/api/@ohos.curves.d.ts b/api/@ohos.curves.d.ts
index 1ffd9819ad5008827d0a5ed60c7d78f796165608..e3a377d6cea5acb289960fa17e9223cf55a1d2f8 100644
--- a/api/@ohos.curves.d.ts
+++ b/api/@ohos.curves.d.ts
@@ -16,13 +16,12 @@
/**
* Contains interpolator functions such as initialization, third-order Bezier curves, and spring curves.
* @import import Curves from '@ohos.curves'
- * @devices phone, tablet, tv, wearable
+ * @syscap SystemCapability.ArkUI.ArkUI.Full
* @since 7
*/
declare namespace curves {
/**
* enum Curve.
- * @devices phone, tablet, tv, wearable
* @since 7
*/
enum Curve {
@@ -43,28 +42,24 @@ declare namespace curves {
/**
* Initializes the interpolator curve when called.
- * @devices phone, tablet, tv, wearable
* @since 7
*/
function init(curve?: Curve): string;
/**
* Constructs a step curve when called.
- * @devices phone, tablet, tv, wearable
* @since 7
*/
function steps(count: number, end: boolean): string;
/**
* Constructs a third-order Bezier curve when called.
- * @devices phone, tablet, tv, wearable
* @since 7
*/
function cubicBezier(x1: number, y1: number, x2: number, y2: number): string;
/**
* Constructs a spring curve when called.
- * @devices phone, tablet, tv, wearable
* @since 7
*/
function spring(velocity: number, mass: number, stiffness: number, damping: number): string;
diff --git a/api/@ohos.data.preferences.d.ts b/api/@ohos.data.preferences.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..000599ed5d287eb42bd8ea5e9894562ac7905021
--- /dev/null
+++ b/api/@ohos.data.preferences.d.ts
@@ -0,0 +1,199 @@
+/*
+* 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, Callback } from './basic';
+import Context from "./application/Context";
+
+/**
+ * Provides interfaces to obtain and modify preferences data.
+ *
+ * @name preferences
+ * @since 9
+ * @syscap SystemCapability.DistributedDataManager.Preferences.Core
+ *
+ */
+declare namespace preferences {
+ /**
+ * Obtains a {@link Preferences} instance matching a specified preferences file name.
+ *
+ * The {@link references} instance loads all data of the preferences file and
+ * resides in the memory. You can use removePreferencesFromCache to remove the instance from the memory.
+ *
+ * @param context Indicates the context of application or capability.
+ * @param name Indicates the preferences file name.
+ * @return Returns the {@link Preferences} instance matching the specified preferences file name.
+ * @throws BusinessError if invoked failed
+ * @since 9
+ */
+ function getPreferences(context: Context, name: string, callback: AsyncCallback): void;
+ function getPreferences(context: Context, name: string): Promise;
+
+ /**
+ * Deletes a {@link Preferences} instance matching a specified preferences file name
+ * from the cache which is performed by removePreferencesFromCache and deletes the
+ * preferences file.
+ *
+ * When deleting the {@link Preferences} instance, you must release all references
+ * of the instance. In addition, do not use the instance to perform data operations. Otherwise, data inconsistency
+ * will occur.
+ *
+ * @param context Indicates the context of application or capability.
+ * @param name Indicates the preferences file name.
+ * @throws BusinessError if invoked failed
+ * @since 9
+ */
+ function deletePreferences(context: Context, name: string, callback: AsyncCallback): void;
+ function deletePreferences(context: Context, name: string): Promise;
+
+ /**
+ * Deletes a {@link Preferences} instance matching a specified preferences file name
+ * from the cache.
+ *
+ * When deleting the {@link Preferences} instance, you must release all references
+ * of the instance. In addition, do not use the instance to perform data operations. Otherwise, data inconsistency
+ * will occur.
+ *
+ * @param context Indicates the context of application or capability.
+ * @param name Indicates the preferences file name.
+ * @throws BusinessError if invoked failed
+ * @since 9
+ */
+ function removePreferencesFromCache(context: Context, name: string, callback: AsyncCallback): void;
+ function removePreferencesFromCache(context: Context, name: string): Promise;
+
+ /**
+ * Provides interfaces to obtain and modify preferences data.
+ *
+ * The preferences data is stored in a file, which matches only one {@link Preferences} instance in the memory.
+ * You can use getPreferences to obtain the {@link Preferences} instance matching
+ * the file that stores preferences data, and use emovePreferencesFromCache
+ * to remove the {@link Preferences} instance from the memory.
+ *
+ * @syscap SystemCapability.DistributedDataManager.Preferences.Core
+ *
+ * @since 9
+ */
+ interface Preferences {
+ /**
+ * Obtains the value of a preferences in the int format.
+ *
+ *
If the value is {@code null} or not in the int format, the default value is returned.
+ *
+ * @param key Indicates the key of the preferences. It cannot be {@code null} or empty.
+ * @param defValue Indicates the default value to return.
+ * @return Returns the value matching the specified key if it is found; returns the default value otherwise.
+ * @throws BusinessError if invoked failed
+ * @since 9
+ */
+ get(key: string, defValue: ValueType, callback: AsyncCallback): void;
+ get(key: string, defValue: ValueType): Promise;
+
+ /**
+ * Checks whether the {@link Preferences} object contains a preferences matching a specified key.
+ *
+ * @param key Indicates the key of the preferences to check for.
+ * @return Returns {@code true} if the {@link Preferences} object contains a preferences with the specified key;
+ * returns {@code false} otherwise.
+ * @throws BusinessError if invoked failed
+ * @since 9
+ */
+ has(key: string, callback: AsyncCallback): boolean;
+ has(key: string): Promise;
+
+ /**
+ * Sets an int value for the key in the {@link Preferences} object.
+ *
+ * You can call the {@link #flush} method to save the {@link Preferences} object to the
+ * file.
+ *
+ * @param key Indicates the key of the preferences to modify. It cannot be {@code null} or empty.
+ * @param value Indicates the value of the preferences.
+ * MAX_KEY_LENGTH.
+ * @throws BusinessError if invoked failed
+ * @since 9
+ */
+ put(key: string, value: ValueType, callback: AsyncCallback): void;
+ put(key: string, value: ValueType): Promise;
+
+ /**
+ * Deletes the preferences with a specified key from the {@link Preferences} object.
+ *
+ * You can call the {@link #flush} method to save the {@link Preferences} object to the
+ * file.
+ *
+ * @param key Indicates the key of the preferences to delete. It cannot be {@code null} or empty.
+ * MAX_KEY_LENGTH.
+ * @throws BusinessError if invoked failed
+ * @since 9
+ */
+ delete(key: string, callback: AsyncCallback): void;
+ delete(key: string): Promise;
+
+ /**
+ * Clears all preferences from the {@link Preferences} object.
+ *
+ * You can call the {@link #flush} method to save the {@link Preferences} object to the
+ * file.
+ *
+ * @throws BusinessError if invoked failed
+ * @since 9
+ */
+ clear(callback: AsyncCallback): void;
+ clear(): Promise;
+
+ /**
+ * Asynchronously saves the {@link Preferences} object to the file.
+ *
+ * @throws BusinessError if invoked failed
+ * @since 9
+ */
+ flush(callback: AsyncCallback): void;
+ flush(): Promise;
+
+ /**
+ * Registers an observer to listen for the change of a {@link Preferences} object.
+ *
+ * @param callback Indicates the callback when preferences changes.
+ * @throws BusinessError if invoked failed
+ * @since 9
+ */
+ on(type: 'change', callback: Callback<{ key: string }>): void;
+
+ /**
+ * Unregisters an existing observer.
+ *
+ * @param callback Indicates the registered callback.
+ * @throws BusinessError if invoked failed
+ * @since 9
+ */
+ off(type: 'change', callback: Callback<{ key: string }>): void;
+ }
+
+ /**
+ * Indicates possible value types
+ */
+ type ValueType = number | string | boolean;
+
+ /**
+ * Indicates the maximum length of a key (80 characters).
+ */
+ const MAX_KEY_LENGTH: 80;
+
+ /**
+ * Indicates the maximum length of a string (8192 characters).
+ */
+ const MAX_VALUE_LENGTH: 8192;
+}
+
+export default preferences;
diff --git a/api/@ohos.data.rdb.d.ts b/api/@ohos.data.rdb.d.ts
index 4ddeecdf177a887cb10cf35f5aa131096f819ea4..e2317b1d94dc98aa1d913bd02426d9f652662a84 100644
--- a/api/@ohos.data.rdb.d.ts
+++ b/api/@ohos.data.rdb.d.ts
@@ -32,7 +32,7 @@ declare namespace rdb {
* to obtain a rdb store.
*
* @note N/A
- * @since 8
+ * @since 7
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @param context Indicates the context of application or capability.
* @param config Indicates the configuration of the database related to this RDB store. The configurations include
@@ -47,7 +47,7 @@ declare namespace rdb {
* Deletes the database with a specified name.
*
* @note N/A
- * @since 8
+ * @since 7
* @syscap SystemCapability.DistributedDataManager.RelationalStore.Core
* @param context Indicates the context of application or capability.
* @param name Indicates the database name.
@@ -240,7 +240,7 @@ declare namespace rdb {
* @param device Indicates the remote device.
* @param table Indicates the local table name.
* @return the distributed table name.
-
+
*/
obtainDistributedTableName(device: string, table: string, callback: AsyncCallback): void;
obtainDistributedTableName(device: string, table: string): Promise;
@@ -254,7 +254,7 @@ declare namespace rdb {
* @param mode Indicates the synchronization mode. The value can be PUSH, PULL.
* @param predicates Constraint synchronized data and devices.
* @param callback Indicates the callback used to send the synchronization result to the caller.
-
+
*/
sync(mode: SyncMode, predicates: RdbPredicates, callback: AsyncCallback>): void;
sync(mode: SyncMode, predicates: RdbPredicates): Promise>;
diff --git a/api/@ohos.data.storage.d.ts b/api/@ohos.data.storage.d.ts
index 10190d3808fe2cdc1d4ab1e511c6181f537527a5..e0d4107e06d10319817f9d4e264863eb28240f50 100644
--- a/api/@ohos.data.storage.d.ts
+++ b/api/@ohos.data.storage.d.ts
@@ -18,9 +18,10 @@ import { AsyncCallback, Callback } from './basic';
* Provides interfaces to obtain and modify storage data.
*
* @name storage
- * @since 5
+ * @since 6
+ * @deprecated since 9, please use @ohos.data.preferences instead.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
- *
+ *
*/
declare namespace storage {
/**
@@ -32,8 +33,10 @@ declare namespace storage {
* @param path Indicates the path of storage file stored.
* @return Returns the {@link Storage} instance matching the specified storage file name.
* @throws BusinessError if invoked failed
- * @since 5
+ * @since 6
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
+
function getStorageSync(path: string): Storage;
function getStorage(path: string, callback: AsyncCallback): void;
function getStorage(path: string): Promise;
@@ -49,7 +52,8 @@ declare namespace storage {
*
* @param path Indicates the path of storage file
* @throws BusinessError if invoked failed
- * @since 5
+ * @since 6
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
function deleteStorageSync(path: string): void;
function deleteStorage(path: string, callback: AsyncCallback): void;
@@ -65,7 +69,8 @@ declare namespace storage {
*
* @param path Indicates the path of storage file.
* @throws BusinessError if invoked failed
- * @since 5
+ * @since 6
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
function removeStorageFromCacheSync(path: string): void;
function removeStorageFromCache(path: string, callback: AsyncCallback): void;
@@ -80,8 +85,9 @@ declare namespace storage {
* to remove the {@link Storage} instance from the memory.
*
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
- *
- * @since 5
+ *
+ * @since 6
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
interface Storage {
/**
@@ -93,7 +99,8 @@ declare namespace storage {
* @param defValue Indicates the default value to return.
* @return Returns the value matching the specified key if it is found; returns the default value otherwise.
* @throws BusinessError if invoked failed
- * @since 5
+ * @since 6
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
getSync(key: string, defValue: ValueType): ValueType;
get(key: string, defValue: ValueType, callback: AsyncCallback): void;
@@ -106,7 +113,8 @@ declare namespace storage {
* @return Returns {@code true} if the {@link Storage} object contains a storage with the specified key;
* returns {@code false} otherwise.
* @throws BusinessError if invoked failed
- * @since 5
+ * @since 6
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
hasSync(key: string): boolean;
has(key: string, callback: AsyncCallback): boolean;
@@ -122,7 +130,8 @@ declare namespace storage {
* @param value Indicates the value of the storage.
* MAX_KEY_LENGTH.
* @throws BusinessError if invoked failed
- * @since 5
+ * @since 6
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
putSync(key: string, value: ValueType): void;
put(key: string, value: ValueType, callback: AsyncCallback): void;
@@ -137,7 +146,8 @@ declare namespace storage {
* @param key Indicates the key of the storage to delete. It cannot be {@code null} or empty.
* MAX_KEY_LENGTH.
* @throws BusinessError if invoked failed
- * @since 5
+ * @since 6
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
deleteSync(key: string): void;
delete(key: string, callback: AsyncCallback): void;
@@ -150,7 +160,8 @@ declare namespace storage {
* file.
*
* @throws BusinessError if invoked failed
- * @since 5
+ * @since 6
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
clearSync(): void;
clear(callback: AsyncCallback): void;
@@ -160,7 +171,8 @@ declare namespace storage {
* Asynchronously saves the {@link Storage} object to the file.
*
* @throws BusinessError if invoked failed
- * @since 5
+ * @since 6
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
flushSync(): void;
flush(callback: AsyncCallback): void;
@@ -171,7 +183,8 @@ declare namespace storage {
*
* @param callback Indicates the callback when storage changes.
* @throws BusinessError if invoked failed
- * @since 5
+ * @since 6
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
on(type: 'change', callback: Callback): void;
@@ -180,7 +193,8 @@ declare namespace storage {
*
* @param callback Indicates the registered callback.
* @throws BusinessError if invoked failed
- * @since 5
+ * @since 6
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
off(type: 'change', callback: Callback): void;
}
@@ -194,8 +208,9 @@ declare namespace storage {
* Define the change data information object.
*
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
- *
- * @since 5
+ *
+ * @since 6
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
interface StorageObserver {
/**
@@ -215,4 +230,4 @@ declare namespace storage {
const MAX_VALUE_LENGTH: 8192;
}
-export default storage;
\ No newline at end of file
+export default storage;
diff --git a/api/@ohos.deviceInfo.d.ts b/api/@ohos.deviceInfo.d.ts
index 18cca631741489f9a1ba67241cfafc5ef11ecdc4..8e91729a901cf1b776dfa7611728b7a507c71410 100644
--- a/api/@ohos.deviceInfo.d.ts
+++ b/api/@ohos.deviceInfo.d.ts
@@ -17,7 +17,7 @@
* A static class pertaining to the product information.
*
* @since 6
- * @Syscap SystemCapability.Startup.SysInfo
+ * @syscap SystemCapability.Startup.SysInfo
*/
declare namespace deviceInfo {
/**
diff --git a/api/@ohos.display.d.ts b/api/@ohos.display.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..024a10daef116b2e7106cb3ebb8439430354318b
--- /dev/null
+++ b/api/@ohos.display.d.ts
@@ -0,0 +1,171 @@
+/*
+* Copyright (c) 2021 Huawei Device Co., Ltd.
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+import { AsyncCallback, Callback } from './basic';
+
+/**
+ * interface of display manager
+ * @syscap SystemCapability.WindowManager.WindowManager.Core
+ * @since 7
+ */
+declare namespace display {
+ /**
+ * get the default display
+ * @since 7
+ */
+ function getDefaultDisplay(callback: AsyncCallback): void;
+
+ /**
+ * get the default display
+ * @since 7
+ */
+ function getDefaultDisplay(): Promise;
+
+ /**
+ * get all displays
+ * @since 7
+ */
+ function getAllDisplay(callback: AsyncCallback>): void;
+
+ /**
+ * get all displays
+ * @since 7
+ */
+ function getAllDisplay(): Promise>;
+
+ /**
+ * register the callback of display change
+ * @param type: type of callback
+ * @since 7
+ */
+ function on(type: 'add' | 'remove' | 'change', callback: Callback): void;
+
+ /**
+ * unregister the callback of display change
+ * @param type: type of callback
+ * @since 7
+ */
+ function off(type: 'add' | 'remove' | 'change', callback?: Callback): void;
+
+ /**
+ * the state of display
+ * @syscap SystemCapability.WindowManager.WindowManager.Core
+ * @since 7
+ */
+ enum DisplayState {
+ /**
+ * unknown
+ */
+ STATE_UNKNOWN = 0,
+ /**
+ * screen off
+ */
+ STATE_OFF,
+ /**
+ * screen on
+ */
+ STATE_ON,
+ /**
+ * doze, but it will update for some important system messages
+ */
+ STATE_DOZE,
+ /**
+ * doze and not update
+ */
+ STATE_DOZE_SUSPEND,
+ /**
+ * VR node
+ */
+ STATE_VR,
+ /**
+ * screen on and not update
+ */
+ STATE_ON_SUSPEND,
+ }
+
+ /**
+ * Properties of display, it couldn't update automatically
+ * @syscap SystemCapability.WindowManager.WindowManager.Core
+ * @since 7
+ */
+ interface Display {
+ /**
+ * display id
+ */
+ id: number;
+
+ /**
+ * display name
+ */
+ name: string;
+
+ /**
+ * the display is alive
+ */
+ alive: boolean;
+
+ /**
+ * the state of display
+ */
+ state: DisplayState;
+
+ /**
+ * refresh rate, unit: Hz
+ */
+ refreshRate: number;
+
+ /**
+ * the rotation degrees of the display
+ */
+ rotation: number;
+
+ /**
+ * the width of display, unit: pixel
+ */
+ width: number;
+
+ /**
+ * the height of display, unit: pixel
+ */
+ height: number;
+
+ /**
+ * indicates the display resolution.
+ */
+ densityDPI: number;
+
+ /**
+ * indicates the display density in pixels. The value of a low-resolution display is 1.0
+ */
+ densityPixels: number;
+
+ /**
+ * indicates the text scale density of a display.
+ */
+ scaledDensity: number;
+
+ /**
+ * the DPI on X-axis.
+ */
+ xDPI: number;
+
+ /**
+ * the DPI on Y-axis.
+ */
+ yDPI: number;
+ }
+}
+
+export default display;
\ No newline at end of file
diff --git a/api/@ohos.distributedBundle.d.ts b/api/@ohos.distributedBundle.d.ts
index 90aef0113a27acab1b229dbcdb05bfc4fa8bf73a..e9fea81850f660acc8f9a24d55b3d5006c313f54 100644
--- a/api/@ohos.distributedBundle.d.ts
+++ b/api/@ohos.distributedBundle.d.ts
@@ -23,6 +23,7 @@ import { RemoteAbilityInfo } from './bundle/remoteAbilityInfo';
* @since 8
* @syscap SystemCapability.BundleManager.DistributedBundleFramework
* @permission NA
+ * @systemapi Hide this for inner system use
*/
declare namespace distributedBundle {
/**
@@ -32,7 +33,7 @@ import { RemoteAbilityInfo } from './bundle/remoteAbilityInfo';
* @syscap SystemCapability.BundleManager.DistributedBundleFramework
* @param elementName Indicates the elementName.
* @return Returns the ability info of the remote device.
- * @permission ohos.permission.GET_REMOTE_ABILITY_INFO_PRIVILEGED
+ * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @systemapi
*/
function getRemoteAbilityInfo(elementName: ElementName, callback: AsyncCallback): void;
@@ -45,7 +46,7 @@ import { RemoteAbilityInfo } from './bundle/remoteAbilityInfo';
* @syscap SystemCapability.BundleManager.DistributedBundleFramework
* @param elementNames Indicates the elementNames, Maximum array length ten.
* @return Returns the ability infos of the remote device.
- * @permission ohos.permission.GET_REMOTE_ABILITY_INFO_PRIVILEGED
+ * @permission ohos.permission.GET_BUNDLE_INFO_PRIVILEGED
* @systemapi
*/
function getRemoteAbilityInfos(elementNames: Array, callback: AsyncCallback>): void;
diff --git a/api/@ohos.enterpriseDeviceManager.d.ts b/api/@ohos.enterpriseDeviceManager.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..a4b105912f65c11786d1b09e798d8038c148fe2e
--- /dev/null
+++ b/api/@ohos.enterpriseDeviceManager.d.ts
@@ -0,0 +1,154 @@
+/*
+ * 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, Callback } from "./basic";
+import { DeviceSettingsManager } from "./enterpriseDeviceManager/DeviceSettingsManager";
+import { Want } from "./ability/want";
+
+/**
+ * enterprise device manager.
+ * @name enterpriseDeviceManager
+ * @since 9
+ * @syscap SystemCapability.Customization.EnterpriseDeviceManager
+ */
+declare namespace enterpriseDeviceManager {
+
+ /**
+ * @name EnterpriseInfo
+ * @since 9
+ * @syscap SystemCapability.Customization.EnterpriseDeviceManager
+ * @import NA
+ * @permission NA
+ */
+ export interface EnterpriseInfo {
+ name: string;
+ description: string;
+ }
+
+ /**
+ * @name AdminType
+ * @since 9
+ * @syscap SystemCapability.Customization.EnterpriseDeviceManager
+ * @import NA
+ * @permission NA
+ */
+ export enum AdminType {
+ ADMIN_TYPE_NORMAL = 0x00,
+ ADMIN_TYPE_SUPER = 0x01
+ }
+
+ /**
+ * Activates the given ability as a administrator of the device.
+ *
+ * Only apps with the ohos.permission.MANAGE_ADMIN permission or the shell uid can call this method.
+ *
+ * @since 9
+ * @syscap SystemCapability.Customization.EnterpriseDeviceManager
+ * @param admin Indicates the administrator ability information.
+ * @param enterpriseInfo Indicates the enterprise information of the calling application.
+ * @param type Indicates the type of administrator to set.
+ * @return {@code true} if activates administrator success.
+ * @permission ohos.permission.MANAGE_ADMIN
+ */
+ function activateAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType, callback: AsyncCallback): void;
+ function activateAdmin(admin: Want, enterpriseInfo: EnterpriseInfo, type: AdminType): Promise;
+
+ /**
+ * Deactivates a current normal administrator ability.
+ *
+ * Only apps with the ohos.permission.MANAGE_ADMIN permission or the shell uid can call this method.
+ *
+ * @since 9
+ * @syscap SystemCapability.Customization.EnterpriseDeviceManager
+ * @param admin Indicates the administrator ability information.
+ * @return {@code true} if deactivates administrator success.
+ * @permission ohos.permission.MANAGE_ADMIN
+ */
+ function deactivateAdmin(admin: Want, callback: AsyncCallback): void;
+ function deactivateAdmin(admin: Want): Promise