diff --git a/en/application-dev/reference/apis/js-apis-data-dataShare.md b/en/application-dev/reference/apis/js-apis-data-dataShare.md index 4a7cc1ed50caafcddad4cfcdbe3bbbc4398d2e04..be4f3d3022b51e7eada6f7736818f1f2b8ceeea0 100644 --- a/en/application-dev/reference/apis/js-apis-data-dataShare.md +++ b/en/application-dev/reference/apis/js-apis-data-dataShare.md @@ -4,11 +4,13 @@ The **DataShare** module allows an application to manage its own data and share > **NOTE** > -> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. +> - The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. > -> The APIs provided by this module are system APIs. > -> The APIs of this module can be used only in the stage model. +> - The APIs provided by this module are system APIs. +> +> +> - The APIs of this module can be used only in the stage model. ## Modules to Import @@ -49,7 +51,7 @@ Creates a **DataShareHelper** instance. This API uses an asynchronous callback t | Name | Type | Mandatory| Description | | -------- | -------------------------------------------------------- | ---- | ------------------------------------------------------------ | -| context | [Context](js-apis-application-context.md#context) | Yes | Context of an application. | +| context | [Context](js-apis-app-ability-uiAbility.md) | Yes | Context of an application. | | uri | string | Yes | Uniform Resource Identifier (URI) of the server application to connect. | | callback | AsyncCallback<[DataShareHelper](#datasharehelper)> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined** and **data** is the **DataShareHelper** instance created. Otherwise, **err** is an error object.| @@ -94,7 +96,7 @@ Creates a **DataShareHelper** instance. This API uses a promise to return the re | Name | Type | Mandatory| Description | | ------- | ------------------------------------------------- | ---- | ------------------------------ | -| context | [Context](js-apis-application-context.md#context) | Yes | Context of an application. | +| context | [Context](js-apis-app-ability-uiAbility.md) | Yes | Context of an application. | | uri | string | Yes | URI of the server application to connect.| **Return value** diff --git a/en/application-dev/reference/apis/js-apis-data-preferences.md b/en/application-dev/reference/apis/js-apis-data-preferences.md index b14256c20d12c8fedd2bb6d8f0b7f38091bbc8d5..99e43bc6a0e1a748dcea5eb8777db5361ded3040 100644 --- a/en/application-dev/reference/apis/js-apis-data-preferences.md +++ b/en/application-dev/reference/apis/js-apis-data-preferences.md @@ -5,7 +5,7 @@ The **Preferences** module provides APIs for processing data in the form of key- The key is of the string type, and the value can be a number, a string, a Boolean value, or an array of numbers, strings, or Boolean values. -> **NOTE**
+> **NOTE** > > The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. @@ -22,8 +22,8 @@ import data_preferences from '@ohos.data.preferences'; | Name | Type| Readable| Writable| Description | | ---------------- | -------- | ---- | ---- | --------------------------------------- | -| MAX_KEY_LENGTH | number | Yes | No | Maximum length of a key. The maximum key length is 80 bytes. | -| MAX_VALUE_LENGTH | number | Yes | No | Maximum length of a value. The maximum value length is 8192 bytes.| +| MAX_KEY_LENGTH | number | Yes | No | Maximum length of a key, which is 80 bytes. | +| MAX_VALUE_LENGTH | number | Yes | No | Maximum length of a value, which is 8192 bytes.| ## data_preferences.getPreferences @@ -38,8 +38,8 @@ Obtains a **Preferences** instance. This API uses an asynchronous callback to re | Name | Type | Mandatory| Description | | -------- | ------------------------------------------------ | ---- | ------------------------------------------------------------ | -| context | Context | Yes | Application context.
For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).
For details about the application context of the stage model, see [Context](js-apis-inner-application-uiAbilityContext.md). | -| name | string | Yes | Name of the **Preferences** instance.| +| context | Context | Yes | Application context.
For details about the application context of the FA model, see [Context](js-apis-inner-app-context.md).
For details about the application context of the stage model, see [Context](js-apis-inner-application-uiAbilityContext.md). | +| name | string | Yes | Name of the **Preferences** instance. | | callback | AsyncCallback<[Preferences](#preferences)> | Yes | Callback invoked to return the result. If the operation is successful, **err** is **undefined** and **object** is the **Preferences** instance obtained. Otherwise, **err** is an error code.| **Example** @@ -213,7 +213,6 @@ Stage model: ```ts import UIAbility from '@ohos.app.ability.UIAbility'; - class EntryAbility extends UIAbility { onWindowStageCreate(windowStage) { try { @@ -289,7 +288,6 @@ Stage model: ```ts import UIAbility from '@ohos.app.ability.UIAbility'; - class EntryAbility extends UIAbility { onWindowStageCreate(windowStage) { try{ @@ -350,7 +348,6 @@ Stage model: ```ts import UIAbility from '@ohos.app.ability.UIAbility'; - class EntryAbility extends UIAbility { onWindowStageCreate(windowStage) { try { @@ -973,7 +970,7 @@ Unsubscribes from data changes. | Name | Type | Mandatory| Description | | -------- | -------------------------------- | ---- | ------------------------------------------ | | type | string | Yes | Event type to unsubscribe from. The value **change** indicates data change events. | -| callback | Callback<{ key : string }> | No | Callback to unregister. If this parameter is left blank, the callbacks used to subscribing to all data changes will be unregistered.| +| callback | Callback<{ key : string }> | No | Callback to unregister. If this parameter is left blank, the callbacks for all data changes will be unregistered.| **Example** diff --git a/en/application-dev/reference/apis/js-apis-data-storage.md b/en/application-dev/reference/apis/js-apis-data-storage.md index 75e9293eadcd0a25fc923146b92246a885829df6..dbb9244fbe3f973baf0b307a80b7a0ed23482f71 100644 --- a/en/application-dev/reference/apis/js-apis-data-storage.md +++ b/en/application-dev/reference/apis/js-apis-data-storage.md @@ -7,8 +7,8 @@ The **DataStorage** module provides applications with data processing capability > > - The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version. > -> - The APIs of this module are no longer maintained since API version 9. You are advised to use [`@ohos.data.preferences`](js-apis-data-preferences.md). -> +> - The APIs of this module are no longer maintained since API version 9. You are advised to use [@ohos.data.preferences](js-apis-data-preferences.md). +> > - The APIs of this module can be used only in the FA model. @@ -24,8 +24,8 @@ import data_storage from '@ohos.data.storage'; | 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.| +| MAX_KEY_LENGTH | number | Yes | No | Maximum length of a key, which is 80 bytes. | +| MAX_VALUE_LENGTH | number | Yes | No | Maximum length of a value, which is 8192 bytes.| ## data_storage.getStorageSync @@ -79,7 +79,7 @@ Reads the specified file and loads its data to the **Storage** instance for data | Name | Type | Mandatory| Description | | -------- | ---------------------------------------- | ---- | -------------------------- | | path | string | Yes | Path of the target file.| -| callback | AsyncCallback<[Storage](#storage)> | Yes | Callback used to return the execution result. | +| callback | AsyncCallback<[Storage](#storage)> | Yes | Callback invoked to return the result. | **Example** @@ -172,7 +172,7 @@ context.getFilesDir().then((filePath) => { console.info("======================>getFilesDirPromise====================>"); data_storage.deleteStorageSync(path + '/mystore'); -}); +}); ``` ## data_storage.deleteStorage @@ -276,9 +276,9 @@ let context = featureAbility.getContext(); context.getFilesDir().then((filePath) => { path = filePath; console.info("======================>getFilesDirPromise====================>"); - + data_storage.removeStorageFromCacheSync(path + '/mystore'); -}); +}); ``` @@ -406,7 +406,7 @@ Obtains the value corresponding to a key. If the value is null or not of the def | -------- | ------------------------------ | ---- | ----------------------------------------- | | key | string | Yes | Key of the data. It cannot be empty. | | defValue | [ValueType](#valuetype) | Yes | Default value to be returned. It can be a number, string, or Boolean value.| -| callback | AsyncCallback<ValueType> | Yes | Callback used to return the execution result. | +| callback | AsyncCallback<ValueType> | Yes | Callback invoked to return the result. | **Example** @@ -581,7 +581,7 @@ Checks whether the storage object contains data with a given key. This API uses | Name | Type | Mandatory| Description | | -------- | ---------------------------- | ---- | ------------------------------- | | key | string | Yes | Key of the data. It cannot be empty.| -| callback | AsyncCallback<boolean> | Yes | Callback used to return the execution result. | +| callback | AsyncCallback<boolean> | Yes | Callback invoked to return the result. | **Return value** @@ -867,7 +867,7 @@ Subscribes to data changes. The **StorageObserver** needs to be implemented. Whe | 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. | +| callback | Callback<[StorageObserver](#storageobserver)> | Yes|Callback invoked to return the data change. | **Example** @@ -894,7 +894,7 @@ Unsubscribes from 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. | +| callback | Callback<[StorageObserver](#storageobserver)> | Yes|Callback for the data change. | **Example** diff --git a/en/application-dev/reference/apis/js-apis-file-environment.md b/en/application-dev/reference/apis/js-apis-file-environment.md index 9c340eef3974ed2875f417c71cb8a5f7dd4b10d8..c87c8465d7909f495baf6babad02e8e5b118424c 100644 --- a/en/application-dev/reference/apis/js-apis-file-environment.md +++ b/en/application-dev/reference/apis/js-apis-file-environment.md @@ -4,7 +4,7 @@ The **Environment** module provides APIs for obtaining the root directories of t > **NOTE** > -> - The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. +> - 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 APIs of this module are system APIs and cannot be called by third-party applications. > - The APIs of this module support processing of error codes. For details, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md). @@ -26,7 +26,7 @@ Obtains the root directory of the storage. This API uses a promise to return the | Type | Description | | --------------------- | ---------------- | -| Promise<string> | Promise returned with the root directory of the storage.| +| Promise<string> | Promise used to return the root directory of the storage.| **Example** @@ -50,7 +50,7 @@ Obtains the root directory of the storage. This API uses an asynchronous callbac | Name | Type | Mandatory| Description | | -------- | --------------------------- | ---- | -------------------------------- | -| callback | AsyncCallback<string> | Yes | Asynchronous callback used to return the root directory of the storage.| +| callback | AsyncCallback<string> | Yes | Asynchronous callback invoked to return the root directory of the storage.| **Example** diff --git a/en/application-dev/reference/apis/js-apis-file-securityLabel.md b/en/application-dev/reference/apis/js-apis-file-securityLabel.md index b9071ecc64025491ed21e55490f4753b83440eb1..13fd25683a394092653f3f7f93ef36efdaf37bca 100644 --- a/en/application-dev/reference/apis/js-apis-file-securityLabel.md +++ b/en/application-dev/reference/apis/js-apis-file-securityLabel.md @@ -5,7 +5,7 @@ The **securityLabel** module provides APIs for managing data security levels of > **NOTE** > > - The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. ->- The APIs of this module support processing of error codes. For details, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md). +> - The APIs of this module support processing of error codes. For details, see [File Management Error Codes](../errorcodes/errorcode-filemanagement.md). ## Modules to Import @@ -45,7 +45,7 @@ For details about how to obtain the FA model context, see [Context](js-apis-inne ## securityLabel.setSecurityLabel -setSecurityLabel(path:string, type:dataLevel):Promise<void> +setSecurityLabel(path:string, type:DataLevel):Promise<void> Sets a security label for a file in asynchronous mode. This API uses a promise to return the result. @@ -56,7 +56,7 @@ Sets a security label for a file in asynchronous mode. This API uses a promise t | Name | Type | Mandatory| Description | | --------- | ------ | ---- | -------------------------------------------- | | path | string | Yes | Path of the target file. | -| type | dataLevel | Yes | File security level to set, which can be **s0**, **s1**, **s2**, **s3**, or **s4**.| +| type | DataLevel | Yes | File security level to set, which can be **s0**, **s1**, **s2**, **s3**, or **s4**.| **Return value** @@ -76,7 +76,7 @@ Sets a security label for a file in asynchronous mode. This API uses a promise t ## securityLabel.setSecurityLabel -setSecurityLabel(path:string, type:dataLevel, callback: AsyncCallback<void>):void +setSecurityLabel(path:string, type:DataLevel, callback: AsyncCallback<void>):void Sets a security label for a file in asynchronous mode. This API uses an asynchronous callback to return the result. @@ -87,7 +87,7 @@ Sets a security label for a file in asynchronous mode. This API uses an asynchro | Name | Type | Mandatory| Description | | --------- | ------------------------- | ---- | -------------------------------------------- | | path | string | Yes | Path of the target file. | -| type | dataLevel | Yes | File security level to set, which can be **s0**, **s1**, **s2**, **s3**, or **s4**.| +| type | DataLevel | Yes | File security level to set, which can be **s0**, **s1**, **s2**, **s3**, or **s4**.| | callback | AsyncCallback<void> | Yes | Callback invoked to return the result. | **Example** @@ -104,7 +104,7 @@ Sets a security label for a file in asynchronous mode. This API uses an asynchro ## securityLabel.setSecurityLabelSync -setSecurityLabelSync(path:string, type:dataLevel):void +setSecurityLabelSync(path:string, type:DataLevel):void Sets a security label for a file in synchronous mode. @@ -115,7 +115,7 @@ Sets a security label for a file in synchronous mode. | Name | Type | Mandatory| Description | | --------- | ------ | ---- | -------------------------------------------- | | path | string | Yes | Path of the target file. | -| type | dataLevel | Yes | File security level to set, which can be **s0**, **s1**, **s2**, **s3**, or **s4**.| +| type | DataLevel | Yes | File security level to set, which can be **s0**, **s1**, **s2**, **s3**, or **s4**.| **Example** diff --git a/en/application-dev/reference/apis/js-apis-huks.md b/en/application-dev/reference/apis/js-apis-huks.md index cad81d4e80c3303859274b2b79c3258bf8d2556c..0dfcc793a2d005d34501735f320e78ab421b1a08 100644 --- a/en/application-dev/reference/apis/js-apis-huks.md +++ b/en/application-dev/reference/apis/js-apis-huks.md @@ -3,7 +3,7 @@ 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**
+> **NOTE** > > 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. @@ -1818,9 +1818,9 @@ Enumerates the user authentication types. | Name | Value | Description | | ------------------------------- | ---- | ------------------------- | -| HUKS_USER_AUTH_TYPE_FINGERPRINT | 1 | Fingerprint authentication. | -| HUKS_USER_AUTH_TYPE_FACE | 2 | Facial authentication.| -| HUKS_USER_AUTH_TYPE_PIN | 4 | PIN authentication.| +| HUKS_USER_AUTH_TYPE_FINGERPRINT | 1 << 0 | Fingerprint authentication. | +| HUKS_USER_AUTH_TYPE_FACE | 1 << 1 | Facial authentication.| +| HUKS_USER_AUTH_TYPE_PIN | 1 << 2 | PIN authentication.| ## HuksAuthAccessType9+ @@ -1830,8 +1830,8 @@ Enumerates the access control types. | Name | Value | Description | | --------------------------------------- | ---- | ------------------------------------------------ | -| HUKS_AUTH_ACCESS_INVALID_CLEAR_PASSWORD | 1 | The key becomes invalid after the password is cleared. | -| HUKS_AUTH_ACCESS_INVALID_NEW_BIO_ENROLL | 2 | The key becomes invalid after a new biometric feature is added.| +| HUKS_AUTH_ACCESS_INVALID_CLEAR_PASSWORD | 1 << 0 | The key becomes invalid after the password is cleared. | +| HUKS_AUTH_ACCESS_INVALID_NEW_BIO_ENROLL | 1 << 1 | The key becomes invalid after a new biometric feature is added.| ## HuksChallengeType9+ @@ -1892,7 +1892,7 @@ Enumerates the tags used to invoke parameters. | Name | Value | Description | | -------------------------------------------- | ---------------------------------------- | -------------------------------------- | | HUKS_TAG_INVALID | HuksTagType.HUKS_TAG_TYPE_INVALID \| 0 | Invalid tag. | -| HUKS_TAG_ALGORITHM | HUKS_TAG_TYPE_UINT \| 1 | Algorithm. | +| HUKS_TAG_ALGORITHM | HuksTagType.HUKS_TAG_TYPE_UINT \| 1 | Algorithm. | | HUKS_TAG_PURPOSE | HuksTagType.HUKS_TAG_TYPE_UINT \| 2 | Purpose of the key. | | HUKS_TAG_KEY_SIZE | HuksTagType.HUKS_TAG_TYPE_UINT \| 3 | Key size. | | HUKS_TAG_DIGEST | HuksTagType.HUKS_TAG_TYPE_UINT \| 4 | Digest algorithm. | @@ -1922,7 +1922,7 @@ Enumerates the tags used to invoke parameters. | HUKS_TAG_ORIGINATION_EXPIRE_DATETIME | HuksTagType.HUKS_TAG_TYPE_ULONG \| 202 | Reserved. | | HUKS_TAG_USAGE_EXPIRE_DATETIME | HuksTagType.HUKS_TAG_TYPE_ULONG \| 203 | Reserved. | | HUKS_TAG_CREATION_DATETIME | HuksTagType.HUKS_TAG_TYPE_ULONG \| 204 | Reserved. | -| HUKS_TAG_ALL_USERS | ksTagType.HUKS_TAG_TYPE_BOOL \| 301 | Reserved. | +| HUKS_TAG_ALL_USERS | HuksTagType.HUKS_TAG_TYPE_BOOL \| 301 | Reserved. | | HUKS_TAG_USER_ID | HuksTagType.HUKS_TAG_TYPE_UINT \| 302 | Reserved. | | HUKS_TAG_NO_AUTH_REQUIRED | HuksTagType.HUKS_TAG_TYPE_BOOL \| 303 | Reserved. | | HUKS_TAG_USER_AUTH_TYPE | HuksTagType.HUKS_TAG_TYPE_UINT \| 304 | User authentication type. For details, see [HuksUserAuthType](#huksuserauthtype9). This parameter must be set together with [HuksAuthAccessType](#huksauthaccesstype9). You can set a maximum of two user authentication types at a time. For example, if **HuksAuthAccessType** is **HKS_SECURE_ACCESS_INVALID_NEW_BIO_ENROLL**, you can set two of **HKS_USER_AUTH_TYPE_FACE**, **HKS_USER_AUTH_TYPE_FINGERPRINT**, and **HKS_USER_AUTH_TYPE_FACE\**.| HKS_USER_AUTH_TYPE_FINGERPRINT | @@ -2889,11 +2889,6 @@ Enumerates the error codes. | HUKS_ERROR_NEW_ROOT_KEY_MATERIAL_EXIST | -36 |New root key material exists.| | HUKS_ERROR_UPDATE_ROOT_KEY_MATERIAL_FAIL | -37 |Failed to update the root key material.| | HUKS_ERROR_VERIFICATION_FAILED | -38 |Failed to verify the certificate chain.| -| HUKS_ERROR_GET_USERIAM_SECINFO_FAILED9+ | -40 |Failed to obtain the security attribute information of the user.| -| HUKS_ERROR_GET_USERIAM_AUTHINFO_FAILED9+ | -41 |Failed to obtain the authentication information of the user.| -| HUKS_ERROR_USER_AUTH_TYPE_NOT_SUPPORT9+ | -42 |The access control of the current authentication type is not supported.| -| HUKS_ERROR_KEY_AUTH_FAILED9+ | -43 |The access control authentication has failed.| -| HUKS_ERROR_DEVICE_NO_CREDENTIAL9+ | -44 |No credential has been enrolled for the device.| | HUKS_ERROR_CHECK_GET_ALG_FAIL | -100 |Failed to obtain the ALG. | | HUKS_ERROR_CHECK_GET_KEY_SIZE_FAIL | -101 |Failed to obtain the key size.| | HUKS_ERROR_CHECK_GET_PADDING_FAIL | -102 |Failed to obtain the padding algorithm.| @@ -2920,7 +2915,5 @@ Enumerates the error codes. | HUKS_ERROR_INVALID_SALT | -123 |Invalid salt value.| | HUKS_ERROR_INVALID_ITERATION | -124 |Invalid iteration count.| | HUKS_ERROR_INVALID_OPERATION | -125 |Invalid operation.| -| HUKS_ERROR_INVALID_WRAPPED_FORMAT9+ | -126 |Incorrect format of the wrapped key being imported.| -| HUKS_ERROR_INVALID_USAGE_OF_KEY9+ | -127 |Incorrect purpose of the wrapped key being imported.| | HUKS_ERROR_INTERNAL_ERROR | -999 |Internal error.| | HUKS_ERROR_UNKNOWN_ERROR | -1000 |Unknown error.|