diff --git a/api/@internal/component/ets/common.d.ts b/api/@internal/component/ets/common.d.ts
index c1157b0610b95cede09f2505b92b2a4131526ce8..a71d0c906707e05dbf31f16e3bc10dc48b5f9f61 100644
--- a/api/@internal/component/ets/common.d.ts
+++ b/api/@internal/component/ets/common.d.ts
@@ -274,12 +274,6 @@ interface DragItemInfo {
extraInfo?: string;
}
-/**
- * Defining syscap function.
- * @since 8
- */
-declare function canIUse(syscap: string): boolean;
-
/**
* Defining animation function.
* @since 7
diff --git a/api/@internal/component/ets/form_component.d.ts b/api/@internal/component/ets/form_component.d.ts
index 1d3fa7dfdd56e0ff2605ab27801d6f5ecee3ff10..d2a7037831dc6c041dfd56b1bd519d018af33ffd 100644
--- a/api/@internal/component/ets/form_component.d.ts
+++ b/api/@internal/component/ets/form_component.d.ts
@@ -132,6 +132,13 @@ declare class FormComponentAttribute extends CommonMethod void): FormComponentAttribute;
+
+ /**
+ * Uninstall Card.
+ * @since 7
+ * @systemapi
+ */
+ onUninstall(callback: (info: { id: number }) => void): FormComponentAttribute;
}
declare const FormComponent: FormComponentInterface;
diff --git a/api/@internal/component/ets/web.d.ts b/api/@internal/component/ets/web.d.ts
index d75f2cda115898468769eac0c424b60756403343..41529e68d5c6182925c13d7df2ebfb88ecd9885c 100755
--- a/api/@internal/component/ets/web.d.ts
+++ b/api/@internal/component/ets/web.d.ts
@@ -468,7 +468,7 @@ declare class WebAttribute extends CommonMethod {
* Inject the arkUI JS object into H5 and invoke the function of the object in H5.
* @since 8
*/
- javaScriptProxy(javaScriptProxy: { obj: object, name: string, methodList: Array }): WebAttribute;
+ javaScriptProxy(javaScriptProxy: { obj: object, name: string, methodList: Array, controller: WebController }): WebAttribute;
/*
* Sets whether the Web should save the password.
diff --git a/api/@internal/component/ets/xcomponent.d.ts b/api/@internal/component/ets/xcomponent.d.ts
index 9cbc7cb1cd9c0f6264ff0072422e178da1e6d947..ef19b96d114155e22d49c5761d45f15a4d750540 100644
--- a/api/@internal/component/ets/xcomponent.d.ts
+++ b/api/@internal/component/ets/xcomponent.d.ts
@@ -32,6 +32,13 @@ declare class XComponentController {
* @systemapi
*/
getXComponentSurfaceId();
+
+ /**
+ * get the context of native XComponent.
+ * @since 8
+ * @systemapi
+ */
+ getXComponentContext();
}
/**
diff --git a/api/@internal/ets/lifecycle.d.ts b/api/@internal/ets/lifecycle.d.ts
index e93c7b285fe44b2b8e654613baf2e5b8786cfe96..18cff8475eb22d59cca76a92c7ce6d10701ef7d7 100644
--- a/api/@internal/ets/lifecycle.d.ts
+++ b/api/@internal/ets/lifecycle.d.ts
@@ -31,7 +31,6 @@ import { PacMap } from "../ability/dataAbilityHelper";
*
* @name LifecycleForm
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @FAModelOnly
*/
export declare interface LifecycleForm {
@@ -39,7 +38,6 @@ export declare interface LifecycleForm {
* Called to return a {@link formBindingData.FormBindingData} object.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param want Indicates the detailed information for creating a {@link formBindingData#FormBindingData}.
* The {@code Want} object must include the form ID, form name, and grid style of the form,
* which can be obtained from {@link formManager#FormParam#IDENTITY_KEY},
@@ -55,7 +53,6 @@ export declare interface LifecycleForm {
* Called when the form provider is notified that a temporary form is successfully converted to a normal form.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param formId Indicates the ID of the form.
* @return -
* @FAModelOnly
@@ -66,7 +63,6 @@ export declare interface LifecycleForm {
* Called to notify the form provider to update a specified form.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param formId Indicates the ID of the form to update.
* @return -
* @FAModelOnly
@@ -77,7 +73,6 @@ export declare interface LifecycleForm {
* Called when the form provider receives form events from the system.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param newStatus Indicates the form events occurred. The key in the {@code Map} object indicates the form ID,
* and the value indicates the event type, which can be either {@link formManager#VisibilityType#FORM_VISIBLE}
* or {@link formManager#VisibilityType#FORM_INVISIBLE}. {@link formManager#VisibilityType#FORM_VISIBLE}
@@ -93,7 +88,6 @@ export declare interface LifecycleForm {
* JS forms.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param formId Indicates the ID of the form on which the message event is triggered, which is provided by
* the client to the form provider.
* @param message Indicates the value of the {@code params} field of the message event. This parameter is
@@ -108,7 +102,6 @@ export declare interface LifecycleForm {
* you want your application, as the form provider, to be notified of form deletion.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param formId Indicates the ID of the deleted form.
* @return -
* @FAModelOnly
@@ -122,7 +115,6 @@ export declare interface LifecycleForm {
* this method returns {@link FormState#DEFAULT} by default.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param want Indicates the description of the form for which the {@link formManager#FormState} is obtained.
* The description covers the bundle name, ability name, module name, form name, and form dimensions.
* @return Returns the {@link formManager#FormState} object.
@@ -136,7 +128,6 @@ export declare interface LifecycleForm {
*
* @name LifecycleApp
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAMode
* @FAModelOnly
*/
export declare interface LifecycleApp {
@@ -144,7 +135,6 @@ export declare interface LifecycleApp {
* Called back when the state of an ability changes from BACKGROUND to INACTIVE.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @return -
* @FAModelOnly
*/
@@ -154,7 +144,6 @@ export declare interface LifecycleApp {
* Called back when an ability enters the BACKGROUND state.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @return -
* @FAModelOnly
*/
@@ -164,7 +153,6 @@ export declare interface LifecycleApp {
* Called back before an ability is destroyed.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @return -
* @FAModelOnly
*/
@@ -174,7 +162,6 @@ export declare interface LifecycleApp {
* Called back when an ability is started for initialization.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @return -
* @FAModelOnly
*/
@@ -185,7 +172,6 @@ export declare interface LifecycleApp {
* to multi-window mode or from multi-window mode to fullscreen mode.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param isShownInMultiWindow Specifies whether this ability is currently in multi-window mode.
* The value {@code true} indicates the multi-window mode, and {@code false} indicates another mode.
* @param newConfig Indicates the new configuration information about this Page ability.
@@ -199,7 +185,6 @@ export declare interface LifecycleApp {
* Asks a user whether to start the migration.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @return Returns {@code true} if the user allows the migration; returns {@code false} otherwise.
* @FAModelOnly
*/
@@ -211,7 +196,6 @@ export declare interface LifecycleApp {
* Scheduler Service requests data from the local ability.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param data Indicates the user data to save.
* @return Returns {@code true} if the data is successfully saved; returns {@code false} otherwise.
* @FAModelOnly
@@ -225,7 +209,6 @@ export declare interface LifecycleApp {
* notify the user of the successful migration and then exit the local ability.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param result Indicates the migration result code. The value {@code 0} indicates that the migration is
* successful, and {@code -1} indicates that the migration fails.
* @return -
@@ -239,7 +222,6 @@ export declare interface LifecycleApp {
* is restored.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param data Indicates the user data to restore.
* @return -
* @FAModelOnly
@@ -251,7 +233,6 @@ export declare interface LifecycleApp {
* migration is performed for the ability from the local device to the remote device.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @return -
* @FAModelOnly
*/
@@ -263,7 +244,6 @@ export declare interface LifecycleApp {
* this method is used only to save temporary states.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param outState Indicates the {@code PacMap} object used for storing user data and states. This
* parameter cannot be null.
* @return -
@@ -277,7 +257,6 @@ export declare interface LifecycleApp {
* states. Generally, this method is called after the {@link #onStart(Want)} method.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param inState Indicates the {@code PacMap} object used for storing data and states. This
* parameter can not be null.
* @return -
@@ -290,7 +269,6 @@ export declare interface LifecycleApp {
* change to the BACKGROUND or ACTIVE state).
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @return -
* @FAModelOnly
*/
@@ -300,7 +278,6 @@ export declare interface LifecycleApp {
* Called back when an ability enters the ACTIVE state.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @return -
* @FAModelOnly
*/
@@ -310,7 +287,6 @@ export declare interface LifecycleApp {
* Called when the launch mode of an ability is set to singleton.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param want Indicates the new {@code want} containing information about the ability.
* @return -
* @FAModelOnly
@@ -322,7 +298,6 @@ export declare interface LifecycleApp {
* background and there is no enough memory for running as many background processes as possible.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param level Indicates the memory trim level, which shows the current memory usage status.
* @return -
* @FAModelOnly
@@ -335,7 +310,6 @@ export declare interface LifecycleApp {
*
* @name LifecycleService
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAMode
* @FAModelOnly
*/
export declare interface LifecycleService {
@@ -344,7 +318,6 @@ export declare interface LifecycleService {
* an ability).
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @return -
* @FAModelOnly
*/
@@ -354,7 +327,6 @@ export declare interface LifecycleService {
* Called back when Service is started.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param want Indicates the want of Service to start.
* @param startId Indicates the number of times the Service ability has been started. The {@code startId} is
* incremented by 1 every time the ability is started. For example, if the ability has been started
@@ -368,7 +340,6 @@ export declare interface LifecycleService {
* Called back before an ability is destroyed.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @return -
* @FAModelOnly
*/
@@ -378,7 +349,6 @@ export declare interface LifecycleService {
* Called back when a Service ability is first connected to an ability.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param want Indicates connection information about the Service ability.
* @return Returns the proxy of the Service ability.
* @FAModelOnly
@@ -389,7 +359,6 @@ export declare interface LifecycleService {
* Called back when all abilities connected to a Service ability are disconnected.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param want Indicates disconnection information about the Service ability.
* @return -
* @FAModelOnly
@@ -404,7 +373,6 @@ export declare interface LifecycleService {
* called but {@link #terminateSelf} has not.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param want Indicates the want of the Service ability being connected.
* @return -
* @FAModelOnly
@@ -417,7 +385,6 @@ export declare interface LifecycleService {
*
* @name LifecycleData
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAMode
* @FAModelOnly
*/
export declare interface LifecycleData {
@@ -425,7 +392,6 @@ export declare interface LifecycleData {
* Updates one or more data records in the database. This method should be implemented by a Data ability.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the database table storing the data to update.
* @param valueBucket Indicates the data to update. This parameter can be null.
* @param predicates Indicates filter criteria. If this parameter is null, all data records will be updated by
@@ -441,7 +407,6 @@ export declare interface LifecycleData {
* Queries one or more data records in the database. This method should be implemented by a Data ability.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the database table storing the data to query.
* @param columns Indicates the columns to be queried, in array, for example, {"name","age"}. You should define
* the processing logic when this parameter is null.
@@ -458,7 +423,6 @@ export declare interface LifecycleData {
* Deletes one or more data records. This method should be implemented by a Data ability.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the database table storing the data to delete.
* @param predicates Indicates filter criteria. If this parameter is null, all data records will be deleted by
* default.
@@ -475,7 +439,6 @@ export declare interface LifecycleData {
* even if the context has changed.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the uri to normalize.
* @param callback function specified by framework to receive the result, developer should call this function to
* return the result to framework.
@@ -488,7 +451,6 @@ export declare interface LifecycleData {
* Inserts multiple data records into the database. This method should be implemented by a Data ability.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the position where the data is to insert.
* @param valueBuckets Indicates the data to insert.
* @param callback function specified by framework to receive the result, developer should call this function to
@@ -503,7 +465,6 @@ export declare interface LifecycleData {
* The default implementation of this method returns the original uri passed to it.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the uri to denormalize.
* @param callback function specified by framework to receive the result, developer should call this function to
* return the result to framework.
@@ -516,7 +477,6 @@ export declare interface LifecycleData {
* Inserts a data record into the database. This method should be implemented by a Data ability.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the position where the data is to insert.
* @param valueBucket Indicates the data to insert.
* @param callback function specified by framework to receive the result, developer should call this function to
@@ -530,7 +490,6 @@ export declare interface LifecycleData {
* Opens a file. This method should be implemented by a Data ability.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the path of the file to open.
* @param mode Indicates the open mode, which can be "r" for read-only access, "w" for write-only access (erasing
* whatever data is currently in the file), "wt" for write access that truncates any existing file,
@@ -547,7 +506,6 @@ export declare interface LifecycleData {
* Obtains the MIME type of files. This method should be implemented by a Data ability.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the path of the files to obtain.
* @param mimeTypeFilter Indicates the MIME type of the files to obtain. This parameter cannot be set to {@code
* null}.
@@ -565,7 +523,6 @@ export declare interface LifecycleData {
* Called to carry {@code AbilityInfo} to this ability after the ability is initialized.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param info Indicates the {@code AbilityInfo} object containing information about this ability.
* @return -
* @FAModelOnly
@@ -579,7 +536,6 @@ export declare interface LifecycleData {
*
Data abilities supports general data types, including text, HTML, and JPEG.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the uri of the data.
* @param callback function specified by framework to receive the result, developer should call this function to
* return the result to framework.
diff --git a/api/@ohos.ability.dataUriUtils.d.ts b/api/@ohos.ability.dataUriUtils.d.ts
index 3b978c07dd07085802a6f2f46ad3ebc2f4ba35c6..af7b6805001a1b4a9e70bf5b40afc7b81447ba2e 100644
--- a/api/@ohos.ability.dataUriUtils.d.ts
+++ b/api/@ohos.ability.dataUriUtils.d.ts
@@ -25,7 +25,7 @@ declare namespace dataUriUtils {
* Obtains the ID attached to the end of the path component of the given uri.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @param uri Indicates the uri object from which the ID is to be obtained.
* @return Returns the ID attached to the end of the path component;
*/
@@ -35,7 +35,7 @@ declare namespace dataUriUtils {
* Attaches the given ID to the end of the path component of the given uri.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @param uri Indicates the uri string from which the ID is to be obtained.
* @param id Indicates the ID to attach.
* @return Returns the uri object with the given ID attached.
@@ -46,7 +46,7 @@ declare namespace dataUriUtils {
* Deletes the ID from the end of the path component of the given uri.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @param uri Indicates the uri object from which the ID is to be deleted.
* @return Returns the uri object with the ID deleted.
*/
@@ -56,7 +56,7 @@ declare namespace dataUriUtils {
* Updates the ID in the specified uri
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @param uri Indicates the uri object to be updated.
* @param id Indicates the new ID.
* @return Returns the updated uri object.
diff --git a/api/@ohos.ability.errorCode.d.ts b/api/@ohos.ability.errorCode.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..155f039766c9f43e869df44ef695970b524b57f8
--- /dev/null
+++ b/api/@ohos.ability.errorCode.d.ts
@@ -0,0 +1,49 @@
+/*
+ * 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.
+ */
+
+ /**
+ * Defines error codes used when starting an ability, for example, featureAbility.ErrorCode.NO_ERROR.
+ * @since 6
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ */
+export enum ErrorCode {
+ /**
+ * Permission denied.
+ * @since 6
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ */
+ PERMISSION_DENY = -3,
+
+ /**
+ * Ability not found.
+ * @since 6
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ */
+ ABILITY_NOT_FOUND = -2,
+
+ /**
+ * Invalid parameter.
+ * @since 6
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ */
+ INVALID_PARAMETER = -1,
+
+ /**
+ * No error.
+ * @since 6
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
+ */
+ NO_ERROR = 0
+}
diff --git a/api/@ohos.ability.featureAbility.d.ts b/api/@ohos.ability.featureAbility.d.ts
index 20b110239b55fe400e17329733f831436d8af0b6..44de8063d5cf4f8e46915229fe97dc5d0a0119a9 100644
--- a/api/@ohos.ability.featureAbility.d.ts
+++ b/api/@ohos.ability.featureAbility.d.ts
@@ -13,6 +13,7 @@
* limitations under the License.
*/
import { AsyncCallback } from './basic';
+import { Callback } from './basic';
import { Want } from './ability/want';
import { StartAbilityParameter } from './ability/startAbilityParameter';
import { AbilityResult } from './ability/abilityResult';
@@ -25,7 +26,7 @@ import { ContinueAbilityOptions } from './ability/continueAbilityOptions';
* A Feature Ability represents an ability with a UI and is designed to interact with users.
* @name featureAbility
* @since 6
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @permission N/A
* @FAModelOnly
*/
@@ -34,7 +35,7 @@ declare namespace featureAbility {
* Obtain the want sended from the source ability.
*
* @since 6
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param parameter Indicates the ability to start.
* @return -
* @FAModelOnly
@@ -46,7 +47,7 @@ declare namespace featureAbility {
* Starts a new ability.
*
* @since 6
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param parameter Indicates the ability to start.
* @return -
* @FAModelOnly
@@ -57,7 +58,7 @@ declare namespace featureAbility {
/**
* Obtains the application context.
*
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @return Returns the application context.
* @since 6
* @FAModelOnly
@@ -68,7 +69,7 @@ declare namespace featureAbility {
* Starts an ability and returns the execution result when the ability is destroyed.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param parameter Indicates the ability to start.
* @return Returns the {@link AbilityResult}.
* @FAModelOnly
@@ -81,7 +82,7 @@ declare namespace featureAbility {
* and destroys this Page ability.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param parameter Indicates the result to return.
* @return -
* @FAModelOnly
@@ -93,7 +94,7 @@ declare namespace featureAbility {
* Destroys this Page ability.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @return -
* @FAModelOnly
*/
@@ -104,7 +105,7 @@ declare namespace featureAbility {
* Obtains the dataAbilityHelper.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the path of the file to open.
* @return Returns the dataAbilityHelper.
* @FAModelOnly
@@ -115,7 +116,7 @@ declare namespace featureAbility {
* Checks whether the main window of this ability has window focus.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @return Returns {@code true} if this ability currently has window focus; returns {@code false} otherwise.
* @FAModelOnly
*/
@@ -126,7 +127,7 @@ declare namespace featureAbility {
* Connects the current ability to an ability using the AbilityInfo.AbilityType.SERVICE template.
* @default -
* @since 7
- * @SysCap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param request The element name of the service ability
* @param options The remote object instance
* @return Returns the number code of the ability connected
@@ -138,7 +139,7 @@ declare namespace featureAbility {
* The callback interface was connect successfully.
* @default -
* @since 7
- * @SysCap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param connection The number code of the ability connected
* @FAModelOnly
*/
@@ -149,7 +150,7 @@ declare namespace featureAbility {
* Migrates this ability to the given device on the same distributed network.
* @default -
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @return -
* @FAModelOnly
*/
diff --git a/api/@ohos.ability.particleAbility.d.ts b/api/@ohos.ability.particleAbility.d.ts
index fc367272ac775fa8a3e00bb24b67072e7b85b86e..f6d62b65b404768e3f2f1a8016f46eed5207da95 100644
--- a/api/@ohos.ability.particleAbility.d.ts
+++ b/api/@ohos.ability.particleAbility.d.ts
@@ -17,12 +17,14 @@ import { AsyncCallback } from './basic';
import { StartAbilityParameter } from './ability/startAbilityParameter';
import { DataAbilityHelper } from './ability/dataAbilityHelper';
import { NotificationRequest } from './notification/notificationRequest';
+import { ConnectOptions } from './ability/connectOptions';
+import { Want } from './ability/want';
/**
* A Particle Ability represents an ability with service.
* @name particleAbility
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @permission N/A
* @FAModelOnly
*/
@@ -31,7 +33,7 @@ declare namespace particleAbility {
* Service ability uses this method to start a specific ability.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param parameter Indicates the ability to start.
* @return -
* @FAModelOnly
@@ -43,7 +45,7 @@ declare namespace particleAbility {
* Destroys this service ability.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @return -
* @FAModelOnly
*/
@@ -54,7 +56,7 @@ declare namespace particleAbility {
* Obtains the dataAbilityHelper.
*
* @since 7
- * @sysCap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
* @param uri Indicates the path of the file to open.
* @return Returns the dataAbilityHelper.
* @FAModelOnly
@@ -85,5 +87,27 @@ declare namespace particleAbility {
*/
function cancelBackgroundRunning(callback: AsyncCallback): void;
function cancelBackgroundRunning(): Promise;
+
+ /**
+ * Connects an ability to a Service ability.
+ *
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @param request Indicates the Service ability to connect.
+ * @param options Callback object for the client. If this parameter is null, an exception is thrown.
+ * @return unique identifier of the connection between the client and the service side.
+ * @FAModelOnly
+ */
+ function connectAbility(request: Want, options:ConnectOptions ): number;
+
+ /**
+ * Disconnects ability to a Service ability.
+ * @since 7
+ * @syscap SystemCapability.Ability.AbilityRuntime.FAModel
+ * @param connection the connection id returned from connectAbility api.
+ * @FAModelOnly
+ */
+ function disconnectAbility(connection: number, callback:AsyncCallback): void;
+ function disconnectAbility(connection: number): Promise;
}
export default particleAbility;
diff --git a/api/@ohos.ability.wantConstant.d.ts b/api/@ohos.ability.wantConstant.d.ts
index a0483c0095fcfbf5e8e4f9234deda55e593836a7..bc93801babdb77b434a5bfd2581da94a11819bc7 100644
--- a/api/@ohos.ability.wantConstant.d.ts
+++ b/api/@ohos.ability.wantConstant.d.ts
@@ -17,7 +17,7 @@
* the constant for action and entity in the want
* @name wantConstant
* @since 6
- * @sysCap SystemCapability.Ability.AbilityBase
+ * @syscap SystemCapability.Ability.AbilityBase
* @permission N/A
*/
declare namespace wantConstant {
@@ -25,7 +25,7 @@ declare namespace wantConstant {
* the constant for action of the want
* @name Action
* @since 6
- * @sysCap SystemCapability.Ability.AbilityBase
+ * @syscap SystemCapability.Ability.AbilityBase
* @permission N/A
*/
export enum Action {
@@ -221,7 +221,7 @@ declare namespace wantConstant {
* the constant for Entity of the want
* @name Action
* @since 6
- * @sysCap SystemCapability.Ability.AbilityBase
+ * @syscap SystemCapability.Ability.AbilityBase
* @permission N/A
*/
export enum Entity {
diff --git a/api/@ohos.app.abilityManager.d.ts b/api/@ohos.app.abilityManager.d.ts
index 9b430de3ca7765df86929782bae19ee36ffc4cc4..8dc9575ac0d1f3db48c585962bd08d3c12f7fabd 100644
--- a/api/@ohos.app.abilityManager.d.ts
+++ b/api/@ohos.app.abilityManager.d.ts
@@ -22,7 +22,7 @@ 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
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @import import abilityManager from '@ohos.app.abilityManager'
* @permission N/A
*/
@@ -38,7 +38,7 @@ declare namespace abilityManager {
/**
* Get information about running processes
* @since 7
- * @SysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @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
@@ -49,7 +49,7 @@ declare namespace abilityManager {
/**
* Get information about the running ability missions
* @since 7
- * @SysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @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
@@ -61,7 +61,7 @@ declare namespace abilityManager {
/**
* Get information about recently run missions
* @since 7
- * @SysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @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
@@ -73,13 +73,31 @@ declare namespace abilityManager {
/**
* Delete the specified missions
* @since 7
- * @SysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @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;
+
+ /**
+ * 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 abilityManager;
diff --git a/api/@ohos.application.Ability.d.ts b/api/@ohos.application.Ability.d.ts
index 38a08deac1f37bee7e06977a44ea7dae7242a401..e41e7e0cdf0603469f6bb4c7a85190f9fd72f1e7 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,7 @@ 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
* @return -
* @StageModelOnly
*/
@@ -159,7 +196,7 @@ 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
* @return -
* @StageModelOnly
*/
@@ -169,7 +206,7 @@ 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
*/
@@ -190,7 +227,7 @@ export default class Ability {
* Called back before an ability is destroyed.
*
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @return -
* @StageModelOnly
*/
@@ -200,7 +237,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
*/
@@ -210,7 +247,7 @@ 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
*/
@@ -220,7 +257,7 @@ export default class Ability {
* Called back when an ability prepares to migrate.
*
* @since 9
- * @sysCap SystemCapability.Ability.AbilityRuntime.AbilityCore
+ * @syscap SystemCapability.Ability.AbilityRuntime.AbilityCore
* @return true if ability agrees to migrate and saves data successfully, otherwise false.
* @StageModelOnly
*/
@@ -230,9 +267,8 @@ export default class Ability {
* 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
* @return -
* @StageModelOnly
*/
@@ -241,9 +277,8 @@ 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
* @return -
* @StageModelOnly
*/
diff --git a/api/@ohos.application.AbilityConstant.d.ts b/api/@ohos.application.AbilityConstant.d.ts
index d2691c2e98cdb1048738e380ceffe927876e5dfb..e43db61c8a1c4d1ab277e8b228cae536fcb11eb4 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 {
diff --git a/api/@ohos.application.AbilityStage.d.ts b/api/@ohos.application.AbilityStage.d.ts
index 7d1762c145c62798083d80e1da61e1aae9809520..5ef07960128a6e898a806952a1257a1c5a67476c 100644
--- a/api/@ohos.application.AbilityStage.d.ts
+++ b/api/@ohos.application.AbilityStage.d.ts
@@ -48,7 +48,6 @@ export default class AbilityStage {
/**
* Called back when start specified ability.
*
- * @devices phone, tablet, tv, wearable, car
* @since 9
* @syscap SystemCapability.Ability.AbilityRuntime.Core
* @return -
diff --git a/api/@ohos.application.ServiceExtAbility.d.ts b/api/@ohos.application.ServiceExtensionAbility.d.ts
similarity index 80%
rename from api/@ohos.application.ServiceExtAbility.d.ts
rename to api/@ohos.application.ServiceExtensionAbility.d.ts
index 57a549082fc195e6c9f0ce9c98d039428b4dfdab..a2567c8945fd3c1cf1cbe3e01885d8a581ff8169 100644
--- a/api/@ohos.application.ServiceExtAbility.d.ts
+++ b/api/@ohos.application.ServiceExtensionAbility.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
@@ -14,35 +14,33 @@
*/
import rpc from "./@ohos.rpc";
-import ServiceExtAbilityContext from "./application/ServiceExtAbilityContext";
+import ServiceExtensionContext from "./application/ServiceExtensionContext";
import Want from './@ohos.application.Want';
/**
* class of service extension ability.
*
* @since 9
- * @sysCap AAFwk
- * @devices phone, tablet, tv, wearable, car
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi hide for inner use.
* @StageModelOnly
*/
-export default class ServiceExtAbility {
+export default class ServiceExtensionAbility {
/**
* Indicates service extension ability context.
*
* @since 9
- * @sysCap AAFwk
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi hide for inner use.
* @StageModelOnly
*/
- context: ServiceExtAbilityContext;
+ context: ServiceExtensionContext;
/**
* Called back when a service extension is started for initialization.
*
- * @devices phone, tablet, tv, wearable, car
* @since 9
- * @sysCap AAFwk
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi hide for inner use.
* @return -
* @StageModelOnly
@@ -52,9 +50,8 @@ export default class ServiceExtAbility {
/**
* Called back before a service extension is destroyed.
*
- * @devices phone, tablet, tv, wearable, car
* @since 9
- * @sysCap AAFwk
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @systemapi hide for inner use.
* @return -
* @StageModelOnly
@@ -64,9 +61,8 @@ export default class ServiceExtAbility {
/**
* Called back when a service extension is started.
*
- * @devices phone, tablet, tv, wearable, car
* @since 9
- * @sysCap AAFwk
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @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
@@ -80,9 +76,8 @@ export default class ServiceExtAbility {
/**
* Called back when a service extension is first connected to an ability.
*
- * @devices phone, tablet, tv, wearable, car
* @since 9
- * @sysCap AAFwk
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @param want Indicates connection information about the Service ability.
* @systemapi hide for inner use.
* @return Returns the proxy of the Service ability.
@@ -93,9 +88,8 @@ export default class ServiceExtAbility {
/**
* Called back when all abilities connected to a service extension are disconnected.
*
- * @devices phone, tablet, tv, wearable, car
* @since 9
- * @sysCap AAFwk
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @param want Indicates disconnection information about the service extension.
* @systemapi hide for inner use.
* @return -
@@ -107,9 +101,8 @@ export default class ServiceExtAbility {
* 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
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @param want Indicates the want of the service extension being connected.
* @systemapi hide for inner use.
* @return -
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/@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.abilityManager.d.ts b/api/@ohos.application.abilityManager.d.ts
index ff2426a5e7bc9e4598d977d2e6bd62e604fb6fba..44885db2034653afb1593c100b4825c07143f77d 100644
--- a/api/@ohos.application.abilityManager.d.ts
+++ b/api/@ohos.application.abilityManager.d.ts
@@ -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,7 +45,7 @@ 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 -
@@ -57,18 +57,18 @@ 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 -
*/
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 -
diff --git a/api/@ohos.application.appManager.d.ts b/api/@ohos.application.appManager.d.ts
index dcb6dca86ab862ac726dd65add9cc4c67820639f..b6956e4857de6ec96b5f056e537ec1f864494dc3 100644
--- a/api/@ohos.application.appManager.d.ts
+++ b/api/@ohos.application.appManager.d.ts
@@ -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,7 +32,7 @@ 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.
@@ -43,7 +43,7 @@ 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 -
@@ -55,7 +55,7 @@ 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.
*/
@@ -66,7 +66,7 @@ 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
@@ -79,7 +79,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,7 +89,7 @@ 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 -
*/
@@ -99,8 +99,7 @@ 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
@@ -111,8 +110,7 @@ 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
diff --git a/api/@ohos.application.formBindingData.d.ts b/api/@ohos.application.formBindingData.d.ts
index ad398765917917ecc7774d2e0ff1cda7225c41e0..6ede7819dcc74a2d77f89944e7461ea3339409e5 100644
--- a/api/@ohos.application.formBindingData.d.ts
+++ b/api/@ohos.application.formBindingData.d.ts
@@ -18,14 +18,14 @@
*
* @name formBindingData
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
*/
declare namespace formBindingData {
/**
* Create an FormBindingData instance.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Core
+ * @syscap SystemCapability.Ability.AbilityRuntime.Core
* @param obj Indicates the FormBindingData instance data.
* @return Returns the {@link FormBindingData} instance.
*/
diff --git a/api/@ohos.application.missionManager.d.ts b/api/@ohos.application.missionManager.d.ts
index 94f172f8e5fc096eaf834b759b95bc4de2195a7c..cc0a560a1a05962d41412e0385ad263afe0783e9 100644
--- a/api/@ohos.application.missionManager.d.ts
+++ b/api/@ohos.application.missionManager.d.ts
@@ -24,7 +24,7 @@ import StartOptions from "./@ohos.application.StartOptions";
*
* @name missionManager
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Mission
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
* @permission N/A
* @systemapi hide for inner use.
*/
@@ -33,7 +33,7 @@ declare namespace missionManager {
* Register the missionListener to ams.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Mission
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
* @return The index number of the MissionListener.
*/
function registerMissionListener(listener: MissionListener): number;
@@ -42,7 +42,7 @@ declare namespace missionManager {
* Unrgister the missionListener to ams.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Mission
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
* @return -
*/
function unregisterMissionListener(listenerId: number, callback: AsyncCallback): void;
@@ -52,7 +52,7 @@ declare namespace missionManager {
* Get the missionInfo with the given missionId.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Mission
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
* @return the {@link MissionInfo} of the given id.
*/
function getMissionInfo(deviceId: string, missionId: number, callback: AsyncCallback): void;
@@ -62,7 +62,7 @@ declare namespace missionManager {
* Get the missionInfo with the given missionId.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Mission
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
* @return The array of the {@link MissionInfo}.
*/
function getMissionInfos(deviceId: string, numMax: number, callback: AsyncCallback>): void;
@@ -72,7 +72,7 @@ declare namespace missionManager {
* Get the mission snapshot with the given missionId.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Mission
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
* @return The {@link MissionSnapshot} of the given id.
*/
function getMissionSnapShot(deviceId: string, missionId: number, callback: AsyncCallback): void;
@@ -82,7 +82,7 @@ declare namespace missionManager {
* Lock the mission.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Mission
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
* @return -
*/
function lockMission(missionId: number, callback: AsyncCallback): void;
@@ -92,7 +92,7 @@ declare namespace missionManager {
* Unlock the mission.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Mission
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
* @return -
*/
function unlockMission(missionId: number, callback: AsyncCallback): void;
@@ -102,7 +102,7 @@ declare namespace missionManager {
* Clear the given mission in the ability manager service.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Mission
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
* @return -
*/
function clearMission(missionId: number, callback: AsyncCallback): void;
@@ -112,7 +112,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 +122,7 @@ declare namespace missionManager {
* Schedule the given mission to foreground.
*
* @since 8
- * @sysCap SystemCapability.Ability.AbilityRuntime.Mission
+ * @syscap SystemCapability.Ability.AbilityRuntime.Mission
* @return -
*/
function moveMissionToFront(missionId: number, callback: AsyncCallback): void;
diff --git a/api/@ohos.application.uriPermissionManager.d.ts b/api/@ohos.application.uriPermissionManager.d.ts
index ad3ad1de005f9e659a7abcc8fede62a2b9e1763d..37cd85441c8e8f9653759a09967c58e6a360c5be 100644
--- a/api/@ohos.application.uriPermissionManager.d.ts
+++ b/api/@ohos.application.uriPermissionManager.d.ts
@@ -20,7 +20,7 @@ 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
*/
declare namespace uriPermissionManager {
@@ -28,7 +28,7 @@ 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.
diff --git a/api/@ohos.batteryinfo.d.ts b/api/@ohos.batteryinfo.d.ts
index a139929f6d85cb3fb8640a99e1fc7d45eabf1762..265f6c4df200eb99e4a13ab50a62bed94d4f0e87 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.BatteryManage.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.BatteryManage.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.BatteryManage.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.BatteryManage.Core
* @since 6
*/
export enum BatteryHealthState {
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..0a7500990c94666069df485ce9b844edce4db5b2 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.
@@ -471,8 +486,6 @@ declare namespace bundle {
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 +502,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 +583,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
+ * @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
+ */
+ 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..eb724fd056044215e00f8d7b64e79b1b2906762e
--- /dev/null
+++ b/api/@ohos.bundleState.d.ts
@@ -0,0 +1,265 @@
+/*
+ * 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.
+ * @permission ohos.permission.BUNDLE_ACTIVE_INFO.
+ * @systemapi Hide this for inner system use.
+ */
+ 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.
+ * @permission ohos.permission.BUNDLE_ACTIVE_INFO.
+ * @systemapi Hide this for inner system use.
+ * @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.
+ * @permission ohos.permission.BUNDLE_ACTIVE_INFO.
+ * @systemapi Hide this for inner system use.
+ */
+ 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.
+ * @permission ohos.permission.BUNDLE_ACTIVE_INFO.
+ * @systemapi Hide this for inner system use.
+ * @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.
+ * @permission ohos.permission.BUNDLE_ACTIVE_INFO.
+ * @systemapi Hide this for inner system use.
+ * @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.
+ * @permission ohos.permission.BUNDLE_ACTIVE_INFO.
+ * @systemapi Hide this for inner system use.
+ */
+ 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.
+ * @permission ohos.permission.BUNDLE_ACTIVE_INFO.
+ * @systemapi Hide this for inner system use.
+ */
+ 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.
+ * @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 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.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.data.preferences.d.ts b/api/@ohos.data.preferences.d.ts
index c5755371035728dbc700781e0828ffed10645373..000599ed5d287eb42bd8ea5e9894562ac7905021 100644
--- a/api/@ohos.data.preferences.d.ts
+++ b/api/@ohos.data.preferences.d.ts
@@ -19,9 +19,9 @@ import Context from "./application/Context";
* Provides interfaces to obtain and modify preferences data.
*
* @name preferences
- * @since 8
+ * @since 9
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
- *
+ *
*/
declare namespace preferences {
/**
@@ -34,7 +34,7 @@ declare namespace preferences {
* @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 8
+ * @since 9
*/
function getPreferences(context: Context, name: string, callback: AsyncCallback): void;
function getPreferences(context: Context, name: string): Promise;
@@ -51,7 +51,7 @@ declare namespace preferences {
* @param context Indicates the context of application or capability.
* @param name Indicates the preferences file name.
* @throws BusinessError if invoked failed
- * @since 8
+ * @since 9
*/
function deletePreferences(context: Context, name: string, callback: AsyncCallback): void;
function deletePreferences(context: Context, name: string): Promise;
@@ -67,7 +67,7 @@ declare namespace preferences {
* @param context Indicates the context of application or capability.
* @param name Indicates the preferences file name.
* @throws BusinessError if invoked failed
- * @since 8
+ * @since 9
*/
function removePreferencesFromCache(context: Context, name: string, callback: AsyncCallback): void;
function removePreferencesFromCache(context: Context, name: string): Promise;
@@ -81,8 +81,8 @@ declare namespace preferences {
* to remove the {@link Preferences} instance from the memory.
*
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
- *
- * @since 8
+ *
+ * @since 9
*/
interface Preferences {
/**
@@ -94,7 +94,7 @@ declare namespace preferences {
* @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 8
+ * @since 9
*/
get(key: string, defValue: ValueType, callback: AsyncCallback): void;
get(key: string, defValue: ValueType): Promise;
@@ -106,7 +106,7 @@ declare namespace preferences {
* @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 8
+ * @since 9
*/
has(key: string, callback: AsyncCallback): boolean;
has(key: string): Promise;
@@ -121,7 +121,7 @@ declare namespace preferences {
* @param value Indicates the value of the preferences.
* MAX_KEY_LENGTH.
* @throws BusinessError if invoked failed
- * @since 8
+ * @since 9
*/
put(key: string, value: ValueType, callback: AsyncCallback): void;
put(key: string, value: ValueType): Promise;
@@ -135,7 +135,7 @@ declare namespace preferences {
* @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 8
+ * @since 9
*/
delete(key: string, callback: AsyncCallback): void;
delete(key: string): Promise;
@@ -147,7 +147,7 @@ declare namespace preferences {
* file.
*
* @throws BusinessError if invoked failed
- * @since 8
+ * @since 9
*/
clear(callback: AsyncCallback): void;
clear(): Promise;
@@ -156,7 +156,7 @@ declare namespace preferences {
* Asynchronously saves the {@link Preferences} object to the file.
*
* @throws BusinessError if invoked failed
- * @since 8
+ * @since 9
*/
flush(callback: AsyncCallback): void;
flush(): Promise;
@@ -166,7 +166,7 @@ declare namespace preferences {
*
* @param callback Indicates the callback when preferences changes.
* @throws BusinessError if invoked failed
- * @since 8
+ * @since 9
*/
on(type: 'change', callback: Callback<{ key: string }>): void;
@@ -175,7 +175,7 @@ declare namespace preferences {
*
* @param callback Indicates the registered callback.
* @throws BusinessError if invoked failed
- * @since 8
+ * @since 9
*/
off(type: 'change', callback: Callback<{ key: string }>): void;
}
@@ -196,4 +196,4 @@ declare namespace preferences {
const MAX_VALUE_LENGTH: 8192;
}
-export default preferences;
\ No newline at end of file
+export default preferences;
diff --git a/api/@ohos.data.storage.d.ts b/api/@ohos.data.storage.d.ts
index 15c6b1b06bf2673be05fc48f2944a56ac7512ee7..3da37c191e7ac942c553c335a441516a376b5ccb 100644
--- a/api/@ohos.data.storage.d.ts
+++ b/api/@ohos.data.storage.d.ts
@@ -19,9 +19,9 @@ import { AsyncCallback, Callback } from './basic';
*
* @name storage
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
- *
+ *
*/
declare namespace storage {
/**
@@ -34,7 +34,7 @@ declare namespace storage {
* @return Returns the {@link Storage} instance matching the specified storage file name.
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
function getStorageSync(path: string): Storage;
@@ -53,7 +53,7 @@ declare namespace storage {
* @param path Indicates the path of storage file
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
function deleteStorageSync(path: string): void;
function deleteStorage(path: string, callback: AsyncCallback): void;
@@ -70,7 +70,7 @@ declare namespace storage {
* @param path Indicates the path of storage file.
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
function removeStorageFromCacheSync(path: string): void;
function removeStorageFromCache(path: string, callback: AsyncCallback): void;
@@ -85,9 +85,9 @@ declare namespace storage {
* to remove the {@link Storage} instance from the memory.
*
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
- *
+ *
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
interface Storage {
/**
@@ -100,7 +100,7 @@ declare namespace storage {
* @return Returns the value matching the specified key if it is found; returns the default value otherwise.
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
getSync(key: string, defValue: ValueType): ValueType;
get(key: string, defValue: ValueType, callback: AsyncCallback): void;
@@ -114,7 +114,7 @@ declare namespace storage {
* returns {@code false} otherwise.
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
hasSync(key: string): boolean;
has(key: string, callback: AsyncCallback): boolean;
@@ -131,7 +131,7 @@ declare namespace storage {
* MAX_KEY_LENGTH.
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
putSync(key: string, value: ValueType): void;
put(key: string, value: ValueType, callback: AsyncCallback): void;
@@ -147,7 +147,7 @@ declare namespace storage {
* MAX_KEY_LENGTH.
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
deleteSync(key: string): void;
delete(key: string, callback: AsyncCallback): void;
@@ -161,7 +161,7 @@ declare namespace storage {
*
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
clearSync(): void;
clear(callback: AsyncCallback): void;
@@ -172,7 +172,7 @@ declare namespace storage {
*
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
flushSync(): void;
flush(callback: AsyncCallback): void;
@@ -184,7 +184,7 @@ declare namespace storage {
* @param callback Indicates the callback when storage changes.
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
on(type: 'change', callback: Callback): void;
@@ -194,7 +194,7 @@ declare namespace storage {
* @param callback Indicates the registered callback.
* @throws BusinessError if invoked failed
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
off(type: 'change', callback: Callback): void;
}
@@ -208,9 +208,9 @@ declare namespace storage {
* Define the change data information object.
*
* @syscap SystemCapability.DistributedDataManager.Preferences.Core
- *
+ *
* @since 5
- * @deprecated since 8, please use @ohos.data.preferences instead.
+ * @deprecated since 9, please use @ohos.data.preferences instead.
*/
interface StorageObserver {
/**
@@ -230,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.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.i18n.d.ts b/api/@ohos.i18n.d.ts
index cec604281101c1f0c31084b969968bd8370d1153..b8dc57ffdc71da03f96bcd0d055c1b8c62438992 100644
--- a/api/@ohos.i18n.d.ts
+++ b/api/@ohos.i18n.d.ts
@@ -16,14 +16,14 @@
/**
* Provides international settings related APIs.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 7
*/
declare namespace i18n {
/**
* Obtains the country or region name localized for display on a given locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param country The locale whose country or region name will be displayed.
* @param locale The locale used to display the country or region.
* @param sentenceCase Specifies whether the country or region name is displayed in sentence case.
@@ -35,7 +35,7 @@ export function getDisplayCountry(country: string, locale: string, sentenceCase?
/**
* Obtains the language name localized for display on a given locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param language The locale whose language name will be displayed.
* @param locale The locale used to display the language.
* @param sentenceCase Specifies whether the language name is displayed in sentence case.
@@ -47,7 +47,7 @@ export function getDisplayLanguage(language: string, locale: string, sentenceCas
/**
* Obtain all languages supported by the system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns all languages supported by the system.
* @since 7
* @systemapi Hide this for inner system use.
@@ -57,7 +57,7 @@ export function getSystemLanguages(): Array;
/**
* Obtain all regions supported by the system in the language.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param language The language used to get the list of regions.
* @return Returns all regions supported by the system in the language.
* @since 7
@@ -68,7 +68,7 @@ export function getSystemCountries(language: string): Array;
/**
* Determine whether the current language or region is recommended.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param language The language code.
* @param region The region code.
* @return Returns whether the current language or region is recommended.
@@ -80,7 +80,7 @@ export function isSuggested(language: string, region?: string): boolean;
/**
* Obtain the language currently used by the system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the language currently used by the system.
* @since 7
*/
@@ -89,7 +89,7 @@ export function getSystemLanguage(): string;
/**
* Set the language currently used by the system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param language The language to be used.
* @since 7
* @systemapi Hide this for inner system use.
@@ -99,7 +99,7 @@ export function setSystemLanguage(language: string): boolean;
/**
* Obtain the region currently used by the system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the region currently used by the system.
* @since 7
*/
@@ -108,7 +108,7 @@ export function getSystemRegion(): string;
/**
* Set the region currently used by the system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param region The region to be used.
* @since 7
* @systemapi Hide this for inner system use.
@@ -118,7 +118,7 @@ export function setSystemRegion(region: string): boolean;
/**
* Obtain the locale currently used by the system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the locale currently used by the system.
* @since 7
*/
@@ -127,7 +127,7 @@ export function getSystemLocale(): string;
/**
* Set the locale currently used by the system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale The locale to be used.
* @since 7
* @systemapi Hide this for inner system use.
@@ -137,14 +137,14 @@ export function setSystemLocale(locale: string): boolean;
/**
* Provides util functions.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export interface Util {
/**
* Convert from unit to to unit and format according to the locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param fromUnit Information of the unit to be converted.
* @param toUnit Information about the unit to be converted to.
* @param value Indicates the number to be formatted.
@@ -158,7 +158,7 @@ export interface Util {
/**
* Provides the options of unit.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export interface UnitInfo {
@@ -176,7 +176,7 @@ export interface UnitInfo {
/**
* Provides the options of PhoneNumberFormat.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export interface PhoneNumberFormatOptions {
@@ -189,14 +189,14 @@ export interface PhoneNumberFormatOptions {
/**
* Provides the API for formatting phone number strings
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export class PhoneNumberFormat {
/**
* A constructor used to create a PhoneNumberFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param country Indicates a character string containing the country information for the PhoneNumberFormat object.
* @param type Indicates the type used to format the phone number, includes: "E164", "RFC3966", "INTERNATIONAL", "NATIONAL".
* @since 8
@@ -206,7 +206,7 @@ export class PhoneNumberFormat {
/**
* Judges whether phone number is valid.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param number Indicates the input phone number to be judged.
* @return Returns a boolean indicates whether the input phone number is valid.
* @since 8
@@ -216,7 +216,7 @@ export class PhoneNumberFormat {
/**
* Obtains the formatted phone number strings of number.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param number Indicates the input phone number to be formatted.
* @return Returns the formatted phone number.
* @since 8
@@ -227,7 +227,7 @@ export class PhoneNumberFormat {
/**
* Get a Calendar instance specified by locale and type.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale The locale used to get calendar.
* @param type If type is not specified, get locale's default Calendar, else get the specified type of Calendar.
* such as buddhist, chinese, coptic, ethiopic, hebrew, gregory, indian, islamic_civil, islamic_tbla, islamic_umalqura,
@@ -240,7 +240,7 @@ export class Calendar {
/**
* set the date.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param date Date object used to set the time and date.
* @since 8
*/
@@ -249,7 +249,7 @@ export class Calendar {
/**
* set the time.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param time Indicates the elapsed milliseconds from 1970.1.1 00:00:00 GMT.
* @since 8
*/
@@ -258,7 +258,7 @@ export class Calendar {
/**
* Set the time
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param year The year field of the calendar, ranges from 0 to 9999.
* @param month The month field of the calendar, ranges from 0 to 11.
* @param date The day field of the calendar, ranges from 1 to 31.
@@ -272,7 +272,7 @@ export class Calendar {
/**
* Set the timezone of this calendar.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param timezone The id of a timezone.
* @since 8
*/
@@ -281,7 +281,7 @@ export class Calendar {
/**
* Get the timezone id of this calendar instance.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the timezone id of this calendar.
* @since 8
*/
@@ -290,7 +290,7 @@ export class Calendar {
/**
* Get the start day of a week. 1 indicates Sunday, 7 indicates Saturday.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns start day of a week.
* @since 8
*/
@@ -299,7 +299,7 @@ export class Calendar {
/**
* Set the start day of a week. 1 indicates Sunday, 7 indicates Saturday.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param value Indicates the start day of a week. 1 indicates Sunday, 7 indicates Saturday.
* @since 8
*/
@@ -308,7 +308,7 @@ export class Calendar {
/**
* Get the minimal days of a week, which is needed for the first day of a year.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the minimal days of a week.
* @since 8
*/
@@ -317,7 +317,7 @@ export class Calendar {
/**
* Set the minimal days of a week, which is needed for the first week of a year.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param value The value to be set.
* @since 8
*/
@@ -326,7 +326,7 @@ export class Calendar {
/**
* Get the associated value with the field.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param field Field values such as era, year, month, week_of_year, week_of_month, date, day_of_year, day_of_week
* day_of_week_in_month, hour, hour_of_day, minute, second, millisecond, zone_offset, dst_offset, year_woy,
* dow_local, extended_year, julian_day, milliseconds_in_day, is_leap_month.
@@ -338,7 +338,7 @@ export class Calendar {
/**
* Get calendar's name localized for display in the given locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Locale used to get the localized name for this calendar.
* @return Returns the localized name of this calendar.
* @since 8
@@ -349,7 +349,7 @@ export class Calendar {
* Returns true if the given date is a weekend day. If the date is not given,
* the date object of this calendar is used.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param date Date object whose attribute is desired.
* @return Returns whether the date is a weekend day.
* @since 8
@@ -360,7 +360,7 @@ export class Calendar {
/**
* Judge whether the locale is RTL locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale The locale to be used.
* @return Returns true representing the locale is an RTL locale
*
@@ -371,7 +371,7 @@ export function isRTL(locale: string): boolean;
/**
* Obtains a BreakIterator object for finding the location of break point in text.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale the returned BreakIterator will adapt the rule, specified by the locale, to break text.
* @return Returns a newly constructed BreakIterator object.
* @since 8
@@ -381,14 +381,14 @@ export function isRTL(locale: string): boolean;
/**
* The BreakIterator class is used for finding the location of break point in text.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export class BreakIterator {
/**
* Obtains the current position of the BreakIterator instance.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the current position of the BreakIterator instance.
* @since 8
*/
@@ -398,7 +398,7 @@ export class BreakIterator {
* Set the BreakIterator's position to the first break point, the first break point is always the beginning of the
* processed text.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the index of the first break point.
* @since 8
*/
@@ -408,7 +408,7 @@ export class BreakIterator {
* Set the BreakIterator's position to the last break point. the last break point is always the index beyond the
* last character of the processed text.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the index of the last break point.
* @since 8
*/
@@ -417,7 +417,7 @@ export class BreakIterator {
/**
* Set the BreakItertor's position to the nth break point from the current break point.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param index indicates the number of break points to advance. If index is not given, n is treated as 1.
* @return Returns the index of the BreakIterator after moving. If there is not enough break points, returns -1.
* @since 8
@@ -427,7 +427,7 @@ export class BreakIterator {
/**
* Set the BreakItertor's position to the break point preceding the current break point.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the index of the BreakIterator after moving. If there is not enough break points, returns -1.
* @since 8
*/
@@ -436,7 +436,7 @@ export class BreakIterator {
/**
* Set the text to be processed.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param text Indicates the text to be processed by the BreakIterator.
* @since 8
*/
@@ -445,7 +445,7 @@ export class BreakIterator {
/**
* Set the BreakIterator's position to the first break point following the specified offset.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the index of the BreakIterator after moving. If there is not enough break points, returns -1.
* @since 8
*/
@@ -454,7 +454,7 @@ export class BreakIterator {
/**
* Obtains the text being processed.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the text that is processed by the BreakIterator.
* @since 8
*/
@@ -465,7 +465,7 @@ export class BreakIterator {
* position will be set to the position indicated by the offset if it returns true, otherwise the BreakIterator
* will be moved to the break point following the offset.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param offset The offset to be checked.
* @return Returns true if the offset is a break point.
* @since 8
@@ -477,14 +477,14 @@ export class BreakIterator {
* Sequence text can be grouped under the specified area,
* and grouping index with different lengths can be specified.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export class IndexUtil {
/**
* Get IndexUtil object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Indicates a character string containing the locale information, including
* the language and optionally the script and region, for the NumberFormat object.
* @return Returns IndexUtil object.
@@ -495,7 +495,7 @@ export class IndexUtil {
/**
* Get a list of labels for use as a UI index
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns a list of labels
* @since 8
*/
@@ -504,7 +504,7 @@ export class IndexUtil {
/**
* Add the index characters from a Locale to the index.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale The locale whose index characters are to be added.
* @since 8
*/
@@ -513,7 +513,7 @@ export class IndexUtil {
/**
* Get corresponding index of the input text.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param text input text
* @since 8
*/
@@ -523,14 +523,14 @@ export class IndexUtil {
/**
* Provides the API for accessing unicode character properties, sunch as whether a character is a digit.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export class Character {
/**
* Determines whether the specified code point is a digit character
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a digit character
*/
@@ -539,7 +539,7 @@ export class Character {
/**
* Determines if the specified character is a space character or not.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a space character
*/
@@ -548,7 +548,7 @@ export class Character {
/**
* Determines if the specified character is a whitespace character
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a whitespace character
*/
@@ -557,7 +557,7 @@ export class Character {
/**
* Determines if the specified character is a RTL character or not.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a RTL character
*/
@@ -566,7 +566,7 @@ export class Character {
/**
* Determines if the specified character is a Ideographic character or not.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a Ideographic character
*/
@@ -575,7 +575,7 @@ export class Character {
/**
* Determines if the specified character is a Letter or not.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a Letter
*/
@@ -584,7 +584,7 @@ export class Character {
/**
* Determines if the specified character is a LowerCase character or not.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a LowerCase character
*/
@@ -593,7 +593,7 @@ export class Character {
/**
* Determines if the specified character is a UpperCase character or not.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns true if the character is a UpperCase character
*/
@@ -602,7 +602,7 @@ export class Character {
/**
* Get the general category value of the specified character.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param char the character to be tested
* @return Returns the general category of the specified character.
*/
@@ -612,7 +612,7 @@ export class Character {
/**
* check out whether system is 24-hour system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns a boolean represent whether system is 24-hour system.
* @since 8
*/
@@ -621,7 +621,7 @@ export class Character {
/**
* set 24-hour system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param option represent the boolean to be set.
* @return Returns a boolean represent whether setting 24-hour system success.
* @since 8
@@ -631,7 +631,7 @@ export class Character {
/**
* Add one language to preferred language List.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param language the language to be added.
* @param index the position of preferred language list to be inserted.
* @return Returns a boolean represent whether language added success.
@@ -642,7 +642,7 @@ export function addPreferredLanguage(language: string, index?: number): boolean;
/**
* Remove one language from preferred language list.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param index the position of removed language in preferred language list.
* @return Returns a boolean represent whether removed success.
* @since 8
@@ -652,7 +652,7 @@ export function removePreferredLanguage(index: number): boolean;
/**
* Access the system preferred language list.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns a string Array represent the preferred language list.
* @since 8
*/
@@ -661,7 +661,7 @@ export function getPreferredLanguageList(): Array;
/**
* Get the first preferred language of system.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns a string represent the first preferred language of system.
* @since 8
*/
diff --git a/api/@ohos.intl.d.ts b/api/@ohos.intl.d.ts
index 070d0614a149bda17c58c7d95c85464645005229..5bf8f664ee8afb4982d3f80f293a2fd960d43ed3 100755
--- a/api/@ohos.intl.d.ts
+++ b/api/@ohos.intl.d.ts
@@ -16,7 +16,7 @@
/**
* Provides internationalization related APIs.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 6
*/
declare namespace intl {
@@ -24,7 +24,7 @@ declare namespace intl {
* Provides the options of Locale.
*
* @since 8
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
*/
export interface LocaleOptions {
/**
@@ -73,14 +73,14 @@ export interface LocaleOptions {
/**
* Provides APIs for obtaining locale information.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 6
*/
export class Locale {
/**
* A constructor used to create a Locale object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Indicates a character string containing the locale information, including
* the language and optionally the script and region.
* @since 6
@@ -90,7 +90,7 @@ export class Locale {
/**
* Indicates the language of the locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 6
*/
language: string
@@ -98,7 +98,7 @@ export class Locale {
/**
* Indicates the script of the locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 6
*/
script: string
@@ -106,7 +106,7 @@ export class Locale {
/**
* Indicates the region of the locale.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 6
*/
region: string
@@ -115,7 +115,7 @@ export class Locale {
* Indicates the basic locale information, which is returned as a substring of
* a complete locale string.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 6
*/
baseName: string
@@ -153,7 +153,7 @@ export class Locale {
/**
* Convert the locale information to string.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns locale information in string form.
*/
toString(): string;
@@ -161,7 +161,7 @@ export class Locale {
/**
* Maximize the locale's base information.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns maximized locale.
*/
maximize(): Locale;
@@ -169,7 +169,7 @@ export class Locale {
/**
* Minimize the locale's base information.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns minimized locale.
*/
minimize(): Locale;
@@ -178,7 +178,7 @@ export class Locale {
/**
* Provides the options of date time format.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
*/
export interface DateTimeOptions {
/**
@@ -280,14 +280,14 @@ export interface DateTimeOptions {
/**
* Provides the API for formatting date strings.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 6
*/
export class DateTimeFormat {
/**
* A constructor used to create a DateTimeFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
constructor();
@@ -295,7 +295,7 @@ export class DateTimeFormat {
/**
* A constructor used to create a DateTimeFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Indicates character string containing the locale information, including
* the language and optionally the script and region, for the DateTimeFormat object.
* @param options Indicates the options used to format the date.
@@ -306,7 +306,7 @@ export class DateTimeFormat {
/**
* Obtains the formatted date strings.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param date Indicates the Date object to be formatted.
* @return Returns a date string formatted based on the specified locale.
* @since 6
@@ -316,7 +316,7 @@ export class DateTimeFormat {
/**
* Obtains the formatted date strings of a date range.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param startDate Indicates the start date of the date range.
* @param endDate Indicates the end date of the date range.
* @return Returns a date string formatted based on the specified locale.
@@ -327,7 +327,7 @@ export class DateTimeFormat {
/**
* Obtains the options of the DateTimeFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the options of the DateTimeFormat object.
* @since 6
*/
@@ -337,7 +337,7 @@ export class DateTimeFormat {
/**
* Provides the options of number format.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
*/
export interface NumberOptions {
/**
@@ -439,13 +439,13 @@ export interface NumberOptions {
/**
* Provides the API for formatting number strings.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
*/
export class NumberFormat {
/**
* A constructor used to create a NumberFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
constructor();
@@ -453,7 +453,7 @@ export class NumberFormat {
/**
* A constructor used to create a NumberFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Indicates a character string containing the locale information, including
* the language and optionally the script and region, for the NumberFormat object.
* @param options Indicates the options used to format the number.
@@ -464,7 +464,7 @@ export class NumberFormat {
/**
* Obtains the formatted number string.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param number Indicates the number to be formatted.
* @return Returns a number string formatted based on the specified locale.
* @since 6
@@ -474,7 +474,7 @@ export class NumberFormat {
/**
* Obtains the options of the NumberFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns the options of the NumberFormat object.
* @since 6
*/
@@ -484,7 +484,7 @@ export class NumberFormat {
/**
* Provides the options of Collator
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export interface CollatorOptions {
@@ -533,21 +533,21 @@ export interface CollatorOptions {
/**
* Enable language-sensitive string comparison.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export class Collator {
/**
* A constructor used to create Collator object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
constructor();
/**
* A constructor used to create Collator Object;
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Indicates a character string containing the locale information, including
* the language and optionally the script and region, for the Collator object.
* @param options Indicates the options used to initialize Collator object.
@@ -558,7 +558,7 @@ export class Collator {
/**
* compares two strings according to the sort order of this Collator object
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param first The first string to compare.
* @param second The second string to compare.
* @return Returns a number indicating how first compare to second:
@@ -573,7 +573,7 @@ export class Collator {
* Returns a new object with properties reflecting the locale and collation options computed
* during initialization of the object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @return Returns a CollatorOptions object reflecting the properties of this object.
* @since 8
*/
@@ -583,7 +583,7 @@ export class Collator {
/**
* Provides the options of PluralRules
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export interface PluralRulesOptions {
@@ -633,14 +633,14 @@ export interface PluralRulesOptions {
/**
* Enables plural-sensitive formatting and plural-related language rules.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export class PluralRules {
/**
* A constructor used to create PluralRules object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
constructor();
@@ -648,7 +648,7 @@ export class PluralRules {
/**
* A constructor used to create PluralRules object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Indicates a character string containing the locale information, including
* the language and optionally the script and region, for the PluralRules object.
* @param options Indicates the options used to initialize PluralRules object.
@@ -659,7 +659,7 @@ export class PluralRules {
/**
* Returns a string indicating which plural rule to use for locale-aware formatting.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param n The number to get a plural rule for.
* @return A string representing the pluralization category of the number,
* can be one of zero, one, two, few, many or other.
@@ -671,7 +671,7 @@ export class PluralRules {
/**
* Provides the input options of RelativeTimeFormat.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export interface RelativeTimeFormatInputOptions {
@@ -697,7 +697,7 @@ export class PluralRules {
/**
* Provides the resolved options of RelativeTimeFormat.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export interface RelativeTimeFormatResolvedOptions {
@@ -728,14 +728,14 @@ export interface RelativeTimeFormatResolvedOptions {
* Given a Time period length value and a unit, RelativeTimeFormat object enables
* language-sensitive relative time formatting.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
export class RelativeTimeFormat {
/**
* A constructor used to create RelativeTimeFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @since 8
*/
constructor();
@@ -743,7 +743,7 @@ export class RelativeTimeFormat {
/**
* A constructor used to create RelativeTimeFormat object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param locale Indicates a character string containing the locale information, including
* the language and optionally the script and region, for the RelativeTimeFormat object.
* @param options Indicates the options used to initialize RelativeTimeFormat object.
@@ -754,7 +754,7 @@ export class RelativeTimeFormat {
/**
* formats a value and unit according to the locale and formatting options of this object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param value Numeric value to use in the internationalized relative time message.
* @param unit Unit to use in the relative time internationalized message.
* Possible values are: year, quarter, month, week, day, hour, minute, second.
@@ -767,7 +767,7 @@ export class RelativeTimeFormat {
* returns an Array of objects representing the relative time format in parts that can be used for
* custom locale-aware formatting
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @param value Numeric value to use in the internationalized relative time message.
* @param unit to use in the relative time internationalized message.
* Possible values are: year, quarter, month, week, day, hour, minute, second.
@@ -780,7 +780,7 @@ export class RelativeTimeFormat {
* Returns a new object with properties reflecting the locale and formatting options computed during
* initialization of the object.
*
- * @sysCap SystemCapability.Global.I18n
+ * @syscap SystemCapability.Global.I18n
* @returns RelativeTimeFormatOptions which reflecting the locale and formatting options of the object.
* @since 8
*/
diff --git a/api/@ohos.multimedia.mediaLibrary.d.ts b/api/@ohos.multimedia.mediaLibrary.d.ts
index c2ff5cc72d54824e73ac00a6228b6579e8d13cf2..45a0cbd12502e79e1bab4a00677720d3d313b626 100644
--- a/api/@ohos.multimedia.mediaLibrary.d.ts
+++ b/api/@ohos.multimedia.mediaLibrary.d.ts
@@ -14,7 +14,7 @@
*/
import { AsyncCallback, Callback } from './basic';
-import Context from './app/context';
+import { Context } from './app/context';
import image from './@ohos.multimedia.image';
/**
@@ -262,6 +262,7 @@ declare namespace mediaLibrary {
* If it is a directory where the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param callback Callback return the result of isDerectory.
*/
isDirectory(callback: AsyncCallback): void;
@@ -269,27 +270,29 @@ declare namespace mediaLibrary {
* If it is a directory where the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
*/
isDirectory():Promise;
/**
* Modify meta data where the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
* @param callback no value will be returned.
- * @systemapi
*/
commitModify(callback: AsyncCallback): void;
/**
* Modify meta data where the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
- * @systemapi
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
*/
commitModify(): Promise;
/**
* Open the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA | ohos.permission.WRITE_MEDIA
* @param mode mode for open, for example: rw, r, w.
* @param callback Callback return the fd of the file.
*/
@@ -298,6 +301,7 @@ declare namespace mediaLibrary {
* Open the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA | ohos.permission.WRITE_MEDIA
* @param mode mode for open, for example: rw, r, w.
*/
open(mode: string): Promise;
@@ -305,6 +309,7 @@ declare namespace mediaLibrary {
* Close the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA | ohos.permission.WRITE_MEDIA
* @param fd fd of the file which had been opened
* @param callback no value will be returned.
*/
@@ -313,6 +318,7 @@ declare namespace mediaLibrary {
* Close the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA | ohos.permission.WRITE_MEDIA
* @param fd fd of the file which had been opened
*/
close(fd: number): Promise;
@@ -320,6 +326,7 @@ declare namespace mediaLibrary {
* Get thumbnail of the file when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param callback Callback used to return the thumbnail's pixelmap.
*/
getThumbnail(callback: AsyncCallback): void;
@@ -327,6 +334,7 @@ declare namespace mediaLibrary {
* Get thumbnail of the file when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param size thumbnail's size
* @param callback Callback used to return the thumbnail's pixelmap.
*/
@@ -335,6 +343,7 @@ declare namespace mediaLibrary {
* Get thumbnail of the file when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param size thumbnail's size
*/
getThumbnail(size?: Size): Promise;
@@ -342,64 +351,64 @@ declare namespace mediaLibrary {
* Set favorite for the file when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
* @param isFavorite ture is favorite file, false is not favorite file
* @param callback Callback used to return, No value is returned.
- * @systemapi
*/
favorite(isFavorite: boolean, callback: AsyncCallback): void;
/**
* Set favorite for the file when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
* @param isFavorite ture is favorite file, false is not favorite file
- * @systemapi
*/
favorite(isFavorite: boolean): Promise;
/**
* If the file is favorite when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param callback Callback used to return true or false.
- * @systemapi
*/
isFavorite(callback: AsyncCallback): void;
/**
* If the file is favorite when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
- * @systemapi
+ * @permission ohos.permission.READ_MEDIA
*/
isFavorite():Promise;
/**
* Set trash for the file when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
* @param isTrash true is trashed file, false is not trashed file
* @param callback Callback used to return, No value is returned.
- * @systemapi
*/
trash(isTrash: boolean, callback: AsyncCallback): void;
/**
* Set trash for the file when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
* @param isTrash true is trashed file, false is not trashed file
- * @systemapi
*/
- trash(isTrash: boolean,): Promise;
+ trash(isTrash: boolean): Promise;
/**
* If the file is in trash when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param callback Callback used to return true or false.
- * @systemapi
*/
isTrash(callback: AsyncCallback): void;
/**
* If the file is in trash when the file is located.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
- * @systemapi
+ * @permission ohos.permission.READ_MEDIA
*/
isTrash():Promise;
}
@@ -545,7 +554,7 @@ declare namespace mediaLibrary {
*/
selectionArgs: Array;
/**
- * Sorting criterion of the retrieval results, for example, order: "datetaken DESC,_display_name DESC, _id DESC".
+ * Sorting criterion of the retrieval results, for example, order: "datetaken DESC,display_name DESC, file_id DESC".
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
*/
@@ -741,21 +750,22 @@ declare namespace mediaLibrary {
* Modify the meta data for the album
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
* @param callback, no value will be returned.
- * @systemapi
*/
commitModify(callback: AsyncCallback): void;
/**
* Modify the meta data for the album
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
- * @systemapi
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
*/
commitModify(): Promise;
/**
* SObtains files in an album. This method uses an asynchronous callback to return the files.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param callback Callback used to return the files in the format of a FetchFileResult instance.
*/
getFileAssets(callback: AsyncCallback): void;
@@ -763,6 +773,7 @@ declare namespace mediaLibrary {
* SObtains files in an album. This method uses an asynchronous callback to return the files.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param option Media retrieval options.
* @param callback Callback used to return the files in the format of a FetchFileResult instance.
*/
@@ -771,6 +782,7 @@ declare namespace mediaLibrary {
* Obtains files in an album. This method uses a promise to return the files.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param option Media retrieval options.
* @return A Promise instance used to return the files in the format of a FetchFileResult instance.
*/
@@ -849,6 +861,7 @@ declare namespace mediaLibrary {
* if need all data, getAllObject from FetchFileResult
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param options, Media retrieval options.
* @param callback, Callback return the FetchFileResult.
*/
@@ -858,6 +871,7 @@ declare namespace mediaLibrary {
* if need all data, getAllObject from FetchFileResult
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param options Media retrieval options.
* @return A promise instance used to return the files in the format of a FetchFileResult instance
*/
@@ -882,6 +896,7 @@ declare namespace mediaLibrary {
* Create File Asset
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
* @param mediaType mediaType for example:IMAGE, VIDEO, AUDIO, FILE
* @param displayName file name
* @param relativePath relative path
@@ -892,6 +907,7 @@ declare namespace mediaLibrary {
* Create File Asset
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
* @param mediaType mediaType for example:IMAGE, VIDEO, AUDIO, FILE
* @param displayName file name
* @param relativePath relative path
@@ -902,6 +918,7 @@ declare namespace mediaLibrary {
* Delete File Asset
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
* @param uri FileAsset's URI
* @param callback no value returned
* @systemapi
@@ -911,6 +928,7 @@ declare namespace mediaLibrary {
* Delete File Asset
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA, ohos.permission.WRITE_MEDIA
* @param uri, FileAsset's URI
* @return A Promise instance, no value returned
* @systemapi
@@ -920,6 +938,7 @@ declare namespace mediaLibrary {
* Obtains albums based on the media retrieval options. This method uses an asynchronous callback to return.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param option Media retrieval options.
* @param callback Callback used to return an album array.
*/
@@ -928,6 +947,7 @@ declare namespace mediaLibrary {
* Obtains albums based on the media retrieval options. This method uses a promise to return the albums.
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.Core
+ * @permission ohos.permission.READ_MEDIA
* @param option Media retrieval options.
* @return A Promise instance used to return an album array.
*/
@@ -999,6 +1019,7 @@ declare namespace mediaLibrary {
* Get Active Peer device information
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore
+ * @permission ohos.permission.READ_MEDIA
* @systemapi
* @param callback, Callback return the list of the active peer devices' information
*/
@@ -1007,6 +1028,7 @@ declare namespace mediaLibrary {
* Get Active Peer device information
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore
+ * @permission ohos.permission.READ_MEDIA
* @systemapi
* @return Promise used to return the list of the active peer devices' information
*/
@@ -1015,6 +1037,7 @@ declare namespace mediaLibrary {
* Get all the peer devices' information
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore
+ * @permission ohos.permission.READ_MEDIA
* @systemapi
* @param callback Callback return the list of the all the peer devices' information
*/
@@ -1023,6 +1046,7 @@ declare namespace mediaLibrary {
* Get all the peer devices' information
* @since 8
* @syscap SystemCapability.Multimedia.MediaLibrary.DistributedCore
+ * @permission ohos.permission.READ_MEDIA
* @systemapi
* @return Promise used to return the list of the all the peer devices' information
*/
diff --git a/api/@ohos.net.http.d.ts b/api/@ohos.net.http.d.ts
index de5a6c3ec88ee314dd5eaf02a7bdd5cbf29fc9dc..b6ecab57c160bc35a91f068d04def36f56c23288 100644
--- a/api/@ohos.net.http.d.ts
+++ b/api/@ohos.net.http.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.net.socket.d.ts b/api/@ohos.net.socket.d.ts
index ccabf9041a3e6fed0a43eb75f8b84bf296ec5dc8..fb88669e14f1127a0b3b1a7d1f2b7df8e3341610 100644
--- a/api/@ohos.net.socket.d.ts
+++ b/api/@ohos.net.socket.d.ts
@@ -1,17 +1,17 @@
/*
-* 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.
-*/
+ * 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
+ *
+ * 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, ErrorCallback} from "./basic";
import connection from "./@ohos.net.connection";
diff --git a/api/@ohos.net.webSocket.d.ts b/api/@ohos.net.webSocket.d.ts
new file mode 100644
index 0000000000000000000000000000000000000000..cbb967bee4a57a447048c9ab4d135df7a8da7385
--- /dev/null
+++ b/api/@ohos.net.webSocket.d.ts
@@ -0,0 +1,126 @@
+/*
+ * 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, ErrorCallback} from "./basic";
+
+/**
+ * Provides WebSocket APIs.
+ *
+ * @since 6
+ * @syscap SystemCapability.Communication.NetStack
+ */
+declare namespace webSocket {
+ /**
+ * Creates a web socket connection.
+ */
+ function createWebSocket(): WebSocket;
+
+ export interface WebSocketRequestOptions {
+ /**
+ * HTTP request header.
+ */
+ header?: Object;
+ }
+
+ export interface WebSocketCloseOptions {
+ /**
+ * Error code.
+ */
+ code?: number;
+ /**
+ * Error cause.
+ */
+ reason?: string;
+ }
+
+ export interface WebSocket {
+ /**
+ * Initiates a WebSocket request to establish a WebSocket connection to a given URL.
+ *
+ * @param url URL for establishing a WebSocket connection.
+ * @param options Optional parameters {@link WebSocketRequestOptions}.
+ * @param callback Returns callback used to return the execution result.
+ * @permission ohos.permission.INTERNET
+ */
+ connect(url: string, callback: AsyncCallback): void;
+ connect(url: string, options: WebSocketRequestOptions, callback: AsyncCallback): void;
+ connect(url: string, options?: WebSocketRequestOptions): Promise;
+
+ /**
+ * Sends data through a WebSocket connection.
+ *
+ * @param data Data to send. It can be a string(API 6) or an ArrayBuffer(API 8).
+ * @param callback Returns callback used to return the execution result.
+ * @permission ohos.permission.INTERNET
+ */
+ send(data: string | ArrayBuffer, callback: AsyncCallback): void;
+ send(data: string | ArrayBuffer): Promise;
+
+ /**
+ * Closes a WebSocket connection.
+ *
+ * @param options Optional parameters {@link WebSocketCloseOptions}.
+ * @param callback Returns callback used to return the execution result.
+ * @permission ohos.permission.INTERNET
+ */
+ close(callback: AsyncCallback): void;
+ close(options: WebSocketCloseOptions, callback: AsyncCallback): void;
+ close(options?: WebSocketCloseOptions): Promise;
+
+ /**
+ * Enables listening for the open events of a WebSocket connection.
+ */
+ on(type: 'open', callback: AsyncCallback