提交 b5d0cc19 编写于 作者: X xsz233

Merge branch 'master' of gitee.com:xsz233/docs_api

......@@ -460,62 +460,64 @@ zh-cn/application-dev/reference/apis/js-apis-service-extension-ability.md @RaySh
zh-cn/application-dev/reference/apis/js-apis-service-extension-context.md @RayShih @littlejerry1 @gwang2008 @ccllee @chengxingzhen
zh-cn/application-dev/reference/apis/js-apis-wantAgent.md @RayShih @littlejerry1 @gwang2008 @ccllee @chengxingzhen
zh-cn/application-dev/reference/errorcodes/errcode-ability.md @RayShih
zh-cn/application-dev/reference/errorcodes/errcode-access-token.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-accessibility.md @RayShih
zh-cn/application-dev/reference/errorcodes/errcode-account.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-animator.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-app-account.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-audio.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-avsession.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-backgroundTaskMgr.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-batteryStatistics.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-brightness.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-buffer.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-bundle.md @RayShih
zh-cn/application-dev/reference/errorcodes/errcode-colorspace-manager.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-CommonEventService.md @RayShih
zh-cn/application-dev/reference/errorcodes/errcode-containers.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-data-rdb.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-datashare.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-device-manager.md @qinxiaowang
zh-cn/application-dev/reference/errorcodes/errcode-DeviceUsageStatistics.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-display.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-distributed-dataObject.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-distributedKVStore.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-DistributedNotificationService.md @RayShih
zh-cn/application-dev/reference/errorcodes/errcode-DistributedSchedule.md @RayShih
zh-cn/application-dev/reference/errorcodes/errcode-enterpriseDeviceManager.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-faultlogger.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-filemanagement.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-geoLocationManager.md @RayShih
zh-cn/application-dev/reference/errorcodes/errcode-hiappevent.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-hisysevent.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-hiviewdfx-hidebug.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-huks.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-i18n.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-inputmethod-framework.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-multimodalinput.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-nfc.md @RayShih
zh-cn/application-dev/reference/errorcodes/errcode-pasteboard.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-power.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-preferences.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-promptAction.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-reminderAgentManager.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-request.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-resource-manager.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-router.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-rpc.md @qinxiaowang
zh-cn/application-dev/reference/errorcodes/errcode-runninglock.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-sensor.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-system-parameterV9.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-thermal.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errcode-uitest.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-universal.md @RayShih
zh-cn/application-dev/reference/errorcodes/errcode-update.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-usb.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-vibrator.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-webview.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-window.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errcode-workScheduler.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errcode-zlib.md @RayShih
zh-cn/application-dev/reference/errorcodes/errorcode-ability.md @RayShih
zh-cn/application-dev/reference/errorcodes/errorcode-access-token.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errorcode-accessibility.md @RayShih
zh-cn/application-dev/reference/errorcodes/errorcode-account.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errorcode-animator.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errorcode-app-account.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errorcode-audio.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errorcode-avsession.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errorcode-backgroundTaskMgr.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errorcode-batteryStatistics.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errorcode-brightness.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errorcode-buffer.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errorcode-bundle.md @RayShih
zh-cn/application-dev/reference/errorcodes/errorcode-colorspace-manager.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errorcode-CommonEventService.md @RayShih
zh-cn/application-dev/reference/errorcodes/errorcode-containers.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errorcode-data-rdb.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errorcode-datashare.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errorcode-device-manager.md @qinxiaowang
zh-cn/application-dev/reference/errorcodes/errorcode-DeviceUsageStatistics.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errorcode-display.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errorcode-distributed-dataObject.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errorcode-distributedKVStore.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errorcode-DistributedNotificationService.md @RayShih
zh-cn/application-dev/reference/errorcodes/errorcode-DistributedSchedule.md @RayShih
zh-cn/application-dev/reference/errorcodes/errorcode-enterpriseDeviceManager.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errorcode-faultlogger.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errorcode-filemanagement.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errorcode-geoLocationManager.md @RayShih
zh-cn/application-dev/reference/errorcodes/errorcode-hiappevent.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errorcode-hisysevent.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errorcode-hiviewdfx-hidebug.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errorcode-huks.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errorcode-i18n.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errorcode-inputmethod-framework.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errorcode-multimodalinput.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errorcode-nfc.md @RayShih
zh-cn/application-dev/reference/errorcodes/errorcode-pasteboard.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errorcode-power.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errorcode-preferences.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errorcode-promptAction.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errorcode-reminderAgentManager.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errorcode-request.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errorcode-resource-manager.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errorcode-router.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errorcode-rpc.md @qinxiaowang
zh-cn/application-dev/reference/errorcodes/errorcode-runninglock.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errorcode-sensor.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errorcode-system-parameterV9.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errorcode-thermal.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errorcode-uitest.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errorcode-universal.md @RayShih
zh-cn/application-dev/reference/errorcodes/errorcode-update.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errorcode-usb.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errorcode-useriam.md @zengyawen
zh-cn/application-dev/reference/errorcodes/errorcode-vibrator.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errorcode-webview.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errorcode-window.md @ge-yafang
zh-cn/application-dev/reference/errorcodes/errorcode-workScheduler.md @HelloCrease
zh-cn/application-dev/reference/errorcodes/errorcode-zlib.md @RayShih
zh-cn/release-notes/changelogs @majiajun518
\ No newline at end of file
......@@ -22,10 +22,10 @@ import data_storage from '@ohos.data.storage';
**System capability**: SystemCapability.DistributedDataManager.Preferences.Core
| Name | Type | Readable | Writable | Description |
| ---------------- | ------ | -------- | -------- | ----------------------------------------------------------- |
| MAX_KEY_LENGTH | string | Yes | No | Maximum length of a key. It must be less than 80 bytes. |
| MAX_VALUE_LENGTH | string | Yes | No | Maximum length of a value. It must be less than 8192 bytes. |
| Name | Type| Readable| Writable| Description |
| ---------------- | -------- | ---- | ---- | ------------------------------------- |
| MAX_KEY_LENGTH | number | Yes | No | Maximum length of a key. It must be less than 80 bytes. |
| MAX_VALUE_LENGTH | number | Yes | No | Maximum length of a value. It must be less than 8192 bytes.|
## data_storage.getStorageSync
......@@ -53,8 +53,8 @@ Reads the specified file and loads its data to the **Storage** instance for data
```js
import featureAbility from '@ohos.ability.featureAbility';
var path;
var context = featureAbility.getContext();
let path;
let context = featureAbility.getContext();
context.getFilesDir().then((filePath) => {
path = filePath;
console.info("======================>getFilesDirPromise====================>");
......@@ -86,8 +86,8 @@ Reads the specified file and loads its data to the **Storage** instance for data
```js
import featureAbility from '@ohos.ability.featureAbility';
var path;
var context = featureAbility.getContext();
let path;
let context = featureAbility.getContext();
context.getFilesDir().then((filePath) => {
path = filePath;
console.info("======================>getFilesDirPromise====================>");
......@@ -129,8 +129,8 @@ Reads the specified file and loads its data to the **Storage** instance for data
```js
import featureAbility from '@ohos.ability.featureAbility';
var path;
var context = featureAbility.getContext();
let path;
let context = featureAbility.getContext();
context.getFilesDir().then((filePath) => {
path = filePath;
console.info("======================>getFilesDirPromise====================>");
......@@ -165,8 +165,8 @@ Deletes the singleton **Storage** instance of a file from the memory, and delete
```js
import featureAbility from '@ohos.ability.featureAbility';
var path;
var context = featureAbility.getContext();
let path;
let context = featureAbility.getContext();
context.getFilesDir().then((filePath) => {
path = filePath;
console.info("======================>getFilesDirPromise====================>");
......@@ -195,8 +195,8 @@ Deletes the singleton **Storage** instance of a file from the memory, and delete
```js
import featureAbility from '@ohos.ability.featureAbility';
var path;
var context = featureAbility.getContext();
let path;
let context = featureAbility.getContext();
context.getFilesDir().then((filePath) => {
path = filePath;
console.info("======================>getFilesDirPromise====================>");
......@@ -237,8 +237,8 @@ Deletes the singleton **Storage** instance of a file from the memory, and delete
```js
import featureAbility from '@ohos.ability.featureAbility';
var path;
var context = featureAbility.getContext();
let path;
let context = featureAbility.getContext();
context.getFilesDir().then((filePath) => {
path = filePath;
console.info("======================>getFilesDirPromise====================>");
......@@ -271,8 +271,8 @@ Removes the singleton **Storage** instance of a file from the cache. The removed
```js
import featureAbility from '@ohos.ability.featureAbility';
var path;
var context = featureAbility.getContext();
let path;
let context = featureAbility.getContext();
context.getFilesDir().then((filePath) => {
path = filePath;
console.info("======================>getFilesDirPromise====================>");
......@@ -302,8 +302,8 @@ Removes the singleton **Storage** instance of a file from the cache. The removed
```js
import featureAbility from '@ohos.ability.featureAbility';
var path;
var context = featureAbility.getContext();
let path;
let context = featureAbility.getContext();
context.getFilesDir().then((filePath) => {
path = filePath;
console.info("======================>getFilesDirPromise====================>");
......@@ -344,8 +344,8 @@ Removes the singleton **Storage** instance of a file from the cache. The removed
```js
import featureAbility from '@ohos.ability.featureAbility';
var path;
var context = featureAbility.getContext();
let path;
let context = featureAbility.getContext();
context.getFilesDir().then((filePath) => {
path = filePath;
console.info("======================>getFilesDirPromise====================>");
......@@ -864,15 +864,15 @@ Subscribes to data changes. The **StorageObserver** needs to be implemented. Whe
**Parameters**
| Name | Type | Description |
| -------- | --------------------------------------------------- | ---------------------------------------- |
| type | string | Event type. The value **change** indicates data change events.|
| callback | Callback<[StorageObserver](#storageobserver)> | Callback used to return data changes. |
| Name | Type | Mandatory| Description |
| -------- | --------------------------------------------------- | ------ |---------------------------------------- |
| type | string |Yes| Event type. The value **change** indicates data change events.|
| callback | Callback<[StorageObserver](#storageobserver)> | Yes|Callback used to return data changes. |
**Example**
```js
var observer = function (key) {
let observer = function (key) {
console.info("The key of " + key + " changed.");
}
storage.on('change', observer);
......@@ -891,15 +891,15 @@ Unsubscribes from data changes.
**Parameters**
| Name | Type | Description |
| -------- | --------------------------------------------------- | ---------------------------------------- |
| type | string | Event type. The value **change** indicates data change events.|
| callback | Callback<[StorageObserver](#storageobserver)> | Callback used to return data changes. |
| Name | Type | Mandatory| Description |
| -------- | --------------------------------------------------- | ------ |---------------------------------------- |
| type | string |Yes| Event type. The value **change** indicates data change events.|
| callback | Callback<[StorageObserver](#storageobserver)> | Yes|Callback used to return data changes. |
**Example**
```js
var observer = function (key) {
let observer = function (key) {
console.info("The key of " + key + " changed.");
}
storage.off('change', observer);
......
# HUKS
The **HUKS** module provides KeyStore (KS) capabilities for applications, including key management and key cryptography operations.
The keys managed by OpenHarmony Universal KeyStore (HUKS) can be imported by applications or generated by calling the HUKS APIs.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>
>
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
The **HUKS** module provides KeyStore (KS) capabilities for applications, including key management and key cryptography operations.
The keys managed by OpenHarmony Universal KeyStore (HUKS) can be imported by applications or generated by calling the HUKS APIs.
## Modules to Import
```js
......@@ -75,7 +75,7 @@ Generates a key. This API uses an asynchronous callback to return the result.
| -------- | --------------------------- | ---- | --------------------------------------------- |
| keyAlias | string | Yes | Alias of the key. |
| options | [HuksOptions](#huksoptions) | Yes | Tags required for generating the key. |
| callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, no **err** value is returned; otherwise, an error code is returned.|
| callback | AsyncCallback\<void> | Yes | Callback that returns no value.|
**Example**
......@@ -186,7 +186,7 @@ Deletes a key. This API uses an asynchronous callback to return the result.
| -------- | --------------------------- | ---- | --------------------------------------------- |
| keyAlias | string | Yes | Key alias passed in when the key was generated. |
| options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty). |
| callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, no **err** value is returned; otherwise, an error code is returned.|
| callback | AsyncCallback\<void> | Yes | Callback that returns no value.|
**Example**
......@@ -289,7 +289,7 @@ Imports a key in plaintext. This API uses an asynchronous callback to return the
| -------- | --------------------------- | ---- | --------------------------------------------- |
| keyAlias | string | Yes | Alias of the key. |
| options | [HuksOptions](#huksoptions) | Yes | Tags required for the import and key to import. |
| callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, no **err** value is returned; otherwise, an error code is returned.|
| callback | AsyncCallback\<void> | Yes | Callback that returns no value.|
**Example**
......@@ -553,7 +553,7 @@ Obtains the certificate used to verify a key. This API uses a promise to return
| Type | Description |
| ---------------------------------------------- | --------------------------------------------- |
| Promise<[HuksReturnResult](#huksreturnresult)> | Promise used to return the result. If **err** is not returned, the operation is successful. Otherwise, an error occurs.|
| Promise<[HuksReturnResult](#huksreturnresult)> | Promise used to return the result. If the operation is successful, no **err** value is returned; otherwise, an error code is returned.|
**Example**
......@@ -676,7 +676,7 @@ Imports a wrapped key. This API uses an asynchronous callback to return the resu
| keyAlias | string | Yes | Alias of the wrapped key to import. |
| wrappingKeyAlias | string | Yes | Alias of the data used to unwrap the key imported. |
| options | [HuksOptions](#huksoptions) | Yes | Tags required for the import and the wrapped key to import.|
| callback | AsyncCallback\<void> | Yes | Callback invoked to return the result. If the operation is successful, no **err** value is returned; otherwise, an error code is returned.|
| callback | AsyncCallback\<void> | Yes | Callback that returns no value.|
**Example**
......@@ -926,7 +926,7 @@ Exports a key. This API uses an asynchronous callback to return the result.
| -------- | ---------------------------------------------------- | ---- | ------------------------------------------------------------ |
| keyAlias | string | Yes | Key alias, which must be the same as the alias used when the key was generated. |
| options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty). |
| callback | AsyncCallback<[HuksReturnResult](#huksreturnresult)> | Yes | Callback invoked to return the result. If **HUKS_SUCCESS** is returned, the operation is successful. Otherwise, an error occurs. **outData** contains the public key exported.|
| callback | AsyncCallback<[HuksReturnResult](#huksreturnresult)> | Yes | Callback invoked to return the result. If the operation is successful, **HUKS_SUCCESS** is returned and **outData** contains the public key exported. If the operation fails, an error code is returned. |
**Example**
......@@ -968,7 +968,7 @@ Exports a key. This API uses a promise to return the result.
| Type | Description |
| ---------------------------------------------- | ------------------------------------------------------------ |
| Promise<[HuksReturnResult](#huksreturnresult)> | Promise used to return the result. If **err** is not returned, the operation is successful. Otherwise, an error occurs. **outData** contains the public key exported.|
| Promise<[HuksReturnResult](#huksreturnresult)> | Promise used to return the result. If the operation is successful, no **err** value is returned and **outData** contains the public key exported. If the operation fails, an error code is returned. |
**Example**
......@@ -1005,7 +1005,7 @@ Obtains key properties. This API uses an asynchronous callback to return the res
| -------- | ---------------------------------------------------- | ---- | ------------------------------------------------------------ |
| keyAlias | string | Yes | Key alias, which must be the same as the alias used when the key was generated. |
| options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty). |
| callback | AsyncCallback<[HuksReturnResult](#huksreturnresult)> | Yes | Callback invoked to return the result. If **errorCode** is **HUKS_SUCCESS**, the operation is successful. Otherwise, an error occurs.|
| callback | AsyncCallback<[HuksReturnResult](#huksreturnresult)> | Yes | Callback invoked to return the result. If the operation is successful, **errorCode** is **HUKS_SUCCESS**; otherwise, an error code is returned.|
**Example**
......@@ -1047,7 +1047,7 @@ Obtains key properties. This API uses a promise to return the result.
| Type | Description |
| ----------------------------------------------- | ------------------------------------------------------------ |
| Promise\<[HuksReturnResult](#huksreturnresult)> | Promise used to return the result. If **err** is not returned, the operation is successful. Otherwise, an error occurs. **properties** returns the parameters required for generating the key.|
| Promise\<[HuksReturnResult](#huksreturnresult)> | Promise used to return the result. If the operation is successful, no **err** value is returned and **properties** contains the parameters required for generating the key. If the operation fails, an error code is returned. |
**Example**
......@@ -1084,7 +1084,7 @@ Checks whether a key exists. This API uses an asynchronous callback to return th
| -------- | --------------------------- | ---- | --------------------------------------- |
| keyAlias | string | Yes | Alias of the key to check. |
| options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty). |
| callback | AsyncCallback\<boolean> | Yes | Callback invoked to return the result. The value **TRUE** means that the key exists, and **FALSE** means the opposite.|
| callback | AsyncCallback\<boolean> | Yes | Callback invoked to return the result. **TRUE** means that the key exists; **FALSE** means the opposite.|
**Example**
......@@ -1126,7 +1126,7 @@ Checks whether a key exists. This API uses a promise to return the result.
| Type | Description |
| ----------------- | --------------------------------------- |
| Promise\<boolean> | Promise used to return the result. The value **TRUE** means that the key exists, and **FALSE** means the opposite.|
| Promise\<boolean> | Promise used to return the result. **TRUE** means that the key exists; **FALSE** means the opposite.|
**Example**
......@@ -1315,7 +1315,7 @@ Aborts the use of the key. This API uses an asynchronous callback to return the
| -------- | --------------------------- | ---- | ------------------------------------------- |
| handle | number | Yes | Handle of the **Abort** operation. |
| options | [HuksOptions](#huksoptions) | Yes | Parameters of the **Abort** operation. |
| callback | AsyncCallback\<void> | Yes | Callback invoked to return the result.|
| callback | AsyncCallback\<void> | Yes | Callback that returns no value.|
**Example**
......@@ -1465,7 +1465,7 @@ Aborts the use of the key. This API uses a promise to return the result.
| Type | Description |
| ----------------------------------- | -------------------------------------------------- |
| Promise\<void> | Promise used to return the result.|
| Promise\<void> | Promise that returns no value.|
**Example**
......@@ -1993,7 +1993,7 @@ Generates a key. This API uses an asynchronous callback to return the result.
| -------- | ----------------------------------------- | ---- | ------------------------------------------------------------ |
| keyAlias | string | Yes | Alias of the key. |
| options | [HuksOptions](#huksoptions) | Yes | Tags required for generating the key. |
| callback | AsyncCallback\<[HuksResult](#huksresult)> | Yes | Callback invoked to return the result. If **HUKS_SUCCESS** is returned, the operation is successful. For details about other results, see HuksResult.|
| callback | AsyncCallback\<[HuksResult](#huksresult)> | Yes | Callback invoked to return the result. If the operation is successful, **HUKS_SUCCESS** is returned; otherwise, an error code defined in **HuksResult** is returned.|
**Example**
......@@ -2050,7 +2050,7 @@ Generates a key. This API uses a promise to return the result.
| Type | Description |
| ----------------------------------- | -------------------------------------------------- |
| Promise\<[HuksResult](#huksresult)> | Promise used to return the result. If **HUKS_SUCCESS** is returned, the operation is successful. Otherwise, an error occurs.|
| Promise\<[HuksResult](#huksresult)> | Promise used to return the result. If the operation is successful, **HUKS_SUCCESS** is returned; otherwise, an error code is returned.|
**Example**
......@@ -2099,7 +2099,7 @@ Deletes a key. This API uses an asynchronous callback to return the result.
| -------- | ----------------------------------------- | ---- | -------------------------------------------------- |
| keyAlias | string | Yes | Key alias passed in when the key was generated. |
| options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty). |
| callback | AsyncCallback\<[HuksResult](#huksresult)> | Yes | Callback invoked to return the result. If **HUKS_SUCCESS** is returned, the operation is successful. Otherwise, an error occurs.|
| callback | AsyncCallback\<[HuksResult](#huksresult)> | Yes | Callback invoked to return the result. If the operation is successful, **HUKS_SUCCESS** is returned; otherwise, an error code is returned.|
**Example**
......@@ -2133,7 +2133,7 @@ Deletes a key. This API uses a promise to return the result.
| Type | Description |
| ----------------------------------- | -------------------------------------------------- |
| Promise\<[HuksResult](#huksresult)> | Promise used to return the result. If **HUKS_SUCCESS** is returned, the operation is successful. Otherwise, an error occurs.|
| Promise\<[HuksResult](#huksresult)> | Promise used to return the result. If the operation is successful, **HUKS_SUCCESS** is returned; otherwise, an error code is returned.|
**Example**
......@@ -2163,7 +2163,7 @@ Imports a key in plaintext. This API uses an asynchronous callback to return the
| -------- | ------------------------ | ---- | ------------------------------------------------- |
| keyAlias | string | Yes | Alias of the key.|
| options | [HuksOptions](#huksoptions) | Yes | Tags required for the import and key to import.|
| callback | AsyncCallback\<[HuksResult](#huksresult)> | Yes | Callback invoked to return the result. If **HUKS_SUCCESS** is returned, the operation is successful. Otherwise, an error occurs.|
| callback | AsyncCallback\<[HuksResult](#huksresult)> | Yes | Callback invoked to return the result. If the operation is successful, **HUKS_SUCCESS** is returned; otherwise, an error code is returned.|
**Example**
......@@ -2228,7 +2228,7 @@ Imports a key in plaintext. This API uses a promise to return the result.
| Type | Description |
| ----------------------------------- | -------------------------------------------------- |
| Promise\<[HuksResult](#huksresult)> | Promise used to return the result. If **HUKS_SUCCESS** is returned, the operation is successful. Otherwise, an error occurs.|
| Promise\<[HuksResult](#huksresult)> | Promise used to return the result. If the operation is successful, **HUKS_SUCCESS** is returned; otherwise, an error code is returned.|
**Example**
......@@ -2291,7 +2291,7 @@ Exports a key. This API uses an asynchronous callback to return the result.
| -------- | ----------------------------------------- | ---- | ------------------------------------------------------------ |
| keyAlias | string | Yes | Key alias, which must be the same as the alias used when the key was generated. |
| options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty). |
| callback | AsyncCallback\<[HuksResult](#huksresult)> | Yes | Callback invoked to return the result. If **HUKS_SUCCESS** is returned, the operation is successful. Otherwise, an error occurs. **outData** contains the public key exported.|
| callback | AsyncCallback\<[HuksResult](#huksresult)> | Yes | Callback invoked to return the result. If the operation is successful, **HUKS_SUCCESS** is returned and **outData** contains the public key exported. If the operation fails, an error code is returned.|
**Example**
......@@ -2325,7 +2325,7 @@ Exports a key. This API uses a promise to return the result.
| Type | Description |
| ----------------------------------- | ------------------------------------------------------------ |
| Promise\<[HuksResult](#huksresult)> | Promise used to return the result. If **HUKS_SUCCESS** is returned, the operation is successful. Otherwise, an error occurs. **outData** contains the public key exported.|
| Promise\<[HuksResult](#huksresult)> | Promise used to return the result. If the operation is successful, **HUKS_SUCCESS** is returned and **outData** contains the public key exported. If the operation fails, an error code is returned. |
**Example**
......@@ -2355,7 +2355,7 @@ Obtains key properties. This API uses an asynchronous callback to return the res
| -------- | ----------------------------------------- | ---- | ------------------------------------------------------------ |
| keyAlias | string | Yes | Key alias, which must be the same as the alias used when the key was generated. |
| options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty). |
| callback | AsyncCallback\<[HuksResult](#huksresult)> | Yes | Callback invoked to return the result. If **errorCode** is **HUKS_SUCCESS**, the operation is successful. Otherwise, an error occurs.|
| callback | AsyncCallback\<[HuksResult](#huksresult)> | Yes | Callback invoked to return the result. If the operation is successful, **errorCode** is **HUKS_SUCCESS**; otherwise, an error code is returned.|
**Example**
......@@ -2389,7 +2389,7 @@ Obtains key properties. This API uses a promise to return the result.
| Type | Description |
| ------------------ | ------------------------------------------------------------ |
| Promise\<[HuksResult](#huksoptions)> | Promise used to return the result. If **HUKS_SUCCESS** is returned, the operation is successful. Otherwise, an error occurs. **properties** returns the parameters required for generating the key.|
| Promise\<[HuksResult](#huksoptions)> | Promise used to return the result. If the operation is successful, **errorCode** is **HUKS_SUCCESS** and **properties** contains the parameters required for generating the key. If the operation fails, an error code is returned. |
**Example**
......@@ -2419,7 +2419,7 @@ Checks whether a key exists. This API uses an asynchronous callback to return th
| -------- | ---------------------- | ---- | ------------------------------------- |
| keyAlias | string | Yes | Alias of the key to check.|
| options | [HuksOptions](#huksoptions) | Yes | Empty object (leave this parameter empty).|
| callback | AsyncCallback\<boolean> | Yes | Callback invoked to return the result. The value **TRUE** means that the key exists, and **FALSE** means the opposite.|
| callback | AsyncCallback\<boolean> | Yes | Callback invoked to return the result. **TRUE** means that the key exists; **FALSE** means the opposite.|
**Example**
......@@ -2453,7 +2453,7 @@ Checks whether a key exists. This API uses a promise to return the result.
| Type | Description |
| ----------------- | --------------------------------------- |
| Promise\<boolean> | Promise used to return the result. The value **TRUE** means that the key exists, and **FALSE** means the opposite.|
| Promise\<boolean> | Promise used to return the result. **TRUE** means that the key exists; **FALSE** means the opposite.|
**Example**
......
# RDB Error Codes
## 14800010 Invalid RDB Name
**Error Message**
Invalid database name.
**Description**
The RDB store name is invalid.
**Possible Causes**
The RDB store name is empty or exceeds 1024 bytes.
**Solution**
Check that the RDB store name is not empty and does not exceed 1024 bytes.
## 14800011 Database File Corrupted
**Error Message**
Database corrupted.
**Description**
The RDB store is corrupted when an API for adding, deleting, querying, or synchronizing data is invoked.
**Possible Causes**
The RDB store file has been corrupted.
**Solution**
1. Restore the RDB store using the backup file.
2. If no RDB backup file is available, delete the RDB store and create it again.
## 14800012 Empty Result Set or Invalid Position
**Error Message**
The result set is empty or the specified location is invalid.
**Description**
The result set is empty or the specified location is invalid.
**Possible Causes**
The result set is empty, or the specified row number in the result set is out of range [0, m - 1]. **m** is **resultsetV9.rowCount**.
**Solution**
Check whether the result set is empty or whether the specified row number is out of range.
## 14800013 Null Column Value or Column Data Type Incompatible With the API Called
**Error Message**
The column value is null or the column type is incompatible.
**Description**
The column value is null, or the column data type is incompatible with the API called.
**Possible Causes**
1. The result set is empty.
2. The current row number in the result set is out of range [0, m - 1]. **m** is **resultsetV9.rowCount**.
3. The column number is out of the range [0, n - 1]. **n** is **resultsetV9.columnCount**.
4. The API called does not support the type of the column data.
**Solution**
1. Check whether the result set is empty.
2. Check whether the row number and column number of the result set are out of range.
3. Check whether the column data type is supported.
# Preferences Error Codes
## 15500010 Failed to Delete Preferences
**Error Message**
Failed to delete preferences.
**Description**
Failed to delete the preference.
**Possible Causes**
The possible causes are as follows:
1. The file name is incorrect.
2. The file path is incorrect.
**Solution**
1. Check that the file name is correct.
2. Check that the file path is correct.
# Kernel
- Kernel
- Mini-System Kernel
- [Kernel Overview](kernel-overview.md)
- Mini-System Kernel (LiteOS-M)
- [LiteOS-M Overview](kernel-mini-overview.md)
- Basic Kernel
- Base Kernel
- [Interrupt Management](kernel-mini-basic-interrupt.md)
- [Task Management](kernel-mini-basic-task.md)
- [Memory Management](kernel-mini-basic-memory.md)
......@@ -16,6 +15,7 @@
- [Semaphore](kernel-mini-basic-ipc-sem.md)
- [Time Management](kernel-basic-mini-time.md)
- [Software Timer](kernel-mini-basic-soft.md)
- [Doubly Linked List](kernel-mini-basic-list.md)
- Extended Components
- [C++ Support](kernel-mini-extend-support.md)
- [CPUP](kernel-mini-extend-cpup.md)
......@@ -28,7 +28,6 @@
- [LMS](kernel-mini-memory-lms.md)
- Appendix
- [Kernel Coding Specification](kernel-mini-appx-code.md)
- [Doubly Linked List](kernel-mini-appx-data-list.md)
- [Standard Libraries](kernel-mini-appx-lib.md)
- Small-System Kernel (LiteOS-A)
- [Kernel Overview](kernel-small-overview.md)
......@@ -158,6 +157,7 @@
- [Compiling and Building the Linux Kernel](kernel-standard-build.md)
- Enhanced Kernel Features
- [Enhanced Swap](kernel-standard-mm-eswap.md)
- [NewIP Kernel Protocol Stack](kernel-standard-newip.md)
- Task Scheduling
- [Related Thread Group](kernel-standard-sched-rtg.md)
- [Lightweight CPU Isolation](kernel-standard-sched-cpuisolation.md)
\ No newline at end of file
此差异已折叠。
......@@ -44,6 +44,7 @@
- [设备使用信息统计](device-usage-statistics/Readme-CN.md)
- [DFX](dfx/Readme-CN.md)
- [国际化](internationalization/Readme-CN.md)
- [应用测试](application-test/Readme-CN.md)
- [一次开发,多端部署](key-features/multi-device-app-dev/Readme-CN.md)
- [IDL工具规格及使用说明书](IDL/idl-guidelines.md)
- [Native API的相关指导](napi/Readme-CN.md)
......@@ -65,4 +66,3 @@
- [常见问题](faqs/Readme-CN.md)
- 贡献
- [参与贡献](../contribute/贡献文档.md)
......@@ -37,6 +37,7 @@
- [设备使用信息统计](device-usage-statistics/Readme-CN.md)
- [DFX](dfx/Readme-CN.md)
- [国际化](internationalization/Readme-CN.md)
- [应用测试](application-test/Readme-CN.md)
- [IDL工具规格及使用说明书](IDL/idl-guidelines.md)
- [Native API的相关指导](napi/Readme-CN.md)
......
......@@ -37,6 +37,7 @@
- [设备使用信息统计](device-usage-statistics/device-usage-statistics-overview.md)
- [DFX](dfx/hiappevent-overview.md)
- [国际化](internationalization/international-overview.md)
- [应用测试](application-test/Readme-CN.md)
- [IDL工具规格及使用说明书](IDL/idl-guidelines.md)
- [Native API的相关指导](napi/napi-guidelines.md)
......
......@@ -13,7 +13,7 @@
- 振动
- [振动开发概述](vibrator-overview.md)
- [振动开发指导](vibrator-guidelines.md)
- 设备管理
- 多模输入
- [输入设备开发指导](inputdevice-guidelines.md)
- [鼠标光标开发指导](pointerstyle-guidelines.md)
- 升级服务
......
......@@ -16,10 +16,10 @@ import inputDevice from '@ohos.multimodalInput.inputDevice';
| 实例名 | 接口名 | 说明 |
| ----------- | ------------------------------------------------------------ | -------------------------- |
| inputDevice | **function** getDeviceList(callback: AsyncCallback<Array<**number**>>): **void**; | 获取输入设备列表。 |
| inputDevice | **function** getKeyboardType(deviceId: **number**, callback: AsyncCallback<KeyboardType>): **void**; | 获取输入设备的键盘类型。 |
| inputDevice | **function** on(**type**: "change", listener: Callback<DeviceListener>): **void**; | 监听输入设备的热插拔事件。 |
| inputDevice | **function** off(**type**: "change", listener?: Callback<DeviceListener>): **void**; | 取消监听输入设备的热插拔事件。 |
| inputDevice | function getDeviceList(callback: AsyncCallback\<Array\<number>>): void; | 获取输入设备列表。 |
| inputDevice | function getKeyboardType(deviceId: number, callback: AsyncCallback\<KeyboardType>): void; | 获取输入设备的键盘类型。 |
| inputDevice | function on(type: "change", listener: Callback\<DeviceListener>): void; | 监听输入设备的热插拔事件。 |
| inputDevice | function off(type: "change", listener?: Callback\<DeviceListener>): void; | 取消监听输入设备的热插拔事件。 |
## 虚拟键盘弹出检测
......
......@@ -16,10 +16,10 @@ import inputDevice from '@ohos.multimodalInput.pointer';
| 实例名 | 接口名 | 说明 |
| ------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| pointer | **function** isPointerVisible(callback: AsyncCallback<boolean>): **void**; | 获取鼠标指针显示或隐藏状态。 |
| pointer | **function** setPointerVisible(visible: boolean, callback: AsyncCallback<**void**>): **void**; | 设置鼠标指针显示或隐藏状态,改接口会影响全局鼠标光标的显示状态。 |
| pointer | **function** setPointerStyle(windowId: **number**, pointerStyle: PointerStyle, callback: AsyncCallback<**void**>): **void**; | 设置鼠标光标样式,改接口会影响指定窗口鼠标光标样式。 |
| pointer | **function** getPointerStyle(windowId: **number**, callback: AsyncCallback<PointerStyle>): **void**; | 查询鼠标光标样式。 |
| pointer | function isPointerVisible(callback: AsyncCallback\<boolean>): void; | 获取鼠标指针显示或隐藏状态。 |
| pointer | function setPointerVisible(visible: boolean, callback: AsyncCallback\<void>): void; | 设置鼠标指针显示或隐藏状态,改接口会影响全局鼠标光标的显示状态。 |
| pointer | function setPointerStyle(windowId: number, pointerStyle: PointerStyle, callback: AsyncCallback\<void>): void; | 设置鼠标光标样式,改接口会影响指定窗口鼠标光标样式。 |
| pointer | function getPointerStyle(windowId: number, callback: AsyncCallback\<PointerStyle>): void; | 查询鼠标光标样式。 |
## 设置鼠标光标隐藏
......
......@@ -21,7 +21,7 @@ display.getDefaultDisplay((err, data) => {
});
```
## 如何获取当前运行设备类型(穿戴、平板等)
## 如何获取当前运行设备类型
适用于:OpenHarmony SDK 3.2.2.5版本,API9 Stage模型
......
......@@ -14,14 +14,14 @@
| 接口名 | 描述 |
|----------------------------------------------------------------------------------|-------------|
| createAVSession(context: Context, tag: string, type: AVSessionType, callback: AsyncCallback<AVSession\>): void | 创建会话 |
| setAVMetadata(data: AVMetadata, callback: AsyncCallback<void\>): void | 设置会话元数据 |
| setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback<void\>): void | 设置会话播放状态信息 |
| setLaunchAbility(ability: WantAgent, callback: AsyncCallback<void\>): void | 设置启动ability |
| getController(callback: AsyncCallback<AVSessionController\>): void | 获取当前会话自身控制器 |
| getOutputDevice(callback: AsyncCallback<OutputDeviceInfo\>): void | 获取音频输出设备信息 |
| activate(callback: AsyncCallback<void\>): void | 激活会话 |
| destroy(callback: AsyncCallback<void\>): void | 销毁会话 |
| createAVSession(context: Context, tag: string, type: AVSessionType, callback: AsyncCallback\<AVSession>): void | 创建会话 |
| setAVMetadata(data: AVMetadata, callback: AsyncCallback\<void>): void | 设置会话元数据 |
| setAVPlaybackState(state: AVPlaybackState, callback: AsyncCallback\<void>): void | 设置会话播放状态信息 |
| setLaunchAbility(ability: WantAgent, callback: AsyncCallback\<void>): void | 设置启动ability |
| getController(callback: AsyncCallback\<AVSessionController>): void | 获取当前会话自身控制器 |
| getOutputDevice(callback: AsyncCallback\<OutputDeviceInfo>): void | 获取音频输出设备信息 |
| activate(callback: AsyncCallback\<void>): void | 激活会话 |
| destroy(callback: AsyncCallback\<void>): void | 销毁会话 |
### 开发步骤
1.导入模块接口
......@@ -354,14 +354,14 @@ currentSession.deactivate().then(() => {
| 接口名 | 描述 |
| ------------------------------------------------------------------------------------------------ | ----------------- |
| getAllSessionDescriptors(callback: AsyncCallback<Array<Readonly<AVSessionDescriptor>>>): void | 获取所有会话的描述符 |
| createController(sessionId: string, callback: AsyncCallback<AVSessionController>): void | 创建控制器 |
| sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback<void\>): void | 发送按键命令 |
| getLaunchAbility(callback: AsyncCallback<WantAgent\>): void | 拉起应用 |
| sendControlCommand(command: AVControlCommand, callback: AsyncCallback<void\>): void | 发送控制命令 |
| sendSystemAVKeyEvent(event: KeyEvent, callback: AsyncCallback<void>): void | 发送系统按键命令 |
| sendSystemControlCommand(command: AVControlCommand, callback: AsyncCallback<void>): void | 发送系统控制命令 |
| castAudio(session: SessionToken | 'all', audioDevices: Array<audio.AudioDeviceDescriptor>, callback: AsyncCallback<void>): void | 远端投播 |
| getAllSessionDescriptors(callback: AsyncCallback\<Array\<Readonly\<AVSessionDescriptor>>>): void | 获取所有会话的描述符 |
| createController(sessionId: string, callback: AsyncCallback\<AVSessionController>): void | 创建控制器 |
| sendAVKeyEvent(event: KeyEvent, callback: AsyncCallback\<void>): void | 发送按键命令 |
| getLaunchAbility(callback: AsyncCallback\<WantAgent>): void | 拉起应用 |
| sendControlCommand(command: AVControlCommand, callback: AsyncCallback\<void>): void | 发送控制命令 |
| sendSystemAVKeyEvent(event: KeyEvent, callback: AsyncCallback\<void>): void | 发送系统按键命令 |
| sendSystemControlCommand(command: AVControlCommand, callback: AsyncCallback\<void>): void | 发送系统控制命令 |
| castAudio(session: SessionToken | 'all', audioDevices: Array\<audio.AudioDeviceDescriptor>, callback: AsyncCallback\<void>): void | 远端投播 |
### 开发步骤
1.导入模块接口
......
......@@ -21,23 +21,27 @@ let opts = { alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: {
// 创建pixelmap对象
const color = new ArrayBuffer(96);
let opts = { alphaType: 0, editable: true, pixelFormat: 4, scaleMode: 1, size: { height: 2, width: 3 } }
image.createPixelMap(color, opts, pixelmap => {
image.createPixelMap(color, opts, (err, pixelmap) => {
console.log('Succeeded in creating pixelmap.');
})
// 用于读像素
pixelmap.readPixels(area,(data) => {
if(data !== null) {
var bufferArr = new Uint8Array(area.pixels);
var res = true;
for (var i = 0; i < bufferArr.length; i++) {
console.info(' buffer ' + bufferArr[i]);
if(res) {
if(bufferArr[i] == 0) {
res = false;
console.log('readPixels end.');
break;
}
const area = {
pixels: new ArrayBuffer(8),
offset: 0,
stride: 8,
region: { size: { height: 1, width: 2 }, x: 0, y: 0 }
}
pixelmap.readPixels(area,() => {
var bufferArr = new Uint8Array(area.pixels);
var res = true;
for (var i = 0; i < bufferArr.length; i++) {
console.info(' buffer ' + bufferArr[i]);
if(res) {
if(bufferArr[i] == 0) {
res = false;
console.log('readPixels end.');
break;
}
}
}
......@@ -128,7 +132,7 @@ imageSourceApi.release(() => {
const imagePackerApi = image.createImagePacker();
const imageSourceApi = image.createImageSource(0);
let packOpts = { format:"image/jpeg", quality:98 };
imagePackerApi.packing(imageSourceApi, packOpts, data => {
imagePackerApi.packing(imageSourceApi, packOpts, (err, data) => {
console.log('Succeeded in packing');
})
......@@ -156,7 +160,7 @@ let decodingOptions = {
};
// 用于回调方式创建pixelmap
imageSourceApi.createPixelMap(decodingOptions, pixelmap => {
imageSourceApi.createPixelMap(decodingOptions, (err, pixelmap) => {
console.log('Succeeded in creating pixelmap.');
})
......
......@@ -5,8 +5,8 @@
- [使用ArkTS语言开发(FA模型)](start-with-ets-fa.md)
- [使用JS语言开发(FA模型)](start-with-js-fa.md)
- 开发基础知识
- [应用包结构说明(FA模型)](package-structure.md)
- [应用包结构说明(Stage模型)](stage-structure.md)
- [应用包结构配置文件的说明(FA模型)](package-structure.md)
- [应用包结构配置文件的说明(Stage模型)](stage-structure.md)
- [SysCap说明](syscap.md)
- [资源分类与访问](resource-categories-and-access.md)
- 学习ArkTS语言
......
# 应用包结构配置文件的说明
# 应用包结构配置文件的说明(FA模型)
在FA模型的应用开发的工程中,需要在config.json配置文件中对应用的包结构进行声明。
......
# 应用包结构配置文件的说明
# 应用包结构配置文件的说明(Stage模型)
在开发stage模型的应用程序时,需要在app.json5和module.json5配置文件中对应用的包结构进行声明。
......
# 开发参考
- [Syscap列表](syscap-list.md)
- [组件参考(基于ArkTS的声明式开发范式)](arkui-ts/Readme-CN.md)
- [组件参考(兼容JS的类Web开发范式)](arkui-js/Readme-CN.md)
- [JS服务卡片UI组件参考](js-service-widget-ui/Readme-CN.md)
- [接口参考(JS及TS API)](apis/Readme-CN.md)
- [错误码参考](errorcodes/Readme-CN.md)
- 接口参考(Native API)
- [OpenHarmony Native API](native-apis/Readme-CN.md)
- [Native API标准库](native-lib/Readme-CN.md)
......@@ -36,6 +36,7 @@
- [@ohos.ability.dataUriUtils (DataUriUtils模块)](js-apis-DataUriUtils.md)
- [@ohos.ability.errorCode (ErrorCode)](js-apis-ability-errorCode.md)
- [@ohos.ability.wantConstant (wantConstant)](js-apis-ability-wantConstant.md)
- [@ohos.app.ability.appRecovery (appRecovery)](js-apis-app-ability-appRecovery.md)
- [@ohos.application.abilityDelegatorRegistry (AbilityDelegatorRegistry)](js-apis-abilityDelegatorRegistry.md)
- [@ohos.application.abilityManager (AbilityManager)](js-apis-application-abilityManager.md)
- [@ohos.application.appManager (appManager)](js-apis-appmanager.md)
......@@ -231,7 +232,6 @@
- [@ohos.batteryStatistics (耗电统计)](js-apis-batteryStatistics.md)
- [@ohos.brightness (屏幕亮度)](js-apis-brightness.md)
- [@ohos.deviceInfo (设备信息)](js-apis-device-info.md)
- [@ohos.devicestatus (设备状态感知框架)](js-apis-stationary.md)
- [@ohos.distributedHardware.deviceManager (设备管理)](js-apis-device-manager.md)
- [@ohos.geoLocationManager (位置服务)](js-apis-geoLocationManager.md)
- [@ohos.multimodalInput.inputConsumer (组合按键)](js-apis-inputconsumer.md)
......@@ -249,6 +249,7 @@
- [@ohos.runningLock (Runninglock锁)](js-apis-runninglock.md)
- [@ohos.sensor (传感器)](js-apis-sensor.md)
- [@ohos.settings (设置数据项名称)](js-apis-settings.md)
- [@ohos.stationary (设备状态感知框架)](js-apis-stationary.md)
- [@ohos.systemCapability (系统能力)](js-apis-system-capability.md)
- [@ohos.systemParameterV9 (系统属性)](js-apis-system-parameterV9.md)
- [@ohos.thermal (热管理)](js-apis-thermal.md)
......
......@@ -45,7 +45,7 @@ setDisposedStatus(appId: string, disposedWant: Want): Promise\<void>
| 错误码ID | 错误信息 |
| ------ | -------------------------------------- |
| 17700005 | The specified appId was not found. |
| 17700005 | The specified app ID is not found. |
**示例:**
......@@ -91,7 +91,7 @@ setDisposedStatus(appId: string, disposedWant: Want, callback: AsyncCallback\<vo
| 错误码ID | 错误信息 |
| ------ | -------------------------------------- |
| 17700005 | The specified appId was not found. |
| 17700005 | The specified app ID is not found. |
**示例:**
......@@ -142,7 +142,7 @@ getDisposedStatus(appId: string): Promise\<Want>;
| 错误码ID | 错误信息 |
| ------ | -------------------------------------- |
| 17700005 | The specified appId was not found. |
| 17700005 | The specified app ID is not found. |
**示例:**
......@@ -186,7 +186,7 @@ getDisposedStatus(appId: string, callback: AsyncCallback\<Want>): void;
| 错误码ID | 错误信息 |
| ------ | -------------------------------------- |
| 17700005 | The specified appId was not found. |
| 17700005 | The specified app ID is not found. |
**示例:**
......@@ -236,7 +236,7 @@ deleteDisposedStatus(appId: string): Promise\<void>
| 错误码ID | 错误信息 |
| ------ | -------------------------------------- |
| 17700005 | The specified appId was not found. |
| 17700005 | The specified app ID is not found. |
**示例:**
......@@ -280,7 +280,7 @@ deleteDisposedStatus(appId: string, callback: AsyncCallback\<void>) : void
| 错误码ID | 错误信息 |
| ------ | -------------------------------------- |
| 17700005 | The specified appId was not found. |
| 17700005 | The specified app ID is not found. |
**示例:**
......
......@@ -51,11 +51,6 @@ ArrayList的构造函数。
```ts
let arrayList = new ArrayList();
try {
let arrayList2 = ArrayList();
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
......@@ -89,21 +84,16 @@ add(element: T): boolean
**示例:**
```ts
let arrayList = new ArrayList();
let result = arrayList.add("a");
let result1 = arrayList.add(1);
let b = [1, 2, 3];
let result2 = arrayList.add(b);
let c = {name: "Dylon", age: "13"};
let result3 = arrayList.add(c);
let result4 = arrayList.add(false);
try {
arrayList.add.bind({}, "b")(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
```ts
let arrayList = new ArrayList();
let result = arrayList.add("a");
let result1 = arrayList.add(1);
let b = [1, 2, 3];
let result2 = arrayList.add(b);
let c = {name: "Dylon", age: "13"};
let result3 = arrayList.add(c);
let result4 = arrayList.add(false);
```
### insert
......@@ -136,21 +126,6 @@ let arrayList = new ArrayList();
arrayList.insert("A", 0);
arrayList.insert(0, 1);
arrayList.insert(true, 2);
try {
arrayList.insert.bind({}, 1, 2)(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
try {
let res = arrayList.insert(8, 11); // 测试越界异常
} catch (err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
try {
let res = arrayList.insert("a", "b"); // 测试类型异常
} catch (err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### has
......@@ -188,11 +163,6 @@ let arrayList = new ArrayList();
let result = arrayList.has("squirrel");
arrayList.add("squirrel");
let result1 = arrayList.has("squirrel");
try {
arrayList.has.bind({}, "squirrel")(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### getIndexOf
......@@ -235,11 +205,6 @@ arrayList.add(1);
arrayList.add(2);
arrayList.add(4);
let result = arrayList.getIndexOf(2);
try {
arrayList.getIndexOf.bind({}, 2)(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### getLastIndexOf
......@@ -282,11 +247,6 @@ arrayList.add(1);
arrayList.add(2);
arrayList.add(4);
let result = arrayList.getLastIndexOf(2);
try {
arrayList.getLastIndexOf.bind({}, 2)(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### removeByIndex
......@@ -328,21 +288,6 @@ arrayList.add(5);
arrayList.add(2);
arrayList.add(4);
let result = arrayList.removeByIndex(2);
try {
arrayList.removeByIndex.bind({}, 2)(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
try {
arrayList.removeByIndex("a"); // 测试类型异常
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
try {
arrayList.removeByIndex(8); // 测试越界异常
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### remove
......@@ -382,11 +327,6 @@ arrayList.add(4);
arrayList.add(5);
arrayList.add(4);
let result = arrayList.remove(2);
try {
arrayList.remove.bind({}, 2)(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### removeByRange
......@@ -422,16 +362,6 @@ arrayList.add(4);
arrayList.add(5);
arrayList.add(4);
arrayList.removeByRange(2, 4);
try {
arrayList.removeByRange.bind({}, 2, 4)(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
try {
arrayList.removeByRange(8, 4); // 测试越界异常
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### replaceAllElements
......@@ -480,13 +410,6 @@ arrayList.replaceAllElements((value: number, index: number)=> {
arrayList.replaceAllElements((value: number, index: number) => {
return value = value - 2;
});
try {
arrayList.replaceAllElements.bind({}, (value: number, index: number)=> {
return value = 2 * value;
})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### forEach
......@@ -532,13 +455,6 @@ arrayList.add(4);
arrayList.forEach((value, index) => {
console.log(`value:${value}`, index);
});
try {
arrayList.forEach.bind({}, (value, index) => {
console.log(`value:${value}`, index);
})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### sort
......@@ -581,11 +497,6 @@ arrayList.add(4);
arrayList.sort((a: number, b: number) => a - b);
arrayList.sort((a: number, b: number) => b - a);
arrayList.sort();
try {
arrayList.sort.bind({})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### subArrayList
......@@ -629,16 +540,6 @@ arrayList.add(4);
let result1 = arrayList.subArrayList(2, 4);
let result2 = arrayList.subArrayList(4, 3);
let result3 = arrayList.subArrayList(2, 6);
try {
arrayList.subArrayList.bind({}, 2, 4)(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
try {
arrayList.subArrayList(6, 4);
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### clear
......@@ -666,11 +567,6 @@ arrayList.add(4);
arrayList.add(5);
arrayList.add(4);
arrayList.clear();
try {
arrayList.clear.bind({})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### clone
......@@ -705,11 +601,6 @@ arrayList.add(4);
arrayList.add(5);
arrayList.add(4);
let result = arrayList.clone();
try {
arrayList.clone.bind({})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### getCapacity
......@@ -743,11 +634,6 @@ arrayList.add(4);
arrayList.add(5);
arrayList.add(4);
let result = arrayList.getCapacity();
try {
arrayList.getCapacity.bind({})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### convertToArray
......@@ -781,11 +667,6 @@ arrayList.add(4);
arrayList.add(5);
arrayList.add(4);
let result = arrayList.convertToArray();
try {
arrayList.convertToArray.bind({})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### isEmpty
......@@ -819,11 +700,6 @@ arrayList.add(4);
arrayList.add(5);
arrayList.add(4);
let result = arrayList.isEmpty();
try {
arrayList.isEmpty.bind({})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### increaseCapacityTo
......@@ -858,11 +734,6 @@ arrayList.add(5);
arrayList.add(4);
arrayList.increaseCapacityTo(2);
arrayList.increaseCapacityTo(8);
try {
arrayList.increaseCapacityTo.bind({}, 5)(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### trimToCurrentLength
......@@ -890,11 +761,6 @@ arrayList.add(4);
arrayList.add(5);
arrayList.add(4);
arrayList.trimToCurrentLength();
try {
arrayList.trimToCurrentLength.bind({})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### [Symbol.iterator]
......@@ -940,9 +806,4 @@ while(temp != undefined) {
console.log(`value:${temp}`);
temp = iter.next().value;
}
try {
arrayList[Symbol.iterator].bind({})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
\ No newline at end of file
......@@ -2256,7 +2256,7 @@ console.info('######### CapturerChange Off is called #########');
isActive(volumeType: AudioVolumeType, callback: AsyncCallback&lt;boolean&gt;): void
获取指定音流是否为活跃状态,使用callback方式异步返回结果。
获取指定音流是否为活跃状态,使用callback方式异步返回结果。
**系统能力:** SystemCapability.Multimedia.Audio.Renderer
......@@ -2264,7 +2264,7 @@ isActive(volumeType: AudioVolumeType, callback: AsyncCallback&lt;boolean&gt;): v
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ----------------------------------- | ---- | ------------------------------------------------- |
| volumeType | [AudioVolumeType](#audiovolumetype) | 是 | 音流类型。 |
| volumeType | [AudioVolumeType](#audiovolumetype) | 是 | 音流类型。 |
| callback | AsyncCallback&lt;boolean&gt; | 是 | 回调返回流的活跃状态,true为活跃,false为不活跃。 |
**示例:**
......@@ -2283,7 +2283,7 @@ audioStreamManager.isActive(audio.AudioVolumeType.MEDIA, (err, value) => {
isActive(volumeType: AudioVolumeType): Promise&lt;boolean&gt;
获取指定音流是否为活跃状态,使用Promise方式异步返回结果。
获取指定音流是否为活跃状态,使用Promise方式异步返回结果。
**系统能力:** SystemCapability.Multimedia.Audio.Renderer
......@@ -2291,7 +2291,7 @@ isActive(volumeType: AudioVolumeType): Promise&lt;boolean&gt;
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ----------------------------------- | ---- | ------------ |
| volumeType | [AudioVolumeType](#audiovolumetype) | 是 | 音流类型。 |
| volumeType | [AudioVolumeType](#audiovolumetype) | 是 | 音流类型。 |
**返回值:**
......
......@@ -41,4 +41,4 @@ Ability信息,未做特殊说明的属性,均通过GET_BUNDLE_DEFAULT获取
| labelId | number | 是 | 否 | Ability的标签id。 |
| subType | AbilitySubType | 是 | 否 | Ability中枚举使用的模板的子类型。<br />此属性仅可在FA模型下使用。 |
| metadata<sup>8+</sup> | Array\<[CustomizeData](js-apis-bundle-CustomizeData.md)> | 是 | 否 | ability的元信息。<br />通过传入GET_ABILITY_INFO_WITH_METADATA获取。 |
| enabled<sup>8+</sup> | boolean | 是 | 否 | ability是否可用。 |
\ No newline at end of file
| enabled<sup>8+</sup> | boolean | 是 | 否 | ability是否可用。 |
......@@ -13,26 +13,26 @@
| 名称 | 类型 | 可读 | 可写 | 说明 |
| -------------------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------------------------------------ |
| name | string | 是 | 否 | 应用程序的名称。 |
| description | string | 是 | 否 | 应用程序的描述。 |
| descriptionId | number | 是 | 否 | 应用程序的描述id。 |
| systemApp | boolean | 是 | 否 | 判断是否为系统应用程序,默认为false。 |
| enabled | boolean | 是 | 否 | 判断应用程序是否可以使用,默认为true。 |
| label | string | 是 | 否 | 应用程序显示的标签。 |
| labelId<sup>(deprecated)</sup> | string | 是 | 否 | 应用程序的标签id。<br />\- **说明:** 从API version 9开始废弃,使用labelIndex。 |
| icon | string | 是 | 否 | 应用程序的图标。 |
| iconId<sup>(deprecated)</sup> | string | 是 | 否 | 应用程序的图标id。<br />\- **说明:** 从API version 9开始废弃,使用iconIndex。 |
| process | string | 是 | 否 | 应用程序的进程,如果不设置,默认为包的名称。 |
| supportedModes | number | 是 | 否 | 标识应用支持的运行模式,当前只定义了驾驶模式(drive)。该标签只适用于车机。 |
| moduleSourceDirs | Array\<string> | 是 | 否 | 应用程序的资源存放的相对路径。 |
| permissions | Array\<string> | 是 | 否 | 访问应用程序所需的权限。<br />通过传入GET_APPLICATION_INFO_WITH_PERMISSION获取 |
| moduleInfos | Array\<[ModuleInfo](js-apis-bundle-ModuleInfo.md)> | 是 | 否 | 应用程序的模块信息。 |
| entryDir | string | 是 | 否 | 应用程序的文件保存路径。 |
| codePath<sup>8+</sup> | string | 是 | 否 | 应用程序的安装目录。 |
| metaData<sup>8+</sup> | Map\<string, Array\<[CustomizeData](js-apis-bundle-CustomizeData.md)>> | 是 | 否 | 应用程序的自定义元信息。<br />通过传入GET_APPLICATION_INFO_WITH_METADATA获取 |
| removable<sup>8+</sup> | boolean | 是 | 否 | 应用程序是否可以被移除。 |
| accessTokenId<sup>8+</sup> | number | 是 | 否 | 应用程序的accessTokenId。 |
| uid<sup>8+</sup> | number | 是 | 否 | 应用程序的uid。 |
| entityType<sup>8+</sup> | string | 是 | 否 | 该标签标记该应用的类别,具体有 :游戏类(game),影音类(media)、社交通信类(communication)、新闻类(news)、出行类(travel)、工具类(utility)、购物类(shopping)、教育类(education)、少儿类(kids)、商务类(business)、拍摄类(photography)。 |
\ No newline at end of file
| 名称 | 类型 | 可读 | 可写 | 说明 |
|----------------------------|------------------------------------------------------------------------|-----|-----|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| name | string | 是 | 否 | 应用程序的名称。 |
| description | string | 是 | 否 | 应用程序的描述。 |
| descriptionId | number | 是 | 否 | 应用程序的描述id。 |
| systemApp | boolean | 是 | 否 | 判断是否为系统应用程序,默认为false。 |
| enabled | boolean | 是 | 否 | 判断应用程序是否可以使用,默认为true。 |
| label | string | 是 | 否 | 应用程序显示的标签。 |
| labelId | string | 是 | 否 | 应用程序的标签id。 |
| icon | string | 是 | 否 | 应用程序的图标。 |
| iconId | string | 是 | 否 | 应用程序的图标id。 |
| process | string | 是 | 否 | 应用程序的进程,如果不设置,默认为包的名称。 |
| supportedModes | number | 是 | 否 | 标识应用支持的运行模式,当前只定义了驾驶模式(drive)。该标签只适用于车机。 |
| moduleSourceDirs | Array\<string> | 是 | 否 | 应用程序的资源存放的相对路径。 |
| permissions | Array\<string> | 是 | 否 | 访问应用程序所需的权限。<br />通过传入GET_APPLICATION_INFO_WITH_PERMISSION获取 |
| moduleInfos | Array\<[ModuleInfo](js-apis-bundle-ModuleInfo.md)> | 是 | 否 | 应用程序的模块信息。 |
| entryDir | string | 是 | 否 | 应用程序的文件保存路径。 |
| codePath<sup>8+</sup> | string | 是 | 否 | 应用程序的安装目录。 |
| metaData<sup>8+</sup> | Map\<string, Array\<[CustomizeData](js-apis-bundle-CustomizeData.md)>> | 是 | 否 | 应用程序的自定义元信息。<br />通过传入GET_APPLICATION_INFO_WITH_METADATA获取 |
| removable<sup>8+</sup> | boolean | 是 | 否 | 应用程序是否可以被移除。 |
| accessTokenId<sup>8+</sup> | number | 是 | 否 | 应用程序的accessTokenId。 |
| uid<sup>8+</sup> | number | 是 | 否 | 应用程序的uid。 |
| entityType<sup>8+</sup> | string | 是 | 否 | 该标签标记该应用的类别,具体有 :游戏类(game),影音类(media)、社交通信类(communication)、新闻类(news)、出行类(travel)、工具类(utility)、购物类(shopping)、教育类(education)、少儿类(kids)、商务类(business)、拍摄类(photography)。 |
\ No newline at end of file
# ShortcutInfo<sup>(deprecated)<sup>
> 从API version 9开始不再维护,建议使用[ShortcutInfo](js-apis-bundleManager-shortcutInfo.md)替代
> **说明:**
>
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 本模块首批接口从API version 7 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
......
......@@ -1555,7 +1555,7 @@ cleanBundleCacheFiles(bundleName: string): Promise\<void>;
| 错误码ID | 错误信息 |
| -------- | ---------------------------------------------------------- |
| 17700001 | The specified bundleName is not found. |
| 17700030 | The specified bundle does not support cleaning cache files. |
| 17700030 | The specified bundle does not support clearing of cache files. |
**示例:**
......@@ -2033,7 +2033,7 @@ getLaunchWantForBundle(bundleName: string, userId: number, callback: AsyncCallba
| 错误码ID | 错误信息 |
| -------- | --------------------------------------|
| 17700001 | The specified bundleName is not found. |
| 17700004 | The specified user ID is not found |
| 17700004 | The specified user ID is not found. |
| 17700026 | The specified bundle is disabled. |
**示例:**
......@@ -2082,7 +2082,7 @@ getLaunchWantForBundle(bundleName: string, callback: AsyncCallback\<Want>): void
| 错误码ID | 错误信息 |
| -------- | --------------------------------------|
| 17700001 | The specified bundleName is not found. |
| 17700004 | The specified user ID is not found |
| 17700004 | The specified user ID is not found. |
| 17700026 | The specified bundle is disabled. |
**示例:**
......@@ -2299,7 +2299,7 @@ getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, m
| 错误码ID | 错误信息 |
| -------- | ------------------------------------------------------------ |
| 17700002 | The specified moduleName is not existed. |
| 17700003 | The specified extensionAbilityName is not existed. |
| 17700003 | The specified extensionAbilityName not existed. |
| 17700024 | Failed to get the profile because there is no profile in the HAP. |
| 17700026 | The specified bundle is disabled. |
......@@ -2353,7 +2353,7 @@ getProfileByExtensionAbility(moduleName: string, extensionAbilityName: string, m
| 错误码ID | 错误信息 |
| -------- | ------------------------------------------------------------ |
| 17700002 | The specified moduleName is not existed. |
| 17700003 | The specified extensionAbilityName is not existed. |
| 17700003 | The specified extensionAbilityName not existed. |
| 17700024 | Failed to get the profile because there is no profile in the HAP. |
| 17700026 | The specified bundle is disabled. |
......@@ -2734,7 +2734,7 @@ getApplicationInfoSync(bundleName: string, applicationFlags: number, userId: num
| 错误码ID | 错误信息 |
| -------- | -------------------------------------- |
| 17700001 | The specified bundleName is not found. |
| 17700004 | The specified userId is not found. |
| 17700004 | The specified user ID is not found. |
| 17700026 | The specified bundle is disabled. |
**示例:**
......
......@@ -37,11 +37,11 @@ on(type: BundleChangedEvent, callback: Callback\<BundleChangedInfo>): void;
注册监听应用的安装,卸载,更新。
**需要权限:**ohos.permission.LISTEN_BUNDLE_CHANGE
**需要权限:** ohos.permission.LISTEN_BUNDLE_CHANGE
**系统API:** 此接口为系统接口,三方应用不支持调用
**系统能力:**SystemCapability.BundleManager.BundleFramework.Core
**系统能力:** SystemCapability.BundleManager.BundleFramework.Core
**参数:**
......@@ -50,10 +50,6 @@ on(type: BundleChangedEvent, callback: Callback\<BundleChangedInfo>): void;
| BundleChangedEvent | string | 是 | 注册监听的事件类型。 |
| Callback\<BundleChangedInfo> | callback | 是 | 注册监听的回调函数。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.bundle错误码](../errorcodes/errorcode-bundle.md)
**示例:**
```ts
......@@ -74,11 +70,11 @@ off(type: BundleChangedEvent, callback?: Callback\<BundleChangedInfo>): void;
注销监听应用的安装,卸载,更新。
**需要权限:**ohos.permission.LISTEN_BUNDLE_CHANGE
**需要权限:** ohos.permission.LISTEN_BUNDLE_CHANGE
**系统API:** 此接口为系统接口,三方应用不支持调用
**系统能力:**SystemCapability.BundleManager.BundleFramework.Core
**系统能力:** SystemCapability.BundleManager.BundleFramework.Core
**参数:**
......@@ -87,10 +83,6 @@ off(type: BundleChangedEvent, callback?: Callback\<BundleChangedInfo>): void;
| BundleChangedEvent | string | 是 | 注销监听的事件类型。 |
| Callback\<BundleChangedInfo> | callback | 是 | 注销监听的回调函数,当为空时表示注销当前事件的所有callback。 |
**错误码:**
以下错误码的详细介绍请参见[ohos.bundle错误码](../errorcodes/errorcode-bundle.md)
**示例:**
```ts
......
......@@ -48,7 +48,7 @@ buffer数组的列表。
| 名称 | 类型 | 可读 | 可写 | 说明 |
| ---- | ---------- | ---- | ---- | ---------- |
| data | Uint8Array | 是 | 是 | 数据列表。 |
| data | Array<Uint8Array> | 是 | 是 | 数据列表。 |
## EncodingFormat
......@@ -1580,10 +1580,10 @@ convertKey(pubKey : DataBlob, priKey : DataBlob, callback : AsyncCallback\<KeyPa
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------- | ---- | ------------------------------ |
| pubKey | DataBlob | 否 | 指定的公钥材料。 |
| priKey | DataBlob | 否 | 指定的私钥材料。 |
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------- | ---- | ------------------------------ |
| pubKey | DataBlob | 是 | 指定的公钥材料。如果公钥不需要转换,可直接传入null |
| priKey | DataBlob | 是 | 指定的私钥材料。如果私钥不需要转换,可直接传入null |
| callback | AsyncCallback\<KeyPair> | 是 | 回调函数,用于获取非对称密钥。 |
**示例:**
......@@ -1612,10 +1612,10 @@ convertKey(pubKey : DataBlob, priKey : DataBlob) : Promise\<KeyPair>
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| 参数名 | 类型 | 必填 | 说明 |
| ------ | -------- | ---- | ---------------- |
| pubKey | DataBlob | 否 | 指定的公钥材料。 |
| priKey | DataBlob | 否 | 指定的私钥材料。 |
| pubKey | DataBlob | 是 | 指定的公钥材料。如果公钥不需要转换,可直接传入null |
| priKey | DataBlob | 是 | 指定的私钥材料。如果私钥不需要转换,可直接传入null |
**返回值:**
......@@ -2586,7 +2586,7 @@ createX509Cert(inStream : EncodingBlob, callback : AsyncCallback\<X509Cert>) : v
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------------- | ---- | -------------------------- |
| inStream | [EncodingBlob](#encodingblob) | 是 | X509证书序列化数据 |
| callback | AsyncCallback\<X509Cert> | | 回调函数。表示X509证书对象 |
| callback | AsyncCallback\<X509Cert> | | 回调函数。表示X509证书对象 |
**示例**
......@@ -2666,7 +2666,7 @@ verify(key : PubKey, callback : AsyncCallback\<void>) : void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------- | ---- | ------------------------------------------------------------ |
| key | [PubKey](#pubkey) | 是 | 用于验签的公钥对象 |
| callback | AsyncCallback\<void>) | 否 | 回调函数。使用AsyncCallback的第一个error参数判断是否验签成功,error为null表示成功,不为null表示失败 |
| callback | AsyncCallback\<void> | 是 | 回调函数。使用AsyncCallback的第一个error参数判断是否验签成功,error为null表示成功,不为null表示失败 |
**示例**
......@@ -2757,7 +2757,7 @@ getEncoded(callback : AsyncCallback\<EncodingBlob>) : void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------------------------- | ---- | -------------------------------- |
| callback | AsyncCallback\<[EncodingBlob](#encodingblob)> | | 回调函数。表示X509证书序列化数据 |
| callback | AsyncCallback\<[EncodingBlob](#encodingblob)> | | 回调函数。表示X509证书序列化数据 |
**示例**
......@@ -2838,7 +2838,7 @@ getPublicKey(callback : AsyncCallback\<PubKey>) : void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------- | ---- | -------------------------- |
| callback | AsyncCallback | 否 | 回调函数,X509证书公钥对象 |
| callback | AsyncCallback\<PubKey> | 是 | 回调函数,X509证书公钥对象 |
**示例**
......@@ -2920,7 +2920,7 @@ checkValidityWithDate(date: string, callback : AsyncCallback\<void>) : void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------------------- | ---- | ------------------------------------------------------------ |
| date | string | 是 | 日期 |
| callback | AsyncCallback\<void> | | 回调函数。使用AsyncCallback的第一个error参数判断是否检查成功,error为null表示成功,不为null表示失败 |
| callback | AsyncCallback\<void> | | 回调函数。使用AsyncCallback的第一个error参数判断是否检查成功,error为null表示成功,不为null表示失败 |
**示例**
......@@ -3550,7 +3550,7 @@ createX509Crl(inStream : EncodingBlob, callback : AsyncCallback\<X509Crl>) : voi
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------------- | ---- | ------------------------------ |
| inStream | [EncodingBlob](#encodingblob) | 是 | 表示证书吊销列表序列化数据 |
| callback | AsyncCallback\<X509Crl> | | 回调函数。表示证书吊销列表对象 |
| callback | AsyncCallback\<X509Crl> | | 回调函数。表示证书吊销列表对象 |
**示例**
......@@ -3630,7 +3630,7 @@ isRevoked(cert : X509Cert, callback : AsyncCallback\<boolean>) : void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------- | ---- | ----------------------------------------------------------- |
| cert | [X509Cert](#x509cert) | 是 | 表示被检查的证书对象 |
| callback | AsyncCallback\<boolean> | | 回调函数。表示证书吊销状态,true表示已吊销,false表示未吊销 |
| callback | AsyncCallback\<boolean> | | 回调函数。表示证书吊销状态,true表示已吊销,false表示未吊销 |
**示例**
......@@ -3757,7 +3757,7 @@ getEncoded(callback : AsyncCallback\<EncodingBlob>) : void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------- | ---- | ------------------------------------------ |
| callback | AsyncCallback\<EncodingBlob> | | 回调函数,表示X509证书吊销列表的序列化数据 |
| callback | AsyncCallback\<EncodingBlob> | | 回调函数,表示X509证书吊销列表的序列化数据 |
**示例**
......@@ -3839,7 +3839,7 @@ verify(key : PubKey, callback : AsyncCallback\<void>) : void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------------------- | ---- | ------------------------------------------------------------ |
| key | PubKey | 是 | 表示用于验签的公钥对象 |
| callback | AsyncCallback\<void> | | 回调函数,使用AsyncCallback的第一个error参数判断是否验签成功,error为null表示成功,error不为null表示失败。 |
| callback | AsyncCallback\<void> | | 回调函数,使用AsyncCallback的第一个error参数判断是否验签成功,error为null表示成功,error不为null表示失败。 |
**示例**
......@@ -4075,7 +4075,7 @@ getRevokedCert(serialNumber : number, callback : AsyncCallback\<X509CrlEntry>) :
| 参数名 | 类型 | 必填 | 说明 |
| ------------ | ---------------------------- | ---- | -------------------------------- |
| serialNumber | number | 是 | 表示证书序列号 |
| callback | AsyncCallback\<X509CrlEntry> | | 回调函数。表示被吊销X509证书对象 |
| callback | AsyncCallback\<X509CrlEntry> | | 回调函数。表示被吊销X509证书对象 |
**示例**
......@@ -4167,7 +4167,7 @@ getRevokedCertWithCert(cert : X509Cert, callback : AsyncCallback\<X509CrlEntry>)
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------------- | ---- | ------------------------------- |
| cert | X509Cert | 是 | 表示证书对象 |
| callback | AsyncCallback\<X509CrlEntry> | | 回调函数,表示被吊销X509证书对象 |
| callback | AsyncCallback\<X509CrlEntry> | | 回调函数,表示被吊销X509证书对象 |
**示例**
......@@ -4258,7 +4258,7 @@ getRevokedCerts(callback : AsyncCallback<Array\<X509CrlEntry>>) : void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------------------- | ---- | -------------------------------- |
| callback | AsyncCallback<Array\<X509CrlEntry>> | | 回调函数。表示被吊销X509证书列表 |
| callback | AsyncCallback<Array\<X509CrlEntry>> | | 回调函数。表示被吊销X509证书列表 |
**示例**
......@@ -4339,7 +4339,7 @@ getTbsInfo(callback : AsyncCallback\<DataBlob>) : void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------- | ---- | ------------------------------------------- |
| callback | AsyncCallback\<[DataBlob](#datablob)> | | 回调函数。表示证书吊销列表的tbsCertList信息 |
| callback | AsyncCallback\<[DataBlob](#datablob)> | | 回调函数。表示证书吊销列表的tbsCertList信息 |
**示例**
......@@ -4608,7 +4608,7 @@ validate(certChain : CertChainData, callback : AsyncCallback\<void>) : void
| 参数名 | 类型 | 必填 | 说明 |
| --------- | ------------------------------- | ---- | ------------------------------------------------------------ |
| certChain | [CertChainData](#certchaindata) | 是 | 表示X509证书链序列化数据 |
| callback | AsyncCallback\<void> | | 回调函数。使用AsyncCallback的第一个error参数判断是否校验成功,error为null表示成功,error不为null表示失败 |
| callback | AsyncCallback\<void> | | 回调函数。使用AsyncCallback的第一个error参数判断是否校验成功,error为null表示成功,error不为null表示失败 |
**示例**
......@@ -4706,7 +4706,7 @@ getEncoded(callback : AsyncCallback\<EncodingBlob>) : void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | --------------------------------------------- | ---- | ------------------------------------ |
| callback | AsyncCallback\<[EncodingBlob](#encodingblob)> | | 回调函数。表示被吊销证书的序列化数据 |
| callback | AsyncCallback\<[EncodingBlob](#encodingblob)> | | 回调函数。表示被吊销证书的序列化数据 |
**示例**
......@@ -4789,7 +4789,7 @@ getCertIssuer(callback : AsyncCallback\<DataBlob>) : void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ------------------------------------- | ---- | ------------------------------------ |
| callback | AsyncCallback\<[DataBlob](#datablob)> | | 回调函数。表示被吊销证书的颁发者信息 |
| callback | AsyncCallback\<[DataBlob](#datablob)> | | 回调函数。表示被吊销证书的颁发者信息 |
**示例**
......@@ -4848,7 +4848,7 @@ getRevocationDate(callback : AsyncCallback\<string>) : void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | ---------------------- | ---- | ------------------------------ |
| callback | AsyncCallback\<string> | | 回调函数。表示证书被吊销的日期 |
| callback | AsyncCallback\<string> | | 回调函数。表示证书被吊销的日期 |
**示例**
......
......@@ -263,7 +263,7 @@ delete(uri: string, predicates: dataSharePredicates.DataSharePredicates, callbac
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| uri | string | 是 | 指示要删除的数据的路径。 |
| predicates | [DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | 是 | 指示筛选条件。<br />delete接口所支持的谓词方法取决于服务端所选用的数据库,如KVDB的删除目前仅支持inKeys谓词。 |
| predicates | [dataSharePredicates.DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | 是 | 指示筛选条件。<br />delete接口所支持的谓词方法取决于服务端所选用的数据库,如KVDB的删除目前仅支持inKeys谓词。 |
| callback | AsyncCallback&lt;number&gt; | 是 | 回调函数。当从数据库中删除一条或多条数据记录成功,err为undefined,data为获取到的已删除的数据记录数;否则为错误对象。<br />因部分数据库(如KVDB)的相应接口并不提供相应支持,故若服务端使用此数据库,则此callback也无法返回删除的数据记录数。 |
**示例:**
......@@ -301,7 +301,7 @@ delete(uri: string, predicates: dataSharePredicates.DataSharePredicates): Promis
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| uri | string | 是 | 指示要删除的数据的路径。 |
| predicates | [DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | 是 | 指示筛选条件。<br />delete接口所支持的谓词方法取决于服务端所选用的数据库,如KVDB的删除目前仅支持inKeys谓词。 |
| predicates | [dataSharePredicates.DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | 是 | 指示筛选条件。<br />delete接口所支持的谓词方法取决于服务端所选用的数据库,如KVDB的删除目前仅支持inKeys谓词。 |
**返回值:**
......@@ -342,7 +342,7 @@ query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns:
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| uri | string | 是 | 指示要查询的数据的路径。 |
| predicates | [DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | 是 | 指示筛选条件。<br />query接口所支持的谓词方法取决于服务端所选用的数据库,如KVDB目前仅支持inKeys和prefixKey。 |
| predicates | [dataSharePredicates.DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | 是 | 指示筛选条件。<br />query接口所支持的谓词方法取决于服务端所选用的数据库,如KVDB目前仅支持inKeys和prefixKey。 |
| columns | Array&lt;string&gt; | 是 | 指示要查询的列。如果此参数为空,则查询所有列。 |
| callback | AsyncCallback&lt;[DataShareResultSet](js-apis-data-DataShareResultSet.md#datashareresultset)&gt; | 是 | 回调函数。当查询数据库中的数据成功,err为undefined,data为获取到的查询到的结果集;否则为错误对象。 |
......@@ -382,7 +382,7 @@ query(uri: string, predicates: dataSharePredicates.DataSharePredicates, columns:
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| uri | string | 是 | 指示要查询的数据的路径。 |
| predicates | [DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | 是 | 指示筛选条件。<br />query接口所支持的谓词方法取决于服务端所选用的数据库,如KVDB目前仅支持inKeys和prefixKey。 |
| predicates | [dataSharePredicates.DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | 是 | 指示筛选条件。<br />query接口所支持的谓词方法取决于服务端所选用的数据库,如KVDB目前仅支持inKeys和prefixKey。 |
| columns | Array&lt;string&gt; | 是 | 指示要查询的列。如果此参数为空,则查询所有列。 |
**返回值:**
......@@ -425,7 +425,7 @@ update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value:
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| uri | string | 是 | 指示要更新的数据的路径。 |
| predicates | [DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | 是 | 指示筛选条件。<br />update接口是否支持谓词筛选条件取决于服务端所选用的数据库,如KVDB目前并不支持谓词筛选条件,仅RDB支持。 |
| predicates | [dataSharePredicates.DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | 是 | 指示筛选条件。<br />update接口是否支持谓词筛选条件取决于服务端所选用的数据库,如KVDB目前并不支持谓词筛选条件,仅RDB支持。 |
| value | [ValuesBucket](js-apis-data-ValuesBucket.md#valuesbucket) | 是 | 指示要更新的数据。 |
| callback | AsyncCallback&lt;number&gt; | 是 | 回调函数。当更新数据库中的数据记录成功,err为undefined,data为获取到的更新的数据记录数;否则为错误对象。<br />因部分数据库(如KVDB)的相应接口并不提供相应支持,故若服务端使用此数据库,则此callback也无法返回更新的数据记录数。 |
......@@ -470,7 +470,7 @@ update(uri: string, predicates: dataSharePredicates.DataSharePredicates, value:
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| uri | string | 是 | 指示要更新的数据的路径。 |
| predicates | [DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | 是 | 指示筛选条件。<br />update接口是否支持谓词筛选条件取决于服务端所选用的数据库,如KVDB目前并不支持谓词筛选条件,仅RDB支持。 |
| predicates | [dataSharePredicates.DataSharePredicates](js-apis-data-dataSharePredicates.md#datasharepredicates) | 是 | 指示筛选条件。<br />update接口是否支持谓词筛选条件取决于服务端所选用的数据库,如KVDB目前并不支持谓词筛选条件,仅RDB支持。 |
| value | [ValuesBucket](js-apis-data-ValuesBucket.md#valuesbucket) | 是 | 指示要更新的数据。 |
**返回值:**
......
......@@ -27,7 +27,7 @@ import defaultAppMgr from '@ohos.bundle.defaultAppManager';
**系统能力:** SystemCapability.BundleManager.BundleFramework.DefaultApp
| 参数名 | 类型 | 值 | 说明 |
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------------------------------------- | -------------------------------------- |
| BROWSER | string | Web Browser | 默认浏览器。 |
| IMAGE | string | Image Gallery | 默认图片查看器。 |
......@@ -58,10 +58,6 @@ isDefaultApplication(type: string): Promise\<boolean>
| ------------------------- | ------------------ |
| Promise\<boolean> | Promise形式返回当前应用是否是默认应用,true表示是默认应用,false表示不是默认应用。 |
**错误码:**
错误码的详细介绍请参见[ohos.bundle错误码](../errorcodes/errorcode-bundle.md)
**示例:**
......@@ -90,10 +86,6 @@ isDefaultApplication(type: string, callback: AsyncCallback\<boolean>): void
| type | string | 是 | 要查询的应用类型,取[ApplicationType](#defaultappmgrapplicationtype)中的值。 |
| callback | AsyncCallback\<boolean> | 是 | 程序启动作为入参的回调函数,返回当前应用是否是默认应用,true表示是默认应用,false表示不是默认应用。 |
**错误码:**
错误码的详细介绍请参见[ohos.bundle错误码](../errorcodes/errorcode-bundle.md)
**示例:**
```ts
......@@ -266,15 +258,7 @@ defaultAppMgr.getDefaultApplication("image/png", (err, data) => {
## defaultAppMgr.setDefaultApplication
setDefaultApplication(type: string, elementName: ElementName, userId?: number): Promise\<BundleInfo>
**返回值:**
| 类型 | 说明 |
| ----------------------------------------------------------- | --------------------------- |
| Promise\<[BundleInfo](js-apis-bundleManager-bundleInfo.md)> | Promise对象,返回BundleInfo |
>
setDefaultApplication(type: string, elementName: ElementName, userId?: number): Promise\<void>
以异步方法根据系统已定义的应用类型或者符合媒体类型格式(type/subtype)的文件类型设置默认应用,使用Promise形式返回结果。
......@@ -296,7 +280,7 @@ setDefaultApplication(type: string, elementName: ElementName, userId?: number):
| 类型 | 说明 |
| -------------- | ---------------------------------- |
| Promise\<void> | Promise对象,无返回结果的Promise。 |
| Promise\<void> | Promise对象,无返回结果的Promise对象。 |
**错误码:**
......
......@@ -50,11 +50,6 @@ Deque的构造函数。
```ts
let deque = new Deque();
try {
let deque2 = Deque();
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### insertFront
......@@ -90,11 +85,6 @@ deque.insertFront(b);
let c = {name : "Dylon", age : "13"};
deque.insertFront(c);
deque.insertFront(false);
try {
deque.insertFront.bind({}, "b")(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### insertEnd
......@@ -130,11 +120,6 @@ deque.insertEnd(b);
let c = {name : "Dylon", age : "13"};
deque.insertEnd(c);
deque.insertEnd(false);
try {
deque.insertEnd.bind({}, "b")(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### has
......@@ -172,11 +157,6 @@ let deque = new Deque();
let result = deque.has("squirrel");
deque.insertFront("squirrel");
let result1 = deque.has("squirrel");
try {
deque.has.bind({}, "b")(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### popFirst
......@@ -211,11 +191,6 @@ deque.insertEnd(5);
deque.insertFront(2);
deque.insertFront(4);
let result = deque.popFirst();
try {
deque.popFirst.bind({})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### popLast
......@@ -250,11 +225,6 @@ deque.insertFront(5);
deque.insertFront(2);
deque.insertFront(4);
let result = deque.popLast();
try {
deque.popLast.bind({})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### forEach
......@@ -300,13 +270,6 @@ deque.insertEnd(4);
deque.forEach((value, index) => {
console.log("value:" + value, index);
});
try {
deque.forEach.bind({}, (value, index) => {
console.log("value:" + value, index);
})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### getFirst
......@@ -340,11 +303,6 @@ deque.insertEnd(4);
deque.insertFront(5);
deque.insertFront(4);
let result = deque.getFirst();
try {
deque.getFirst.bind({})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### getLast
......@@ -378,11 +336,6 @@ deque.insertFront(4);
deque.insertFront(5);
deque.insertFront(4);
let result = deque.getLast();
try {
deque.getLast.bind({})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
### [Symbol.iterator]
......@@ -427,9 +380,4 @@ while(temp != undefined) {
console.log("value:" + temp);
temp = iter.next().value;
}
try {
deque[Symbol.iterator].bind({})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
\ No newline at end of file
......@@ -236,7 +236,7 @@ on(type: 'add'|'remove'|'change', callback: Callback&lt;number&gt;): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| type | string | 是 | 监听事件。<br/>- type为"add",表示增加显示设备事件。例如:PC上插入显示器。<br/>- type为"remove",表示移除显示设备事件。例如:PC上移除显示器。<br/>- type为"change",表示改变显示设备事件。例如:显示器方向改变。 |
| type | string | 是 | 监听事件。<br/>- type为"add",表示增加显示设备事件。例如:插入显示器。<br/>- type为"remove",表示移除显示设备事件。例如:移除显示器。<br/>- type为"change",表示改变显示设备事件。例如:显示器方向改变。 |
| callback | Callback&lt;number&gt; | 是 | 回调函数。返回监听到的显示设备的id。 |
**示例:**
......
......@@ -363,10 +363,6 @@ getDispatchInfo(callback: AsyncCallback\<DispatchInfo>): void;
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| callback | AsyncCallback<[DispatchInfo](js-apis-bundleManager-dispatchInfo.md)> | 是 | 回调函数。当函数调用成功,err为null,data为获取到的[DispatchInfo](js-apis-bundleManager-dispatchInfo.md)信息。否则为错误对象。 |
**错误码:**
错误码的详细介绍请参见[ohos.bundle错误码](../errorcodes/errorcode-bundle.md)
**示例:**
```js
......@@ -402,10 +398,6 @@ getDispatchInfo(): Promise\<DispatchInfo>;
| ------------------------------------------------ | ------------------------------------------------------------ |
| Promise<[DispatchInfo](js-apis-bundleManager-dispatchInfo.md)> | Promise对象,返回[DispatchInfo](js-apis-bundleManager-dispatchInfo.md)信息。 |
**错误码:**
错误码的详细介绍请参见[ohos.bundle错误码](../errorcodes/errorcode-bundle.md)
**示例:**
```js
......
......@@ -1063,7 +1063,7 @@ setReverseGeocodingMockInfo(mockInfos: Array&lt;ReverseGeocodingMockInfo&gt;): P
**系统能力**:SystemCapability.Location.Location.Geocoder
| 名称 | 类型 | 可读 | 可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| locale | string | 是 | 是 | 指定位置描述信息的语言,“zh”代表中文,“en”代表英文。 |
| latitude | number | 是 | 是 | 表示纬度信息,正值表示北纬,负值表示南纬。 |
| longitude | number | 是 | 是 | 表示经度信息,正值表示东经,负值表示西经。 |
......@@ -1077,9 +1077,9 @@ setReverseGeocodingMockInfo(mockInfos: Array&lt;ReverseGeocodingMockInfo&gt;): P
**系统能力**:SystemCapability.Location.Location.Geocoder
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| locale | string | 是 | 是 | 表示位置描述信息的语言,“zh”代表中文,“en”代表英文。 |
| description | number | 是 | 是 | 表示位置信息描述,如“上海市浦东新区xx路xx号”。 |
| description | string | 是 | 是 | 表示位置信息描述,如“上海市浦东新区xx路xx号”。 |
| maxItems | number | 是 | 是 | 表示返回位置信息的最大个数。 |
| minLatitude | number | 是 | 是 | 表示最小纬度信息,与下面三个参数一起,表示一个经纬度范围。 |
| minLongitude | number | 是 | 是 | 表示最小经度信息。 |
......@@ -1094,7 +1094,7 @@ setReverseGeocodingMockInfo(mockInfos: Array&lt;ReverseGeocodingMockInfo&gt;): P
**系统能力**:SystemCapability.Location.Location.Geocoder
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| latitude | number | 是 | 否 | 表示纬度信息,正值表示北纬,负值表示南纬。 |
| longitude | number | 是 | 否 | 表示经度信息,正值表示东经,负值表是西经。 |
| locale | string | 是 | 否 | 表示位置描述信息的语言,“zh”代表中文,“en”代表英文。 |
......@@ -1123,7 +1123,7 @@ setReverseGeocodingMockInfo(mockInfos: Array&lt;ReverseGeocodingMockInfo&gt;): P
**系统能力**:SystemCapability.Location.Location.Core
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| priority | [LocationRequestPriority](#locationrequestpriority) | 是 | 是 | 表示优先级信息。 |
| scenario | [LocationRequestScenario](#locationrequestscenario) | 是 | 是 | 表示场景信息。 |
| timeInterval | number | 是 | 是 | 表示上报位置信息的时间间隔。 |
......@@ -1138,7 +1138,7 @@ setReverseGeocodingMockInfo(mockInfos: Array&lt;ReverseGeocodingMockInfo&gt;): P
**系统能力**:SystemCapability.Location.Location.Core
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| priority | [LocationRequestPriority](#locationrequestpriority) | 是 | 是 | 表示优先级信息。 |
| scenario | [LocationRequestScenario](#locationrequestscenario) | 是 | 是 | 表示场景信息。 |
| maxAccuracy | number | 是 | 是| 表示精度信息,单位是米。仅在精确位置功能场景下有效,模糊位置功能生效场景下该字段无意义。 |
......@@ -1152,7 +1152,7 @@ setReverseGeocodingMockInfo(mockInfos: Array&lt;ReverseGeocodingMockInfo&gt;): P
**系统能力**:SystemCapability.Location.Location.Gnss
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| satellitesNumber | number | 是 | 否 | 表示卫星个数。 |
| satelliteIds | Array&lt;number&gt; | 是 | 否 | 表示每个卫星的ID,数组类型。 |
| carrierToNoiseDensitys | Array&lt;number&gt; | 是 | 否 | 表示载波噪声功率谱密度比,即cn0。 |
......@@ -1168,7 +1168,7 @@ setReverseGeocodingMockInfo(mockInfos: Array&lt;ReverseGeocodingMockInfo&gt;): P
**系统能力**:SystemCapability.Location.Location.Gnss
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| reportingPeriodSec | number | 是 | 是 | 表示GNSS缓存位置上报的周期,单位是毫秒。 |
| wakeUpCacheQueueFull | boolean | 是 | 是 | true表示GNSS芯片底层缓存队列满之后会主动唤醒AP芯片,并把缓存位置上报给应用。<br/>false表示GNSS芯片底层缓存队列满之后不会主动唤醒AP芯片,会把缓存位置直接丢弃。 |
......@@ -1179,12 +1179,12 @@ GNSS围栏的配置参数。目前只支持圆形围栏。
**系统能力**:SystemCapability.Location.Location.Geofence
| 名称 | 参数类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| latitude | number | 是 | 表示纬度。 |
| longitude | number | 是 | 表示经度。 |
| radius | number | 是 | 表示圆形围栏的半径。 |
| expiration | number | 是 | 围栏存活的时间,单位是毫秒。 |
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- | -------- |
| latitude | number | 是 | 是 |表示纬度。 |
| longitude | number | 是 |是 | 表示经度。 |
| radius | number | 是 |是 | 表示圆形围栏的半径。 |
| expiration | number | 是 |是 | 围栏存活的时间,单位是毫秒。 |
## GeofenceRequest
......@@ -1194,7 +1194,7 @@ GNSS围栏的配置参数。目前只支持圆形围栏。
**系统能力**:SystemCapability.Location.Location.Geofence
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| priority | [LocationRequestPriority](#locationrequestpriority) | 是 | 是 | 表示位置信息优先级。 |
| scenario | [LocationRequestScenario](#locationrequestscenario) | 是 | 是 | 表示定位场景。 |
| geofence | [Geofence](#geofence) | 是 | 是 | 表示围栏信息。 |
......@@ -1220,7 +1220,7 @@ GNSS围栏的配置参数。目前只支持圆形围栏。
**系统能力**:SystemCapability.Location.Location.Core
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| scenario | [LocationRequestScenario](#locationrequestscenario) | 是 | 是 | 表示定位场景。 |
| command | string | 是 | 是 | 扩展命令字符串。 |
......@@ -1232,7 +1232,7 @@ GNSS围栏的配置参数。目前只支持圆形围栏。
**系统能力**:SystemCapability.Location.Location.Core
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| latitude | number| 是 | 否 | 表示纬度信息,正值表示北纬,负值表示南纬。 |
| longitude | number| 是 | 否 | 表示经度信息,正值表示东经,负值表是西经。 |
| altitude | number | 是 | 否 | 表示高度信息,单位米。 |
......@@ -1255,7 +1255,7 @@ GNSS围栏的配置参数。目前只支持圆形围栏。
**系统API**:此接口为系统接口,三方应用不支持调用。
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| location | [ReverseGeoCodeRequest](#reversegeocoderequest) | 是 | 是 | 表示经纬度信息。 |
| geoAddress | [GeoAddress](#geoaddress) | 是 | 是 |表示地名信息。 |
......@@ -1269,7 +1269,7 @@ GNSS围栏的配置参数。目前只支持圆形围栏。
**系统API**:此接口为系统接口,三方应用不支持调用。
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| timeInterval | number | 是 | 是 | 表示模拟位置上报的时间间隔,单位是秒。 |
| locations | Array&lt;Location&gt; | 是 | 是 | 表示模拟位置数组。 |
......@@ -1281,7 +1281,7 @@ GNSS围栏的配置参数。目前只支持圆形围栏。
**系统能力**:SystemCapability.Location.Location.Core
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| country | string | 是 | 否 | 表示国家码字符串。 |
| type | [CountryCodeType](#countrycodetype) | 是 | 否 | 表示国家码信息来源。 |
......
......@@ -179,7 +179,7 @@ on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, ca
| -------- | -------- | -------- | -------- |
| type | string | 是 | 设置事件类型。type为“cachedGnssLocationsReporting”,表示GNSS缓存定位结果上报。 |
| request | [CachedGnssLocationsRequest](#cachedgnsslocationsrequest) | 是 | GNSS缓存功能配置参数 |
| callback | Callback&lt;boolean&gt; | 是 | 接收GNSS缓存位置上报。 |
| callback | Callback&lt;Array&lt;[Location](#location)&gt;&gt; | 是 | 接收GNSS缓存位置上报。 |
**示例**
......@@ -209,7 +209,7 @@ off(type: 'cachedGnssLocationsReporting', callback?: Callback&lt;Array&lt;Locati
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| type | string | 是 | 设置事件类型。type为“cachedGnssLocationsReporting”,表示GNSS缓存定位结果上报。 |
| callback | Callback&lt;boolean&gt; | 否 | 需要取消订阅的回调函数。若无此参数,则取消当前类型的所有订阅。 |
| callback | Callback&lt;Array&lt;[Location](#location)&gt;&gt; | 否 | 需要取消订阅的回调函数。若无此参数,则取消当前类型的所有订阅。 |
**示例**
......@@ -447,7 +447,7 @@ getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback&lt;L
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| request | [CurrentLocationRequest](#currentlocationrequest) | | 设置位置请求参数。 |
| request | [CurrentLocationRequest](#currentlocationrequest) | | 设置位置请求参数。 |
| callback | AsyncCallback&lt;[Location](#location)&gt; | 是 | 用来接收位置信息的回调。 |
**示例**
......@@ -464,6 +464,38 @@ getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback&lt;L
}
};
geolocation.getCurrentLocation(requestInfo, locationChange);
```
## geolocation.getCurrentLocation
getCurrentLocation(callback: AsyncCallback&lt;Location&gt;): void
获取当前位置,使用callback回调异步返回结果。
**需要权限**:ohos.permission.LOCATION
**系统能力**:SystemCapability.Location.Location.Core
**参数**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;[Location](#location)&gt; | 是 | 用来接收位置信息的回调。 |
**示例**
```ts
import geolocation from '@ohos.geolocation';
var locationChange = (err, location) => {
if (err) {
console.log('locationChanger: err=' + JSON.stringify(err));
}
if (location) {
console.log('locationChanger: location=' + JSON.stringify(location));
}
};
geolocation.getCurrentLocation(locationChange);
```
......@@ -1230,7 +1262,7 @@ sendCommand(command: LocationCommand): Promise&lt;boolean&gt;;
**系统能力**:SystemCapability.Location.Location.Geocoder
| 名称 | 类型 | 可读 | 可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| locale | string | 是 | 是 | 指定位置描述信息的语言,“zh”代表中文,“en”代表英文。 |
| latitude | number | 是 | 是 | 表示纬度信息,正值表示北纬,负值表示南纬。 |
| longitude | number | 是 | 是 | 表示经度信息,正值表示东经,负值表示西经。 |
......@@ -1246,9 +1278,9 @@ sendCommand(command: LocationCommand): Promise&lt;boolean&gt;;
**系统能力**:SystemCapability.Location.Location.Geocoder
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| locale | string | 是 | 是 | 表示位置描述信息的语言,“zh”代表中文,“en”代表英文。 |
| description | number | 是 | 是 | 表示位置信息描述,如“上海市浦东新区xx路xx号”。 |
| description | string | 是 | 是 | 表示位置信息描述,如“上海市浦东新区xx路xx号”。 |
| maxItems | number | 是 | 是 | 表示返回位置信息的最大个数。 |
| minLatitude | number | 是 | 是 | 表示最小纬度信息,与下面三个参数一起,表示一个经纬度范围。 |
| minLongitude | number | 是 | 是 | 表示最小经度信息。 |
......@@ -1265,7 +1297,7 @@ sendCommand(command: LocationCommand): Promise&lt;boolean&gt;;
**系统能力**:SystemCapability.Location.Location.Geocoder
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| latitude<sup>7+</sup> | number | 是 | 否 | 表示纬度信息,正值表示北纬,负值表示南纬。 |
| longitude<sup>7+</sup> | number | 是 | 否 | 表示经度信息,正值表示东经,负值表是西经。 |
| locale<sup>7+</sup> | string | 是 | 否 | 表示位置描述信息的语言,“zh”代表中文,“en”代表英文。 |
......@@ -1295,7 +1327,7 @@ sendCommand(command: LocationCommand): Promise&lt;boolean&gt;;
**系统能力**:SystemCapability.Location.Location.Core
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| priority | [LocationRequestPriority](#locationrequestpriority) | 是 | 是 | 表示优先级信息。 |
| scenario | [LocationRequestScenario](#locationrequestscenario) | 是 | 是 | 表示场景信息。 |
| timeInterval | number | 是 | 是 | 表示上报位置信息的时间间隔。 |
......@@ -1312,7 +1344,7 @@ sendCommand(command: LocationCommand): Promise&lt;boolean&gt;;
**系统能力**:SystemCapability.Location.Location.Core
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| priority | [LocationRequestPriority](#locationrequestpriority) | 是 | 是 | 表示优先级信息。 |
| scenario | [LocationRequestScenario](#locationrequestscenario) | 是 | 是 | 表示场景信息。 |
| maxAccuracy | number | 是 | 是| 表示精度信息,单位是米。仅在精确位置功能场景下有效,模糊位置功能生效场景下该字段无意义。 |
......@@ -1328,7 +1360,7 @@ sendCommand(command: LocationCommand): Promise&lt;boolean&gt;;
**系统能力**:SystemCapability.Location.Location.Gnss
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| satellitesNumber | number | 是 | 否 | 表示卫星个数。 |
| satelliteIds | Array&lt;number&gt; | 是 | 否 | 表示每个卫星的ID,数组类型。 |
| carrierToNoiseDensitys | Array&lt;number&gt; | 是 | 否 | 表示载波噪声功率谱密度比,即cn0。 |
......@@ -1346,7 +1378,7 @@ sendCommand(command: LocationCommand): Promise&lt;boolean&gt;;
**系统能力**:SystemCapability.Location.Location.Gnss
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| reportingPeriodSec | number | 是 | 是 | 表示GNSS缓存位置上报的周期,单位是毫秒。 |
| wakeUpCacheQueueFull | boolean | 是 | 是 | true表示GNSS芯片底层缓存队列满之后会主动唤醒AP芯片,并把缓存位置上报给应用。<br/>false表示GNSS芯片底层缓存队列满之后不会主动唤醒AP芯片,会把缓存位置直接丢弃。 |
......@@ -1360,7 +1392,7 @@ GNSS围栏的配置参数。目前只支持圆形围栏。
**系统能力**:SystemCapability.Location.Location.Geofence
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| latitude | number | 是 | 是 | 表示纬度。 |
| longitude | number | 是 | 是 | 表示经度。 |
| radius | number | 是 | 是 | 表示圆形围栏的半径。 |
......@@ -1376,7 +1408,7 @@ GNSS围栏的配置参数。目前只支持圆形围栏。
**系统能力**:SystemCapability.Location.Location.Geofence
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| priority | [LocationRequestPriority](#locationrequestpriority) | 是 | 是 | 表示位置信息优先级。 |
| scenario | [LocationRequestScenario](#locationrequestscenario) | 是 | 是 | 表示定位场景。 |
| geofence | [Geofence](#geofence)| 是 | 是 | 表示围栏信息。 |
......@@ -1406,7 +1438,7 @@ GNSS围栏的配置参数。目前只支持圆形围栏。
**系统能力**:SystemCapability.Location.Location.Core
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| scenario | [LocationRequestScenario](#locationrequestscenario) | 是 | 是 | 表示定位场景。 |
| command | string | 是 | 是 | 扩展命令字符串。 |
......@@ -1420,7 +1452,7 @@ GNSS围栏的配置参数。目前只支持圆形围栏。
**系统能力**:SystemCapability.Location.Location.Core
| 名称 | 类型 | 可读|可写 | 说明 |
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- | -------- |
| latitude<sup>7+</sup> | number | 是 | 否 | 表示纬度信息,正值表示北纬,负值表示南纬。 |
| longitude<sup>7+</sup> | number | 是 | 否 | 表示经度信息,正值表示东经,负值表是西经。 |
| altitude<sup>7+</sup> | number | 是 | 否 | 表示高度信息,单位米。 |
......
......@@ -60,11 +60,6 @@ HashSet的构造函数。
```ts
let hashSet = new HashSet();
try {
let hashSet2 = HashSet();
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
......@@ -95,11 +90,6 @@ isEmpty(): boolean
```ts
const hashSet = new HashSet();
let result = hashSet.isEmpty();
try {
hashSet.isEmpty.bind({})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
......@@ -138,11 +128,6 @@ let hashSet = new HashSet();
let result = hashSet.has("squirrel");
hashSet.add("squirrel");
let result1 = hashSet.has("squirrel");
try {
hashSet.has.bind({}, "squirrel")(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
......@@ -179,11 +164,6 @@ add(value: T): boolean
```ts
let hashSet = new HashSet();
let result = hashSet.add("squirrel");
try {
hashSet.add.bind({}, "squirrel")(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
......@@ -222,11 +202,6 @@ let hashSet = new HashSet();
hashSet.add("squirrel");
hashSet.add("sparrow");
let result = hashSet.remove("sparrow");
try {
hashSet.remove.bind({}, "sparrow")(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
......@@ -253,11 +228,6 @@ let hashSet = new HashSet();
hashSet.add("squirrel");
hashSet.add("sparrow");
hashSet.clear();
try {
hashSet.remove.bind({})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
......@@ -295,11 +265,6 @@ while(temp != undefined) {
console.log("value:" + temp);
temp = iter.next().value;
}
try {
hashSet.values.bind({})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
......@@ -342,13 +307,6 @@ hashSet.add("squirrel");
hashSet.forEach((value, key) => {
console.log("value:" + value, key);
});
try {
hashSet.forEach.bind({}, (value, key) => {
console.log("value:" + value, key);
})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
......@@ -386,11 +344,6 @@ while(temp != undefined) {
console.log("value:" + temp[1]);
temp = iter.next().value;
}
try {
hashSet.entries.bind({})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
......@@ -435,9 +388,4 @@ while(temp != undefined) {
console.log("value: " + temp);
temp = iter.next().value;
}
try {
hashSet[Symbol.iterator].bind({})(); // bind为JS标准内置对象Function的方法,用于改变this的指向,测试异常捕获
} catch(err) {
console.log(`${err.code} - ${err.name} - ${err.message}`);
}
```
\ No newline at end of file
......@@ -1771,7 +1771,7 @@ createImageReceiver(width: number, height: number, format: number, capacity: num
| -------- | ------ | ---- | ---------------------- |
| width | number | 是 | 图像的默认宽度。 |
| height | number | 是 | 图像的默认高度。 |
| format | number | 是 | 图像格式,取值为[ImageFormat](#imageformat9)常量(目前该参数为使用者和camera约定的值,以后可能还有其他应用场景,receiver的作用只是传递,目前仅支持 ImageFormat:JPEG 格式)。 |
| format | number | 是 | 图像格式,取值为[ImageFormat](#imageformat9)常量(目前仅支持 ImageFormat:JPEG 和 4)。 |
| capacity | number | 是 | 同时访问的最大图像数。 |
**返回值:**
......
......@@ -108,7 +108,7 @@ try {
| 名称 | 类型 | 可读 | 可写 | 说明 |
| --------- | ------ | ---- | ---- | ------- |
| preKeys | Array<number> | 是 | 否 | 前置按键集合,数量范围[0, 4],前置按键无顺序要求。 |
| preKeys | Array\<number> | 是 | 否 | 前置按键集合,数量范围[0, 4],前置按键无顺序要求。 |
| finalKey | number | 是 | 否 | 最终按键,此项必填,最终按键触发上报回调函数。 |
| isFinalKeyDown | boolean | 是 | 否 | 最终按键状态。 |
| finalKeyDownDuration | number | 是 | 否 | 最终按键保持按下持续时间,为0时立即触发回调函数,大于0时,当isFinalKeyDown为true,则最终按键按下超过此时长后触发回调函数,当isFinalKeyDown为false,则最终按键按下到抬起时间小于此时长时触发回调函数。 |
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册