diff --git a/README_zh.md b/README_zh.md index 0add1ca75ee7fb41dd56d1a180b3abf30098ea76..27ad5abed9665603e2bf925f5e59b5dcf221f658 100644 --- a/README_zh.md +++ b/README_zh.md @@ -33,7 +33,14 @@ OpenHarmony_v1.x_release:OpenHarmony 1.1.4 LTS稳定版本,[了解版本详 [了解更多版本详情](zh-cn/release-notes/)。 +## 第三方开源软件及许可说明 +3rd-Party-License:[第三方开源软件及许可证说明](zh-cn/contribute/第三方开源软件及许可证说明.md) +## 贡献 +非常欢迎您参与[贡献](zh-cn/contribute/参与贡献.md),我们鼓励开发者以各种方式参与文档反馈和贡献。 +您可以对现有文档进行评价、简单更改、反馈文档质量问题、贡献您的原创内容,详细请参考[贡献文档](zh-cn/contribute/贡献文档.md)。 + +卓越贡献者将会在开发者社区文档贡献专栏表彰公示。 \ No newline at end of file diff --git a/en/application-dev/reference/apis/Readme-EN.md b/en/application-dev/reference/apis/Readme-EN.md index f9f0247e9fff7af42e5d4ba0e57bec7750d41fa5..b33bcf666262b6c1b98d4ed734c08b4a2a6d03bc 100644 --- a/en/application-dev/reference/apis/Readme-EN.md +++ b/en/application-dev/reference/apis/Readme-EN.md @@ -45,8 +45,13 @@ - [SMS](js-apis-sms.md) - [SIM Management](js-apis-sim.md) - [Radio](js-apis-radio.md) - - [observer](js-apis-observer.md) + - [Observer](js-apis-observer.md) - [Cellular Data](js-apis-telephony-data.md) +- Network Management + - [Network Connection Management](js-apis-net-connection.md) + - [Socket Connection](js-apis-socket.md) + - [WebSocket Connection](js-apis-webSocket.md) + - [Data Request](js-apis-http.md) - Network and Connectivity - [WLAN](js-apis-wifi.md) - [Bluetooth](js-apis-bluetooth.md) diff --git a/en/application-dev/reference/apis/js-apis-call.md b/en/application-dev/reference/apis/js-apis-call.md index 33ea80fda600d889e265ace58cb3de2b5f0d19fb..4d2b6c07f8170d6f930fc6522095967c3f608f92 100644 --- a/en/application-dev/reference/apis/js-apis-call.md +++ b/en/application-dev/reference/apis/js-apis-call.md @@ -11,11 +11,11 @@ import call from '@ohos.telephony.call'; ``` -## call.dial +## call.dial dial\(phoneNumber: string, callback: AsyncCallback\): void -Initiates a call. This function uses an asynchronous callback to return the execution result. +Initiates a call. This API uses an asynchronous callback to return the execution result. **Required permission**: ohos.permission.PLACE\_CALL (a system permission) @@ -23,7 +23,7 @@ Initiates a call. This function uses an asynchronous callback to return the exec **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ----------- | ---------------------------- | ---- | ------------------------------------------------- | | phoneNumber | string | Yes | Phone number. | | callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: success
- **false**: failure| @@ -37,11 +37,11 @@ call.dial("138xxxxxxxx", (err, data) => { ``` -## call.dial +## call.dial dial\(phoneNumber: string, options: DialOptions, callback: AsyncCallback\): void -Initiates a call. You can set call options as needed. This function uses an asynchronous callback to return the execution result. +Initiates a call. You can set call options as needed. This API uses an asynchronous callback to return the execution result. **Required permission**: ohos.permission.PLACE\_CALL (a system permission) @@ -49,10 +49,10 @@ Initiates a call. You can set call options as needed. This function uses an asyn **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ----------- | ---------------------------- | ---- | ------------------------------------------------- | | phoneNumber | string | Yes | Phone number. | -| options | DialOptions | Yes | Call options. For details, see [DialOptions](#DialOptions). | +| options | DialOptions | Yes | Call options defined in [DialOptions](#dialoptions). | | callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: success
- **false**: failure| **Example** @@ -66,11 +66,11 @@ call.dial("138xxxxxxxx", { ``` -## call.dial +## call.dial dial\(phoneNumber: string, options?: DialOptions\): Promise -Initiates a call. You can set call options as needed. This function uses a promise to return the execution result. +Initiates a call. You can set call options as needed. This API uses a promise to return the execution result. **Required permission**: ohos.permission.PLACE\_CALL (a system permission) @@ -78,10 +78,10 @@ Initiates a call. You can set call options as needed. This function uses a promi **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ----------- | ----------- | ---- | ------------------------------------------- | | phoneNumber | string | Yes | Phone number. | -| options | DialOptions | Yes | Call options. For details, see [DialOptions](#DialOptions).| +| options | DialOptions | Yes | Call options defined in [DialOptions](#dialoptions).| **Return Value** @@ -102,17 +102,19 @@ promise.then(data => { }); ``` -## call.makeCall7+ +## call.makeCall7+ -makeCall(phoneNumber: string, callback: AsyncCallback): void +makeCall(phoneNumber: string, callback: AsyncCallback\): void -Launches the call screen and displays the dialed number. This method uses an asynchronous callback to return the result. +Launches the call screen and displays the dialed number. This API uses an asynchronous callback to return the result. -**System capability**: SystemCapability.Telephony.CallManager +This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR. + +**System capability**: SystemCapability.Applications.Contacts **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ----------- | ------------------------- | ---- | ------------------------------------------ | | phoneNumber | string | Yes | Phone number. | | callback | AsyncCallback<void> | Yes | Callback used to return the result.| @@ -126,17 +128,19 @@ call.makeCall("138xxxxxxxx", err => { ``` -## call.makeCall7+ +## call.makeCall7+ -makeCall(phoneNumber: string): Promise +makeCall(phoneNumber: string): Promise\ -Launches the call screen and displays the dialed number. This method uses a promise to return the result. +Launches the call screen and displays the dialed number. This API uses a promise to return the result. -**System capability**: SystemCapability.Telephony.CallManager +This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR. + +**System capability**: SystemCapability.Applications.Contacts **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ----------- | ------ | ---- | ---------- | | phoneNumber | string | Yes | Phone number.| @@ -157,17 +161,17 @@ promise.then(() => { }); ``` -## call.hasCall +## call.hasCall hasCall\(callback: AsyncCallback\): void -Checks whether a call is in progress. This function uses an asynchronous callback to return the result. +Checks whether a call is in progress. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Telephony.CallManager **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | -------- | ---------------------------- | ---- | ------------------------------------------------------------ | | callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: A call is in progress.
- **false**: No call is in progress.| @@ -180,11 +184,11 @@ call.hasCall((err, data) => { ``` -## call.hasCall +## call.hasCall hasCall\(\): Promise -Checks whether a call is in progress. This function uses a promise to return the result. +Checks whether a call is in progress. This API uses a promise to return the result. **System capability**: SystemCapability.Telephony.CallManager @@ -206,19 +210,19 @@ promise.then(data => { ``` -## call.getCallState +## call.getCallState getCallState\(callback: AsyncCallback\): void -Obtains the call status. This function uses an asynchronous callback to return the result. +Obtains the call status. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Telephony.CallManager **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | -------- | -------------------------------------------- | ---- | ------------------------------------ | -| callback | AsyncCallback<[CallState](#CallState)> | Yes | Callback used to return the result.| +| callback | AsyncCallback<[CallState](#callstate)> | Yes | Callback used to return the result.| **Example** @@ -229,11 +233,11 @@ call.getCallState((err, data) => { ``` -## call.getCallState +## call.getCallState getCallState\(\): Promise -Obtains the call status. This function uses a promise to return the result. +Obtains the call status. This API uses a promise to return the result. **System capability**: SystemCapability.Telephony.CallManager @@ -241,7 +245,7 @@ Obtains the call status. This function uses a promise to return the result. | Type | Description | | -------------------------------------- | ----------------------------------------- | -| Promise<[CallState](#CallState)> | Promise used to return the result.| +| Promise<[CallState](#callstate)> | Promise used to return the result.| **Example** @@ -254,11 +258,11 @@ promise.then(data => { }); ``` -## call.hasVoiceCapability7+ +## call.hasVoiceCapability7+ hasVoiceCapability(): boolean -Checks whether a device supports voice calls. This function works in synchronous mode. +Checks whether a device supports voice calls. This API works in synchronous mode. **System capability**: SystemCapability.Telephony.CallManager @@ -273,17 +277,17 @@ let result = call.hasVoiceCapability(); console.log(`hasVoiceCapability: ${JSON.stringify(result)}`); ``` -## call.isEmergencyPhoneNumber7+ +## call.isEmergencyPhoneNumber7+ isEmergencyPhoneNumber\(phoneNumber: string, callback: AsyncCallback\): void -Checks whether the call number of the SIM card in the specified slot is an emergency number. This function uses an asynchronous callback to return the result. +Checks whether the call number of the SIM card in the specified slot is an emergency number. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Telephony.CallManager **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ----------- | ---------------------------- | ---- | ------------------------------------------------------------ | | phoneNumber | string | Yes | Phone number. | | callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: The called number is an emergency number.
- **false**: The called number is not an emergency number.| @@ -297,20 +301,20 @@ call.isEmergencyPhoneNumber("138xxxxxxxx", (err, data) => { ``` -## call.isEmergencyPhoneNumber7+ +## call.isEmergencyPhoneNumber7+ isEmergencyPhoneNumber\(phoneNumber: string, options: EmergencyNumberOptions, callback: AsyncCallback\): void -Checks whether the call number of the SIM card in the specified slot is an emergency number. This function uses an asynchronous callback to return the result. +Checks whether the call number of the SIM card in the specified slot is an emergency number. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Telephony.CallManager **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ----------- | ---------------------------- | ---- | ------------------------------------------------------------ | | phoneNumber | string | Yes | Phone number. | -| options | EmergencyNumberOptions | Yes | Emergency number options defined in [EmergencyNumberOptions](#EmergencyNumberOptions).| +| options | EmergencyNumberOptions | Yes | Emergency number options defined in [EmergencyNumberOptions](#emergencynumberoptions7).| | callback | AsyncCallback<boolean> | Yes | Callback used to return the result.
- **true**: The called number is an emergency number.
- **false**: The called number is not an emergency number.| **Example** @@ -322,20 +326,20 @@ call.isEmergencyPhoneNumber("112", {slotId: 1}, (err, value) => { ``` -## call.isEmergencyPhoneNumber7+ +## call.isEmergencyPhoneNumber7+ isEmergencyPhoneNumber\(phoneNumber: string, options?: EmergencyNumberOptions\): Promise -Checks whether the call number of the SIM card in the specified slot is an emergency number. This function uses a promise to return the result. +Checks whether the call number of the SIM card in the specified slot is an emergency number. This API uses a promise to return the result. **System capability**: SystemCapability.Telephony.CallManager **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ----------- | ---------------------- | ---- | ------------------------------------------------------------ | | phoneNumber | string | Yes | Phone number. | -| options | EmergencyNumberOptions | Yes | Emergency number options defined in [EmergencyNumberOptions](#EmergencyNumberOptions).| +| options | EmergencyNumberOptions | Yes | Emergency number options defined in [EmergencyNumberOptions](#emergencynumberoptions7).| **Return Value** @@ -354,17 +358,17 @@ promise.then(data => { }); ``` -## call.formatPhoneNumber7+ +## call.formatPhoneNumber7+ formatPhoneNumber\(phoneNumber: string, callback: AsyncCallback\): void -Formats a phone number based on the specified ISO country code. This function uses an asynchronous callback to return the result. +Formats a phone number based on the specified ISO country code. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Telephony.CallManager **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ----------- | --------------------------- | ---- | ------------------------------------ | | phoneNumber | string | Yes | Phone number. | | callback | AsyncCallback<string> | Yes | Callback used to return the result.| @@ -378,20 +382,20 @@ call.formatPhoneNumber("138xxxxxxxx", (err, data) => { ``` -## call.formatPhoneNumber7+ +## call.formatPhoneNumber7+ formatPhoneNumber\(phoneNumber: string, options: NumberFormatOptions, callback: AsyncCallback\): void -Formats a phone number based on specified formatting options. This function uses an asynchronous callback to return the result. +Formats a phone number based on specified formatting options. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Telephony.CallManager **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ----------- | --------------------------- | ---- | ------------------------------------------------------------ | | phoneNumber | string | Yes | Phone number. | -| options | NumberFormatOptions | Yes | Number formatting options defined in [NumberFormatOptions](#NumberFormatOptions).| +| options | NumberFormatOptions | Yes | Number formatting options defined in [NumberFormatOptions](#numberformatoptions7).| | callback | AsyncCallback<string> | Yes | Callback used to return the result. | **Example** @@ -405,20 +409,20 @@ call.formatPhoneNumber("138xxxxxxxx",{ ``` -## call.formatPhoneNumber7+ +## call.formatPhoneNumber7+ formatPhoneNumber\(phoneNumber: string, options?: NumberFormatOptions\): Promise -Formats a phone number based on specified formatting options. This function uses a promise to return the result. +Formats a phone number based on specified formatting options. This API uses a promise to return the result. **System capability**: SystemCapability.Telephony.CallManager **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ----------- | ------------------- | ---- | ------------------------------------------------------------ | | phoneNumber | string | Yes | Phone number. | -| options | NumberFormatOptions | Yes | Number formatting options defined in [NumberFormatOptions](#NumberFormatOptions).| +| options | NumberFormatOptions | Yes | Number formatting options defined in [NumberFormatOptions](#numberformatoptions7).| **Return Value** @@ -439,11 +443,11 @@ promise.then(data => { }); ``` -## call.formatPhoneNumberToE1647+ +## call.formatPhoneNumberToE1647+ formatPhoneNumberToE164\(phoneNumber: string, countryCode: string, callback: AsyncCallback\): void -Converts a phone number into the E.164 format. This function uses an asynchronous callback to return the result. +Converts a phone number into the E.164 format. This API uses an asynchronous callback to return the result. The phone number must match the specified country code. For example, for a China phone number, the country code must be **CN**. Otherwise, **null** will be returned. @@ -453,7 +457,7 @@ All country codes are supported. **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ----------- | --------------------------- | ---- | ----------------------------------------------------- | | phoneNumber | string | Yes | Phone number. | | countryCode | string | Yes | Country code, for example, **CN** (China). All country codes are supported. | @@ -470,11 +474,11 @@ call.formatPhoneNumberToE164("138xxxxxxxx",{ ``` -## call.formatPhoneNumberToE1647+ +## call.formatPhoneNumberToE1647+ formatPhoneNumberToE164\(phoneNumber: string, countryCode: string\): Promise -Converts a phone number into the E.164 format. This function uses a promise to return the result. +Converts a phone number into the E.164 format. This API uses a promise to return the result. The phone number must match the specified country code. For example, for a China phone number, the country code must be **CN**. Otherwise, **null** will be returned. @@ -484,7 +488,7 @@ All country codes are supported. **Parameters** -| Name | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ----------- | ------ | ---- | ---------------------------------------- | | phoneNumber | string | Yes | Phone number. | | countryCode | string | Yes | Country code, for example, **CN** (China). All country codes are supported.| @@ -508,43 +512,45 @@ promise.then(data => { }); ``` -## DialOptions +## DialOptions Provides an option for determining whether a call is a video call. **System capability**: SystemCapability.Telephony.CallManager -| Parameter | Type | Mandatory| Description | +| Name| Type | Mandatory| Description | | ------ | ------- | ---- | ------------------------------------------------------------ | | extras | boolean | No | Indication of a video call.
- **true**: video call
- **false** (default): voice call| -## CallState +## CallState Enumerates call states. -| Variable | Value | Description | +**System capability**: SystemCapability.Telephony.CallManager + +| Name | Value | Description | | ------------------ | ---- | ------------------------------------------------------------ | -| CALL_STATE_UNKNOWN | -1 | The call status fails to be obtained and is unknown.
**System capability**: SystemCapability.Telephony.CallManager| -| CALL_STATE_IDLE | 0 | No call is in progress.
**System capability**: SystemCapability.Telephony.CallManager| -| CALL_STATE_RINGING | 1 | The call is in the ringing or waiting state.
**System capability**: SystemCapability.Telephony.CallManager| -| CALL_STATE_OFFHOOK | 2 | At least one call is in dialing, active, or on hold, and no new incoming call is ringing or waiting.
**System capability**: SystemCapability.Telephony.CallManager| +| CALL_STATE_UNKNOWN | -1 | The call status fails to be obtained and is unknown. | +| CALL_STATE_IDLE | 0 | No call is in progress. | +| CALL_STATE_RINGING | 1 | The call is in the ringing or waiting state. | +| CALL_STATE_OFFHOOK | 2 | At least one call is in dialing, active, or on hold, and no new incoming call is ringing or waiting.| -## EmergencyNumberOptions7+ +## EmergencyNumberOptions7+ Provides an option for determining whether a number is an emergency number for the SIM card in the specified slot. **System capability**: SystemCapability.Telephony.CallManager -| Parameter | Type | Mandatory| Description | +| Name| Type | Mandatory| Description | | ------ | ------ | ---- | ------------------------------------------ | | slotId | number | No | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| -## NumberFormatOptions7+ +## NumberFormatOptions7+ Provides an option for number formatting. **System capability**: SystemCapability.Telephony.CallManager -| Parameter | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ----------- | ------ | ---- | ---------------------------------------------------------- | | countryCode | string | No | Country code, for example, **CN** (China). All country codes are supported. The default value is **CN**.| diff --git a/en/application-dev/reference/apis/js-apis-camera.md b/en/application-dev/reference/apis/js-apis-camera.md index c076a882942d2145b641555efd8ac2bd5a504fd4..3d41d138f00cfee03c52555c27fe3e18e8dd2dcf 100644 --- a/en/application-dev/reference/apis/js-apis-camera.md +++ b/en/application-dev/reference/apis/js-apis-camera.md @@ -1,7 +1,7 @@ # Camera > ![icon-note.gif](public_sys-resources/icon-note.gif) **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. +> 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. ## Modules to Import @@ -31,11 +31,6 @@ Gets a **CameraManager** instance. This method uses an asynchronous callback to | context | Context | Yes | Application context | | callback | AsyncCallback | Yes | Callback used to return the CameraManager instance | - -**Return values** - -none - **Example** ``` @@ -82,59 +77,62 @@ camera.getCameraManager(context).then((cameraManger) => { Enumerates camera status types. +**System Capabilities:** + +SystemCapability.Multimedia.Camera.Core + | Name | Default Value | Description | |---------------------------|---------------|--------------------| -| CAMERA_STATUS_APPEAR | 0 | Camera appear
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_STATUS_DISAPPEAR | 1 | Camera disappear
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_STATUS_AVAILABLE | 2 | Camera available
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_STATUS_UNAVAILABLE | 3 | Camera unavailable
System Capabilities: SystemCapability.Multimedia.Camera.Core| +| CAMERA_STATUS_APPEAR | 0 | Camera appear | +| CAMERA_STATUS_DISAPPEAR | 1 | Camera disappear | +| CAMERA_STATUS_AVAILABLE | 2 | Camera available | +| CAMERA_STATUS_UNAVAILABLE | 3 | Camera unavailable | ## CameraPosition Enumerates the camera positions. +**System Capabilities:** + +SystemCapability.Multimedia.Camera.Core + | Name | Default value | Description | |-----------------------------|---------------|-----------------------| -| CAMERA_POSITION_UNSPECIFIED | 0 | Unspecified position
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_POSITION_BACK | 1 | Rear camera
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_POSITION_FRONT | 2 | Front camera
System Capabilities: SystemCapability.Multimedia.Camera.Core | +| CAMERA_POSITION_UNSPECIFIED | 0 | Unspecified position | +| CAMERA_POSITION_BACK | 1 | Rear camera | +| CAMERA_POSITION_FRONT | 2 | Front camera | ## CameraType Enumerates the camera types. +**System Capabilities:** + +SystemCapability.Multimedia.Camera.Core + | Name | Default value | Description | |-------------------------|---------------|-------------------------| -| CAMERA_TYPE_UNSPECIFIED | 0 | Unspecified camera type
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_TYPE_WIDE_ANGLE | 1 | Wide camera
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_TYPE_ULTRA_WIDE | 2 | Ultra wide camera
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_TYPE_TELEPHOTO | 3 | Telephoto camera
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_TYPE_TRUE_DEPTH | 4 | True depth camera
System Capabilities: SystemCapability.Multimedia.Camera.Core | +| CAMERA_TYPE_UNSPECIFIED | 0 | Unspecified camera type | +| CAMERA_TYPE_WIDE_ANGLE | 1 | Wide camera | +| CAMERA_TYPE_ULTRA_WIDE | 2 | Ultra wide camera | +| CAMERA_TYPE_TELEPHOTO | 3 | Telephoto camera | +| CAMERA_TYPE_TRUE_DEPTH | 4 | True depth camera | ## ConnectionType Enumerates camera connection types. -| Name | Default value | Description | -|------------------------------|---------------|----------------------------| -| CAMERA_CONNECTION_BUILT_IN | 0 | Built-in camera
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_CONNECTION_USB_PLUGIN | 1 | Camera connected using USB
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_CONNECTION_REMOTE | 2 | Remote camera
System Capabilities: SystemCapability.Multimedia.Camera.Core | - - -## CameraFormat - -Enumerates the camera formats. +**System Capabilities:** -| Name | Default value | Description | -|----------------------------|---------------|---------------------| -| CAMERA_FORMAT_YCRCb_420_SP | 1003 | Camera YCRCb
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_FORMAT_JPEG | 2000 | Camera format jpeg
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_FORMAT_AVC | 3000 | Camera format avc
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| CAMERA_FORMAT_HEVC | 3001 | Camera format hevc
System Capabilities: SystemCapability.Multimedia.Camera.Core | +SystemCapability.Multimedia.Camera.Core +| Name | Default value | Description | +|------------------------------|---------------|----------------------------| +| CAMERA_CONNECTION_BUILT_IN | 0 | Built-in camera | +| CAMERA_CONNECTION_USB_PLUGIN | 1 | Camera connected using USB | +| CAMERA_CONNECTION_REMOTE | 2 | Remote camera | ## CameraManager @@ -156,10 +154,6 @@ Gets all cameras supported by the device. This method uses an asynchronous callb |----------|--------------------------------|-----------|---------------------------------------------------------| | callback | AsyncCallback\> | Yes | Callback used to return the array of supported cameras. | -**Return values** - -none - **Example** ``` @@ -182,10 +176,6 @@ SystemCapability.Multimedia.Camera.Core Gets all cameras supported by the device. This method uses a promise to return the array of supported cameras. -**Parameters** - -none - **Return values** | Type | Description | @@ -218,10 +208,6 @@ Creates a **CameraInput** instance with the specified camera ID. This method use | cameraId | string | Yes | Camera ID used to create the instance | | callback | AsyncCallback | Yes | Callback used to return the CameraInput instance | -**Return values** - -none - **Example** ``` @@ -282,10 +268,6 @@ Creates a **CameraInput** instance with the specified camera position and camera | cameraType | CameraType | Yes | Camera type | | callback | AsyncCallback | Yes | Callback used to return the CameraInput instance | -**Return values** - -none - **Example** ``` @@ -346,10 +328,6 @@ Listens for camera status changes. This method uses a callback to get camera sta | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to get the camera status change. | -**Return value** - -None - **Example** ``` @@ -361,38 +339,48 @@ cameraManager.on('cameraStatus', (cameraStatusInfo) => { ## Camera -Camera class. +when we call *cameraManager.getCameras()* API, then it will return the **Camera** class which will have all camera-related metadata such as *cameraId, cameraPosition, cameraType & connectionType*. + +**System Capabilities:** + +SystemCapability.Multimedia.Camera.Core **Fields** | Name | Type | Access | Description | |----------------|----------------|----------|------------------------| -| cameraId | string | readonly | Camera ID
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| cameraPosition | cameraPosition | readonly | Camera position
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| cameraType | cameraType | readonly | Camera type
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| connectionType | connectionType | readonly | Camera connection type
System Capabilities: SystemCapability.Multimedia.Camera.Core| +| cameraId | string | readonly | Camera ID | +| cameraPosition | cameraPosition | readonly | Camera position | +| cameraType | cameraType | readonly | Camera type | +| connectionType | connectionType | readonly | Camera connection type | ``` -var cameraManager = await camera.getCameraManager(); -var cameras = await cameraManager.getCameras(); -var cameraObj = cameras[0]; -var cameraId = cameraObj.cameraId; -var cameraPosition = cameraObj.cameraPosition; -var cameraType = cameraObj.cameraType; -var cameraId = cameraObj.connectionType; +async function getCameraInfo() { + var cameraManager = await camera.getCameraManager(); + var cameras = await cameraManager.getCameras(); + var cameraObj = cameras[0]; + var cameraId = cameraObj.cameraId; + var cameraPosition = cameraObj.cameraPosition; + var cameraType = cameraObj.cameraType; + var cameraId = cameraObj.connectionType; +} ``` ## CameraStatusInfo -CameraStatusInfo class. +This interface is a CameraManager callback API return. **CameraStatusInfo** will have *Camera* class & *CameraStatus* predefine constants.From *Camera* class, we can have all camera-related metadata & from *CameraStatus* constants, we will have information such as *APPEAR, DISAPPEAR, AVAILABLE & UNAVAILABLE*. + +**System Capabilities:** + +SystemCapability.Multimedia.Camera.Core **Fields** | Name | Type | Description | |----------------|----------------|------------------| -| camera | Camera | Camera object
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| status | CameraStatus | Camera status
System Capabilities: SystemCapability.Multimedia.Camera.Core | +| camera | Camera | Camera object | +| status | CameraStatus | Camera status | ## CameraInput @@ -415,10 +403,6 @@ Gets the camera ID based on which this **CameraInput** instance is created. This |----------|------------------------|-----------|---------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the camera ID | -**Return values** - -none - ``` cameraInput.getCameraId((err, cameraId) => { if (err) { @@ -439,10 +423,6 @@ SystemCapability.Multimedia.Camera.Core Gets the camera ID based on which this **CameraInput** instance is created. This method uses a promise to return the camera ID. -**Parameters** - -none - **Return values** | Type | Description | @@ -457,251 +437,6 @@ cameraInput.getCameraId().then((cameraId) => { }) ``` -### getSupportedSizes\(format: CameraFormat, callback: AsyncCallback\>\): void; - -**System Capabilities:** - -SystemCapability.Multimedia.Camera.Core - -**Description** - -Gets supported sizes for a given format. This method uses an asynchronous callback to return the supported sizes. - -**Parameters** - -| Name | Type | Mandatory | Description | -|----------|------------------------------|-----------|---------------------------------------------| -| format | CameraFormat | Yes | Camera format used to get supported sizes | -| callback | AsyncCallback\> | Yes | Callback used to return the supported sizes | - - -**Return values** - -none - -**Example** - -``` -cameraInput.getSupportedSizes(format, (err, sizes) => { - if (err) { - console.error('Failed to get the supported sizes. ${err.message}'); - return; - } - console.log('Callback returned with the supported sizes:' + sizes); -}) -``` - -### getSupportedSizes\(format: CameraFormat\): Promise\>; - -**System Capabilities:** - -SystemCapability.Multimedia.Camera.Core - -**Description** - -Gets supported sizes for a given format. This method uses a promise to return the supported sizes. - -**Parameters** - -| Name | Type | Mandatory | Description | -|----------|----------------------------|-----------|-----------------------------------------------| -| format | CameraFormat | Yes | Camera format used to get the supported sizes | - -**Return values** - -| Type | Description | -|------------------------|---------------------------------------------| -| Promise\> | Promise used to return the supported sizes. | - -**Example** - -``` -cameraInput.getSupportedSizes(format).then((sizes) => { - console.log('Promise returned with supported sizes: ' + sizes); -}) -``` - -### getSupportedPreviewFormats\(callback: AsyncCallback\>\): void; - -**System Capabilities:** - -SystemCapability.Multimedia.Camera.Core - -**Description** - -Gets supported formats for preview. This method uses an asynchronous callback to return the supported formats. - -**Parameters** - -| Name | Type | Mandatory | Description | -|----------|--------------------------------------|-----------|---------------------------------------------------| -| callback | AsyncCallback\> | Yes | Callback used to return the supported preview formats. | - - -**Return values** - -none - -**Example** - -``` -cameraInput.getSupportedPreviewFormats((err, previewFormats) => { - if (err) { - console.error('Failed to get the supported preview formats. ${err.message}'); - return; - } - console.log('Callback returned with supported preview formats: ' + previewFormats.length); -}) -``` - -### getSupportedPreviewFormats\(\): Promise\>; - -**System Capabilities:** - -SystemCapability.Multimedia.Camera.Core - -**Description** - -Gets supported formats for preview. This method uses a promise to return the supported formats. - -**Parameters** - -none - -**Return values** - -| Type | Description | -|--------------------------------|-------------------------------------------------------| -| Promise\> | Promise used to return the supported preview formats | - -**Example** - -``` -cameraInput.getSupportedPreviewFormats().then((previewFormats) => { - console.log('Promise returned with supported preview formats.' + previewFormats.length); -}) -``` - -### getSupportedPhotoFormats\(callback: AsyncCallback\>\): void; - -**System Capabilities:** - -SystemCapability.Multimedia.Camera.Core - -**Description** - -Gets supported formats for photographing. This method uses an asynchronous callback to return the supported formats. - -**Parameters** - -| Name | Type | Mandatory | Description | -|----------|--------------------------------------|-----------|-------------------------------------------------| -| callback | AsyncCallback\> | Yes | Callback used to return the supported photo formats. | - -**Return values** - -none - -**Example** - -``` -cameraInput.getSupportedPhotoFormats((err, photoFormats) => { - if (err) { - console.error('Failed to get the supported photo formats. ${err.message}'); - return; - } - console.log('Callback returned with supported photo formats'); -}) -``` - -### getSupportedPhotoFormats\(\): Promise\>; - -**System Capabilities:** - -SystemCapability.Multimedia.Camera.Core - -**Description** - -Gets supported formats for photographing. This method uses a promise to return the supported formats. - -**Parameters** - -none - -**Return values** - -| Type | Description | -|--------------------------------|---------------------------------------------------| -| Promise\> | Promise used to return supported photo formats. | - -**Example** - -``` -cameraInput.getSupportedPhotoFormats().then((photoFormats) => { - console.log('Promise returned with supported photo formats.' + photoFormats.length); -}) -``` - -### getSupportedVideoFormats\(callback: AsyncCallback\>\): void; - -**System Capabilities:** - -SystemCapability.Multimedia.Camera.Core - -**Description** - -Gets supported formats for video recording. This method uses an asynchronous callback to return the supported video formats. - -**Parameters** - -| Name | Type | Mandatory | Description | -|----------|--------------------------------------|-----------|-------------------------------------------------| -| callback | AsyncCallback\> | Yes | Callback used to return the supported video formats. | - -**Return values** - -none - -**Example** - -``` -cameraInput.getSupportedVideoFormats((err, videoFormats) => { - if (err) { - console.error('Failed to get the supported video formats. ${err.message}'); - return; - } - console.log('Callback returned with supported video formats : ' + videoFormats.length); -}) -``` - -### getSupportedVideoFormats\(\): Promise\>; - -**System Capabilities:** - -SystemCapability.Multimedia.Camera.Core - -**Description** - -Gets supported formats for video recording. This method uses a promise to return the supported video format. - -**Parameters** - -none - -**Return values** - -| Type | Description | -|--------------------------------|---------------------------------------------------| -| Promise\> | Promise used to return supported video formats. | - -**Example** - -``` -cameraInput.getSupportedVideoFormats().then((videoFormats) => { - console.log('Promise returned with supported video formats.' + videoFormats.length); -}) -``` - ### hasFlash(callback: AsyncCallback): void; **System Capabilities:** @@ -718,10 +453,6 @@ Checks whether the device has flash light. This method uses an asynchronous call |----------|-------------------------|-----------|----------------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the flash light support status | -**Return values** - -none - **Example** ``` @@ -744,10 +475,6 @@ SystemCapability.Multimedia.Camera.Core Checks whether the device has flash light. This method uses a promise to return the result. -**Parameters** - -none - **Return values** | Type | Description | @@ -779,10 +506,6 @@ Checks whether a specified flash mode is supported. This method uses an asynchro | flashMode | FlashMode | Yes | Flash mode | | callback | AsyncCallback | Yes | Callback used to return the device flash support status | -**Return values** - -none - **Example** ``` @@ -844,10 +567,6 @@ Note: Before setting the flash mode, check the support for the flash light (FlashMode | Yes | Flash mode | | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -887,7 +606,7 @@ Note: Before setting the flash mode, check the support for the flash light ( { +cameraInput.setFlashMode(flashMode).then(() => { console.log('Promise returned with the successful execution of setFlashMode.'); }) ``` @@ -908,10 +627,6 @@ Gets current flash mode. This method uses an asynchronous callback to return the |-----------|---------------------------|-----------|------------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the current flash mode | -**Return values** - -none - **Example** ``` @@ -934,10 +649,6 @@ SystemCapability.Multimedia.Camera.Core Gets current flash mode. This method uses a promise to return the result. -**Parameters** - -none - **Return values** | Type | Description | @@ -947,7 +658,7 @@ none **Example** ``` -cameraInput.getFlashMode().then(flashMode) => { +cameraInput.getFlashMode().then((flashMode) => { console.log('Promise returned with current flash mode : ' + flashMode); }) ``` @@ -969,10 +680,6 @@ Checks whether a specified focus mode is supported. This method uses an asynchro | afMode | FocusMode | Yes | Focus mode | | callback | AsyncCallback | Yes | Callback used to return the device focus support status | -**Return values** - -none - **Example** ``` @@ -1034,10 +741,6 @@ Note: Before setting the focus mode, check focus mode support (FocusMode | Yes | Focus mode | | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -1077,7 +780,7 @@ Note: Before setting the focus mode, check focus mode support ( Enumerates the focus modes. +**System Capabilities:** + +SystemCapability.Multimedia.Camera.Core + | Name | Default value | Description | |----------------------------|---------------|----------------------------| -| FOCUS_MODE_MANUAL | 0 | Focus mode manual
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| FOCUS_MODE_CONTINUOUS_AUTO | 1 | Focus mode continuous auto
System Capabilities: SystemCapability.Multimedia.Camera.Core| -| FOCUS_MODE_AUTO | 2 | Focus mode auto
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| FOCUS_MODE_LOCKED | 3 | Focus mode locked
System Capabilities: SystemCapability.Multimedia.Camera.Core | - +| FOCUS_MODE_MANUAL | 0 | Focus mode manual | +| FOCUS_MODE_CONTINUOUS_AUTO | 1 | Focus mode continuous auto | +| FOCUS_MODE_AUTO | 2 | Focus mode auto | +| FOCUS_MODE_LOCKED | 3 | Focus mode locked | ## createCaptureSession\(context: Context, callback: AsyncCallback\): void; @@ -1484,14 +1149,10 @@ Creates a **CaptureSession** instance. This method uses an asynchronous callback | context | Context | Yes | Application context | | callback | AsyncCallback | Yes | Callback used to return the CaptureSession instance | -**Return values** - -none - **Example** ``` -captureSession.createCaptureSession(context), (err, captureSession) => { +captureSession.createCaptureSession((context), (err, captureSession) => { if (err) { console.error('Failed to create the CaptureSession instance. ${err.message}'); return; @@ -1550,10 +1211,6 @@ Starts configuration for this CaptureSession instance. This method uses an async |----------|----------------------|-----------|----------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -1576,10 +1233,6 @@ SystemCapability.Multimedia.Camera.Core Starts configuration for this CaptureSession instance. This method uses a promise to return the result. -**Parameters** - -none - **Return values** | Type | Description | @@ -1611,10 +1264,6 @@ Commits the configuration for this CaptureSession instance. This method uses an |----------|---------------------|-----------|----------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -1637,10 +1286,6 @@ SystemCapability.Multimedia.Camera.Core Commits the configuration for this CaptureSession instance. This method uses a promise to return the result. -**Parameters** - -none - **Return values** | Type | Description | @@ -1672,10 +1317,6 @@ Add a CameraInput instance to this CaptureSession instance. This method uses an | cameraInput | CameraInput | Yes | CameraInput instance to add | | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -1735,10 +1376,6 @@ Add a PreviewOutput instance to this CaptureSession instance. This method uses a | previewOutput | PreviewOutput | Yes | PreviewOutput instance to add | | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -1798,10 +1435,6 @@ Add a PhotoOutput instance to this CaptureSession instance. This method uses an | photoOutput | PhotoOutput | Yes | PhotoOutput instance to add | | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -1861,10 +1494,6 @@ Add a VideoOutput instance to this CaptureSession instance. This method uses an | videoOutput | VideoOutput | Yes | VideoOutput instance to add | | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -1924,11 +1553,6 @@ Removes a **CameraInput** instance from this **CaptureSession** instance. This m | cameraInput | CameraInput | Yes | CameraInput instance to remove | | callback | AsyncCallback | Yes | Callback used to return the result | - -**Return values** - -none - **Example** ``` @@ -1988,10 +1612,6 @@ Removes a **PreviewOutput** instance from this **CaptureSession** instance. This | previewOutput | PreviewOutput | Yes | PreviewOutput instance to remove | | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -2053,10 +1673,6 @@ Removes a **PhotoOutput** instance from this **CaptureSession** instance. This m | photoOutput | PhotoOutput | Yes | PhotoOutput instance to remove | | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -2118,10 +1734,6 @@ Removes a **VideoOutput** instance from this **CaptureSession** instance. This m | videoOutput | VideoOutput | Yes | VideoOutput instance to remove | | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -2182,10 +1794,6 @@ Starts this **CaptureSession** instance. This method uses an asynchronous callba |----------|----------------------|-----------|----------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -2208,10 +1816,6 @@ SystemCapability.Multimedia.Camera.Core Starts this **CaptureSession** instance. This method uses a promise to return the result. -**Parameters** - -none - **Return values** | Type | Description | @@ -2243,10 +1847,6 @@ Stops this **CaptureSession** instance. This method uses an asynchronous callbac |----------|----------------------|-----------|------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -2269,10 +1869,6 @@ SystemCapability.Multimedia.Camera.Core Stops this **CaptureSession** instance. This method uses a promise to return the result. -**Parameters** - -none - **Return values** | Type | Description | @@ -2303,10 +1899,6 @@ Releases this **CaptureSession** instance. This method uses an asynchronous call |----------|----------------------|-----------|------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -2329,10 +1921,6 @@ SystemCapability.Multimedia.Camera.Core Releases this **CaptureSession** instance. This method uses a promise to return the result. -**Parameters** - -none - **Return values** | Type | Description | @@ -2364,10 +1952,6 @@ Listens for **CaptureSession** errors. This method uses a callback to get errors | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to get the capture session errors. | -**Return value** - -None - **Example** ``` @@ -2393,14 +1977,10 @@ Creates a **PreviewOutput** instance. This method uses an asynchronous callback | surfaceId | string | Yes | Surface ID received from XComponent view | | callback | AsyncCallback | Yes | Callback used to return the PreviewOutput instance | -**Return values** - -none - **Example** ``` -camera.createPreviewOutput(surfaceId), (err, previewOutput) => { +camera.createPreviewOutput((surfaceId), (err, previewOutput) => { if (err) { console.error('Failed to create the PreviewOutput instance. ${err.message}'); return; @@ -2459,10 +2039,6 @@ Releases this **PreviewOutput** instance. This method uses an asynchronous callb |----------|----------------------|-----------|----------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -2485,9 +2061,6 @@ SystemCapability.Multimedia.Camera.Core Releases this **PreviewOutput** instance. This method uses a promise to return the result. -**Parameters** -none - **Return values** | Type | Description | @@ -2520,10 +2093,6 @@ Listens for preview frame start events. This method uses a callback to get the e | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to return the result | -**Return value** - -None - **Example** ``` @@ -2549,10 +2118,6 @@ Listens for preview frame end event. This method uses a callback to get the even | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to return the result | -**Return value** - -None - **Example** ``` @@ -2578,10 +2143,6 @@ Listens for **PreviewOutput** errors. This method uses a callback to get errors. | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to get the preview output errors. | -**Return value** - -None - **Example** ``` @@ -2607,14 +2168,10 @@ Creates a **PhotoOutput** instance. This method uses an asynchronous callback to | surfaceId | string | Yes | Surface ID received from ImageReceiver | | callback | AsyncCallback | Yes | Callback used to return the PhotoOutput instance | -**Return values** - -none - **Example** ``` -camera.createPhotoOutput(surfaceId), (err, photoOutput) => { +camera.createPhotoOutput((surfaceId), (err, photoOutput) => { if (err) { console.error('Failed to create the PhotoOutput instance. ${err.message}'); return; @@ -2656,42 +2213,58 @@ camera.createPhotoOutput(surfaceId).then((photoOutput) => { Enumerates the image rotation angles. +**System Capabilities:** + +SystemCapability.Multimedia.Camera.Core + | Name | Default Value | Description | |--------------|---------------|----------------------------------------| -| ROTATION_0 | 0 | The capture image rotates 0 degrees
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| ROTATION_90 | 90 | The capture image rotates 90 degrees
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| ROTATION_180 | 180 | The capture image rotates 180 degrees
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| ROTATION_270 | 270 | The capture image rotates 270 degrees
System Capabilities: SystemCapability.Multimedia.Camera.Core| +| ROTATION_0 | 0 | The capture image rotates 0 degrees | +| ROTATION_90 | 90 | The capture image rotates 90 degrees | +| ROTATION_180 | 180 | The capture image rotates 180 degrees | +| ROTATION_270 | 270 | The capture image rotates 270 degrees | ## Location Defines the location of a captured image. +**System Capabilities:** + +SystemCapability.Multimedia.Camera.Core + | Name | Type | Access | Description | |-----------|--------|--------------|-------------| -| latitude | number | read / write | Latitude
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| longitude | number | read / write | Longitude
System Capabilities: SystemCapability.Multimedia.Camera.Core | +| latitude | number | read / write | Latitude | +| longitude | number | read / write | Longitude | ## QualityLevel Enumerates the image quality levels. +**System Capabilities:** + +SystemCapability.Multimedia.Camera.Core + | Name | Default value | Description | |----------------------|---------------|----------------------| -| QUALITY_LEVEL_HIGH | 0 | High image quality
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| QUALITY_LEVEL_MEDIUM | 1 | Medium image quality
System Capabilities: SystemCapability.Multimedia.Camera.Core | -| QUALITY_LEVEL_LOW | 2 | Low image quality
System Capabilities: SystemCapability.Multimedia.Camera.Core | +| QUALITY_LEVEL_HIGH | 0 | High image quality | +| QUALITY_LEVEL_MEDIUM | 1 | Medium image quality | +| QUALITY_LEVEL_LOW | 2 | Low image quality | ## PhotoCaptureSetting Defines the settings for image capture. +**System Capabilities:** + +SystemCapability.Multimedia.Camera.Core + | Name | Type | Mandatory | Description | |----------|---------------|-----------|---------------------| -| quality | QualityLevel | Optional | Photo image quality
System Capabilities: SystemCapability.Multimedia.Camera.Core| -| rotation | ImageRotation | Optional | Photo rotation
System Capabilities: SystemCapability.Multimedia.Camera.Core | +| quality | QualityLevel | Optional | Photo image quality | +| rotation | ImageRotation | Optional | Photo rotation | ## PhotoOutput @@ -2714,10 +2287,6 @@ Captures a photo. This method uses an asynchronous callback to return the result |----------|---------------------|-----------|----------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -2747,10 +2316,6 @@ Captures a photo with the specified capture settings. This method uses an asynch | setting | PhotoCaptureSetting | Yes | Photo capture settings | | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -2810,10 +2375,6 @@ Releases this **PhotoOutput** instance. This method uses an asynchronous callbac |----------|----------------------|-----------|----------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -2836,9 +2397,6 @@ SystemCapability.Multimedia.Camera.Core Releases this **PhotoOutput** instance. This method uses a promise to return the result. -**Parameters** -none - **Return values** | Type | Description | @@ -2871,10 +2429,6 @@ Listens for photo capture start events. This method uses a callback to get the e | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to get the capture ID. | -**Return value** - -None - **Example** ``` @@ -2900,10 +2454,6 @@ Listens for frame shutter events. This method uses a callback to get the event i | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to get the frame shutter information.| -**Return value** - -None - **Example** ``` @@ -2930,10 +2480,6 @@ Listens for photo capture end events. This method uses a callback to get the eve | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to get the capture end information | -**Return value** - -None - **Example** ``` @@ -2960,10 +2506,6 @@ Listens for **PhotoOutput** errors. This method uses a callback to get errors. | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to get the photo output errors. | -**Return value** - -None - **Example** ``` @@ -2989,14 +2531,10 @@ Creates a **VideoOutput** instance. This method uses an asynchronous callback to | surfaceId | string | Yes | Surface ID received from VideoRecorder | | callback | AsyncCallback | Yes | Callback used to return the VideoOutput instance | -**Return values** - -none - **Example** ``` -camera.createVideoOutput(surfaceId), (err, videoOutput) => { +camera.createVideoOutput((surfaceId), (err, videoOutput) => { if (err) { console.error('Failed to create the VideoOutput instance. ${err.message}'); return; @@ -3054,10 +2592,6 @@ Starts the video output. This method uses an asynchronous callback to return the |----------|----------------------|-----------|----------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -3080,9 +2614,6 @@ SystemCapability.Multimedia.Camera.Core Starts the video output. This method uses a promise to return the result. -**Parameters** -none - **Return values** | Type | Description | @@ -3114,10 +2645,6 @@ Stops the video output. This method uses an asynchronous callback to return the |----------|----------------------|-----------|----------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -3140,9 +2667,6 @@ SystemCapability.Multimedia.Camera.Core Stops the video output. This method uses a promise to return the result. -**Parameters** -none - **Return values** | Type | Description | @@ -3173,10 +2697,6 @@ Releases this VideoOutput instance. This method uses an asynchronous callback to |----------|----------------------|-----------|----------------------------------------------| | callback | AsyncCallback | Yes | Callback used to return the result | -**Return values** - -none - **Example** ``` @@ -3199,10 +2719,6 @@ SystemCapability.Multimedia.Camera.Core Releases this VideoOutput instance. This method uses a promise to return the result. -**Parameters** - -none - **Return values** | Type | Description | @@ -3235,10 +2751,6 @@ Listens for video frame start events. This method uses a callback to get the eve | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to return the result | -**Return value** - -None - **Example** ``` @@ -3258,10 +2770,6 @@ Listens for video frame end events. This method uses a callback to get the event | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to return the result | -**Return value** - -None - **Example** ``` @@ -3281,10 +2789,6 @@ Listens for **VideoOutput** errors. This method uses a callback to get errors. | type | string | Yes | Name of the event to listen for. | | callback | Callback | Yes | Callback used to get the video output errors. | -**Return value** - -None - **Example** ``` diff --git a/en/application-dev/reference/apis/js-apis-hitracechain.md b/en/application-dev/reference/apis/js-apis-hitracechain.md index 2ad97f096f7abedaa6e8dceb06678d564c287802..b5af74e563915592773475c7a2409f1bbe682690 100644 --- a/en/application-dev/reference/apis/js-apis-hitracechain.md +++ b/en/application-dev/reference/apis/js-apis-hitracechain.md @@ -9,57 +9,62 @@ import hiTraceChain from '@ohos.hiTraceChain'; ``` -## System Capabilities - -SystemCapability.HiviewDFX.HiTrace ## HiTraceFlag Enumerates trace flag types. +**System capability**: SystemCapability.HiviewDFX.HiTrace + | Name| Default Value| Description| | -------- | -------- | -------- | -| DEFAULT | 0 | Default flag| -| INCLUDE_ASYNC | 1 | Asynchronous call flag| -| DONOT_CREATE_SPAN | 1 << 1 | No span flag| -| TP_INFO | 1 << 2 | Trace point flag| -| NO_BE_INFO | 1 << 3 | No begin/end flag| -| DISABLE_LOG | 1 << 4 | Log association flag| -| FAILURE_TRIGGER | 1 << 5 | Failure trigger flag| -| D2D_TP_INFO | 1 << 6 | Device-to-device trace point flag| +| DEFAULT | 0 | Default flag. | +| INCLUDE_ASYNC | 1 | Asynchronous call flag. By default, only synchronous calls are traced. If this flag is set, both synchronous and asynchronous calls will be traced. | +| DONOT_CREATE_SPAN | 1 << 1 | No span flag. By default, a span is automatically created during tracing of synchronous and asynchronous calls. If this flag is set, no span will be created. | +| TP_INFO | 1 << 2 | Trace point flag. By default, no trace point is added when tracing is enabled. This flag is used for debugging. If this flag is set, trace points will be automatically added on the TX and RX sides of synchronous and asynchronous calls to output trace point and timestamp information. Trace points are classified into four types: [CS, SR, SS, and CR](#hitracetracepointtype). For a synchronous call, the output trace points are CS, SR, SS, and CR; for an asynchronous call, the output trace points are CS, SR, and SS. | +| NO_BE_INFO | 1 << 3 | No begin/end flag. By default, information about the start and end of the trace task is printed. If this flag is set, information about the start and end of the trace task will not be printed.| +| DISABLE_LOG | 1 << 4 | Log association flag. If this flag is set, information about the trace task will not be printed. | +| FAILURE_TRIGGER | 1 << 5 | Failure trigger flag. This flag is reserved for future use. | +| D2D_TP_INFO | 1 << 6 | Device-to-device trace point flag. It is a subset of **TP_INFO**. If this flag is set, trace points are added only for call chain tracing between devices.| ## HiTraceTracepointType Enumerates trace point types. +**System capability**: SystemCapability.HiviewDFX.HiTrace + | Name| Default Value| Description| | -------- | -------- | -------- | -| CS | 0 | Client Send| -| CR | 1 | Client Receive| -| SS | 2 | Server Send| -| SR | 3 | Server Receive| -| GENERAL | 4 | General| +| CS | 0 | Client Send (CS) trace point. | +| CR | 1 | Client Receive (CS) trace point. | +| SS | 2 | Server Send (SS) trace point. | +| SR | 3 | Server Receive (SR) trace point. | +| GENERAL | 4 | General trace points except CS, CR, SS, and SR.| ## HiTraceCommunicationMode Enumerates communication modes. +**System capability**: SystemCapability.HiviewDFX.HiTrace + | Name| Default Value| Description| | -------- | -------- | -------- | -| DEFAULT | 0 | Default mode| -| THREAD | 1 | Inter-thread communication| -| PROCESS | 2 | Inter-process communication| -| DEVICE | 3 | Inter-device communication| +| DEFAULT | 0 | Default communication mode. | +| THREAD | 1 | Inter-thread communication. | +| PROCESS | 2 | Inter-process communication. | +| DEVICE | 3 | Inter-device communication. | ## HiTraceId Defines a **HiTraceId** object. +**System capability**: SystemCapability.HiviewDFX.HiTrace + | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | -| chainId | bigint | Yes| Call chain ID.| -| spanId | number | No| Span ID.| -| parentSpanId | number | No| Parent span ID.| +| chainId | bigint | Yes| Call chain ID. | +| spanId | number | No| Span ID. | +| parentSpanId | number | No| Parent span ID. | | flags | number | No| Trace flag combination.| ## hiTraceChain.begin @@ -68,6 +73,8 @@ begin(name: string, flags: number = HiTraceFlag.DEFAULT): HiTraceId Starts call chain tracing. This API works in synchronous manner. +**System capability**: SystemCapability.HiviewDFX.HiTrace + **Parameters** | Name| Type| Mandatory| Description| @@ -93,6 +100,8 @@ end(id: HiTraceId): void Stops call chain tracing. This API works in synchronous manner. +**System capability**: SystemCapability.HiviewDFX.HiTrace + **Parameters** | Name| Type| Mandatory| Description| @@ -113,6 +122,8 @@ getId(): HiTraceId Obtains the trace ID. This API works in synchronous manner. +**System capability**: SystemCapability.HiviewDFX.HiTrace + **Return value** | Type| Description| @@ -133,6 +144,8 @@ setId(id: HiTraceId): void Sets a trace ID. This API works in synchronous manner. +**System capability**: SystemCapability.HiviewDFX.HiTrace + **Parameters** | Name| Type| Mandatory| Description| @@ -153,6 +166,8 @@ clearId(): void Clears the trace ID. This API works in synchronous manner. +**System capability**: SystemCapability.HiviewDFX.HiTrace + **Example** ``` @@ -167,6 +182,8 @@ createSpan(): HiTraceId Creates a trace span. This API works in synchronous manner. +**System capability**: SystemCapability.HiviewDFX.HiTrace + **Return value** | Type| Description| @@ -187,6 +204,8 @@ tracepoint(mode: HiTraceCommunicationMode, type: HiTraceTracepointType, id: HiTr Triggers a trace point. This API works in synchronous manner. +**System capability**: SystemCapability.HiviewDFX.HiTrace + **Parameters** | Name| Type| Mandatory| Description| @@ -210,6 +229,8 @@ isValid(id: HiTraceId): boolean Checks whether a **HiTraceId** instance is valid. This API works in synchronous manner. +**System capability**: SystemCapability.HiviewDFX.HiTrace + **Parameters** | Name| Type| Mandatory| Description| @@ -235,6 +256,8 @@ isFlagEnabled(id: HiTraceId, flag: HiTraceFlag): boolean Checks whether the specified trace flag in the **HiTraceId** instance is enabled. This API works in synchronous manner. +**System capability**: SystemCapability.HiviewDFX.HiTrace + **Parameters** | Name| Type| Mandatory| Description| @@ -262,6 +285,8 @@ enableFlag(id: HiTraceId, flag: HiTraceFlag): void Enables the specified trace flag in the **HiTraceId** instance. This API works in synchronous manner. +**System capability**: SystemCapability.HiviewDFX.HiTrace + **Parameters** | Name| Type| Mandatory| Description| | -------- | -------- | -------- | -------- | diff --git a/en/application-dev/reference/apis/js-apis-http.md b/en/application-dev/reference/apis/js-apis-http.md index 3956505f311775d34c41c3e98b41b8d7ab882243..b3986832237d649e34dff9ed546378504fa9db78 100644 --- a/en/application-dev/reference/apis/js-apis-http.md +++ b/en/application-dev/reference/apis/js-apis-http.md @@ -37,8 +37,8 @@ httpRequest.request( extraData: { "data": "data to send", }, - connectTimeout: 60000, // Optional. The default value is **60000**, in ms. - readTimeout: 60000, // Optional. The default value is **60000**, in ms. + connectTimeout: 60000, // Optional. The default value is 60000, in ms. + readTimeout: 60000, // Optional. The default value is 60000, in ms. },(err, data) => { if (!err) { // data.result contains the HTTP response. It is up to you whether to parse the content. @@ -60,7 +60,7 @@ httpRequest.request( createHttp\(\): HttpRequest -Creates an HTTP request. You can use this API to initiate or destroy an HTTP request, or enable or disable listening for HTTP Response Header events. An HttpRequest object corresponds to an HTTP request. To initiate multiple HTTP requests, you must create an HttpRequest object for each HTTP request. +Creates an HTTP request. You can use this API to initiate or destroy an HTTP request, or enable or disable listening for HTTP Response Header events. An HttpRequest object corresponds to an HTTP request. To initiate multiple HTTP requests, you must create an **HttpRequest** object for each HTTP request. **System capability**: SystemCapability.Communication.NetStack @@ -68,7 +68,7 @@ Creates an HTTP request. You can use this API to initiate or destroy an HTTP req | Type | Description | | :---------- | :----------------------------------------------------------- | -| HttpRequest | An **HttpRequest **object, which contains the **request**, **destroy**, **on**, or **off** method.| +| HttpRequest | An **HttpRequest** object, which contains the **request**, **destroy**, **on**, or **off** method.| **Example** @@ -137,25 +137,25 @@ Initiates an HTTP request containing specified options to a given URL. This API ``` httpRequest.request("EXAMPLE_URL", { - method: 'GET', - header: { - 'Content-Type': 'application/json' - }, - readTimeout: 60000, - connectTimeout: 60000 -},(err, data) => { - if (!err) { - console.info('Result:' + data.result); - console.info('code:' + data.responseCode); - console.info('header:' + data.header); - console.info('cookies:' + data.cookies); // 8+ - console.info('header['Content-Type']:' + data.header['Content-Type']); - console.info('header['Status-Line']:' + data.header['Status-Line']); - console.info('header.Date:' + data.header.Date); - console.info('header.Server:' + data.header.Server); - } else { - console.info('error:' + err.data); - } + method: 'GET', + header: { + 'Content-Type': 'application/json' + }, + readTimeout: 60000, + connectTimeout: 60000 +}, (err, data) => { + if (!err) { + console.info('Result:' + data.result); + console.info('code:' + data.responseCode); + console.info('header:' + data.header); + console.info('cookies:' + data.cookies); // 8+ + console.info('header.Content-Type:' + data.header['Content-Type']); + console.info('header.Status-Line:' + data.header['Status-Line']); + console.info('header.Date:' + data.header.Date); + console.info('header.Server:' + data.header.Server); + } else { + console.info('error:' + err.data); + } }); ``` @@ -188,24 +188,24 @@ Initiates an HTTP request to a given URL. This API uses a promise to return the ``` let promise = httpRequest.request("EXAMPLE_URL", { - method: "GET", - connectTimeout: 60000, - readTimeout: 60000, - header: { - 'Content-Type': 'application/json' - } + method: "GET", + connectTimeout: 60000, + readTimeout: 60000, + header: { + 'Content-Type': 'application/json' + } }); promise.then((value) => { - console.info('Result:' + value.result); - console.info('code:' + value.responseCode); - console.info('header:' + value.header); - console.info('cookies:' + value.cookies); // 8+ - console.info('header['Content-Type']:' + value.header['Content-Type']); - console.info('header['Status-Line']:' + value.header['Status-Line']); - console.info('header.Date:' + value.header.Date); - console.info('header.Server:' + value.header.Server); + console.info('Result:' + value.result); + console.info('code:' + value.responseCode); + console.info('header:' + value.header); + console.info('cookies:' + value.cookies); // 8+ + console.info('header.Content-Type:' + value.header['Content-Type']); + console.info('header.Status-Line:' + value.header['Status-Line']); + console.info('header.Date:' + value.header.Date); + console.info('header.Server:' + value.header.Server); }).catch((err) => { - console.error(`errCode:${err.code}, errMessage:${err.data}`); + console.error(`errCode:${err.code}, errMessage:${err.data}`); }); ``` @@ -246,9 +246,9 @@ Registers an observer for HTTP Response Header events. ``` httpRequest.on('headerReceive', (err, data) => { if (!err) { - console.info('header: ' + data.header); + console.info('header: ' + data.header); } else { - console.info('error:' + err.data); + console.info('error:' + err.data); } }); ``` @@ -280,9 +280,9 @@ Unregisters the observer for HTTP Response Header events. ``` httpRequest.on('headerReceive', (err, data) => { if (!err) { - console.info('header: ' + data.header); + console.info('header: ' + data.header); } else { - console.info('error:' + err.data); + console.info('error:' + err.data); } }); httpRequest.off('headerReceive'); diff --git a/en/application-dev/reference/apis/js-apis-media.md b/en/application-dev/reference/apis/js-apis-media.md index 918757324c65226f33047966940bcfbf3723779c..71be88dd94b4df3b95365068394e353c3acda12f 100644 --- a/en/application-dev/reference/apis/js-apis-media.md +++ b/en/application-dev/reference/apis/js-apis-media.md @@ -10,7 +10,7 @@ This subsystem offers various media services covering audio and video, which pro - Audio playback ([AudioPlayer](#audioplayer)) - Video playback ([VideoPlayer](#videoplayer8)) - Audio recording ([AudioRecorder](#audiorecorder)) -- Video recording ([VideoRecorder](#VideoRecorder8+)) +- Video recording ([VideoRecorder](#videoRecorder9)) The following capabilities will be provided in later versions: data source audio/video playback, audio/video encoding and decoding, container encapsulation and decapsulation, and media capability query. @@ -125,9 +125,9 @@ Creates an **AudioRecorder** instance to control audio recording. let audiorecorder = media.createAudioRecorder(); ``` -## media.createVideoRecorder8+ +## media.createVideoRecorder9+ -createVideoRecorder(callback: AsyncCallback\<[VideoRecorder](#videorecorder8)>): void +createVideoRecorder(callback: AsyncCallback\<[VideoRecorder](#videorecorder9)>): void Creates a **VideoRecorder** instance in asynchronous mode. This API uses a callback to return the result. @@ -137,7 +137,7 @@ Creates a **VideoRecorder** instance in asynchronous mode. This API uses a callb | Name | Type | Mandatory| Description | | -------- | ----------------------------------------------- | ---- | ------------------------------ | -| callback | AsyncCallback<[VideoRecorder](#videorecorder8)> | Yes | Callback used to return the **VideoRecorder** instance created.| +| callback | AsyncCallback<[VideoRecorder](#videorecorder9)> | Yes | Callback used to return the **VideoRecorder** instance created.| **Example** @@ -154,9 +154,9 @@ media.createVideoRecorder((error, video) => { }); ``` -## media.createVideoRecorder8+ +## media.createVideoRecorder9+ -createVideoRecorder(): Promise<[VideoRecorder](#videorecorder8)> +createVideoRecorder(): Promise<[VideoRecorder](#videorecorder9)> Creates a **VideoRecorder** instance in asynchronous mode. This API uses a promise to return the result. @@ -166,7 +166,7 @@ Creates a **VideoRecorder** instance in asynchronous mode. This API uses a promi | Type | Description | | ----------------------------------------- | ----------------------------------- | -| Promise<[VideoRecorder](#videorecorder8)> | Promise used to return the **VideoRecorder** instance created.| +| Promise<[VideoRecorder](#videorecorder9)> | Promise used to return the **VideoRecorder** instance created.| **Example** @@ -228,16 +228,16 @@ Enumerates the codec MIME types. **System capability**: SystemCapability.Multimedia.Media.Core -| Name | Value | Description | -| ------------ | --------------------- | ------------------------------------------------------------ | -| VIDEO_H263 | 'video/h263' | Video in H.263 format.| -| VIDEO_AVC | 'video/avc' | Video in AVC format.| -| VIDEO_MPEG2 | 'video/mpeg2' | Video in MPEG-2 format.| -| VIDEO_MPEG4 | 'video/mp4v-es' | Video in MPEG-4 format.| -| VIDEO_VP8 | 'video/x-vnd.on2.vp8' | Video in VP8 format.| +| Name | Value | Description | +| ------------ | --------------------- | ------------------------ | +| VIDEO_H263 | 'video/h263' | Video in H.263 format. | +| VIDEO_AVC | 'video/avc' | Video in AVC format. | +| VIDEO_MPEG2 | 'video/mpeg2' | Video in MPEG-2 format. | +| VIDEO_MPEG4 | 'video/mp4v-es' | Video in MPEG-4 format. | +| VIDEO_VP8 | 'video/x-vnd.on2.vp8' | Video in VP8 format. | | AUDIO_AAC | "audio/mp4a-latm" | Audio in MP4A-LATM format.| -| AUDIO_VORBIS | 'audio/vorbis' | Audio in Vorbis format.| -| AUDIO_FLAC | 'audio/flac' | Audio in FLAC format.| +| AUDIO_VORBIS | 'audio/vorbis' | Audio in Vorbis format. | +| AUDIO_FLAC | 'audio/flac' | Audio in FLAC format. | ## MediaDescriptionKey8+ @@ -273,7 +273,7 @@ Enumerates the buffering event types. ## AudioPlayer -Provides methods to manage and play audio. Before calling a method of **AudioPlayer**, you must use [createAudioPlayer()](#mediacreateaudioplayer) to create an **AudioPlayer** instance. +Provides APIs to manage and play audio. Before calling an API of **AudioPlayer**, you must use [createAudioPlayer()](#mediacreateaudioplayer) to create an **AudioPlayer** instance. For details about the audio playback demo, see [Audio Playback Development](../../media/audio-playback.md). @@ -283,7 +283,7 @@ For details about the audio playback demo, see [Audio Playback Development](../. | Name | Type | Readable| Writable| Description | | ----------- | ------------------------- | ---- | ---- | ------------------------------------------------------------ | -| src | string | Yes | Yes | Audio media URI. The mainstream audio formats (MPEG-4, AAC, MPEG-3, OGG, and WAV) are supported.
**Example of supported URIs**:
1. FD playback: fd://xx
![en-us_image_0000001164217678](figures/en-us_image_url.png)
2. HTTP network playback: http://xx
3. HLS network playback path (under development)
**Note**:
To use media materials, you must declare the read permission. Otherwise, the media materials cannot be played properly.| +| src | string | Yes | Yes | Audio media URI. The mainstream audio formats (MPEG-4, AAC, MPEG-3, OGG, and WAV) are supported.
**Example of supported URIs**:
1. FD playback: fd://xx
![](figures/en_image_url.png)
2. HTTP network playback: http://xx
3. HLS network playback path (under development)
**Note**:
To use media materials, you must declare the read permission. Otherwise, the media materials cannot be played properly.| | loop | boolean | Yes | Yes | Whether to loop audio playback. The value **true** means to loop audio playback, and **false** means the opposite. | | currentTime | number | Yes | No | Current audio playback position. | | duration | number | Yes | No | Audio duration. | @@ -293,7 +293,7 @@ For details about the audio playback demo, see [Audio Playback Development](../. play(): void -Starts to play audio resources. This method can be called only after the [dataLoad](#on('play' | 'pause' | 'stop' | 'reset' | 'dataLoad' | 'finish' | 'volumeChange')) event is triggered. +Starts to play audio resources. This API can be called only after the [dataLoad](#audioplayer_on) event is triggered. **System capability**: SystemCapability.Multimedia.Media.AudioPlayer @@ -424,7 +424,7 @@ audioPlayer = undefined; ### getTrackDescription8+ -getTrackDescription(callback: AsyncCallback>): void +getTrackDescription(callback: AsyncCallback>): void Obtains the audio track information. This API uses a callback to return the result. @@ -460,7 +460,7 @@ audioPlayer.getTrackDescription((error, arrlist) => { ### getTrackDescription8+ -getTrackDescription(): Promise> +getTrackDescription(): Promise> Obtains the audio track information. This API uses a promise to return the result. @@ -511,10 +511,10 @@ Subscribes to the audio buffering update event. **Parameters** -| Name | Type | Mandatory| Description | -| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | -| type | string | Yes | Type of the event to subscribe to, which is 'bufferingUpdate' in this example. | -| callback | (infoType: [BufferingInfoType](#bufferinginfotype8), value: number) => void | Yes | Callback invoked when the event is triggered.
When [BufferingInfoType](#bufferinginfotype8) is set to **BUFFERING_PERCENT** or **CACHED_DURATION**, **value** is valid. Otherwise, **value** is fixed at **0**.| +| Name | Type | Mandatory| Description | +| -------- | -------- | ---- | ------------------------------------------------------------ | +| type | string | Yes | Type of the event to subscribe to, which is 'bufferingUpdate' in this example. | +| callback | function | Yes | Callback invoked when the event is triggered.
When [BufferingInfoType](#bufferinginfotype8) is set to **BUFFERING_PERCENT** or **CACHED_DURATION**, **value** is valid. Otherwise, **value** is fixed at **0**.| **Example** @@ -525,7 +525,7 @@ audioPlayer.on('bufferingUpdate', (infoType, value) => { }); ``` - ### on('play' | 'pause' | 'stop' | 'reset' | 'dataLoad' | 'finish' | 'volumeChange') + ### on('play' | 'pause' | 'stop' | 'reset' | 'dataLoad' | 'finish' | 'volumeChange') on(type: 'play' | 'pause' | 'stop' | 'reset' | 'dataLoad' | 'finish' | 'volumeChange', callback: () => void): void @@ -537,7 +537,7 @@ Subscribes to the audio playback events. | Name | Type | Mandatory| Description | | -------- | ---------- | ---- | ------------------------------------------------------------ | -| type | string | Yes | Type of the event to subscribe to. The following events are supported: 'play' \| 'pause' \| 'stop' \| 'reset' \| 'dataLoad' \| 'finish' \| 'volumeChange'
- The 'play' event is triggered when the [play()](#play) method is called and audio playback starts.
- The 'pause' event is triggered when the [pause()](#pause) method is called and audio playback is paused.
- The 'stop' event is triggered when the [stop()](#stop) method is called and audio playback stops.
- The 'reset' event is triggered when the [reset()](#reset7) method is called and audio playback is reset.
- The 'dataLoad' event is triggered when the audio data is loaded, that is, when the **src** attribute is configured.
- The 'finish' event is triggered when the audio playback is finished.
- The 'volumeChange' event is triggered when the [setVolume()](#setvolume) method is called and the playback volume is changed.| +| type | string | Yes | Type of the event to subscribe to. The following events are supported: 'play' \| 'pause' \| 'stop' \| 'reset' \| 'dataLoad' \| 'finish' \| 'volumeChange'
- The 'play' event is triggered when the [play()](#audioplayer_play) API is called and audio playback starts.
- The 'pause' event is triggered when the [pause()](#audioplayer_pause) API is called and audio playback is paused.
- The 'stop' event is triggered when the [stop()](#audioplayer_stop) API is called and audio playback stops.
- The 'reset' event is triggered when the [reset()](#audioplayer_reset) API is called and audio playback is reset.
- The 'dataLoad' event is triggered when the audio data is loaded, that is, when the **src** attribute is configured.
- The 'finish' event is triggered when the audio playback is finished.
- The 'volumeChange' event is triggered when the [setVolume()](#audioplayer_setvolume) API is called and the playback volume is changed.| | callback | () => void | Yes | Callback invoked when the event is triggered. | **Example** @@ -550,7 +550,7 @@ audioPlayer.on('dataLoad', () => { // Set the 'dataLoad' event callba }); audioPlayer.on('play', () => { // Set the 'play' event callback. console.info('audio play success'); - audioPlayer.seek(30000); // Call the seek() method and trigger the 'timeUpdate' event callback. + audioPlayer.seek(30000); // Call the seek() API and trigger the 'timeUpdate' event callback. }); audioPlayer.on('pause', () => { // Set the 'pause' event callback. console.info('audio pause success'); @@ -609,7 +609,7 @@ Subscribes to the 'timeUpdate' event. | Name | Type | Mandatory| Description | | -------- | ----------------- | ---- | ------------------------------------------------------------ | -| type | string | Yes | Type of the event to subscribe to, which is 'timeUpdate' in this method.
The 'timeUpdate' event is triggered when the [seek()](#seek) method is called.| +| type | string | Yes | Type of the event to subscribe to, which is 'timeUpdate' in this API.
The 'timeUpdate' event is triggered when the [seek()](#audioplayer_seek) API is called.| | callback | Callback\ | Yes | Callback invoked when the event is triggered. The input parameter of the callback is the time when the seek operation is successful. | **Example** @@ -637,7 +637,7 @@ Subscribes to the audio playback error event. | Name | Type | Mandatory| Description | | -------- | ------------- | ---- | ------------------------------------------------------------ | -| type | string | Yes | Type of the event to subscribe to, which is 'error' in this method.
The 'error' event is triggered when an error occurs during audio playback.| +| type | string | Yes | Type of the event to subscribe to, which is 'error' in this API.
The 'error' event is triggered when an error occurs during audio playback.| | callback | ErrorCallback | Yes | Callback invoked when the event is triggered. | **Example** @@ -667,7 +667,7 @@ Enumerates the audio playback states. You can obtain the state through the **sta ## VideoPlayer8+ -Provides methods to manage and play video. Before calling a method of the **VideoPlayer** class, you must call [createVideoPlayer()](#media.createvideoplayer8) to create a [VideoPlayer](#videoplayer8) instance. +Provides APIs to manage and play video. Before calling an API of the **VideoPlayer** class, you must call [createVideoPlayer()](#mediacreatevideoplayer8) to create a [VideoPlayer](#videoplayer8) instance. For details about the video playback demo, see [Video Playback Development](../../media/video-playback.md). @@ -677,7 +677,7 @@ For details about the video playback demo, see [Video Playback Development](../. | Name | Type | Readable| Writable| Description | | ------------------------ | ---------------------------------- | ---- | ---- | ------------------------------------------------------------ | -| url8+ | string | Yes | Yes | Video media URL. The mainstream video formats (MPEG-4, MPEG-TS, WebM, and MKV) are supported.
**Example of supported URIs**:
1. FD playback: fd://xx
![en-us_image_0000001164217678](figures/en-us_image_url.png)
2. HTTP network playback: http://xx
3. HLS network playback path (under development)
**Note**:
To use media materials, you must declare the read permission. Otherwise, the media materials cannot be played properly.| +| url8+ | string | Yes | Yes | Video media URL. The mainstream video formats (MPEG-4, MPEG-TS, WebM, and MKV) are supported.
**Example of supported URIs**:
1. FD playback: fd://xx
![](figures/en_image_url.png)
2. HTTP network playback: http://xx
3. HLS network playback path (under development)
**Note**:
To use media materials, you must declare the read permission. Otherwise, the media materials cannot be played properly.| | loop8+ | boolean | Yes | Yes | Whether to loop video playback. The value **true** means to loop video playback, and **false** means the opposite. | | currentTime8+ | number | Yes | No | Current video playback position. | | duration8+ | number | Yes | No | Video duration. The value **-1** indicates the live streaming mode. | @@ -1053,11 +1053,11 @@ Seeks to the specified playback position. This API uses a callback to return the **Parameters** -| Name | Type | Mandatory| Description | -| -------- | -------- | ---- | ---------------------------------------- | -| timeMs | number | Yes | Position to seek to, in milliseconds. | -| mode | SeekMode | Yes | Seek mode. For details, see [SeekMode](#seekmode8).| -| callback | function | Yes | Callback used to return the result. | +| Name | Type | Mandatory| Description | +| -------- | ---------------------- | ---- | ------------------------------ | +| timeMs | number | Yes | Position to seek to, in milliseconds.| +| mode | [SeekMode](#seekmode8) | Yes | Seek mode. | +| callback | function | Yes | Callback used to return the result.| **Example** @@ -1081,10 +1081,10 @@ Seeks to the specified playback position. If **mode** is not specified, the next **Parameters** -| Name| Type | Mandatory| Description | -| ------ | -------- | ---- | -------------------------------------- | -| timeMs | number | Yes | Position to seek to, in milliseconds. | -| mode | SeekMode | No | Seek mode. For details, see [SeekMode](#seekmode8).| +| Name| Type | Mandatory| Description | +| ------ | ---------------------- | ---- | ------------------------------ | +| timeMs | number | Yes | Position to seek to, in milliseconds.| +| mode | [SeekMode](#seekmode8) | No | Seek mode. | **Return value** @@ -1227,7 +1227,7 @@ await videoPlayer.release().then() => { ### getTrackDescription8+ -getTrackDescription(callback: AsyncCallback>): void +getTrackDescription(callback: AsyncCallback>): void Obtains the video track information. This API uses a callback to return the result. @@ -1235,9 +1235,9 @@ Obtains the video track information. This API uses a callback to return the resu **Parameters** -| Name | Type | Mandatory| Description | -| -------- | -------- | ---- | -------------------------- | -| callback | function | Yes | Callback used to return the video track information obtained.| +| Name | Type | Mandatory| Description | +| -------- | ------------------------------------------------------------ | ---- | -------------------------- | +| callback | AsyncCallback> | Yes | Callback used to return the video track information obtained.| **Example** @@ -1263,7 +1263,7 @@ videoPlayer.getTrackDescription((error, arrlist) => { ### getTrackDescription8+ -getTrackDescription(): Promise> +getTrackDescription(): Promise> Obtains the video track information. This API uses a promise to return the result. @@ -1346,6 +1346,12 @@ Sets the video playback speed. This API uses a promise to return the result. | ------ | ------ | ---- | ---------------------------------------------------------- | | speed | number | Yes | Video playback speed. For details, see [PlaybackSpeed](#playbackspeed8).| +**Return value** + +| Type | Description | +| ---------------- | ------------------------- | +| Promise\ | Promise used to return the result.| + **Example** ```js @@ -1417,10 +1423,10 @@ Subscribes to the frame rendering start event. **Parameters** -| Name | Type | Mandatory| Description | -| -------- | -------- | ---- | ------------------------------------------------------------ | -| type | string | Yes | Type of the event to subscribe to, which is 'startRenderFrame' in this example.| -| callback | function | Yes | Callback invoked when the event is triggered. | +| Name | Type | Mandatory| Description | +| -------- | --------------- | ---- | ------------------------------------------------------------ | +| type | string | Yes | Type of the event to subscribe to, which is 'startRenderFrame' in this example.| +| callback | Callback\ | Yes | Callback invoked when the event is triggered. | **Example** @@ -1464,10 +1470,10 @@ Subscribes to the video playback error event. **Parameters** -| Name | Type | Mandatory| Description | -| -------- | -------- | ---- | ------------------------------------------------------------ | -| type | string | Yes | Type of the event to subscribe to, which is 'error' in this method.
The 'error' event is triggered when an error occurs during video playback.| -| callback | function | Yes | Callback invoked when the event is triggered. | +| Name | Type | Mandatory| Description | +| -------- | ------------- | ---- | ------------------------------------------------------------ | +| type | string | Yes | Type of the event to subscribe to, which is 'error' in this API.
The 'error' event is triggered when an error occurs during video playback.| +| callback | ErrorCallback | Yes | Callback invoked when the event is triggered. | **Example** @@ -1497,7 +1503,7 @@ Enumerates the video playback states. You can obtain the state through the **sta ## SeekMode8+ -Enumerates the video playback seek modes, which can be passed in the **seek** method. +Enumerates the video playback seek modes, which can be passed in the **seek** API. **System capability**: SystemCapability.Multimedia.Media.Core @@ -1508,7 +1514,7 @@ Enumerates the video playback seek modes, which can be passed in the **seek** me ## PlaybackSpeed8+ -Enumerates the video playback speeds, which can be passed in the **setSpeed** method. +Enumerates the video playback speeds, which can be passed in the **setSpeed** API. **System capability**: SystemCapability.Multimedia.Media.VideoPlayer @@ -1555,7 +1561,7 @@ audioPlayer.getTrackDescription((error, arrlist) => { ## AudioRecorder -Implements audio recording. Before calling a method of the **AudioRecorder** class, you must call [createAudioRecorder()](#media.createaudiorecorder) to create an [AudioRecorder](#audiorecorder) instance. +Implements audio recording. Before calling an API of the **AudioRecorder** class, you must call [createAudioRecorder()](#mediacreateaudiorecorder) to create an [AudioRecorder](#audiorecorder) instance. For details about the audio recording demo, see [Audio Recording Development](../../media/audio-recorder.md). @@ -1598,7 +1604,7 @@ audioRecorder.prepare(audioRecorderConfig); start(): void -Starts audio recording. This method can be called only after the [prepare](#audiorecorder_on) event is triggered. +Starts audio recording. This API can be called only after the [prepare](#audiorecorder_on) event is triggered. **System capability**: SystemCapability.Multimedia.Media.AudioRecorder @@ -1615,7 +1621,7 @@ audioRecorder.start(); pause():void -Pauses audio recording. This method can be called only after the [start](#audiorecorder_on) event is triggered. +Pauses audio recording. This API can be called only after the [start](#audiorecorder_on) event is triggered. **System capability**: SystemCapability.Multimedia.Media.AudioRecorder @@ -1632,7 +1638,7 @@ audioRecorder.pause(); resume():void -Resumes audio recording. This method can be called only after the [pause](#audiorecorder_on) event is triggered. +Resumes audio recording. This API can be called only after the [pause](#audiorecorder_on) event is triggered. **System capability**: SystemCapability.Multimedia.Media.AudioRecorder @@ -1711,7 +1717,7 @@ Subscribes to the audio recording events. | Name | Type | Mandatory| Description | | -------- | -------- | ---- | ------------------------------------------------------------ | -| type | string | Yes | Type of the event to subscribe to. The following events are supported: 'prepare'\|'start'\| 'pause' \| 'resume' \|'stop'\|'release'\|'reset'
- The 'prepare' event is triggered when the [prepare](#audiorecorder_prepare) method is called and the audio recording parameters are set.
- The 'start' event is triggered when the [start](#audiorecorder_start) method is called and audio recording starts.
- The 'pause' event is triggered when the [pause](#audiorecorder_pause) method is called and audio recording is paused.
- The 'resume' event is triggered when the [resume](#audiorecorder_resume) method is called and audio recording is resumed.
- The 'stop' event is triggered when the [stop](#audiorecorder_stop) method is called and audio recording stops.
- The 'release' event is triggered when the [release](#audiorecorder_release) method is called and the recording resource is released.
- The 'reset' event is triggered when the [reset](#audiorecorder_reset) method is called and audio recording is reset.| +| type | string | Yes | Type of the event to subscribe to. The following events are supported: 'prepare'\|'start'\| 'pause' \| 'resume' \|'stop'\|'release'\|'reset'
- The 'prepare' event is triggered when the [prepare](#audiorecorder_prepare) API is called and the audio recording parameters are set.
- The 'start' event is triggered when the [start](#audiorecorder_start) API is called and audio recording starts.
- The 'pause' event is triggered when the [pause](#audiorecorder_pause) API is called and audio recording is paused.
- The 'resume' event is triggered when the [resume](#audiorecorder_resume) API is called and audio recording is resumed.
- The 'stop' event is triggered when the [stop](#audiorecorder_stop) API is called and audio recording stops.
- The 'release' event is triggered when the [release](#audiorecorder_release) API is called and the recording resource is released.
- The 'reset' event is triggered when the [reset](#audiorecorder_reset) API is called and audio recording is reset.| | callback | ()=>void | Yes | Callback invoked when the event is triggered. | **Example** @@ -1769,7 +1775,7 @@ Subscribes to the audio recording error event. | Name | Type | Mandatory| Description | | -------- | ------------- | ---- | ------------------------------------------------------------ | -| type | string | Yes | Type of the event to subscribe to, which is 'error' in this method.
The 'error' event is triggered when an error occurs during audio recording.| +| type | string | Yes | Type of the event to subscribe to, which is 'error' in this API.
The 'error' event is triggered when an error occurs during audio recording.| | callback | ErrorCallback | Yes | Callback invoked when the event is triggered. | **Example** @@ -1796,9 +1802,9 @@ Describes audio recording configurations. | audioSampleRate | number | No | Audio sampling rate. The default value is **48000**. | | numberOfChannels | number | No | Number of audio channels. The default value is **2**. | | format | [AudioOutputFormat](#audiooutputformat) | No | Audio output format. The default value is **MPEG_4**. | -| location8+ | [Location](#location8) | No | Geographical location of the recorded audio. | +| location | [Location](#location) | No | Geographical location of the recorded audio. | | uri | string | Yes | Audio output URI. Supported: fd://xx (fd number)
![en-us_image_0000001164217678](figures/en-us_image_url.png)
The file must be created by the caller and granted with proper permissions.| -| audioEncoderMime | [CodecMimeType](#CodecMimeType8) | No | Audio encoding format.| +| audioEncoderMime | [CodecMimeType](#codecmimetype8) | No | Audio encoding format. | ## AudioEncoder @@ -1830,25 +1836,27 @@ Enumerates the audio output formats. | AMR_WB | 4 | AMR_WB.
This API is merely defined in OpenHarmony 3.1 Release and cannot be used currently. It can be used in OpenHarmony 3.1 MR.| | AAC_ADTS | 6 | Audio Data Transport Stream (ADTS), which is a transport stream format of AAC-based audio.| -## VideoRecorder8+ +## VideoRecorder9+ -Implements video recording. Before calling a method of the **VideoRecorder** class, you must call [createVideoRecorder()](#media.createvideorecorder8) to create a [VideoRecorder](#videorecorder8) instance. +Implements video recording. Before calling an API of the **VideoRecorder** class, you must call [createVideoRecorder()](#mediacreatevideorecorder9) to create a [VideoRecorder](#videorecorder9) instance. For details about the video recording demo, see [Video Recording Development](../../media/video-recorder.md). ### Attributes -| Name | Type | Readable| Writable| Description | -| ------------------ | ------------------------------------- | ---- | ---- | ---------------- | -| state8+ | [VideoRecordState](#videorecordstate) | Yes | No | Video recording state.| +**System capability**: SystemCapability.Multimedia.Media.VideoRecorder + +| Name | Type | Readable| Writable| Description | +| ------------------ | -------------------------------------- | ---- | ---- | ---------------- | +| state8+ | [VideoRecordState](#videorecordstate9) | Yes | No | Video recording state.| -### prepare8+ +### prepare9+ prepare(config: VideoRecorderConfig, callback: AsyncCallback\): void; Sets video recording parameters in asynchronous mode. This API uses a callback to return the result. -**Required permissions:** ohos.permission.MICROPHONE ohos.permission.CAMERA +**Required permissions:** ohos.permission.MICROPHONE and ohos.permission.CAMERA **System capability**: SystemCapability.Multimedia.Media.VideoRecorder @@ -1856,7 +1864,7 @@ Sets video recording parameters in asynchronous mode. This API uses a callback t | Name | Type | Mandatory| Description | | -------- | -------------------------------------------- | ---- | ----------------------------------- | -| config | [VideoRecorderConfig](#videorecorderconfig8) | Yes | Video recording parameters to set. | +| config | [VideoRecorderConfig](#videorecorderconfig9) | Yes | Video recording parameters to set. | | callback | AsyncCallback\ | Yes | Callback used to return the result.| **Example** @@ -1910,13 +1918,13 @@ media.createVideoRecorder((err, recorder) => { }); ``` -### prepare8+ +### prepare9+ prepare(config: VideoRecorderConfig): Promise\; Sets video recording parameters in asynchronous mode. This API uses a promise to return the result. -**Required permissions:** ohos.permission.MICROPHONE ohos.permission.CAMERA +**Required permissions:** ohos.permission.MICROPHONE and ohos.permission.CAMERA **System capability**: SystemCapability.Multimedia.Media.VideoRecorder @@ -1924,7 +1932,7 @@ Sets video recording parameters in asynchronous mode. This API uses a promise to | Name| Type | Mandatory| Description | | ------ | -------------------------------------------- | ---- | ------------------------ | -| config | [VideoRecorderConfig](#videorecorderconfig8) | Yes | Video recording parameters to set.| +| config | [VideoRecorderConfig](#videorecorderconfig9) | Yes | Video recording parameters to set.| **Return value** @@ -1981,7 +1989,7 @@ await videoRecorder.prepare(videoConfig).then(() => { }); ``` -### getInputSurface8+ +### getInputSurface9+ getInputSurface(callback: AsyncCallback\): void; @@ -1989,7 +1997,7 @@ Obtains the surface required for recording in asynchronous mode. This surface is Note that the video data must carry the timestamp (in ns) and buffer size, and the start time of the timestamp is based on the system startup time. -This method can be called only after [prepare()](#videorecorder_prepare1) is called. +This API can be called only after [prepare()](#videorecorder_prepare1) is called. **System capability**: SystemCapability.Multimedia.Media.VideoRecorder @@ -2014,7 +2022,7 @@ videoRecorder.getInputSurface((err, surfaceId) => { }); ``` -### getInputSurface8+ +### getInputSurface9+ getInputSurface(): Promise\; @@ -2022,7 +2030,7 @@ getInputSurface(): Promise\; Note that the video data must carry the timestamp (in ns) and buffer size, and the start time of the timestamp is based on the system startup time. -This method can be called only after [prepare()](#videorecorder_prepare1) is called. +This API can be called only after [prepare()](#videorecorder_prepare1) is called. **System capability**: SystemCapability.Multimedia.Media.VideoRecorder @@ -2047,13 +2055,13 @@ await videoRecorder.getInputSurface().then((surfaceId) => { }); ``` -### start8+ +### start9+ start(callback: AsyncCallback\): void; Starts video recording in asynchronous mode. This API uses a callback to return the result. -This method can be called only after [prepare()](#videorecorder_prepare1) and [getInputSurface()](#getinputsurface8) are called, because the data source must pass data to the surface first. +This API can be called only after [prepare()](#videorecorder_prepare1) and [getInputSurface()](#getinputsurface8) are called, because the data source must pass data to the surface first. **System capability**: SystemCapability.Multimedia.Media.VideoRecorder @@ -2076,13 +2084,13 @@ videoRecorder.start((err) => { }); ``` -### start8+ +### start9+ start(): Promise\; Starts video recording in asynchronous mode. This API uses a promise to return the result. -This method can be called only after [prepare()](#videorecorder_prepare1) and [getInputSurface()](#getinputsurface8) are called, because the data source must pass data to the surface first. +This API can be called only after [prepare()](#videorecorder_prepare1) and [getInputSurface()](#getinputsurface8) are called, because the data source must pass data to the surface first. **System capability**: SystemCapability.Multimedia.Media.VideoRecorder @@ -2105,13 +2113,13 @@ await videoRecorder.start().then(() => { }); ``` -### pause8+ +### pause9+ pause(callback: AsyncCallback\): void; Pauses video recording in asynchronous mode. This API uses a callback to return the result. -This method can be called only after [start()](#videorecorder_start1) is called. You can resume recording by calling [resume()](#videorecorder_resume1). +This API can be called only after [start()](#videorecorder_start1) is called. You can resume recording by calling [resume()](#videorecorder_resume1). **System capability**: SystemCapability.Multimedia.Media.VideoRecorder @@ -2134,13 +2142,13 @@ videoRecorder.pause((err) => { }); ``` -### pause8+ +### pause9+ pause(): Promise\; Pauses video recording in asynchronous mode. This API uses a promise to return the result. -This method can be called only after [start()](#videorecorder_start1) is called. You can resume recording by calling [resume()](#videorecorder_resume1). +This API can be called only after [start()](#videorecorder_start1) is called. You can resume recording by calling [resume()](#videorecorder_resume1). **System capability**: SystemCapability.Multimedia.Media.VideoRecorder @@ -2163,7 +2171,7 @@ await videoRecorder.pause().then(() => { }); ``` -### resume8+ +### resume9+ resume(callback: AsyncCallback\): void; @@ -2190,7 +2198,7 @@ videoRecorder.resume((err) => { }); ``` -### resume8+ +### resume9+ resume(): Promise\; @@ -2217,7 +2225,7 @@ await videoRecorder.resume().then(() => { }); ``` -### stop8+ +### stop9+ stop(callback: AsyncCallback\): void; @@ -2246,7 +2254,7 @@ videoRecorder.stop((err) => { }); ``` -### stop8+ +### stop9+ stop(): Promise\; @@ -2275,7 +2283,7 @@ await videoRecorder.stop().then(() => { }); ``` -### release8+ +### release9+ release(callback: AsyncCallback\): void; @@ -2302,7 +2310,7 @@ videoRecorder.release((err) => { }); ``` -### release8+ +### release9+ release(): Promise\; @@ -2329,7 +2337,7 @@ await videoRecorder.release().then(() => { }); ``` -### reset8+ +### reset9+ reset(callback: AsyncCallback\): void; @@ -2358,7 +2366,7 @@ videoRecorder.reset((err) => { }); ``` -### reset8+ +### reset9+ reset(): Promise\; @@ -2387,7 +2395,7 @@ await videoRecorder.reset().then(() => { }); ``` -### on('error')8+ +### on('error')9+ on(type: 'error', callback: ErrorCallback): void @@ -2399,7 +2407,7 @@ Subscribes to the video recording error event. | Name | Type | Mandatory| Description | | -------- | ------------- | ---- | ------------------------------------------------------------ | -| type | string | Yes | Type of the event to subscribe to, which is 'error' in this method.
The 'error' event is triggered when an error occurs during video recording.| +| type | string | Yes | Type of the event to subscribe to, which is 'error' in this API.
The 'error' event is triggered when an error occurs during video recording.| | callback | ErrorCallback | Yes | Callback invoked when the event is triggered. | **Example** @@ -2413,7 +2421,7 @@ videoRecorder.on('error', (error) => { // Set the 'error' event call // This event is reported when an error occurs during the retrieval of videoRecordState. ``` -## VideoRecordState8+ +## VideoRecordState9+ Enumerates the video recording states. You can obtain the state through the **state** attribute. @@ -2426,24 +2434,24 @@ Enumerates the video recording states. You can obtain the state through the **st | playing | string | Video recording is in progress. | | paused | string | Video recording is paused. | | stopped | string | Video recording is stopped. | -| error | string | Video recording is in the error state. | +| error | string | Audio playback is in the error state. | -## VideoRecorderConfig8+ +## VideoRecorderConfig9+ Describes the video recording parameters. **System capability**: SystemCapability.Multimedia.Media.VideoRecorder -| Name | Type | Mandatory| Description | -| --------------- | ---------------------------------------------------------- | ---- | ------------------------------------------------------------ | -| audioSourceType | [AudioSourceType](#audiosourcetype8+) | Yes | Type of the audio source for video recording. | -| videoSourceType | [VideoSourceType](#videosourcetype8+) | Yes | Type of the video source for video recording. | -| profile | [VideoRecorderProfile](#videorecorderprofile8) | Yes | Video recording profile. | -| rotation | number | No | Rotation angle of the recorded video. | -| location | [Location](#location8) | No | Geographical location of the recorded video. | -| url | string | Yes | Video output URL. Supported: fd://xx (fd number)
![en-us_image_0000001164217678](figures/en-us_image_url.png)
The file must be created by the caller and granted with proper permissions.| +| Name | Type | Mandatory| Description | +| --------------- | ---------------------------------------------- | ---- | ------------------------------------------------------------ | +| audioSourceType | [AudioSourceType](#audiosourcetype9) | Yes | Type of the audio source for video recording. | +| videoSourceType | [VideoSourceType](#videosourcetype9) | Yes | Type of the video source for video recording. | +| profile | [VideoRecorderProfile](#videorecorderprofile9) | Yes | Video recording profile. | +| rotation | number | No | Rotation angle of the recorded video. | +| location | [Location](#location) | No | Geographical location of the recorded video. | +| url | string | Yes | Video output URL. Supported: fd://xx (fd number)
![](figures/en-us_image_url.png)
The file must be created by the caller and granted with proper permissions.| -## AudioSourceType8+ +## AudioSourceType9+ Enumerates the audio source types for video recording. @@ -2454,7 +2462,7 @@ Enumerates the audio source types for video recording. | AUDIO_SOURCE_TYPE_DEFAULT | 0 | Default audio input source.| | AUDIO_SOURCE_TYPE_MIC | 1 | Mic audio input source. | -## VideoSourceType8+ +## VideoSourceType9+ Enumerates the video source types for video recording. @@ -2465,7 +2473,7 @@ Enumerates the video source types for video recording. | VIDEO_SOURCE_TYPE_SURFACE_YUV | 0 | The input surface carries raw data.| | VIDEO_SOURCE_TYPE_SURFACE_ES | 1 | The input surface carries ES data. | -## VideoRecorderProfile8+ +## VideoRecorderProfile9+ Describes the video recording profile. @@ -2475,12 +2483,14 @@ Describes the video recording profile. | ---------------- | -------------------------------------------- | ---- | ---------------- | | audioBitrate | number | Yes | Audio encoding bit rate.| | audioChannels | number | Yes | Number of audio channels.| -| audioCodec | [CodecMimeType](#CodecMimeType8) | Yes | Audio encoding format. | +| audioCodec | [CodecMimeType](#codecmimetype8) | Yes | Audio encoding format. | | audioSampleRate | number | Yes | Audio sampling rate. | | fileFormat | [ContainerFormatType](#containerformattype8) | Yes | Container format of a file.| +| videoBitrate | number | Yes | Video encoding bit rate.| | videoCodec | [CodecMimeType](#CodecMimeType8) | Yes | Video encoding format. | | videoFrameWidth | number | Yes | Width of the recorded video frame.| | videoFrameHeight | number | Yes | Height of the recorded video frame.| +| videoFrameRate | number | Yes | Video frame rate. | ## ContainerFormatType8+ @@ -2493,7 +2503,7 @@ Enumerates the container format types (CFTs). | CFT_MPEG_4 | "mp4" | Video container format MP4.| | CFT_MPEG_4A | "m4a" | Audio container format M4A.| -## Location8+ +## Location Describes the geographical location of the recorded video. diff --git a/en/application-dev/reference/apis/js-apis-net-connection.md b/en/application-dev/reference/apis/js-apis-net-connection.md index 7e14306d2f67145b4e0d28d6fc532cb925729175..c0d9c297f77b71cff69ee91d920e0721ea93725d 100644 --- a/en/application-dev/reference/apis/js-apis-net-connection.md +++ b/en/application-dev/reference/apis/js-apis-net-connection.md @@ -1,7 +1,7 @@ # Network Connection Management -> **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. @@ -17,7 +17,7 @@ getDefaultNet(callback: AsyncCallback\): void Obtains the default active data network. This API uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.GET_NETWORK_INFO +**Required permission**: ohos.permission.GET_NETWORK_INFO **System capability**: SystemCapability.Communication.NetManager.Core @@ -42,11 +42,11 @@ getDefaultNet(): Promise\ Obtains the default active data network. This API uses a promise to return the result. -**Required permissions**: ohos.permission.GET_NETWORK_INFO +**Required permission**: ohos.permission.GET_NETWORK_INFO **System capability**: SystemCapability.Communication.NetManager.Core -**Return value** +**Return Value** | Type | Description | | --------------------------------- | ------------------------------------- | @@ -91,7 +91,7 @@ Checks whether the default data network is activated. This API uses a promise to **System capability**: SystemCapability.Communication.NetManager.Core -**Return value** +**Return Value** | Type | Description | | ----------------- | ----------------------------------------------- | @@ -111,7 +111,7 @@ getAllNets(callback: AsyncCallback<Array<NetHandle>>): void Obtains the list of all active data networks. This API uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.GET_NETWORK_INFO +**Required permission**: ohos.permission.GET_NETWORK_INFO **System capability**: SystemCapability.Communication.NetManager.Core @@ -136,11 +136,11 @@ getAllNets(): Promise<Array<NetHandle>> Obtains the list of all active data networks. This API uses a promise to return the result. -**Required permissions**: ohos.permission.GET_NETWORK_INFO +**Required permission**: ohos.permission.GET_NETWORK_INFO **System capability**: SystemCapability.Communication.NetManager.Core -**Return value** +**Return Value** | Type| Description| | -------- | -------- | | Promise<Array<[NetHandle](#nethandle)>> | Promise used to return the result.| @@ -157,9 +157,9 @@ connection.getAllNets().then(function (nets) { getConnectionProperties(netHandle: NetHandle, callback: AsyncCallback\): void -Obtains connection properties of the network corresponding to the **netHandle**. This API uses an asynchronous callback to return the result. +Obtains connection properties of the network corresponding to given network handle. This API uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.GET_NETWORK_INFO +**Required permission**: ohos.permission.GET_NETWORK_INFO **System capability**: SystemCapability.Communication.NetManager.Core @@ -185,9 +185,9 @@ connection.getDefaultNet().then(function (netHandle) { getConnectionProperties(netHandle: NetHandle): Promise\ -Obtains connection properties of the network corresponding to the **netHandle**. This API uses a promise to return the result. +Obtains connection properties of the network corresponding to **netHandle**. This API uses a promise to return the result. -**Required permissions**: ohos.permission.GET_NETWORK_INFO +**Required permission**: ohos.permission.GET_NETWORK_INFO **System capability**: SystemCapability.Communication.NetManager.Core @@ -197,7 +197,7 @@ Obtains connection properties of the network corresponding to the **netHandle**. | --------- | ----------------------- | ---- | ---------------- | | netHandle | [NetHandle](#nethandle) | Yes | Network handle.| -**Return value** +**Return Value** | Type | Description | | ------------------------------------------------------- | --------------------------------- | @@ -217,9 +217,9 @@ connection.getDefaultNet().then(function (netHandle) { getNetCapabilities(netHandle: NetHandle, callback: AsyncCallback\): void -Obtains capability information of the network corresponding to the **netHandle**. This API uses an asynchronous callback to return the result. +Obtains capability information of the network corresponding to **netHandle**. This API uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.GET_NETWORK_INFO +**Required permission**: ohos.permission.GET_NETWORK_INFO **System capability**: SystemCapability.Communication.NetManager.Core @@ -245,9 +245,9 @@ connection.getDefaultNet().then(function (netHandle) { getNetCapabilities(netHandle: NetHandle): Promise\ -Obtains capability information of the network corresponding to the **netHandle**. This API uses a promise to return the result. +Obtains capability information of the network corresponding to **netHandle**. This API uses a promise to return the result. -**Required permissions**: ohos.permission.GET_NETWORK_INFO +**Required permission**: ohos.permission.GET_NETWORK_INFO **System capability**: SystemCapability.Communication.NetManager.Core @@ -257,7 +257,7 @@ Obtains capability information of the network corresponding to the **netHandle** | --------- | ----------------------- | ---- | ---------------- | | netHandle | [NetHandle](#nethandle) | Yes | Network handle.| -**Return value** +**Return Value** | Type | Description | | --------------------------------------------- | --------------------------------- | @@ -279,7 +279,7 @@ reportNetConnected(netHandle: NetHandle, callback: AsyncCallback<void>): v Reports connection of the data network. This API uses an asynchronous callback to return the result. -**Required permissions** : ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET +**Permission required**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET **System capability**: SystemCapability.Communication.NetManager.Core @@ -306,7 +306,7 @@ reportNetConnected(netHandle: NetHandle): Promise<void> Reports connection of the data network. This API uses a promise to return the result. -**Required permissions**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET +**Permission required**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET **System capability**: SystemCapability.Communication.NetManager.Core @@ -315,7 +315,7 @@ Reports connection of the data network. This API uses a promise to return the re | -------- | -------- | -------- | -------- | | netHandle | [NetHandle](#nethandle) | Yes| Handle of the data network. For details, see [NetHandle](#nethandle).| -**Return value** +**Return Value** | Type| Description| | -------- | -------- | | Promise<void> | Promise used to return the result.| @@ -337,7 +337,7 @@ reportNetDisconnected(netHandle: NetHandle, callback: AsyncCallback<void>) Reports disconnection of the data network. This API uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET +**Permission required**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET **System capability**: SystemCapability.Communication.NetManager.Core @@ -364,7 +364,7 @@ reportNetDisconnected(netHandle: NetHandle): Promise<void> Reports disconnection of the data network. This API uses a promise to return the result. -**Required permissions**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET +**Permission required**: ohos.permission.GET_NETWORK_INFO and ohos.permission.INTERNET **System capability**: SystemCapability.Communication.NetManager.Core @@ -373,7 +373,7 @@ Reports disconnection of the data network. This API uses a promise to return the | -------- | -------- | -------- | -------- | | netHandle | [NetHandle](#nethandle) | Yes| Handle of the data network. For details, see [NetHandle](#nethandle).| -**Return value** +**Return Value** | Type| Description| | -------- | -------- | | Promise<void> | Promise used to return the result.| @@ -394,7 +394,7 @@ getAddressesByName(host: string, callback: AsyncCallback\>): Resolves the host name by using the default network to obtain all IP addresses. This API uses an asynchronous callback to return the result. -**Required permissions**: ohos.permission.GET_NETWORK_INFO +**Required permission**: ohos.permission.GET_NETWORK_INFO **System capability**: SystemCapability.Communication.NetManager.Core @@ -402,7 +402,7 @@ Resolves the host name by using the default network to obtain all IP addresses. | Name | Type | Mandatory| Description | | -------- | ------------------------------------------------- | ---- | ------------------ | -| host | string | Yes | Host name to resolve.| +| host | string | Yes | Host name to be resolved.| | callback | AsyncCallback\> | Yes | Callback used to return the result. | **Example** @@ -421,7 +421,7 @@ getAddressesByName(host: string): Promise\> Resolves the host name by using the default network to obtain all IP addresses. This API uses a promise to return the result. -**Required permissions**: ohos.permission.GET_NETWORK_INFO +**Required permission**: ohos.permission.GET_NETWORK_INFO **System capability**: SystemCapability.Communication.NetManager.Core @@ -429,13 +429,13 @@ Resolves the host name by using the default network to obtain all IP addresses. | Name| Type | Mandatory| Description | | ------ | ------ | ---- | ------------------ | -| host | string | Yes | Host name to resolve.| +| host | string | Yes | Host name to be resolved.| -**Return value** +**Return Value** | Type | Description | | ------------------------------------------- | ----------------------------- | -| Promise\> | Promise used to return the IP addresses obtained.| +| Promise\> | Promise used to return the result.| **Example** @@ -461,7 +461,7 @@ Obtains the handle of the network specified by **netSpecifier**. | netSpecifier | [NetSpecifier](#netspecifier) | No | Network specifier. If this parameter is not set, the default network is used. | | timeout | number | No | Timeout interval for obtaining the network specified by **netSpecifier**. This parameter is valid only when **netSpecifier** is set.| -**Return value** +**Return Value** | Type | Description | | ------------------------------- | -------------------- | @@ -520,7 +520,7 @@ Registers a listener for **netCapabilitiesChange** events. | Name | Type | Mandatory| Description | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | -| type | string | Yes | Event type. The value is fixed to **netCapabilitiesChange**.
**netCapabilitiesChange**: event indicating that the network capabilities have changed.| +| type | string | Yes | Event type. The value is fixed to **netCapabilitiesChange**.
**netCapabilitiesChange**: event indicating that he network capabilities have changed.| | callback | Callback<{ netHandle: [NetHandle](#nethandle), netCap: [NetCapabilities](#netcapabilities) }> | Yes | Callback used to return the result. | **Example** @@ -630,7 +630,7 @@ register(callback: AsyncCallback\): void Registers a listener for network status changes. -**Required permissions**: ohos.permission.GET_NETWORK_INFO +**Required permission**: ohos.permission.GET_NETWORK_INFO **System capability**: SystemCapability.Communication.NetManager.Core @@ -674,15 +674,15 @@ netConnection.unregister(function (error) { Defines the handle of the data network. -Before invoking **NetHandle** APIs, call **getNetHandle** to obtain a **NetHandle** object. +Before invoking NetHandle APIs, call **getNetHandle** to obtain a **NetHandle** object. **System capability**: SystemCapability.Communication.NetManager.Core -### Attributes +### Parameters | Name| Type | Description | | ------ | ------ | ------------------------- | -| netId | number | Network ID. The value must be greater than or equal to **100**.| +| netId | number | Network ID. The value must be greater than or equal to 100.| ### bindSocket @@ -731,7 +731,7 @@ Binds a **TCPSocket** or **UDPSocket** object to the data network. This API uses | ----------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | socketParam | TCPSocket \| UDPSocket | Yes | **TCPSocket** or **UDPSocket** object.| -**Return value** +**Return Value** | Type | Description | | ------------------- | --------------------------- | | Promise<void> | Promise used to return the result.| @@ -767,7 +767,7 @@ Resolves the host name by using the corresponding network to obtain all IP addre | Name | Type | Mandatory| Description | | -------- | ------------------------------------------------- | ---- | ------------------ | -| host | string | Yes | Host name to resolve.| +| host | string | Yes | Host name to be resolved.| | callback | AsyncCallback\> | Yes | Callback used to return the result. | **Example** @@ -794,9 +794,9 @@ Resolves the host name by using the corresponding network to obtain all IP addre | Name| Type | Mandatory| Description | | ------ | ------ | ---- | ------------------ | -| host | string | Yes | Host name to resolve.| +| host | string | Yes | Host name to be resolved.| -**Return value** +**Return Value** | Type | Description | | ------------------------------------------- | ----------------------------- | @@ -825,7 +825,7 @@ Resolves the host name by using the corresponding network to obtain the first IP | Name | Type | Mandatory| Description | | -------- | ----------------------------------------- | ---- | ------------------ | -| host | string | Yes | Host name to resolve.| +| host | string | Yes | Host name to be resolved.| | callback | AsyncCallback\<[NetAddress](#netaddress)> | Yes | Callback used to return the result. | **Example** @@ -852,9 +852,9 @@ Resolves the host name by using the corresponding network to obtain the first IP | Name| Type | Mandatory| Description | | ------ | ------ | ---- | ------------------ | -| host | string | Yes | Host name to resolve.| +| host | string | Yes | Host name to be resolved.| -**Return value** +**Return Value** | Type | Description | | ----------------------------------- | ------------------------------- | @@ -901,7 +901,7 @@ Defines the network capability. **System capability**: SystemCapability.Communication.NetManager.Core -| Name | Value α | Description | +| Name | Value | Description | | ------------------------ | ---- | ---------------------- | | NET_CAPABILITY_MMS | 0 | The network can connect to the carrier's Multimedia Messaging Service Center (MMSC) to send and receive multimedia messages.| | NET_CAPABILITY_NOT_METERED | 11 | The network traffic is not metered.| @@ -915,7 +915,7 @@ Defines the network type. **System capability**: SystemCapability.Communication.NetManager.Core -| Name | Value α | Description | +| Name | Value | Description | | --------------- | ---- | ----------- | | BEARER_CELLULAR | 0 | Cellular network | | BEARER_WIFI | 1 | Wi-Fi network| @@ -938,7 +938,7 @@ Defines the network connection properties. ## LinkAddress -Defines network link information. +Network link information. **System capability**: SystemCapability.Communication.NetManager.Core @@ -949,7 +949,7 @@ Defines network link information. ## RouteInfo -Defines network route information. +Network route information. **System capability**: SystemCapability.Communication.NetManager.Core @@ -971,4 +971,4 @@ Defines the network address. | ------- | ------ | ------------------------------ | | address | string | Network address. | | family | number | Address family identifier. The value is **1** for IPv4 and **2** for IPv6. The default value is **1**.| -| port | number | Port number. The value range is 0 to 65535. | +| port | number | Port number. The value ranges from **0** to **65535**. | diff --git a/en/application-dev/reference/apis/js-apis-radio.md b/en/application-dev/reference/apis/js-apis-radio.md index f8f768ecc656722305f32f6f5c1e568e8cc37777..86090ef47d9add9dba3d2c0836e76b8d7f6ab989 100644 --- a/en/application-dev/reference/apis/js-apis-radio.md +++ b/en/application-dev/reference/apis/js-apis-radio.md @@ -600,13 +600,13 @@ Defines the network type. | Name | Value | Description | | -------------------- | ---- | ------------------------------------------------------------ | -| NETWORK_TYPE_UNKNOWN | 0 | Unknown network | -| NETWORK_TYPE_GSM | 1 | GSM network | -| NETWORK_TYPE_CDMA | 2 | CDMA network | -| NETWORK_TYPE_WCDMA | 3 | WCDMA network | -| NETWORK_TYPE_TDSCDMA | 4 | TD-SCDMA network| -| NETWORK_TYPE_LTE | 5 | LTE network | -| NETWORK_TYPE_NR | 6 | 5G NR network | +| NETWORK_TYPE_UNKNOWN | 0 | Unknown network. | +| NETWORK_TYPE_GSM | 1 | GSM network. | +| NETWORK_TYPE_CDMA | 2 | CDMA network. | +| NETWORK_TYPE_WCDMA | 3 | WCDMA network. | +| NETWORK_TYPE_TDSCDMA | 4 | TD-SCDMA network.| +| NETWORK_TYPE_LTE | 5 | LTE network. | +| NETWORK_TYPE_NR | 6 | 5G NR network. | ## NetworkState diff --git a/en/application-dev/reference/apis/js-apis-sim.md b/en/application-dev/reference/apis/js-apis-sim.md index 3421e50e7d1df9cd8dca76edf6edd5b3334daaef..b5e188671584289f3a36396e98b0a0f99ed790c2 100644 --- a/en/application-dev/reference/apis/js-apis-sim.md +++ b/en/application-dev/reference/apis/js-apis-sim.md @@ -15,7 +15,7 @@ import sim from '@ohos.telephony.sim'; isSimActive\(slotId: number, callback: AsyncCallback\): void -Checks whether the SIM card in the specified slot is activated. This function uses an asynchronous callback to return the result. +Checks whether the SIM card in the specified slot is activated. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Communication.CoreService @@ -23,7 +23,7 @@ Checks whether the SIM card in the specified slot is activated. This function us | Name | Type | Mandatory| Description | | -------- | --------------------------- | ---- | -------------------------------------- | -| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| slotId | number | Yes | Card slot ID. The options are as follows:
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback<boolean> | Yes | Callback used to return the result. | **Example** @@ -39,7 +39,7 @@ sim.isSimActive(0, (err, data) => { isSimActive\(slotId: number\): Promise -Checks whether the SIM card in the specified slot is activated. This function uses a promise to return the result. +Checks whether the SIM card in the specified slot is activated. This API uses a promise to return the result. **System capability**: SystemCapability.Communication.CoreService @@ -47,9 +47,9 @@ Checks whether the SIM card in the specified slot is activated. This function us | Name| Type | Mandatory| Description | | ------ | ------ | ---- | -------------------------------------- | -| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| slotId | number | Yes | Card slot ID. The options are as follows:
- **0**: card slot 1
- **1**: card slot 2| -**Return Value** +**Return value** | Type | Description | | --------------------- | ---------------------------------- | @@ -71,7 +71,7 @@ promise.then(data => { getDefaultVoiceSlotId\(callback: AsyncCallback\): void -Obtains the default slot ID of the SIM card that provides voice services. This function uses an asynchronous callback to return the result. +Obtains the default slot ID of the SIM card that provides voice services. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Communication.CoreService @@ -94,11 +94,11 @@ sim.getDefaultVoiceSlotId((err, data) => { getDefaultVoiceSlotId\(\): Promise -Obtains the default slot ID of the SIM card that provides voice services. This function uses a promise to return the result. +Obtains the default slot ID of the SIM card that provides voice services. This API uses a promise to return the result. **System capability**: SystemCapability.Communication.CoreService -**Return Value** +**Return value** | Type | Description | | ----------------- | --------------------------------------- | @@ -119,7 +119,7 @@ promise.then(data => { hasOperatorPrivileges(slotId: number, callback: AsyncCallback\): void -Checks whether the application (caller) has been granted the operator permission. This function uses an asynchronous callback to return the result. +Checks whether the application (caller) has been granted the operator permission. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Communication.CoreService @@ -127,7 +127,7 @@ Checks whether the application (caller) has been granted the operator permission | Name | Type | Mandatory| Description | | -------- | ------------------------ | ---- | ---------------------------------------- | -| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| slotId | number | Yes | Card slot ID. The options are as follows:
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback\ | Yes | Callback used to return the result. | **Example** @@ -140,9 +140,9 @@ sim.hasOperatorPrivileges(0, (err, data) => { ## sim.hasOperatorPrivileges7+ -hasOperatorPrivileges(slotId: number): Promise +hasOperatorPrivileges(slotId: number): Promise -Checks whether the application (caller) has been granted the operator permission. This function uses a promise to return the result. +Checks whether the application (caller) has been granted the operator permission. This API uses a promise to return the result. **System capability**: SystemCapability.Communication.CoreService @@ -150,9 +150,9 @@ Checks whether the application (caller) has been granted the operator permission | Name| Type | Mandatory| Description | | ------ | ------ | ---- | ---------------------------------------- | -| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| slotId | number | Yes | Card slot ID. The options are as follows:
- **0**: card slot 1
- **1**: card slot 2| -**Return Value** +**Return value** | Type | Description | | :----------------- | :---------------------------------------------------------- | @@ -173,7 +173,7 @@ promise.then(data => { getISOCountryCodeForSim\(slotId: number, callback: AsyncCallback\): void -Obtains the ISO country code of the SIM card in the specified slot. This function uses an asynchronous callback to return the result. +Obtains the ISO country code of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Communication.CoreService @@ -181,7 +181,7 @@ Obtains the ISO country code of the SIM card in the specified slot. This functio | Name | Type | Mandatory| Description | | -------- | ----------------------- | ---- | ---------------------------------------- | -| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2 | +| slotId | number | Yes | Card slot ID. The options are as follows:
- **0**: card slot 1
- **1**: card slot 2 | | callback | AsyncCallback\ | Yes | Callback used to return the result, which is a country code, for example, **CN** (China).| **Example** @@ -197,7 +197,7 @@ sim.getISOCountryCodeForSim(0, (err, data) => { getISOCountryCodeForSim\(slotId: number\): Promise -Obtains the ISO country code of the SIM card in the specified slot. This function uses a promise to return the result. +Obtains the ISO country code of the SIM card in the specified slot. This API uses a promise to return the result. **System capability**: SystemCapability.Communication.CoreService @@ -205,9 +205,9 @@ Obtains the ISO country code of the SIM card in the specified slot. This functio | Name| Type | Mandatory| Description | | ------ | ------ | ---- | -------------------------------------- | -| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| slotId | number | Yes | Card slot ID. The options are as follows:
- **0**: card slot 1
- **1**: card slot 2| -**Return Value** +**Return value** | Type | Description | | ----------------- | ------------------------------------------------------------ | @@ -229,7 +229,7 @@ promise.then(data => { getSimOperatorNumeric\(slotId: number, callback: AsyncCallback\): void -Obtains the public land mobile network (PLMN) ID of the SIM card in the specified slot. This function uses an asynchronous callback to return the result. +Obtains the public land mobile network (PLMN) ID of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Communication.CoreService @@ -237,7 +237,7 @@ Obtains the public land mobile network (PLMN) ID of the SIM card in the specifie | Name | Type | Mandatory| Description | | -------- | ----------------------- | ---- | -------------------------------------- | -| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| slotId | number | Yes | Card slot ID. The options are as follows:
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback\ | Yes | Callback used to return the result. | **Example** @@ -253,7 +253,7 @@ sim.getSimOperatorNumeric(0, (err, data) => { getSimOperatorNumeric\(slotId: number\): Promise -Obtains the PLMN ID of the SIM card in the specified slot. This function uses a promise to return the result. +Obtains the PLMN ID of the SIM card in the specified slot. This API uses a promise to return the result. **System capability**: SystemCapability.Communication.CoreService @@ -261,9 +261,9 @@ Obtains the PLMN ID of the SIM card in the specified slot. This function uses a | Name| Type | Mandatory| Description | | ------ | ------ | ---- | -------------------------------------- | -| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| slotId | number | Yes | Card slot ID. The options are as follows:
- **0**: card slot 1
- **1**: card slot 2| -**Return Value** +**Return value** | Type | Description | | ----------------- | ------------------------------------------------ | @@ -285,7 +285,7 @@ promise.then(data => { getSimSpn\(slotId: number, callback: AsyncCallback\): void -Obtains the service provider name (SPN) of the SIM card in the specified slot. This function uses an asynchronous callback to return the result. +Obtains the service provider name (SPN) of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Communication.CoreService @@ -293,7 +293,7 @@ Obtains the service provider name (SPN) of the SIM card in the specified slot. T | Name | Type | Mandatory| Description | | -------- | ----------------------- | ---- | -------------------------------------- | -| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| slotId | number | Yes | Card slot ID. The options are as follows:
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback\ | Yes | Callback used to return the result. | **Example** @@ -309,7 +309,7 @@ sim.getSimSpn(0, (err, data) => { getSimSpn\(slotId: number\): Promise -Obtains the SPN of the SIM card in the specified slot. This function uses a promise to return the result. +Obtains the SPN of the SIM card in the specified slot. This API uses a promise to return the result. **System capability**: SystemCapability.Communication.CoreService @@ -317,9 +317,9 @@ Obtains the SPN of the SIM card in the specified slot. This function uses a prom | Name| Type | Mandatory| Description | | ------ | ------ | ---- | -------------------------------------- | -| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| slotId | number | Yes | Card slot ID. The options are as follows:
- **0**: card slot 1
- **1**: card slot 2| -**Return Value** +**Return value** | Type | Description | | ----------------- | ----------------------------------------- | @@ -341,7 +341,7 @@ promise.then(data => { getSimState\(slotId: number, callback: AsyncCallback\): void -Obtains the status of the SIM card in the specified slot. This function uses an asynchronous callback to return the result. +Obtains the status of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Communication.CoreService @@ -349,7 +349,7 @@ Obtains the status of the SIM card in the specified slot. This function uses an | Name | Type | Mandatory| Description | | -------- | -------------------------------------- | ---- | -------------------------------------- | -| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| slotId | number | Yes | Card slot ID. The options are as follows:
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback\<[SimState](#simState)\> | Yes | Callback used to return the result. For details, see [SimState](#simState). | **Example** @@ -365,7 +365,7 @@ sim.getSimState(0, (err, data) => { getSimState\(slotId: number\): Promise -Obtains the status of the SIM card in the specified slot. This function uses a promise to return the result. +Obtains the status of the SIM card in the specified slot. This API uses a promise to return the result. **System capability**: SystemCapability.Communication.CoreService @@ -373,9 +373,9 @@ Obtains the status of the SIM card in the specified slot. This function uses a p | Name| Type | Mandatory| Description | | ------ | ------ | ---- | -------------------------------------- | -| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| slotId | number | Yes | Card slot ID. The options are as follows:
- **0**: card slot 1
- **1**: card slot 2| -**Return Value** +**Return value** | Type | Description | | -------------------------------- | ------------------------------------------ | @@ -396,7 +396,7 @@ promise.then(data => { getCardType\(slotId: number, callback: AsyncCallback\): void -Obtains the type of the SIM card in the specified slot. This function uses an asynchronous callback to return the result. +Obtains the type of the SIM card in the specified slot. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Communication.CoreService @@ -404,7 +404,7 @@ Obtains the type of the SIM card in the specified slot. This function uses an as | Name | Type | Mandatory| Description | | -------- | ----------------------- | ---- | -------------------------------------- | -| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| slotId | number | Yes | Card slot ID. The options are as follows:
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback\<[CardType](#cardtype7)\> | Yes | Callback used to return the result. | **Example** @@ -420,7 +420,7 @@ sim.getCardType(0, (err, data) => { getCardType\(slotId: number\): Promise -Obtains the type of the SIM card in the specified slot. This function uses a promise to return the result. +Obtains the type of the SIM card in the specified slot. This API uses a promise to return the result. **System capability**: SystemCapability.Communication.CoreService @@ -428,9 +428,9 @@ Obtains the type of the SIM card in the specified slot. This function uses a pro | Name| Type | Mandatory| Description | | ------ | ------ | ---- | -------------------------------------- | -| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| slotId | number | Yes | Card slot ID. The options are as follows:
- **0**: card slot 1
- **1**: card slot 2| -**Return Value** +**Return value** | Type | Description | | ----------------- | ------------------------------------------------------------ | @@ -452,7 +452,7 @@ promise.then(data => { hasSimCard\(slotId: number, callback: AsyncCallback\): void -Checks whether the SIM card in the specified slot is installed. This function uses an asynchronous callback to return the result. +Checks whether the SIM card in the specified slot is installed. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Communication.CoreService @@ -460,7 +460,7 @@ Checks whether the SIM card in the specified slot is installed. This function us | Name | Type | Mandatory| Description | | -------- | --------------------------- | ---- | -------------------------------------- | -| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| slotId | number | Yes | Card slot ID. The options are as follows:
- **0**: card slot 1
- **1**: card slot 2| | callback | AsyncCallback<boolean> | Yes | Callback used to return the result. | **Example** @@ -476,7 +476,7 @@ sim.hasSimCard(0, (err, data) => { hasSimCard\(slotId: number\): Promise -Checks whether the SIM card in the specified slot is installed. This function uses a promise to return the result. +Checks whether the SIM card in the specified slot is installed. This API uses a promise to return the result. **System capability**: SystemCapability.Communication.CoreService @@ -484,9 +484,9 @@ Checks whether the SIM card in the specified slot is installed. This function us | Name| Type | Mandatory| Description | | ------ | ------ | ---- | -------------------------------------- | -| slotId | number | Yes | Card slot ID.
- **0**: card slot 1
- **1**: card slot 2| +| slotId | number | Yes | Card slot ID. The options are as follows:
- **0**: card slot 1
- **1**: card slot 2| -**Return Value** +**Return value** | Type | Description | | --------------------- | ---------------------------------- | @@ -512,7 +512,7 @@ Obtains the number of card slots. **System capability**: SystemCapability.Communication.CoreService -**Return Value** +**Return value** | Type | Description | | ----------------- | ------------------------------------------------------------ | @@ -557,4 +557,4 @@ Enumerates card types. |CU_DUAL_MODE_CARD | 42 | China Unicom dual-mode card| |DUAL_MODE_TELECOM_LTE_CARD | 43 | China Telecom dual-mode LTE card| |DUAL_MODE_UG_CARD | 50 | Dual-mode card (UMTS+GSM)| -|SINGLE_MODE_ISIM_CARD | 60 | Single-card (ISIM)| +|SINGLE_MODE_ISIM_CARD8+ | 60 | Single-card (ISIM)| diff --git a/en/application-dev/reference/apis/js-apis-sms.md b/en/application-dev/reference/apis/js-apis-sms.md index 22ed6555ba33c13893bcbaa2c318b358e0ae98d3..e874588b5e209f5386a34c4fc8e10f2b5fc6aef0 100644 --- a/en/application-dev/reference/apis/js-apis-sms.md +++ b/en/application-dev/reference/apis/js-apis-sms.md @@ -10,11 +10,11 @@ import sms from '@ohos.telephony.sms'; ``` -## sms.createMessage +## sms.createMessage createMessage\(pdu: Array, specification: string, callback: AsyncCallback\): void -Creates an SMS message instance based on the protocol data unit (PDU) and the specified SMS protocol. This function uses an asynchronous callback to return the result. +Creates an SMS message instance based on the protocol data unit (PDU) and the specified SMS protocol. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Telephony.SmsMms @@ -24,7 +24,7 @@ Creates an SMS message instance based on the protocol data unit (PDU) and the sp | ------------- | -------------------------------------------------- | ---- | ------------------------------------------------------------ | | pdu | Array<number> | Yes | PDU, which is obtained from the received SMS message. | | specification | string | Yes | SMS protocol type.
- **3gpp**: GSM/UMTS/LTE SMS
- **3gpp2**: CDMA SMS| -| callback | AsyncCallback<[ShortMessage](#ShortMessage)> | Yes | Callback used to return the result. | +| callback | AsyncCallback<[ShortMessage](#shortmessage)> | Yes | Callback used to return the result. | **Example** @@ -38,11 +38,11 @@ sms.createMessage(pdu, specification, (err, data) => { ``` -## sms.createMessage +## sms.createMessage createMessage\(pdu: Array, specification: string\): Promise -Creates an SMS message instance based on the PDU and the specified SMS protocol. This function uses a promise to return the result. +Creates an SMS message instance based on the PDU and the specified SMS protocol. This API uses a promise to return the result. **System capability**: SystemCapability.Telephony.SmsMms @@ -57,7 +57,7 @@ Creates an SMS message instance based on the PDU and the specified SMS protocol. | Type | Description | | -------------------------------------------- | --------------------------------- | -| Promise<[ShortMessage](#ShortMessage)> | Promise used to return the result.| +| Promise<[ShortMessage](#shortmessage)> | Promise used to return the result.| **Example** @@ -87,7 +87,7 @@ Sends an SMS message. | Name | Type | Mandatory| Description | | ------- | ----------------------------------------- | ---- | ------------------------------------------------------------ | -| options | [SendMessageOptions](#SendMessageOptions) | Yes | Options (including the callback) for sending an SMS message. For details, see [SendMessageOptions](#SendMessageOptions).| +| options | [SendMessageOptions](#sendmessageoptions) | Yes | Options (including the callback) for sending an SMS message. For details, see [SendMessageOptions](#sendmessageoptions).| **Example** @@ -108,11 +108,11 @@ sms.sendMessage(options); ``` -## sms.getDefaultSmsSlotId7+ +## sms.getDefaultSmsSlotId7+ getDefaultSmsSlotId\(callback: AsyncCallback\): void -Obtains the default slot of the SIM card used to send SMS messages. This function uses an asynchronous callback to return the result. +Obtains the default slot of the SIM card used to send SMS messages. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Telephony.SmsMms @@ -131,11 +131,11 @@ sms.getDefaultSmsSlotId((err, data) => { ``` -## sms.getDefaultSmsSlotId7+ +## sms.getDefaultSmsSlotId7+ getDefaultSmsSlotId\(\): Promise -Obtains the default slot of the SIM card used to send SMS messages. This function uses a promise to return the result. +Obtains the default slot of the SIM card used to send SMS messages. This API uses a promise to return the result. **System capability**: SystemCapability.Telephony.SmsMms @@ -157,16 +157,18 @@ promise.then(data => { ``` -## sms.setSmscAddr7+ +## sms.setSmscAddr7+ setSmscAddr\(slotId: number, smscAddr: string, callback: AsyncCallback\): void -Sets the short message service center (SMSC) address. This function uses an asynchronous callback to return the result. +Sets the short message service center (SMSC) address. This API uses an asynchronous callback to return the result. **Required permission**: ohos.permission.SET_TELEPHONY_STATE (a system permission) **System capability**: SystemCapability.Telephony.SmsMms +This is a system API and cannot be called by third-party applications. + **Parameters** | Name | Type | Mandatory| Description | @@ -186,16 +188,18 @@ sms.setSmscAddr(slotId, smscAddr, (err,data) => { ``` -## sms.setSmscAddr7+ +## sms.setSmscAddr7+ setSmscAddr\(slotId: number, smscAddr: string\): Promise -Sets the SMSC address. This function uses a promise to return the result. +Sets the SMSC address. This API uses a promise to return the result. **Required permission**: ohos.permission.SET_TELEPHONY_STATE (a system permission) **System capability**: SystemCapability.Telephony.SmsMms +This is a system API and cannot be called by third-party applications. + **Parameters** | Name | Type | Mandatory| Description | @@ -223,17 +227,17 @@ promise.then(data => { ``` -## sms.getSmscAddr7+ +## sms.getSmscAddr7+ getSmscAddr\(slotId: number, callback: AsyncCallback\): void -Obtains the SMSC address. This function uses an asynchronous callback to return the result. +Obtains the SMSC address. This API uses an asynchronous callback to return the result. **Required permission**: ohos.permission.GET_TELEPHONY_STATE (a system permission) **System capability**: SystemCapability.Telephony.SmsMms -**Note:** This is a system API and it is used only for system applications. +This is a system API and cannot be called by third-party applications. **Parameters** @@ -252,17 +256,17 @@ sms.getSmscAddr(slotId, (err, data) => { ``` -## sms.getSmscAddr7+ +## sms.getSmscAddr7+ getSmscAddr\(slotId: number\): Promise -Obtains the SMSC address. This function uses a promise to return the result. +Obtains the SMSC address. This API uses a promise to return the result. **Required permission**: ohos.permission.GET_TELEPHONY_STATE (a system permission) **System capability**: SystemCapability.Telephony.SmsMms -**Note:** This is a system API and it is used only for system applications. +This is a system API and cannot be called by third-party applications. **Parameters** @@ -288,11 +292,11 @@ promise.then(data => { }); ``` -## sms.hasSmsCapability7+ +## sms.hasSmsCapability7+ hasSmsCapability(): boolean -Checks whether the current device can send and receive SMS messages. This function works in synchronous mode. +Checks whether the current device can send and receive SMS messages. This API works in synchronous mode. **System capability**: SystemCapability.Telephony.SmsMms @@ -307,18 +311,18 @@ let result = sms.hasSmsCapability(); console.log(`hasSmsCapability: ${JSON.stringify(result)}`); ``` -## ShortMessage +## ShortMessage Defines an SMS message instance. **System capability**: SystemCapability.Telephony.SmsMms -| Variable | Type | Description | +| Name | Type | Description | | ------------------------ | --------------------------------------- | ------------------------------------------------------------ | | hasReplyPath | boolean | Whether the received SMS contains **TP-Reply-Path**. The default value is **false**.
**TP-Reply-Path**: the path in which the mobile phone can reply to the SMS message through the originating SMSC.| | isReplaceMessage | boolean | Whether the received SMS message is a **replace short message**. The default value is **false**.
For details, see section 9.2.3.9 in **3GPP TS 23.040**.| | isSmsStatusReportMessage | boolean | Whether the received SMS message is an SMS delivery status report. The default value is **false**.
**SMS-Status-Report**: a message sent from the SMSC to the mobile station to show the SMS message delivery status.| -| messageClass | [ShortMessageClass](#ShortMessageClass) | SMS message type. | +| messageClass | [ShortMessageClass](#shortmessageclass) | SMS message type. | | pdu | Array<number> | PDU in the SMS message. | | protocolId | number | ID of the protocol used for sending SMS messages. | | scAddress | string | Address of the short message service center (SMSC). | @@ -328,69 +332,69 @@ Defines an SMS message instance. | visibleRawAddress | string | Sender address. | -## ShortMessageClass +## ShortMessageClass -Enumerates SMS message types. +SMS message type. -| Variable | Value | Description | -| ---------------- | ---- | ------------------------------------------------------------ | -| UNKNOWN | 0 | Unknown type.
**System capability**: SystemCapability.Telephony.SmsMms| -| INSTANT_MESSAGE | 1 | Instant message, which is displayed immediately after being received.
**System capability**: SystemCapability.Telephony.SmsMms| -| OPTIONAL_MESSAGE | 2 | Message stored in the device or SIM card.
**System capability**: SystemCapability.Telephony.SmsMms| -| SIM_MESSAGE | 3 | Message containing SIM card information, which is to be stored in the SIM card.
**System capability**: SystemCapability.Telephony.SmsMms| -| FORWARD_MESSAGE | 4 | Message to be forwarded to another device.
**System capability**: SystemCapability.Telephony.SmsMms| +**System capability**: SystemCapability.Telephony.SmsMms +| Name | Value | Description | +| ---------------- | ---- | ---------------------------------------- | +| UNKNOWN | 0 | Unknown type. | +| INSTANT_MESSAGE | 1 | Instant message, which is displayed immediately after being received. | +| OPTIONAL_MESSAGE | 2 | Message stored in the device or SIM card. | +| SIM_MESSAGE | 3 | Message containing SIM card information, which is to be stored in the SIM card.| +| FORWARD_MESSAGE | 4 | Message to be forwarded to another device. | -## SendMessageOptions -Provides the options (including callbacks) for sending an SMS message. +## SendMessageOptions -For example, you can specify the SMS message type by the optional parameter **content**. +Provides the options (including callbacks) for sending an SMS message. For example, you can specify the SMS message type by the optional parameter **content**. **System capability**: SystemCapability.Telephony.SmsMms -| Parameter | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ---------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | | slotId | number | Yes | Slot ID of the SIM card used for sending SMS messages.
- **0**: card slot 1
- **1**: card slot 2 | | destinationHost | string | Yes | Destination address of the SMS message. | | content | string \| Array<number> | Yes | SMS message type. If the content is composed of character strings, the SMS message is a text message. If the content is composed of byte arrays, the SMS message is a data message.| | serviceCenter | string | No | SMSC address. By default, the SMSC address in the SIM card is used. | | destinationPort | number | No | Destination port of the SMS message. This field is mandatory only for a data message. Otherwise, it is optional. | -| sendCallback | AsyncCallback<[ISendShortMessageCallback](#ISendShortMessageCallback)> | No | Callback used to return the SMS message sending result. For details, see [ISendShortMessageCallback](#ISendShortMessageCallback).| -| deliveryCallback | AsyncCallback<[IDeliveryShortMessageCallback](#IDeliveryShortMessageCallback)> | No | Callback used to return the SMS message delivery report. For details, see [IDeliveryShortMessageCallback](#IDeliveryShortMessageCallback).| +| sendCallback | AsyncCallback<[ISendShortMessageCallback](#isendshortmessagecallback)> | No | Callback used to return the SMS message sending result. For details, see [ISendShortMessageCallback](#isendshortmessagecallback).| +| deliveryCallback | AsyncCallback<[IDeliveryShortMessageCallback](#ideliveryshortmessagecallback)> | No | Callback used to return the SMS message delivery report. For details, see [IDeliveryShortMessageCallback](#ideliveryshortmessagecallback).| -## ISendShortMessageCallback +## ISendShortMessageCallback Provides the callback for the SMS message sending result. It consists of three parts: SMS message sending result, URI for storing the sent SMS message, and whether the SMS message is the last part of a long SMS message. **System capability**: SystemCapability.Telephony.SmsMms -| Parameter | Type | Mandatory| Description | +| Name | Type | Mandatory| Description | | ---------- | ------------------------------- | ---- | ------------------------------------------------------------ | | isLastPart | boolean | No | Whether this SMS message is the last part of a long SMS message. The value **true** indicates that this SMS message is the last part of a long SMS message, and value **false** indicates the opposite. The default value is **false**.| -| result | [SendSmsResult](#SendSmsResult) | Yes | SMS message sending result. | +| result | [SendSmsResult](#sendsmsresult) | Yes | SMS message sending result. | | url | string | Yes | URI for storing sent SMS messages. | -## IDeliveryShortMessageCallback +## IDeliveryShortMessageCallback Provides the callback for the SMS message sending result. Return the SMS delivery report. **System capability**: SystemCapability.Telephony.SmsMms -| Parameter| Type | Mandatory| Description | +| Name| Type | Mandatory| Description | | ------ | ------------------- | ---- | -------------- | | pdu | Array<number> | Yes | SMS message delivery report.| -## SendSmsResult +## SendSmsResult -Enumerates SMS message sending results. +SMS message sending result. **System capability**: SystemCapability.Telephony.SmsMms -| Parameter | Value | Description | +| Name | Value | Description | | ------------------------------------ | ---- | ------------------------------------------------------ | | SEND_SMS_SUCCESS | 0 | SMS message sent successfully. | | SEND_SMS_FAILURE_UNKNOWN | 1 | Failed to send the SMS message due to unknown reasons. | diff --git a/en/application-dev/reference/apis/js-apis-socket.md b/en/application-dev/reference/apis/js-apis-socket.md index 1cf0e0c7d4fb1fd4e1c90ab0b55c561f437a3d47..34116c7c04b96f45167a8896710017851779d349 100644 --- a/en/application-dev/reference/apis/js-apis-socket.md +++ b/en/application-dev/reference/apis/js-apis-socket.md @@ -1,4 +1,4 @@ -# Socket +# Socket Connection >![](public_sys-resources/icon-note.gif) **NOTE:** > diff --git a/en/application-dev/reference/apis/js-apis-telephony-data.md b/en/application-dev/reference/apis/js-apis-telephony-data.md index 8cb2951bda1838891021ab653db926958859786c..b6bdef1d34b9f544e1380d3d4a9a7cd7d1d293b7 100644 --- a/en/application-dev/reference/apis/js-apis-telephony-data.md +++ b/en/application-dev/reference/apis/js-apis-telephony-data.md @@ -10,11 +10,11 @@ import data from '@ohos.telephony.data'; ``` -## data.getDefaultCellularDataSlotId +## data.getDefaultCellularDataSlotId getDefaultCellularDataSlotId(callback: AsyncCallback\): void -Obtains the default SIM card used for mobile data. This function uses an asynchronous callback to return the result. +Obtains the default SIM card used for mobile data. This API uses an asynchronous callback to return the result. **Required permission**: ohos.permission.GET_NETWORK_INFO @@ -22,9 +22,9 @@ Obtains the default SIM card used for mobile data. This function uses an asynchr **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | -------- | ----------------------- | ---- | ------------------------------------------ | -| callback | AsyncCallback\ | Yes| Callback used to return the result.
**0**: slot 1
**1**: slot 2| +| callback | AsyncCallback\ | Yes | Callback used to return the result.
**0**: card slot 1
**1**: card slot 2| **Example** @@ -34,21 +34,21 @@ data.getDefaultCellularDataSlotId((err, data) => { }); ``` -## data.getDefaultCellularDataSlotId +## data.getDefaultCellularDataSlotId getDefaultCellularDataSlotId(): Promise\ -Obtains the default SIM card used for mobile data. This function uses a promise to return the result. +Obtains the default SIM card used for mobile data. This API uses a promise to return the result. **Required permission**: ohos.permission.GET_NETWORK_INFO **System capability**: SystemCapability.Telephony.CellularData -**Return value** +**Return Value** -| Type| Description| +| Type | Description | | ----------------- | ------------------------------------------------------------ | -| Promise\ | Promise used to return the result, wherein:
**0**: slot 1
**1**: slot 2| +| Promise\ | Promise used to return the result.
**0**: card slot 1
**1**: card slot 2| **Example** @@ -61,19 +61,19 @@ promise.then((data) => { }); ``` -## data.getCellularDataFlowType +## data.getCellularDataFlowType getCellularDataFlowType(callback: AsyncCallback\): void -Obtains the cellular data flow type, which can be uplink or downlink. This function uses an asynchronous callback to return the result. +Obtains the cellular data flow type, which can be uplink or downlink. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Telephony.CellularData **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | -------- | ---------------------------------------------- | ---- | ---------- | -| callback | AsyncCallback\<[DataFlowType](#DataFlowType)\> | Yes| Callback used to return the result.| +| callback | AsyncCallback\<[DataFlowType](#dataflowtype)\> | Yes | Callback used to return the result.| **Example** @@ -83,19 +83,19 @@ data.getCellularDataFlowType((err, data) => { }); ``` -## data.getCellularDataFlowType +## data.getCellularDataFlowType getCellularDataFlowType(): Promise\ -Obtains the cellular data flow type, which can be uplink or downlink. This function uses a promise to return the result. +Obtains the cellular data flow type, which can be uplink or downlink. This API uses a promise to return the result. **System capability**: SystemCapability.Telephony.CellularData -**Return value** +**Return Value** -| Type| Description| +| Type | Description | | ---------------------------------------- | ----------------------------------------------- | -| Promise\<[DataFlowType](#DataFlowType)\> | Promise used to return the result. | +| Promise\<[DataFlowType](#dataflowtype)\> | Promise used to return the result. | **Example** @@ -108,19 +108,19 @@ promise.then((data) => { }); ``` -## data.getCellularDataState +## data.getCellularDataState getCellularDataState(callback: AsyncCallback\): void -Obtains the connection status of the packet switched (PS) domain. This function uses an asynchronous callback to return the result. +Obtains the connection status of the packet switched (PS) domain. This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.Telephony.CellularData **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | -------- | ------------------------------------------------------ | ---- | ---------- | -| callback | AsyncCallback\<[DataConnectState](#DataConnectState)\> | Yes| Callback used to return the result.| +| callback | AsyncCallback\<[DataConnectState](#dataconnectstate)\> | Yes | Callback used to return the result.| **Example** @@ -130,19 +130,19 @@ data.getCellularDataState((err, data) => { }); ``` -## data.getCellularDataState +## data.getCellularDataState getCellularDataState(): Promise\ -Obtains the connection status of the PS domain. This function uses a promise to return the result. +Obtains the connection status of the PS domain. This API uses a promise to return the result. **System capability**: SystemCapability.Telephony.CellularData -**Return value** +**Return Value** -| Type| Description| +| Type | Description | | ------------------------------------------------ | ------------------------------------- | -| Promise\<[DataConnectState](#DataConnectState)\> | Promise used to return the result.| +| Promise\<[DataConnectState](#dataconnectstate)\> | Promise used to return the result.| **Example** @@ -155,11 +155,11 @@ promise.then((data) => { }); ``` -## data.isCellularDataEnabled +## data.isCellularDataEnabled isCellularDataEnabled(callback: AsyncCallback\): void -Checks whether the cellular data service is enabled. This function uses an asynchronous callback to return the result. +Checks whether the cellular data service is enabled. This API uses an asynchronous callback to return the result. **Required permission**: ohos.permission.GET_NETWORK_INFO @@ -167,9 +167,9 @@ Checks whether the cellular data service is enabled. This function uses an async **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | -------- | ------------------------ | ---- | ------------------------------------------------------------ | -| callback | AsyncCallback\ | Yes| Callback used to return the result.
**true**: The cellular data service is enabled.
**false**: The cellular data service is disabled.| +| callback | AsyncCallback\ | Yes | Callback used to return the result.
**true**: The cellular data service is enabled.
**false**: The cellular data service is disabled.| **Example** @@ -179,21 +179,21 @@ data.isCellularDataEnabled((err, data) => { }); ``` -## data.isCellularDataEnabled +## data.isCellularDataEnabled isCellularDataEnabled(): Promise\ -Checks whether the cellular data service is enabled. This function uses a promise to return the result. +Checks whether the cellular data service is enabled. This API uses a promise to return the result. **Required permission**: ohos.permission.GET_NETWORK_INFO **System capability**: SystemCapability.Telephony.CellularData -**Return value** +**Return Value** -| Type| Description| +| Type | Description | | ------------------ | ------------------------------------------------------------ | -| Promise\ | Promise used to return the result, wherein:
**true**: The cellular data service is enabled.
**false**: The cellular data service is disabled.| +| Promise\ | Promise used to return the result.
**true**: The cellular data service is enabled.
**false**: The cellular data service is disabled.| **Example** @@ -206,11 +206,11 @@ promise.then((data) => { }); ``` -## data.isCellularDataRoamingEnabled +## data.isCellularDataRoamingEnabled isCellularDataRoamingEnabled(slotId: number, callback: AsyncCallback\): void -Checks whether roaming is enabled for the cellular data service. This function uses an asynchronous callback to return the result. +Checks whether roaming is enabled for the cellular data service. This API uses an asynchronous callback to return the result. **Required permission**: ohos.permission.GET_NETWORK_INFO @@ -218,10 +218,10 @@ Checks whether roaming is enabled for the cellular data service. This function u **Parameters** -| Name| Type| Mandatory| Description| +| Name | Type | Mandatory| Description | | -------- | ------------------------ | ---- | ------------------------------------------------------------ | -| slotId | number | Yes| Card slot ID. The options are as follows:
**0**: slot 1
**1**: slot 2| -| callback | AsyncCallback\ | Yes| Callback used to return the result.
**true**: Roaming is enabled for the cellular data service.
**false**: Roaming is disabled for the cellular data service.| +| slotId | number | Yes | Card slot ID.
**0**: card slot 1
**1**: card slot 2 | +| callback | AsyncCallback\ | Yes | Callback used to return the result.
**true**: Roaming is enabled for the cellular data service.
**false**: Roaming is disabled for the cellular data service.| **Example** @@ -231,11 +231,11 @@ data.isCellularDataRoamingEnabled(0,(err, data) => { }); ``` -## data.isCellularDataRoamingEnabled +## data.isCellularDataRoamingEnabled isCellularDataRoamingEnabled(slotId: number): Promise\ -Checks whether roaming is enabled for the cellular data service. This method uses a promise to return the result. +Checks whether roaming is enabled for the cellular data service. This API uses a promise to return the result. **Required permission**: ohos.permission.GET_NETWORK_INFO @@ -243,15 +243,15 @@ Checks whether roaming is enabled for the cellular data service. This method use **Parameters** -| Name| Type| Mandatory| Description| +| Name| Type | Mandatory| Description | | ------ | ------ | ---- | ---------------------------------------- | -| slotId | number | Yes| Card slot ID. The options are as follows:
**0**: slot 1
**1**: slot 2| +| slotId | number | Yes | Card slot ID.
**0**: card slot 1
**1**: card slot 2| -**Return value** +**Return Value** -| Type| Description| +| Type | Description | | ------------------ | ------------------------------------------------------------ | -| Promise\ | Promise used to return the result, wherein:
**true**: Roaming is enabled for the cellular data service.
**false**: Roaming is disabled for the cellular data service.| +| Promise\ | Promise used to return the result.
**true**: Roaming is enabled for the cellular data service.
**false**: Roaming is disabled for the cellular data service.| **Example** @@ -264,26 +264,30 @@ promise.then((data) => { }); ``` -## DataFlowType +## DataFlowType - Defines the cellular data flow type. +Defines the cellular data flow type. -| Name| Value| Description| -| ------ | ---------------------- | ------------------------------------------------------------ | -| 0 | DATA_FLOW_TYPE_NONE | No uplink or downlink data is available.
**System capability**: SystemCapability.Telephony.CellularData| -| 1 | DATA_FLOW_TYPE_DOWN | Only the downlink data is available.
**System capability**: SystemCapability.Telephony.CellularData| -| 2 | DATA_FLOW_TYPE_UP | Only the uplink data is available.
**System capability**: SystemCapability.Telephony.CellularData| -| 3 | DATA_FLOW_TYPE_UP_DOWN | Both uplink data and downlink data are available.
**System capability**: SystemCapability.Telephony.CellularData| -| 4 | DATA_FLOW_TYPE_DORMANT | No uplink or downlink data is available because the lower-layer link is in the dormant state.
**System capability**: SystemCapability.Telephony.CellularData| +**System capability**: SystemCapability.Telephony.CellularData + +| Name | Value | Description | +| ---------------------- | ---- | ------------------------------------------ | +| DATA_FLOW_TYPE_NONE | 0 | No uplink or downlink data is available. | +| DATA_FLOW_TYPE_DOWN | 1 | Only the downlink data is available. | +| DATA_FLOW_TYPE_UP | 2 | Only the uplink data is available. | +| DATA_FLOW_TYPE_UP_DOWN | 3 | Both uplink data and downlink data are available. | +| DATA_FLOW_TYPE_DORMANT | 4 | No uplink or downlink data is available because the lower-layer link is in the dormant state.| -## DataConnectState +## DataConnectState - Describes the connection status of a cellular data link. +Describes the connection status of a cellular data link. + +**System capability**: SystemCapability.Telephony.CellularData -| Name| Value| Description| -| ------ | ----------------------- | ------------------------------------------------------------ | -| -1 | DATA_STATE_UNKNOWN| The status of the cellular data link is unknown.
**System capability**: SystemCapability.Telephony.CellularData| -| 0 | DATA_STATE_DISCONNECTED | The cellular data link is disconnected.
**System capability**: SystemCapability.Telephony.CellularData| -| 1 | DATA_STATE_CONNECTING | The cellular data link is being connected.
**System capability**: SystemCapability.Telephony.CellularData| -| 2 | DATA_STATE_CONNECTED | The cellular data link is connected.
**System capability**: SystemCapability.Telephony.CellularData| -| 3 | DATA_STATE_SUSPENDED | The cellular data link is suspended.
**System capability**: SystemCapability.Telephony.CellularData| +| Name | Value | Description | +| ----------------------- | ---- | -------------------------- | +| DATA_STATE_UNKNOWN | -1 | The status of the cellular data link is unknown. | +| DATA_STATE_DISCONNECTED | 0 | The cellular data link is disconnected. | +| DATA_STATE_CONNECTING | 1 | The cellular data link is being connected.| +| DATA_STATE_CONNECTED | 2 | The cellular data link is connected. | +| DATA_STATE_SUSPENDED | 3 | The cellular data link is suspended. | diff --git a/en/application-dev/reference/apis/js-apis-thermal.md b/en/application-dev/reference/apis/js-apis-thermal.md index 5d6648171ee97febc156025f1501c8500a0cb011..f1b246f11ff17c4b2b31a1ca16210d5ce11c48bc 100644 --- a/en/application-dev/reference/apis/js-apis-thermal.md +++ b/en/application-dev/reference/apis/js-apis-thermal.md @@ -3,7 +3,7 @@ > ![icon-note.gif](public_sys-resources/icon-note.gif) **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. -The Thermal Manager module provides APIs for listening to the device thermal status. +This module provides thermal level-related callback and query APIs to obtain the information required for thermal control. ## Modules to Import @@ -17,15 +17,17 @@ import thermal from '@ohos.thermal'; Represents the thermal level. +**System capability:** SystemCapability.PowerManager.ThermalManager + | Name | Default Value | Description | | ---------- | ---- | ---------------------------------------- | -| COOL | 0 | The device is cool, and services are not restricted.
**System capability:** SystemCapability.PowerManager.ThermalManager| -| NORMAL | 1 | The device is operational but is not cool. You need to pay attention to its heating.
**System capability:** SystemCapability.PowerManager.ThermalManager| -| WARM | 2 | The device is warm. You need to stop or delay some imperceptible services.
**System capability:** SystemCapability.PowerManager.ThermalManager| -| HOT | 3 | The device is heating up. You need to stop all imperceptible services and downgrade or reduce the load of other services.
**System capability:** SystemCapability.PowerManager.ThermalManager| -| OVERHEATED | 4 | The device is overheated. You need to stop all imperceptible services and downgrade or reduce the load of major services.
**System capability:** SystemCapability.PowerManager.ThermalManager| -| WARNING | 5 | The device is overheated and is about to enter the emergency state. You need to stop all imperceptible services and downgrade major services to the maximum extent.
**System capability:** SystemCapability.PowerManager.ThermalManager| -| EMERGENCY | 6 | The device has entered the emergency state. You need to stop all services except those for the emergency help purposes.
**System capability:** SystemCapability.PowerManager.ThermalManager| +| COOL | 0 | The device is cool, and services are not restricted.| +| NORMAL | 1 | The device is operational but is not cool. You need to pay attention to its heating.| +| WARM | 2 | The device is warm. You need to stop or delay some imperceptible services.| +| HOT | 3 | The device is heating up. You need to stop all imperceptible services and downgrade or reduce the load of other services.| +| OVERHEATED | 4 | The device is overheated. You need to stop all imperceptible services and downgrade or reduce the load of major services.| +| WARNING | 5 | The device is overheated and is about to enter the emergency state. You need to stop all imperceptible services and downgrade major services to the maximum extent.| +| EMERGENCY | 6 | The device has entered the emergency state. You need to stop all services except those for the emergency help purposes.| ## thermal.subscribeThermalLevel diff --git a/en/application-dev/reference/apis/js-apis-webSocket.md b/en/application-dev/reference/apis/js-apis-webSocket.md index 65d7eeb5c49fbe9a0b456333dd043d17835aeaea..7ffb3babc8171c25ffb2e1814e69e150870071e9 100644 --- a/en/application-dev/reference/apis/js-apis-webSocket.md +++ b/en/application-dev/reference/apis/js-apis-webSocket.md @@ -1,4 +1,4 @@ -# WebSocket +# WebSocket Connection >![](public_sys-resources/icon-note.gif) **NOTE:** >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. diff --git a/en/application-dev/website.md b/en/application-dev/website.md index 98d9ffe250c4827420553b7c348c085f1f7c5626..4f312d93b860af28ea806a15a17fe6fb54552ea5 100644 --- a/en/application-dev/website.md +++ b/en/application-dev/website.md @@ -3,547 +3,515 @@ - [Application Development Overview](application-dev-guide.md) - Quick Start - [Getting Started with Application Development](quick-start/Readme-EN.md) - - [DevEco Studio \(OpenHarmony\) User Guide](quick-start/deveco-studio-user-guide-for-openharmony.md) - - [Overview](quick-start/deveco-studio-overview.md) - - [Version Change History](quick-start/deveco-studio-release-notes.md) - - [Configuring the OpenHarmony SDK](quick-start/configuring-openharmony-sdk.md) - - [Creating an OpenHarmony Project](quick-start/create-openharmony-project.md) - - [Using the Project Wizard to Create a Project](quick-start/use-wizard-to-create-project.md) - - [Importing a Sample to Create a Project](quick-start/import-sample-to-create-project.md) - - - [Configuring the OpenHarmony App Signature](quick-start/configuring-openharmony-app-signature.md) - - [Installing and Running Your OpenHarmony App](quick-start/installing-openharmony-app.md) - - - [Directory Structure](quick-start/package-structure.md) -- Development - - [UI](ui/Readme-EN.md) - - JavaScript-based Web-Like Development Paradigm - - [Overview](ui/ui-js-overview.md) - - Framework - - [File Organization](ui/js-framework-file.md) - - ["js" Tag](ui/js-framework-js-tag.md) - - [app.js](ui/js-framework-js-file.md) - - Syntax - - [HML](ui/js-framework-syntax-hml.md) - - [CSS](ui/js-framework-syntax-css.md) - - [JavaScript](ui/js-framework-syntax-js.md) - - [Lifecycle](ui/js-framework-lifecycle.md) - - [Resource Limitations and Access](ui/js-framework-resource-restriction.md) - - [Multi-Language Capability](ui/js-framework-multiple-languages.md) - - Building the UI - - [Component Overview](ui/ui-js-building-ui-component.md) - - Building the Layout - - [Layout Description](ui/ui-js-building-ui-layout-intro.md) - - [Adding Title and Paragraph Text](ui/ui-js-building-ui-layout-text.md) - - [Adding an Image](ui/ui-js-building-ui-layout-image.md) - - [Adding a Comment](ui/ui-js-building-ui-layout-comment.md) - - [Adding a Container](ui/ui-js-building-ui-layout-external-container.md) - - [Adding Interactions](ui/ui-js-building-ui-interactions.md) - - [Developing Animations](ui/ui-js-building-ui-animation.md) - - [Defining Events](ui/ui-js-building-ui-event.md) - - [Defining Page Routes](ui/ui-js-building-ui-routes.md) - - Common Component Development Guidelines - - [Text](ui/ui-js-components-text.md) - - [Input](ui/ui-js-components-input.md) - - [Button](ui/ui-js-components-button.md) - - [List](ui/ui-js-components-list.md) - - [Picker](ui/ui-js-components-picker.md) - - [Dialog](ui/ui-js-components-dialog.md) - - [Form](ui/ui-js-components-form.md) - - [Stepper](ui/ui-js-components-stepper.md) - - [Tabs](ui/ui-js-component-tabs.md) - - [Image](ui/ui-js-components-images.md) - - Animation Development Guidelines - - CSS Animation - - [Defining Attribute Style Animations](ui/ui-js-animate-attribute-style.md) - - [Defining Animations with the transform Attribute](ui/ui-js-animate-transform.md) - - [Defining Animations with the background-position Attribute](ui/ui-js-animate-background-position-style.md) - - JS Animation - - [Component Animation](ui/ui-js-animate-component.md) - - Interpolator Animation - - [Animation Effect](ui/ui-js-animate-dynamic-effects.md) - - [Animation Frame](ui/ui-js-animate-frame.md) - - [Custom Components](ui/ui-js-custom-components.md) - - TypeScript-based Declarative Development Paradigm - - [Overview](ui/ui-ts-overview.md) - - Framework Overview - - File Organization - - [Directory Structure](ui/ts-framework-directory.md) - - [Rules for Accessing Application Code Files](ui/ts-framework-file-access-rules.md) - - ["js" Tag](ui/ts-framework-js-tag.md) - - Resource Access - - [Media Resource Types](ui/ts-media-resource-type.md) - - [Pixel Units](ui/ts-pixel-units.md) - - [Types](ui/ts-types.md) - - Declarative Syntax - - [Overview](ui/ts-syntax-intro.md) - - General UI Description Specifications - - [Basic Concepts](ui/ts-general-ui-concepts.md) - - Declarative UI Description Specifications - - [Parameterless Configuration](ui/ts-parameterless-configuration.md) - - [Configuration with Mandatory Parameters](ui/ts-configuration-with-mandatory-parameters.md) - - [Attribution Configuration](ui/ts-attribution-configuration.md) - - [Event Configuration](ui/ts-event-configuration.md) - - [Child Component Configuration](ui/ts-child-component-configuration.md) - - Componentization - - [@Component](ui/ts-component-based-component.md) - - [@Entry](ui/ts-component-based-entry.md) - - [@Preview](ui/ts-component-based-preview.md) - - [@Builder](ui/ts-component-based-builder.md) - - [@Extend](ui/ts-component-based-extend.md) - - [@CustomDialog](ui/ts-component-based-customdialog.md) - - About UI State Management - - [Basic Concepts](ui/ts-ui-state-mgmt-concepts.md) - - Managing Component States - - [@State](ui/ts-component-states-state.md) - - [@Prop](ui/ts-component-states-prop.md) - - [@Link](ui/ts-component-states-link.md) - - Managing Application States - - [AppStorage](ui/ts-application-states-appstorage.md) - - [PersistentStorage](ui/ts-application-states-apis-persistentstorage.md) - - [Environment](ui/ts-application-states-apis-environment.md) - - Managing Other States - - [@observed and @objectLink](ui/ts-other-states-observed-objectlink.md) - - [@Consume and @Provide](ui/ts-other-states-consume-provide.md) - - [@Watch](ui/ts-other-states-watch.md) - - About Rendering Control Syntax - - [if/else](ui/ts-rending-control-syntax-if-else.md) - - [ForEach](ui/ts-rending-control-syntax-foreach.md) - - [LazyForEach](ui/ts-rending-control-syntax-lazyforeach.md) - - About @Component - - [build Function](ui/ts-function-build.md) - - [Custom Component Initialization](ui/ts-custom-component-initialization.md) - - [Custom Component Lifecycle Callbacks](ui/ts-custom-component-lifecycle-callbacks.md) - - [Example: Component Creation and Re-Initialization](ui/ts-component-creation-re-initialization.md) - - [Syntactic Sugar](ui/ts-syntactic-sugar.md) - - Experiencing the Declarative UI - - [Creating a Declarative UI Project](ui/ui-ts-creating-project.md) - - [Getting to Know Components](ui/ui-ts-components.md) - - [Creating a Simple Page](ui/ui-ts-creating-simple-page.md) - - Defining Page Layout and Connection - - [Building a Food Data Model](ui/ui-ts-building-data-model.md) - - [Building a Food Category List Layout](ui/ui-ts-building-category-list-layout.md) - - [Building a Food Category Grid Layout](ui/ui-ts-building-category-grid-layout.md) - - [Implementing Page Redirection and Data Transmission](ui/ui-ts-page-redirection-data-transmission.md) - - Basic Functions - - [Agent-Powered Scheduled Reminders ](background-agent-scheduled-reminder/Readme-EN.md) - - [Overview](background-agent-scheduled-reminder/background-agent-scheduled-reminder-overview.md) - - [Development Guidelines](background-agent-scheduled-reminder/background-agent-scheduled-reminder-guide.md) - - [Background Task Management ](background-task-management/Readme-EN.md) - - [Background Task Management Overview](background-task-management/background-task-overview.md) - - [Background Task Management Development](background-task-management/background-task-dev-guide.md) - - [WebGL](webgl/Readme-EN.md) - - [WebGL Overview](webgl/webgl-overview.md) - - [WebGL Development](webgl/webgl-guidelines.md) - - [Media](media/Readme-EN.md) - - Audio - - - [Audio Overview](media/audio-overview.md) - - - [Audio Playback Development](media/audio-playback.md) - - - [Audio Playback Development Using AudioRenderer](media/audio-renderer.md) - - - [Audio Management Development](media/audio-management.md) - - - [Audio Recording Development](media/audio-recorder.md) - - - [Audio Recorder Development Using AudioCapturer](media/audio-capturer) - - Video - - - [Video Playback Development](media/video-playback.md) - - - [Video Recording Development](media/video-recorder.md) - - [Security](security/Readme-EN.md) - - User Authentication - - [User Authentication Overview](security/userauth-overview.md) - - [User Authentication Development](security/userauth-guidelines.md) - - [Connectivity](connectivity/Readme-EN.md) - - [IPC & RPC](connectivity/ipc-rpc.md) - - [IPC & RPC Overview](connectivity/ipc-rpc-overview.md) - - [IPC & RPC Development Guidelines](connectivity/ipc-rpc-development-guideline.md) - - [Subscribing to State Changes of a Remote Object](connectivity/subscribe-remote-state.md) - - [Data Management](database/Readme-EN.md) - - Distributed Data Service - - [Distributed Data Service Overview](database/database-mdds-overview.md) - - [Distributed Data Service Development](database/database-mdds-guidelines.md) - - Relational Database Overview - - [RDB Overview](database/database-relational-overview.md) - - [RDB Development](database/database-relational-guidelines.md) - - Lightweight Data Store - - [Lightweight Data Store Overview](database/database-preference-overview.md) - - [Lightweight Data Store Development](database/database-preference-guidelines.md) - - [Device](device/Readme-EN.md) - - USB Service - - [USB Service Overview](device/usb-overview.md) - - [USB Service Development](device/usb-guidelines.md) - - Location - - [Location Overview](device/device-location-overview.md) - - [Obtaining Device Location Information](device/device-location-info.md) - - [Geocoding and Reverse Geocoding Capabilities](device/device-location-geocoding.md) - - [DFX](dfx/Readme-EN.md) - - Application Event Logging - - [Overview of Application Event Logging](dfx/hiappevent-overview.md) - - [Development Guidelines on Application Event Logging](dfx/hiappevent-guidelines.md) -- Tools - - [DevEco Studio \(OpenHarmony\) User Guide](quick-start/deveco-studio-user-guide-for-openharmony.md) - - [Overview](quick-start/deveco-studio-overview.md) - - [Version Change History](quick-start/deveco-studio-release-notes.md) - - [Configuring the OpenHarmony SDK](quick-start/configuring-openharmony-sdk.md) + - DevEco Studio (OpenHarmony) User Guide + - [Overview](quick-start/deveco-studio-overview.md) + - [Version Change History](quick-start/deveco-studio-release-notes.md) + - [Configuring the OpenHarmony SDK](quick-start/configuring-openharmony-sdk.md) - [Creating an OpenHarmony Project](quick-start/create-openharmony-project.md) + - [Using the Project Wizard to Create a Project](quick-start/use-wizard-to-create-project.md) + - [Importing a Sample to Create a Project](quick-start/import-sample-to-create-project.md) - [Configuring the OpenHarmony App Signature](quick-start/configuring-openharmony-app-signature.md) - [Installing and Running Your OpenHarmony App](quick-start/installing-openharmony-app.md) -- Hands-On Tutorials - - [Samples](https://gitee.com/openharmony/app_samples/blob/master/README.md) -- API References - - [Compent Reference (JavaScript-based Web-like Development Paradigm)](reference/arkui-js/Readme-EN.md) - - [Components](reference/arkui-js/js-components.md) - - [Common](reference/arkui-js/js-components-common.md) - - [Universal Attributes](reference/arkui-js/js-components-common-attributes.md) - - [Universal Styles](reference/arkui-js/js-components-common-styles.md) - - [Universal Events](reference/arkui-js/js-components-common-events.md) - - [Universal Methods](reference/arkui-js/js-components-common-methods.md) - - [Animation Styles](reference/arkui-js/js-components-common-animation.md) - - [Gradient Styles](reference/arkui-js/js-components-common-gradient.md) - - [Transition Styles](reference/arkui-js/js-components-common-transition.md) - - [Media Query](reference/arkui-js/js-components-common-mediaquery.md) - - [Custom Font Styles](reference/arkui-js/js-components-common-customizing-font.md) - - [Atomic Layout](reference/arkui-js/js-components-common-atomic-layout.md) - - - [Container Component](reference/arkui-js/js-components-container.md) - - [badge](reference/arkui-js/js-components-container-badge.md) - - [dialog](reference/arkui-js/js-components-container-dialog.md) - - [div](reference/arkui-js/js-components-container-div.md) - - [form](reference/arkui-js/js-components-container-form.md) - - [list](reference/arkui-js/js-components-container-list.md) - - [list-item](reference/arkui-js/js-components-container-list-item.md) - - [list-item-group](reference/arkui-js/js-components-container-list-item-group.md) - - [panel](reference/arkui-js/js-components-container-panel.md) - - [popup](reference/arkui-js/js-components-container-popup.md) - - [refresh](reference/arkui-js/js-components-container-refresh.md) - - [stack](reference/arkui-js/js-components-container-stack.md) - - [stepper](reference/arkui-js/js-components-container-stepper.md) - - [stepper-item](reference/arkui-js/js-components-container-stepper-item.md) - - [swiper](reference/arkui-js/js-components-container-swiper.md) - - [tabs](reference/arkui-js/js-components-container-tabs.md) - - [tab-bar](reference/arkui-js/js-components-container-tab-bar.md) - - [tab-content](reference/arkui-js/js-components-container-tab-content.md) - - - [Basic Components](reference/arkui-js/js-components-basic.md) - - [button](reference/arkui-js/js-components-basic-button.md) - - [chart](reference/arkui-js/js-components-basic-chart.md) - - [divider](reference/arkui-js/js-components-basic-divider.md) - - [image](reference/arkui-js/js-components-basic-image.md) - - [image-animator](reference/arkui-js/js-components-basic-image-animator.md) - - [input](reference/arkui-js/js-components-basic-input.md) - - [label](reference/arkui-js/js-components-basic-label.md) - - [marquee](reference/arkui-js/js-components-basic-marquee.md) - - [menu](reference/arkui-js/js-components-basic-menu.md) - - [option](reference/arkui-js/js-components-basic-option.md) - - [picker](reference/arkui-js/js-components-basic-picker.md) - - [picker-view](reference/arkui-js/js-components-basic-picker-view.md) - - [piece](reference/arkui-js/js-components-basic-piece.md) - - [progress](reference/arkui-js/js-components-basic-progress.md) - - [qrcode](reference/arkui-js/js-components-basic-qrcode.md) - - [rating](reference/arkui-js/js-components-basic-rating.md) - - [richtext](reference/arkui-js/js-components-basic-richtext.md) - - [search](reference/arkui-js/js-components-basic-search.md) - - [select](reference/arkui-js/js-components-basic-select.md) - - [slider](reference/arkui-js/js-components-basic-slider.md) - - [span](reference/arkui-js/js-components-basic-span.md) - - [switch](reference/arkui-js/js-components-basic-switch.md) - - [text](reference/arkui-js/js-components-basic-text.md) - - [textarea](reference/arkui-js/js-components-basic-textarea.md) - - [toolbar](reference/arkui-js/js-components-basic-toolbar.md) - - [toolbar-item](reference/arkui-js/js-components-basic-toolbar-item.md) - - [toggle](reference/arkui-js/js-components-basic-toggle.md) - - - [Media Components](reference/arkui-js/js-components-media.md) - - [video](reference/arkui-js/js-components-media-video.md) - - - [Canvas Components](reference/arkui-js/js-components-canvas.md) - - [canvas](reference/arkui-js/js-components-canvas-canvas.md) - - [CanvasRenderingContext2D](reference/arkui-js/js-components-canvas-canvasrenderingcontext2d.md) - - [Image](reference/arkui-js/js-components-canvas-image.md) - - [CanvasGradient](reference/arkui-js/js-components-canvas-canvasgradient.md) - - [ImageData](reference/arkui-js/js-components-canvas-imagedata.md) - - [Path2D](reference/arkui-js/js-components-canvas-path2d.md) - - [ImageBitmap](reference/arkui-js/js-components-canvas-imagebitmap.md) - - [OffscreenCanvas](reference/arkui-js/js-components-canvas-offscreencanvas.md) - - [OffscreenCanvasRenderingContext2D](reference/arkui-js/js-offscreencanvasrenderingcontext2d.md) - - - [Grid](reference/arkui-js/js-components-grid.md) - - [Basic Concepts](reference/arkui-js/js-components-grid-basic-concepts.md) - - [grid-container](reference/arkui-js/js-components-grid-container.md) - - [grid-row](reference/arkui-js/js-components-grid-row.md) - - [grid-col](reference/arkui-js/js-components-grid-col.md) - - - [SVG Components](reference/arkui-js/js-svg.md) - - [Universal Attributes](reference/arkui-js/js-components-svg-common-attributes.md) - - [svg](reference/arkui-js/js-components-svg.md) - - [rect](reference/arkui-js/js-components-svg-rect.md) - - [circle](reference/arkui-js/js-components-svg-circle.md) - - [ellipse](reference/arkui-js/js-components-svg-ellipse.md) - - [path](reference/arkui-js/js-components-svg-path.md) - - [line](reference/arkui-js/js-components-svg-line.md) - - [polyline](reference/arkui-js/js-components-svg-polyline.md) - - [polygon](reference/arkui-js/js-components-svg-polygon.md) - - [text](reference/arkui-js/js-components-svg-text.md) - - [tspan](reference/arkui-js/js-components-svg-tspan.md) - - [textPath](reference/arkui-js/js-components-svg-textpath.md) - - [animate](reference/arkui-js/js-components-svg-animate.md) - - [animateMotion](reference/arkui-js/js-components-svg-animatemotion.md) - - [animateTransform](reference/arkui-js/js-components-svg-animatetransform.md) - - - [Custom Components](reference/arkui-js/js-components-custom.md) - - [Basic Usage](reference/arkui-js/js-components-custom-basic-usage.md) - - [Custom Events](reference/arkui-js/js-components-custom-events.md) - - [props](reference/arkui-js/js-components-custom-props.md) - - [Event Parameter](reference/arkui-js/js-components-custom-event-parameter.md) - - [slot](reference/arkui-js/js-components-custom-slot.md) - - [Lifecycle Definition](reference/arkui-js/js-components-custom-lifecycle.md) - - - [Appendix](reference/arkui-js/js-appendix.md) - - [Type Attributes](reference/arkui-js/js-appendix-types.md) - - [Compent Reference (TypeScript-based Declarative Development Paradigm)](reference/arkui-ts/Readme-EN.md) - - [Components](reference/arkui-ts/ts-components.md) - - [Universal Components](reference/arkui-ts/ts-universal-components.md) - - [Universal Events](reference/arkui-ts/ts-universal-events.md) - - [Click Event](reference/arkui-ts/ts-universal-events-click.md) - - [Touch](reference/arkui-ts/ts-universal-events-touch.md) - - [Show/Hide Event](reference/arkui-ts/ts-universal-events-show-hide.md) - - [Key Event](reference/arkui-ts/ts-universal-events-key.md) - - [Component Area Change Event](reference/arkui-ts/ts-universal-events-component-area-change.md) - - - [Universal Attributes](reference/arkui-ts/ts-universal-attributes.md) - - [Size](reference/arkui-ts/ts-universal-attributes-size.md) - - [Location](reference/arkui-ts/ts-universal-attributes-location.md) - - [Layout Constraints](reference/arkui-ts/ts-universal-attributes-layout-constraints.md) - - [Flex Layout](reference/arkui-ts/ts-universal-attributes-flex-layout.md) - - [Border Configuration](reference/arkui-ts/ts-universal-attributes-border.md) - - [Background](reference/arkui-ts/ts-universal-attributes-background.md) - - [Opacity](reference/arkui-ts/ts-universal-attributes-opacity.md) - - [Visibility](reference/arkui-ts/ts-universal-attributes-visibility.md) - - [Enable/Disable](reference/arkui-ts/ts-universal-attributes-enable.md) - - [Overlay](reference/arkui-ts/ts-universal-attributes-overlay.md) - - [Z-order Control](reference/arkui-ts/ts-universal-attributes-z-order.md) - - [Transformation](reference/arkui-ts/ts-universal-attributes-transformation.md) - - [Image Effect Configuration](reference/arkui-ts/ts-universal-attributes-image-effect.md) - - [Shape Clipping](reference/arkui-ts/ts-universal-attributes-sharp-clipping.md) - - [Text Style](reference/arkui-ts/ts-universal-attributes-text-style.md) - - [Grid](reference/arkui-ts/ts-universal-attributes-grid.md) - - [Gradient Color](reference/arkui-ts/ts-universal-attributes-gradient-color.md) - - [Popup Control](reference/arkui-ts/ts-universal-attributes-popup.md) - - [Menu Control](reference/arkui-ts/ts-universal-attributes-menu.md) - - [Click Control](reference/arkui-ts/ts-universal-attributes-touchable.md) - - [Touch Target](reference/arkui-ts/ts-universal-attributes-response-region.md) - - - [Gesture Processing](reference/arkui-ts/ts-gesture-processing.md) - - [Gesture Binding Methods](reference/arkui-ts/ts-gesture-settings.md) - - [Basic Gestures](reference/arkui-ts/ts-basic-gestures.md) - - [TapGesture](reference/arkui-ts/ts-basic-gestures-tapgesture.md) - - [LongPressGesture](reference/arkui-ts/ts-basic-gestures-longpressgesture.md) - - [PanGesture](reference/arkui-ts/ts-basic-gestures-pangesture.md) - - [PinchGesture](reference/arkui-ts/ts-basic-gestures-pinchgesture.md) - - [RotationGesture](reference/arkui-ts/ts-basic-gestures-rotationgesture.md) - - [SwipeGesture](reference/arkui-ts/ts-basic-gestures-swipegesture.md) - - - [Combined Gestures](reference/arkui-ts/ts-combined-gestures.md) - - - [Basic Components](reference/arkui-ts/ts-basic-components.md) - - [Blank](reference/arkui-ts/ts-basic-components-blank.md) - - [Button](reference/arkui-ts/ts-basic-components-button.md) - - [DataPanel](reference/arkui-ts/ts-basic-components-datapanel.md) - - [Divider](reference/arkui-ts/ts-basic-components-divider.md) - - [Gauge](reference/arkui-ts/ts-basic-components-gauge.md) - - [Image](reference/arkui-ts/ts-basic-components-image.md) - - [ImageAnimator](reference/arkui-ts/ts-basic-components-imageanimator.md) - - [LoadingProgress](reference/arkui-ts/ts-basic-components-loadingprogress.md) - - [Marquee](reference/arkui-ts/ts-basic-components-marquee.md) - - [Progress](reference/arkui-ts/ts-basic-components-progress.md) - - [QRCode](reference/arkui-ts/ts-basic-components-qrcode.md) - - [Rating](reference/arkui-ts/ts-basic-components-rating.md) - - [Select](reference/arkui-ts/ts-basic-components-select.md) - - [Slider](reference/arkui-ts/ts-basic-components-slider.md) - - [Span](reference/arkui-ts/ts-basic-components-span.md) - - [Text](reference/arkui-ts/ts-basic-components-text.md) - - [TextArea](reference/arkui-ts/ts-basic-components-textarea.md) - - [TextInput](reference/arkui-ts/ts-basic-components-textinput.md) - - [Toggle](reference/arkui-ts/ts-basic-components-toggle.md) - - [TextClock](reference/arkui-ts/ts-basic-components-textclock.md) - - - [Container Components](reference/arkui-ts/ts-components-container.md) - - [AlphabetIndexer](reference/arkui-ts/ts-container-alphabet-indexer.md) - - [Badge](reference/arkui-ts/ts-container-badge.md) - - [Column](reference/arkui-ts/ts-container-column.md) - - [ColumnSplit](reference/arkui-ts/ts-container-columnsplit.md) - - [Counter](reference/arkui-ts/ts-container-counter.md) - - [Flex](reference/arkui-ts/ts-container-flex.md) - - [GridContainer](reference/arkui-ts/ts-container-gridcontainer.md) - - [Grid](reference/arkui-ts/ts-container-grid.md) - - [GridItem](reference/arkui-ts/ts-container-griditem.md) - - [List](reference/arkui-ts/ts-container-list.md) - - [ListItem](reference/arkui-ts/ts-container-listitem.md) - - [Navigator](reference/arkui-ts/ts-container-navigator.md) - - [Navigation](reference/arkui-ts/ts-container-navigation.md) - - [Panel](reference/arkui-ts/ts-container-panel.md) - - [Row](reference/arkui-ts/ts-container-row.md) - - [RowSplit](reference/arkui-ts/ts-container-rowsplit.md) - - [Scroll](reference/arkui-ts/ts-container-scroll.md) - - [ScrollBar](reference/arkui-ts/ts-container-scrollbar.md) - - [Stack](reference/arkui-ts/ts-container-stack.md) - - [Swiper](reference/arkui-ts/ts-container-swiper.md) - - [Tabs](reference/arkui-ts/ts-container-tabs.md) - - [TabContent](reference/arkui-ts/ts-container-tabcontent.md) - - - [Refresh](reference/arkui-ts/ts-container-refresh.md) - - [Drawing Components](reference/arkui-ts/ts-drawing-components.md) - - - [Circle](reference/arkui-ts/ts-drawing-components-circle.md) - - [Ellipse](reference/arkui-ts/ts-drawing-components-ellipse.md) - - [Line](reference/arkui-ts/ts-drawing-components-line.md) - - [Polyline](reference/arkui-ts/ts-drawing-components-polyline.md) - - [Polygon](reference/arkui-ts/ts-drawing-components-polygon.md) - - [Path](reference/arkui-ts/ts-drawing-components-path.md) - - [Rect](reference/arkui-ts/ts-drawing-components-rect.md) - - [Shape](reference/arkui-ts/ts-drawing-components-shape.md) - - - [Canvas Components](reference/arkui-ts/ts-components-canvas.md) - - [Canvas](reference/arkui-ts/ts-components-canvas-canvas.md) - - [CanvasRenderingContext2D](reference/arkui-ts/ts-canvasrenderingcontext2d.md) - - [OffscreenCanvasRenderingConxt2D](reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md) - - [Lottie](reference/arkui-ts/ts-components-canvas-lottie.md) - - [Path2D](reference/arkui-ts/ts-components-canvas-path2d.md) - - [CanvasGradient](reference/arkui-ts/ts-components-canvas-canvasgradient.md) - - [ImageBitmap](reference/arkui-ts/ts-components-canvas-imagebitmap.md) - - [ImageData](reference/arkui-ts/ts-components-canvas-imagedata.md) - - [Animation](reference/arkui-ts/ts-animation.md) - - [Attribute Animation](reference/arkui-ts/ts-animatorproperty.md) - - [Explicit Animation](reference/arkui-ts/ts-explicit-animation.md) - - [Transition Animation](reference/arkui-ts/ts-transition-animation.md) - - [Page Transition](reference/arkui-ts/ts-page-transition-animation.md) - - [Component Transition](reference/arkui-ts/ts-transition-animation-component.md) - - [Transition of Shared Elements](reference/arkui-ts/ts-transition-animation-shared-elements.md) - - - [Motion Path Animation](reference/arkui-ts/ts-motion-path-animation.md) - - [Matrix Transformation](reference/arkui-ts/ts-matrix-transformation.md) - - [Interpolation Calculation](reference/arkui-ts/ts-interpolation-calculation.md) - - - [Global UI Methods](reference/arkui-ts/ts-global-ui-methods.md) - - [Alert Dialog Box](reference/arkui-ts/ts-methods-alert-dialog-box.md) - - [Custom Dialog box](reference/arkui-ts/ts-methods-custom-dialog-box.md) - - [Image Cache](reference/arkui-ts/ts-methods-image-cache.md) - - [Media Query](reference/arkui-ts/ts-methods-media-query.md) - - [List Selection Dialog Box](reference/arkui-ts/ts-methods-action-sheet.md) - - - [Appendix](reference/arkui-ts/ts-appendix.md) - - - [Built-in Enums](reference/arkui-ts/ts-appendix-enums.md) - - [APIs](reference/apis/Readme-EN.md) - - Ability Framework - - [FeatureAbility Module](reference/apis/js-apis-featureAbility.md) - - [ParticleAbility Module](reference/apis/js-apis-particleAbility.md) - - [DataAbilityHelper Module](reference/apis/js-apis-dataAbilityHelper.md) - - [DataUriUtils Module](reference/apis/js-apis-DataUriUtils.md) - - [Bundle Module](reference/apis/js-apis-Bundle.md) - - [Context Module](reference/apis/js-apis-Context.md) - - Event Notification - - [CommonEvent Module](reference/apis/js-apis-commonEvent.md) - - [Notification Module](reference/apis/js-apis-notification.md) - - [Reminder Agent](reference/apis/js-apis-reminderAgent.md) - - Resource Management - - [Resource Manager](reference/apis/js-apis-resource-manager.md) - - [Internationalization \(intl\) ](reference/apis/js-apis-intl.md) - - [Internationalization \(i18n\) ](reference/apis/js-apis-i18n.md) - - Media - - [Audio Management](reference/apis/js-apis-audio.md) - - [Media](reference/apis/js-apis-media.md) - - Security - - [User Authentication](reference/apis/js-apis-useriam-userauth.md) - - [Access Control](reference/apis/js-apis-abilityAccessCtrl.md) - - Data Management - - [Lightweight Storage (deprecated since 8)](reference/apis/js-apis-data-storage.md) - - [Distributed Data Management](reference/apis/js-apis-distributed-data.md) - - [Relational Database](reference/apis/js-apis-data-rdb.md) - - [Result Set](reference/apis/js-apis-data-resultset.md) - - [DataAbilityPredicates](reference/apis/js-apis-data-ability.md) - - [Settings](reference/apis/js-apis-settings.md) - - File Management - - [File Management](reference/apis/js-apis-fileio.md) - - [Statfs](reference/apis/js-apis-statfs.md) - - [Environment](reference/apis/js-apis-environment.md) - - [Public File Access and Management](reference/apis/js-apis-filemanager.md) - - [App Storage Statistics](reference/apis/js-apis-storage-statistics.md) - - [Volume Management](reference/apis/js-apis-volumemanager.md) - - Account Management - - [Distributed Account Management](reference/apis/js-apis-distributed-account.md) - - [App Account Management](reference/apis/js-apis-appAccount.md) - - Telephony Service - - [Call](reference/apis/js-apis-call.md) - - [SMS](reference/apis/js-apis-sms.md) - - [SIM Management](reference/apis/js-apis-sim.md) - - [Radio](reference/apis/js-apis-radio.md) - - [observer](reference/apis/js-apis-observer.md) - - [Cellular Data](reference/apis/js-apis-telephony-data.md) - - Network and Connectivity - - [WLAN](reference/apis/js-apis-wifi.md) - - [Bluetooth](reference/apis/js-apis-bluetooth.md) - - [RPC](reference/apis/js-apis-rpc.md) - - Device Management - - [Sensor](reference/apis/js-apis-sensor.md) - - [Vibrator](reference/apis/js-apis-vibrator.md) - - [Brightness](reference/apis/js-apis-brightness.md) - - [Battery Info](reference/apis/js-apis-battery-info.md) - - [Power Management](reference/apis/js-apis-power.md) - - [Thermal Management](reference/apis/js-apis-thermal.md) - - [Running Lock](reference/apis/js-apis-runninglock.md) - - [Device Info](reference/apis/js-apis-device-info.md) - - [systemParameter](reference/apis/js-apis-system-parameter.md) - - [Device Management](reference/apis/js-apis-device-manager.md) - - [Window](reference/apis/js-apis-window.md) - - [Display](reference/apis/js-apis-display.md) - - [Update](reference/apis/js-apis-update.md) - - [USB](reference/apis/js-apis-usb.md) - - [Location](reference/apis/js-apis-geolocation.md) - - Basic Features - - [Application Context](reference/apis/js-apis-basic-features-app-context.md) - - [Console Logs](reference/apis/js-apis-basic-features-logs.md) - - [Page Routing](reference/apis/js-apis-basic-features-routes.md) - - [Pop-up Window](reference/apis/js-apis-basic-features-pop-up.md) - - [Application Configuration](reference/apis/js-apis-basic-features-configuration.md) - - [Timer](reference/apis/js-apis-basic-features-timer.md) - - [Setting the System Time](reference/apis/js-apis-system-time.md) - - [Animation](reference/apis/js-apis-basic-features-animator.md) - - [WebGL](reference/apis/js-apis-webgl.md) - - [WebGL2](reference/apis/js-apis-webgl2.md) - - [Screenshot](reference/apis/js-apis-screenshot.md) - - DFX - - [HiAppEvent](reference/apis/js-apis-hiappevent.md) - - [Performance Tracing](reference/apis/js-apis-hitracemeter.md) - - [Fault Logger](reference/apis/js-apis-faultLogger.md) - - [Distributed Call Chain Tracing](reference/apis/js-apis-hitracechain.md) - - [HiLog](reference/apis/js-apis-hilog.md) - - [HiChecker](reference/apis/js-apis-hichecker.md) - - [HiDebug](reference/apis/js-apis-hidebug.md) - - Language Base Class Library - - [Obtaining Process Information](reference/apis/js-apis-process.md) - - [URL String Parsing](reference/apis/js-apis-url.md) - - [URI String Parsing](reference/apis/js-apis-uri.md) - - [Util](reference/apis/js-apis-util.md) - - [XML Parsing and Generation](reference/apis/js-apis-xml.md) - - [XML-to-JavaScript Conversion](reference/apis/js-apis-convertxml.md) - - [Worker Startup](reference/apis/js-apis-worker.md) - - [Linear Container ArrayList](reference/apis/js-apis-arraylist.md) - - [Linear Container Deque](reference/apis/js-apis-deque.md) - - [Linear Container List](reference/apis/js-apis-list.md) - - [Linear Container LinkedList](reference/apis/js-apis-linkedlist.md) - - [Linear Container Queue](reference/apis/js-apis-queue.md) - - [Linear Container Stack](reference/apis/js-apis-stack.md) - - [Linear Container Vector](reference/apis/js-apis-vector.md) - - [Nonlinear Container HashSet](reference/apis/js-apis-hashset.md) - - [Nonlinear Container HashMap](reference/apis/js-apis-hashmap.md) - - [Nonlinear Container PlainArray](reference/apis/js-apis-plainarray.md) - - [Nonlinear Container TreeMap](reference/apis/js-apis-treemap.md) - - [Nonlinear Container TreeSet](reference/apis/js-apis-treeset.md) - - [Nonlinear Container LightWeightMap](reference/apis/js-apis-lightweightmap.md) - - [Nonlinear Container LightWeightSet](reference/apis/js-apis-lightweightset.md) \ No newline at end of file + - [Directory Structure](quick-start/package-structure.md) +- Development + - UI + - JavaScript-based Web-Like Development Paradigm + - [Overview](ui/ui-js-overview.md) + - Framework + - [File Organization](ui/js-framework-file.md) + - ["js" Tag](ui/js-framework-js-tag.md) + - [app.js](ui/js-framework-js-file.md) + - Syntax + - [HML](ui/js-framework-syntax-hml.md) + - [CSS](ui/js-framework-syntax-css.md) + - [JavaScript](ui/js-framework-syntax-js.md) + - [Lifecycle](ui/js-framework-lifecycle.md) + - [Resource Limitations and Access](ui/js-framework-resource-restriction.md) + - [Multi-Language Capability](ui/js-framework-multiple-languages.md) + - Building the UI + - [Component Overview](ui/ui-js-building-ui-component.md) + - Building the Layout + - [Layout Description](ui/ui-js-building-ui-layout-intro.md) + - [Adding Title and Paragraph Text](ui/ui-js-building-ui-layout-text.md) + - [Adding an Image](ui/ui-js-building-ui-layout-image.md) + - [Adding a Comment](ui/ui-js-building-ui-layout-comment.md) + - [Adding a Container](ui/ui-js-building-ui-layout-external-container.md) + - [Adding Interactions](ui/ui-js-building-ui-interactions.md) + - [Developing Animations](ui/ui-js-building-ui-animation.md) + - [Defining Events](ui/ui-js-building-ui-event.md) + - [Defining Page Routes](ui/ui-js-building-ui-routes.md) + - Common Component Development Guidelines + - [Text](ui/ui-js-components-text.md) + - [Input](ui/ui-js-components-input.md) + - [Button](ui/ui-js-components-button.md) + - [List](ui/ui-js-components-list.md) + - [Picker](ui/ui-js-components-picker.md) + - [Dialog](ui/ui-js-components-dialog.md) + - [Form](ui/ui-js-components-form.md) + - [Stepper](ui/ui-js-components-stepper.md) + - [Tabs](ui/ui-js-component-tabs.md) + - [Image](ui/ui-js-components-images.md) + - Animation Development Guidelines + - CSS Animation + - [Defining Attribute Style Animations](ui/ui-js-animate-attribute-style.md) + - [Defining Animations with the transform Attribute](ui/ui-js-animate-transform.md) + - [Defining Animations with the background-position Attribute](ui/ui-js-animate-background-position-style.md) + - JS Animation + - [Component Animation](ui/ui-js-animate-component.md) + - Interpolator Animation + - [Animation Effect](ui/ui-js-animate-dynamic-effects.md) + - [Animation Frame](ui/ui-js-animate-frame.md) + - [Custom Components](ui/ui-js-custom-components.md) + - TypeScript-based Declarative Development Paradigm + - [Overview](ui/ui-ts-overview.md) + - Framework Overview + - File Organization + - [Directory Structure](ui/ts-framework-directory.md) + - [Rules for Accessing Application Code Files](ui/ts-framework-file-access-rules.md) + - ["js" Tag](ui/ts-framework-js-tag.md) + - Resource Access + - [Media Resource Types](ui/ts-media-resource-type.md) + - [Pixel Units](ui/ts-pixel-units.md) + - [Types](ui/ts-types.md) + - Declarative Syntax + - [Overview](ui/ts-syntax-intro.md) + - General UI Description Specifications + - [Basic Concepts](ui/ts-general-ui-concepts.md) + - Declarative UI Description Specifications + - [Parameterless Configuration](ui/ts-parameterless-configuration.md) + - [Configuration with Mandatory Parameters](ui/ts-configuration-with-mandatory-parameters.md) + - [Attribution Configuration](ui/ts-attribution-configuration.md) + - [Event Configuration](ui/ts-event-configuration.md) + - [Child Component Configuration](ui/ts-child-component-configuration.md) + - Componentization + - [@Component](ui/ts-component-based-component.md) + - [@Entry](ui/ts-component-based-entry.md) + - [@Preview](ui/ts-component-based-preview.md) + - [@Builder](ui/ts-component-based-builder.md) + - [@Extend](ui/ts-component-based-extend.md) + - [@CustomDialog](ui/ts-component-based-customdialog.md) + - About UI State Management + - [Basic Concepts](ui/ts-ui-state-mgmt-concepts.md) + - Managing Component States + - [@State](ui/ts-component-states-state.md) + - [@Prop](ui/ts-component-states-prop.md) + - [@Link](ui/ts-component-states-link.md) + - Managing Application States + - [AppStorage](ui/ts-application-states-appstorage.md) + - [PersistentStorage](ui/ts-application-states-apis-persistentstorage.md) + - [Environment](ui/ts-application-states-apis-environment.md) + - Managing Other States + - [@observed and @objectLink](ui/ts-other-states-observed-objectlink.md) + - [@Consume and @Provide](ui/ts-other-states-consume-provide.md) + - [@Watch](ui/ts-other-states-watch.md) + - About Rendering Control Syntax + - [if/else](ui/ts-rending-control-syntax-if-else.md) + - [ForEach](ui/ts-rending-control-syntax-foreach.md) + - [LazyForEach](ui/ts-rending-control-syntax-lazyforeach.md) + - About @Component + - [build Function](ui/ts-function-build.md) + - [Custom Component Initialization](ui/ts-custom-component-initialization.md) + - [Custom Component Lifecycle Callbacks](ui/ts-custom-component-lifecycle-callbacks.md) + - [Example: Component Creation and Re-Initialization](ui/ts-component-creation-re-initialization.md) + - [Syntactic Sugar](ui/ts-syntactic-sugar.md) + - Experiencing the Declarative UI + - [Creating a Declarative UI Project](ui/ui-ts-creating-project.md) + - [Getting to Know Components](ui/ui-ts-components.md) + - [Creating a Simple Page](ui/ui-ts-creating-simple-page.md) + - Defining Page Layout and Connection + - [Building a Food Data Model](ui/ui-ts-building-data-model.md) + - [Building a Food Category List Layout](ui/ui-ts-building-category-list-layout.md) + - [Building a Food Category Grid Layout](ui/ui-ts-building-category-grid-layout.md) + - [Implementing Page Redirection and Data Transmission](ui/ui-ts-page-redirection-data-transmission.md) + - Basic Functions + - Agent-Powered Scheduled Reminders + - [Overview](background-agent-scheduled-reminder/background-agent-scheduled-reminder-overview.md) + - [Development Guidelines](background-agent-scheduled-reminder/background-agent-scheduled-reminder-guide.md) + - Background Task Management + - [Background Task Management Overview](background-task-management/background-task-overview.md) + - [Background Task Management Development](background-task-management/background-task-dev-guide.md) + - WebGL + - [WebGL Overview](webgl/webgl-overview.md) + - [WebGL Development](webgl/webgl-guidelines.md) + - Media + - Audio + - [Audio Overview](media/audio-overview.md) + - [Audio Playback Development](media/audio-playback.md) + - [Audio Playback Development Using AudioRenderer](media/audio-renderer.md) + - [Audio Recording Development](media/audio-recorder.md) + - [Audio Recorder Development Using AudioCapturer](media/audio-capturer) + - Video + - [Video Playback Development](media/video-playback.md) + - [Video Recording Development](media/video-recorder.md) + - Security + - User Authentication + - [User Authentication Overview](security/userauth-overview.md) + - [User Authentication Development](security/userauth-guidelines.md) + - Connectivity + - IPC & RPC + - [IPC & RPC Overview](connectivity/ipc-rpc-overview.md) + - [IPC & RPC Development Guidelines](connectivity/ipc-rpc-development-guideline.md) + - [Subscribing to State Changes of a Remote Object](connectivity/subscribe-remote-state.md) + - Data Management + - Distributed Data Service + - [Distributed Data Service Overview](database/database-mdds-overview.md) + - [Distributed Data Service Development](database/database-mdds-guidelines.md) + - Relational Database Overview + - [RDB Overview](database/database-relational-overview.md) + - [RDB Development](database/database-relational-guidelines.md) + - Lightweight Data Store + - [Lightweight Data Store Overview](database/database-preference-overview.md) + - [Lightweight Data Store Development](database/database-preference-guidelines.md) + - Device + - USB Service + - [USB Service Overview](device/usb-overview.md) + - [USB Service Development](device/usb-guidelines.md) + - Location + - [Location Overview](device/device-location-overview.md) + - [Obtaining Device Location Information](device/device-location-info.md) + - [Geocoding and Reverse Geocoding Capabilities](device/device-location-geocoding.md) + - DFX + - Application Event Logging + - [Overview of Application Event Logging](dfx/hiappevent-overview.md) + - [Development Guidelines on Application Event Logging](dfx/hiappevent-guidelines.md) +- Tools + - DevEco Studio (OpenHarmony) User Guide + - [Overview](quick-start/deveco-studio-overview.md) + - [Version Change History](quick-start/deveco-studio-release-notes.md) + - [Configuring the OpenHarmony SDK](quick-start/configuring-openharmony-sdk.md) + - [Creating an OpenHarmony Project](quick-start/create-openharmony-project.md) + - [Configuring the OpenHarmony App Signature](quick-start/configuring-openharmony-app-signature.md) + - [Installing and Running Your OpenHarmony App](quick-start/installing-openharmony-app.md) +- Hands-On Tutorials + - [Samples](https://gitee.com/openharmony/app_samples/blob/master/README.md) +- API References + - Compent Reference (JavaScript-based Web-like Development Paradigm) + - [Components](reference/arkui-js/js-components.md) + - [Common](reference/arkui-js/js-components-common.md) + - [Universal Attributes](reference/arkui-js/js-components-common-attributes.md) + - [Universal Styles](reference/arkui-js/js-components-common-styles.md) + - [Universal Events](reference/arkui-js/js-components-common-events.md) + - [Universal Methods](reference/arkui-js/js-components-common-methods.md) + - [Animation Styles](reference/arkui-js/js-components-common-animation.md) + - [Gradient Styles](reference/arkui-js/js-components-common-gradient.md) + - [Transition Styles](reference/arkui-js/js-components-common-transition.md) + - [Custom Font Styles](reference/arkui-js/js-components-common-customizing-font.md) + - [Atomic Layout](reference/arkui-js/js-components-common-atomic-layout.md) + - [Container Component](reference/arkui-js/js-components-container.md) + - [badge](reference/arkui-js/js-components-container-badge.md) + - [dialog](reference/arkui-js/js-components-container-dialog.md) + - [div](reference/arkui-js/js-components-container-div.md) + - [form](reference/arkui-js/js-components-container-form.md) + - [list](reference/arkui-js/js-components-container-list.md) + - [list-item](reference/arkui-js/js-components-container-list-item.md) + - [list-item-group](reference/arkui-js/js-components-container-list-item-group.md) + - [panel](reference/arkui-js/js-components-container-panel.md) + - [popup](reference/arkui-js/js-components-container-popup.md) + - [refresh](reference/arkui-js/js-components-container-refresh.md) + - [stack](reference/arkui-js/js-components-container-stack.md) + - [stepper](reference/arkui-js/js-components-container-stepper.md) + - [stepper-item](reference/arkui-js/js-components-container-stepper-item.md) + - [swiper](reference/arkui-js/js-components-container-swiper.md) + - [tabs](reference/arkui-js/js-components-container-tabs.md) + - [tab-bar](reference/arkui-js/js-components-container-tab-bar.md) + - [tab-content](reference/arkui-js/js-components-container-tab-content.md) + - [Basic Components](reference/arkui-js/js-components-basic.md) + - [button](reference/arkui-js/js-components-basic-button.md) + - [chart](reference/arkui-js/js-components-basic-chart.md) + - [divider](reference/arkui-js/js-components-basic-divider.md) + - [image](reference/arkui-js/js-components-basic-image.md) + - [image-animator](reference/arkui-js/js-components-basic-image-animator.md) + - [input](reference/arkui-js/js-components-basic-input.md) + - [label](reference/arkui-js/js-components-basic-label.md) + - [marquee](reference/arkui-js/js-components-basic-marquee.md) + - [menu](reference/arkui-js/js-components-basic-menu.md) + - [option](reference/arkui-js/js-components-basic-option.md) + - [picker](reference/arkui-js/js-components-basic-picker.md) + - [picker-view](reference/arkui-js/js-components-basic-picker-view.md) + - [piece](reference/arkui-js/js-components-basic-piece.md) + - [progress](reference/arkui-js/js-components-basic-progress.md) + - [qrcode](reference/arkui-js/js-components-basic-qrcode.md) + - [rating](reference/arkui-js/js-components-basic-rating.md) + - [richtext](reference/arkui-js/js-components-basic-richtext.md) + - [search](reference/arkui-js/js-components-basic-search.md) + - [select](reference/arkui-js/js-components-basic-select.md) + - [slider](reference/arkui-js/js-components-basic-slider.md) + - [span](reference/arkui-js/js-components-basic-span.md) + - [switch](reference/arkui-js/js-components-basic-switch.md) + - [text](reference/arkui-js/js-components-basic-text.md) + - [textarea](reference/arkui-js/js-components-basic-textarea.md) + - [toolbar](reference/arkui-js/js-components-basic-toolbar.md) + - [toolbar-item](reference/arkui-js/js-components-basic-toolbar-item.md) + - [toggle](reference/arkui-js/js-components-basic-toggle.md) + - [Media Components](reference/arkui-js/js-components-media.md) + - [video](reference/arkui-js/js-components-media-video.md) + - [Canvas Components](reference/arkui-js/js-components-canvas.md) + - [canvas](reference/arkui-js/js-components-canvas-canvas.md) + - [CanvasRenderingContext2D](reference/arkui-js/js-components-canvas-canvasrenderingcontext2d.md) + - [Image](reference/arkui-js/js-components-canvas-image.md) + - [CanvasGradient](reference/arkui-js/js-components-canvas-canvasgradient.md) + - [ImageData](reference/arkui-js/js-components-canvas-imagedata.md) + - [Path2D](reference/arkui-js/js-components-canvas-path2d.md) + - [ImageBitmap](reference/arkui-js/js-components-canvas-imagebitmap.md) + - [OffscreenCanvas](reference/arkui-js/js-components-canvas-offscreencanvas.md) + - [OffscreenCanvasRenderingContext2D](reference/arkui-js/js-offscreencanvasrenderingcontext2d.md) + - [Grid](reference/arkui-js/js-components-grid.md) + - [Basic Concepts](reference/arkui-js/js-components-grid-basic-concepts.md) + - [grid-container](reference/arkui-js/js-components-grid-container.md) + - [grid-row](reference/arkui-js/js-components-grid-row.md) + - [grid-col](reference/arkui-js/js-components-grid-col.md) + - [SVG Components](reference/arkui-js/js-svg.md) + - [Universal Attributes](reference/arkui-js/js-components-svg-common-attributes.md) + - [svg](reference/arkui-js/js-components-svg.md) + - [rect](reference/arkui-js/js-components-svg-rect.md) + - [circle](reference/arkui-js/js-components-svg-circle.md) + - [ellipse](reference/arkui-js/js-components-svg-ellipse.md) + - [path](reference/arkui-js/js-components-svg-path.md) + - [line](reference/arkui-js/js-components-svg-line.md) + - [polyline](reference/arkui-js/js-components-svg-polyline.md) + - [polygon](reference/arkui-js/js-components-svg-polygon.md) + - [text](reference/arkui-js/js-components-svg-text.md) + - [tspan](reference/arkui-js/js-components-svg-tspan.md) + - [textPath](reference/arkui-js/js-components-svg-textpath.md) + - [animate](reference/arkui-js/js-components-svg-animate.md) + - [animateMotion](reference/arkui-js/js-components-svg-animatemotion.md) + - [animateTransform](reference/arkui-js/js-components-svg-animatetransform.md) + - [Custom Components](reference/arkui-js/js-components-custom.md) + - [Basic Usage](reference/arkui-js/js-components-custom-basic-usage.md) + - [Custom Events](reference/arkui-js/js-components-custom-events.md) + - [props](reference/arkui-js/js-components-custom-props.md) + - [Event Parameter](reference/arkui-js/js-components-custom-event-parameter.md) + - [slot](reference/arkui-js/js-components-custom-slot.md) + - [Lifecycle Definition](reference/arkui-js/js-components-custom-lifecycle.md) + - [Appendix](reference/arkui-js/js-appendix.md) + - [Type Attributes](reference/arkui-js/js-appendix-types.md) + - Compent Reference (TypeScript-based Declarative Development Paradigm) + - [Components](reference/arkui-ts/ts-components.md) + - [Universal Components](reference/arkui-ts/ts-universal-components.md) + - [Universal Events](reference/arkui-ts/ts-universal-events.md) + - [Click Event](reference/arkui-ts/ts-universal-events-click.md) + - [Touch](reference/arkui-ts/ts-universal-events-touch.md) + - [Show/Hide Event](reference/arkui-ts/ts-universal-events-show-hide.md) + - [Key Event](reference/arkui-ts/ts-universal-events-key.md) + - [Component Area Change Event](reference/arkui-ts/ts-universal-events-component-area-change.md) + - [Universal Attributes](reference/arkui-ts/ts-universal-attributes.md) + - [Size](reference/arkui-ts/ts-universal-attributes-size.md) + - [Location](reference/arkui-ts/ts-universal-attributes-location.md) + - [Layout Constraints](reference/arkui-ts/ts-universal-attributes-layout-constraints.md) + - [Flex Layout](reference/arkui-ts/ts-universal-attributes-flex-layout.md) + - [Border Configuration](reference/arkui-ts/ts-universal-attributes-border.md) + - [Background](reference/arkui-ts/ts-universal-attributes-background.md) + - [Opacity](reference/arkui-ts/ts-universal-attributes-opacity.md) + - [Visibility](reference/arkui-ts/ts-universal-attributes-visibility.md) + - [Enable/Disable](reference/arkui-ts/ts-universal-attributes-enable.md) + - [Overlay](reference/arkui-ts/ts-universal-attributes-overlay.md) + - [Z-order Control](reference/arkui-ts/ts-universal-attributes-z-order.md) + - [Transformation](reference/arkui-ts/ts-universal-attributes-transformation.md) + - [Image Effect Configuration](reference/arkui-ts/ts-universal-attributes-image-effect.md) + - [Shape Clipping](reference/arkui-ts/ts-universal-attributes-sharp-clipping.md) + - [Text Style](reference/arkui-ts/ts-universal-attributes-text-style.md) + - [Grid](reference/arkui-ts/ts-universal-attributes-grid.md) + - [Gradient Color](reference/arkui-ts/ts-universal-attributes-gradient-color.md) + - [Popup Control](reference/arkui-ts/ts-universal-attributes-popup.md) + - [Menu Control](reference/arkui-ts/ts-universal-attributes-menu.md) + - [Click Control](reference/arkui-ts/ts-universal-attributes-touchable.md) + - [Touch Target](reference/arkui-ts/ts-universal-attributes-response-region.md) + - [Gesture Processing](reference/arkui-ts/ts-gesture-processing.md) + - [Gesture Binding Methods](reference/arkui-ts/ts-gesture-settings.md) + - [Basic Gestures](reference/arkui-ts/ts-basic-gestures.md) + - [TapGesture](reference/arkui-ts/ts-basic-gestures-tapgesture.md) + - [LongPressGesture](reference/arkui-ts/ts-basic-gestures-longpressgesture.md) + - [PanGesture](reference/arkui-ts/ts-basic-gestures-pangesture.md) + - [PinchGesture](reference/arkui-ts/ts-basic-gestures-pinchgesture.md) + - [RotationGesture](reference/arkui-ts/ts-basic-gestures-rotationgesture.md) + - [SwipeGesture](reference/arkui-ts/ts-basic-gestures-swipegesture.md) + - [Combined Gestures](reference/arkui-ts/ts-combined-gestures.md) + - [Basic Components](reference/arkui-ts/ts-basic-components.md) + - [Blank](reference/arkui-ts/ts-basic-components-blank.md) + - [Button](reference/arkui-ts/ts-basic-components-button.md) + - [DataPanel](reference/arkui-ts/ts-basic-components-datapanel.md) + - [Divider](reference/arkui-ts/ts-basic-components-divider.md) + - [Gauge](reference/arkui-ts/ts-basic-components-gauge.md) + - [Image](reference/arkui-ts/ts-basic-components-image.md) + - [ImageAnimator](reference/arkui-ts/ts-basic-components-imageanimator.md) + - [LoadingProgress](reference/arkui-ts/ts-basic-components-loadingprogress.md) + - [Marquee](reference/arkui-ts/ts-basic-components-marquee.md) + - [Progress](reference/arkui-ts/ts-basic-components-progress.md) + - [QRCode](reference/arkui-ts/ts-basic-components-qrcode.md) + - [Rating](reference/arkui-ts/ts-basic-components-rating.md) + - [Select](reference/arkui-ts/ts-basic-components-select.md) + - [Slider](reference/arkui-ts/ts-basic-components-slider.md) + - [Span](reference/arkui-ts/ts-basic-components-span.md) + - [Text](reference/arkui-ts/ts-basic-components-text.md) + - [TextArea](reference/arkui-ts/ts-basic-components-textarea.md) + - [TextInput](reference/arkui-ts/ts-basic-components-textinput.md) + - [Toggle](reference/arkui-ts/ts-basic-components-toggle.md) + - [TextClock](reference/arkui-ts/ts-basic-components-textclock.md) + - [Container Components](reference/arkui-ts/ts-components-container.md) + - [AlphabetIndexer](reference/arkui-ts/ts-container-alphabet-indexer.md) + - [Badge](reference/arkui-ts/ts-container-badge.md) + - [Column](reference/arkui-ts/ts-container-column.md) + - [ColumnSplit](reference/arkui-ts/ts-container-columnsplit.md) + - [Counter](reference/arkui-ts/ts-container-counter.md) + - [Flex](reference/arkui-ts/ts-container-flex.md) + - [GridContainer](reference/arkui-ts/ts-container-gridcontainer.md) + - [Grid](reference/arkui-ts/ts-container-grid.md) + - [GridItem](reference/arkui-ts/ts-container-griditem.md) + - [List](reference/arkui-ts/ts-container-list.md) + - [ListItem](reference/arkui-ts/ts-container-listitem.md) + - [Navigator](reference/arkui-ts/ts-container-navigator.md) + - [Navigation](reference/arkui-ts/ts-container-navigation.md) + - [Panel](reference/arkui-ts/ts-container-panel.md) + - [Row](reference/arkui-ts/ts-container-row.md) + - [RowSplit](reference/arkui-ts/ts-container-rowsplit.md) + - [Scroll](reference/arkui-ts/ts-container-scroll.md) + - [ScrollBar](reference/arkui-ts/ts-container-scrollbar.md) + - [Stack](reference/arkui-ts/ts-container-stack.md) + - [Swiper](reference/arkui-ts/ts-container-swiper.md) + - [Tabs](reference/arkui-ts/ts-container-tabs.md) + - [TabContent](reference/arkui-ts/ts-container-tabcontent.md) + - [Refresh](reference/arkui-ts/ts-container-refresh.md) + - [Drawing Components](reference/arkui-ts/ts-drawing-components.md) + - [Circle](reference/arkui-ts/ts-drawing-components-circle.md) + - [Ellipse](reference/arkui-ts/ts-drawing-components-ellipse.md) + - [Line](reference/arkui-ts/ts-drawing-components-line.md) + - [Polyline](reference/arkui-ts/ts-drawing-components-polyline.md) + - [Polygon](reference/arkui-ts/ts-drawing-components-polygon.md) + - [Path](reference/arkui-ts/ts-drawing-components-path.md) + - [Rect](reference/arkui-ts/ts-drawing-components-rect.md) + - [Shape](reference/arkui-ts/ts-drawing-components-shape.md) + - [Canvas Components](reference/arkui-ts/ts-components-canvas.md) + - [Canvas](reference/arkui-ts/ts-components-canvas-canvas.md) + - [CanvasRenderingContext2D](reference/arkui-ts/ts-canvasrenderingcontext2d.md) + - [OffscreenCanvasRenderingConxt2D](reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md) + - [Lottie](reference/arkui-ts/ts-components-canvas-lottie.md) + - [Path2D](reference/arkui-ts/ts-components-canvas-path2d.md) + - [CanvasGradient](reference/arkui-ts/ts-components-canvas-canvasgradient.md) + - [ImageBitmap](reference/arkui-ts/ts-components-canvas-imagebitmap.md) + - [ImageData](reference/arkui-ts/ts-components-canvas-imagedata.md) + - [Animation](reference/arkui-ts/ts-animation.md) + - [Attribute Animation](reference/arkui-ts/ts-animatorproperty.md) + - [Explicit Animation](reference/arkui-ts/ts-explicit-animation.md) + - [Transition Animation](reference/arkui-ts/ts-transition-animation.md) + - [Page Transition](reference/arkui-ts/ts-page-transition-animation.md) + - [Component Transition](reference/arkui-ts/ts-transition-animation-component.md) + - [Transition of Shared Elements](reference/arkui-ts/ts-transition-animation-shared-elements.md) + - [Motion Path Animation](reference/arkui-ts/ts-motion-path-animation.md) + - [Matrix Transformation](reference/arkui-ts/ts-matrix-transformation.md) + - [Interpolation Calculation](reference/arkui-ts/ts-interpolation-calculation.md) + - [Global UI Methods](reference/arkui-ts/ts-global-ui-methods.md) + - [Alert Dialog Box](reference/arkui-ts/ts-methods-alert-dialog-box.md) + - [Custom Dialog box](reference/arkui-ts/ts-methods-custom-dialog-box.md) + - [Image Cache](reference/arkui-ts/ts-methods-image-cache.md) + - [Media Query](reference/arkui-ts/ts-methods-media-query.md) + - [List Selection Dialog Box](reference/arkui-ts/ts-methods-action-sheet.md) + - [Appendix](reference/arkui-ts/ts-appendix.md) + - [Built-in Enums](reference/arkui-ts/ts-appendix-enums.md) + - APIs + - Ability Framework + - [FeatureAbility Module](reference/apis/js-apis-featureAbility.md) + - [ParticleAbility Module](reference/apis/js-apis-particleAbility.md) + - [DataAbilityHelper Module](reference/apis/js-apis-dataAbilityHelper.md) + - [DataUriUtils Module](reference/apis/js-apis-DataUriUtils.md) + - [Bundle Module](reference/apis/js-apis-Bundle.md) + - [Context Module](reference/apis/js-apis-Context.md) + - Event Notification + - [CommonEvent Module](reference/apis/js-apis-commonEvent.md) + - [Notification Module](reference/apis/js-apis-notification.md) + - [Reminder Agent](reference/apis/js-apis-reminderAgent.md) + - Resource Management + - [Resource Manager](reference/apis/js-apis-resource-manager.md) + - [Internationalization (intl)](reference/apis/js-apis-intl.md) + - [Internationalization (i18n)](reference/apis/js-apis-i18n.md) + - Media + - [Audio Management](reference/apis/js-apis-audio.md) + - [Media](reference/apis/js-apis-media.md) + - Security + - [User Authentication](reference/apis/js-apis-useriam-userauth.md) + - [Access Control](reference/apis/js-apis-abilityAccessCtrl.md) + - Data Management + - [Lightweight Storage (deprecated since 8)](reference/apis/js-apis-data-storage.md) + - [Distributed Data Management](reference/apis/js-apis-distributed-data.md) + - [Relational Database](reference/apis/js-apis-data-rdb.md) + - [Result Set](reference/apis/js-apis-data-resultset.md) + - [DataAbilityPredicates](reference/apis/js-apis-data-ability.md) + - [Settings](reference/apis/js-apis-settings.md) + - File Management + - [File Management](reference/apis/js-apis-fileio.md) + - [Statfs](reference/apis/js-apis-statfs.md) + - [Environment](reference/apis/js-apis-environment.md) + - [Public File Access and Management](reference/apis/js-apis-filemanager.md) + - [App Storage Statistics](reference/apis/js-apis-storage-statistics.md) + - [Volume Management](reference/apis/js-apis-volumemanager.md) + - Account Management + - [Distributed Account Management](reference/apis/js-apis-distributed-account.md) + - [App Account Management](reference/apis/js-apis-appAccount.md) + - Telephony Service + - [Call](reference/apis/js-apis-call.md) + - [SMS](reference/apis/js-apis-sms.md) + - [SIM Management](reference/apis/js-apis-sim.md) + - [Radio](reference/apis/js-apis-radio.md) + - [observer](reference/apis/js-apis-observer.md) + - [Cellular Data](reference/apis/js-apis-telephony-data.md) + - Network and Connectivity + - [WLAN](reference/apis/js-apis-wifi.md) + - [Bluetooth](reference/apis/js-apis-bluetooth.md) + - [RPC](reference/apis/js-apis-rpc.md) + - Device Management + - [Sensor](reference/apis/js-apis-sensor.md) + - [Vibrator](reference/apis/js-apis-vibrator.md) + - [Brightness](reference/apis/js-apis-brightness.md) + - [Battery Info](reference/apis/js-apis-battery-info.md) + - [Power Management](reference/apis/js-apis-power.md) + - [Thermal Management](reference/apis/js-apis-thermal.md) + - [Running Lock](reference/apis/js-apis-runninglock.md) + - [Device Info](reference/apis/js-apis-device-info.md) + - [systemParameter](reference/apis/js-apis-system-parameter.md) + - [Device Management](reference/apis/js-apis-device-manager.md) + - [Window](reference/apis/js-apis-window.md) + - [Display](reference/apis/js-apis-display.md) + - [Update](reference/apis/js-apis-update.md) + - [USB](reference/apis/js-apis-usb.md) + - [Location](reference/apis/js-apis-geolocation.md) + - Basic Features + - [Application Context](reference/apis/js-apis-basic-features-app-context.md) + - [Console Logs](reference/apis/js-apis-basic-features-logs.md) + - [Page Routing](reference/apis/js-apis-basic-features-routes.md) + - [Pop-up Window](reference/apis/js-apis-basic-features-pop-up.md) + - [Application Configuration](reference/apis/js-apis-basic-features-configuration.md) + - [Timer](reference/apis/js-apis-basic-features-timer.md) + - [Setting the System Time](reference/apis/js-apis-system-time.md) + - [Animation](reference/apis/js-apis-basic-features-animator.md) + - [WebGL](reference/apis/js-apis-webgl.md) + - [WebGL2](reference/apis/js-apis-webgl2.md) + - [Screenshot](reference/apis/js-apis-screenshot.md) + - DFX + - [HiAppEvent](reference/apis/js-apis-hiappevent.md) + - [Performance Tracing](reference/apis/js-apis-hitracemeter.md) + - [Fault Logger](reference/apis/js-apis-faultLogger.md) + - [Distributed Call Chain Tracing](reference/apis/js-apis-hitracechain.md) + - [HiLog](reference/apis/js-apis-hilog.md) + - [HiChecker](reference/apis/js-apis-hichecker.md) + - [HiDebug](reference/apis/js-apis-hidebug.md) + - Language Base Class Library + - [Obtaining Process Information](reference/apis/js-apis-process.md) + - [URL String Parsing](reference/apis/js-apis-url.md) + - [URI String Parsing](reference/apis/js-apis-uri.md) + - [Util](reference/apis/js-apis-util.md) + - [XML Parsing and Generation](reference/apis/js-apis-xml.md) + - [XML-to-JavaScript Conversion](reference/apis/js-apis-convertxml.md) + - [Worker Startup](reference/apis/js-apis-worker.md) + - [Linear Container ArrayList](reference/apis/js-apis-arraylist.md) + - [Linear Container Deque](reference/apis/js-apis-deque.md) + - [Linear Container List](reference/apis/js-apis-list.md) + - [Linear Container LinkedList](reference/apis/js-apis-linkedlist.md) + - [Linear Container Queue](reference/apis/js-apis-queue.md) + - [Linear Container Stack](reference/apis/js-apis-stack.md) + - [Linear Container Vector](reference/apis/js-apis-vector.md) + - [Nonlinear Container HashSet](reference/apis/js-apis-hashset.md) + - [Nonlinear Container HashMap](reference/apis/js-apis-hashmap.md) + - [Nonlinear Container PlainArray](reference/apis/js-apis-plainarray.md) + - [Nonlinear Container TreeMap](reference/apis/js-apis-treemap.md) + - [Nonlinear Container TreeSet](reference/apis/js-apis-treeset.md) + - [Nonlinear Container LightWeightMap](reference/apis/js-apis-lightweightmap.md) + - [Nonlinear Container LightWeightSet](reference/apis/js-apis-lightweightset.md) \ No newline at end of file diff --git a/en/device-dev/driver/driver-platform-mipicsi-des.md b/en/device-dev/driver/driver-platform-mipicsi-des.md new file mode 100644 index 0000000000000000000000000000000000000000..cd877612d26e3451d2ca57a4d3929c9f14fa6547 --- /dev/null +++ b/en/device-dev/driver/driver-platform-mipicsi-des.md @@ -0,0 +1,670 @@ +# MIPI CSI + +## Overview + +Defined by the Mobile Industry Processor Interface (MIPI) Alliance, the Camera Serial Interface (CSI) is a specification that allows data to be transmitted from the camera to the host processor on mobile platforms. As the second release, the MIPI CSI-2 consists of the application layer, protocol layer, and physical layer. It supports a maximum of four-lane data transmission and a single-lane transmission rate of 1 Gbit/s. + +The physical layer supports the high speed (HS) and low power (LP) modes. Using low-voltage differential signaling (LVDS), the HS mode delivers 80 Mbit/s to 1 Gbit/s transmission speed but high power consumption. The unidirectional LP mode provides lower power consumption but lower transmission speed (< 10 Mbit/s). The blend of the two modes ensures high-speed transmission of massive data (such as images) and minimized power consumption when less data is transmitted. + +The figure below shows a simplified CSI. The D-PHY transmits data by using one pair of source-synchronized differential clocks and one to four pairs of differential data lanes. Data is transmitted in Double Data Rate (DDR) mode, that is, data is transmitted on both the rising and falling edges of the clock. + +**Figure 1** CSI TX and RX interfaces +![](figures/CSI_TX-RX_interface.png) + +### ComboDevAttr Structure + +**Table 1** ComboDevAttr structure + + + +| Name | Description | +| --------- | ----------------------------------------------------- | +| devno | Device number. | +| inputMode | Input mode, which can be MIPI, LVDS, sub-LVDS, HiSPI, or DC. | +| dataRate | Input rate of the MIPI RX scalable low voltage signaling (SLVS). | +| imgRect | Crop area of the MIPI RX device (same as the size of the input image of the sensor).| +| MIPIAttr | Attributes of the MIPI device. | +| lvdsAttr | Attributes of the LVDS, sub-LVDS, or HiSPi device. | + +### ExtDataType Structure + +**Table 2** ExtDataType structure + + + +| Name | Description | +| --------------- | ------------------------------- | +| devno | Device number. | +| num | Sensor number. | +| extDataBitWidth | Bit depth of an image. | +| extDataType | Pointer to the YUV, raw data format, and bit depth.| + +### Available APIs + +**Table 3** MIPI CSI APIs + + + + | Category| API| +| -------- | -------- | +| Opening or closing the MIPI CSI controller operation handle| **MipiCsiOpen**: opens the MIPI CSI controller operation handle.
**MipiCsiClose**: closes the MIPI CSI controller operation handle.| +| Setting MIPI CSI parameters| **MipiCsiSetComboDevAttr**: sets parameters of the MIPI, CMOS, or LVDS camera to the controller. The parameters include the working mode, image area, image depth, data rate, and physical channel.
**MipiCsiSetExtDataType** (optional): sets the YUV and RAW data formats and bit depths.
**MipiCsiSetHsMode**: sets the MIPI RX lane distribution. Set the mode based on the hardware connection.
**MipiCsiSetPhyCmvmode**: sets the common-mode voltage (CMV) mode.| +| Resetting a sensor or deasserting the reset of a sensor| **MipiCsiResetSensor**: resets a sensor.
**MipiCsiUnresetSensor**: deasserts the reset of a sensor.| +| Resetting the MIPI RX or deasserting the reset of the MIPI RX| **MipiCsiResetRx**: resets the MIPI&nbsp;RX. The value of **enSnsType** varies depending on the value of **s32WorkingViNum**.
**MipiCsiUnresetRx**: deasserts the reset on the MIPI&nbsp;RX.| +| Enabling or disabling the MIPI clock| **MipiCsiEnableClock**: enables the MIPI clock. The **enSnsType** passed by the upper-layer function during electrophoresis determines whether MIPI or LVDS is used.
**MipiCsiDisableClock**: disables the MIPI clock.| +| Enabling or disabling the MIPI sensor clock| **MipiCsiEnableSensorClock**: enables the MIPI sensor clock.
**MipiCsiDisableSensorClock**: disables the MIPI sensor clock.| + + +## Usage Guidelines + +### How to Use + +The figure below shows the process of using a MIPI CSI device. + +**Figure 2** MIPI CSI usage process + + +![](figures/process-of-using-MIPI-CSI.png) + +### Opening the MIPI CSI Controller Operation Handle + +Before starting MIPI CSI communication, call **MipiCsiOpen** to open the MIPI CSI device handle. This function returns the MIPI CSI device handle with the specified lane ID. + +```c +DevHandle MipiCsiOpen(uint8_t id); +``` + +**Table 4** Description of MipiCsiOpen + + + +| Parameter | Description | +| ---------- | ----------------------------------------------- | +| id | MIPI CSI lane ID. | +| **Return Value**| **Description** | +| NULL | The operation fails. | +| Device handle | MIPI CSI device handle with the specified lane ID. The data type is **DevHandle**.| + +For example, open the controller operation handle for MIPI CSI lane 0: + +```c +DevHandle mipiCsiHandle = NULL; /* Device handle */ +id = 0; /* MIPI CSI lane ID */ + +/* Open the controller operation handle. */ +MipiCsiHandle = MipiCsiOpen(id); +if (MipiCsiHandle == NULL) { + HDF_LOGE("MipiCsiOpen: failed\n"); + return; +} +``` + +### Setting MIPI CSI Parameters + +- Set MIPI CSI parameters. + + ```c + int32_t MipiCsiSetComboDevAttr(DevHandle handle, ComboDevAttr *pAttr); + ``` + + **Table 5** Description of MipiCsiSetComboDevAttr + + + + | Parameter | Description | + | ---------- | -------------------------- | + | handle | Controller operation handle. | + | pAttr | Pointer to the MIPI CSI structure.| + | **Return Value**| **Description** | + | 0 | The operation is successful. | + | Negative value | The operation fails. | + + ```c + int32_t ret; + struct ComboDevAttr attr; + + /* The current configuration is as follows: */ + (void)memset_s(&attr, sizeof(ComboDevAttr), 0, sizeof(ComboDevAttr)); + attr.devno = 0; /* Device 0 */ + attr.inputMode = INPUT_MODE_MIPI; /* The input mode is MIPI. */ + attr.dataRate = MIPI_DATA_RATE_X1; /* The data rate is 1 pixel per clock cycle. */ + attr.imgRect.x = 0; /* The value 0 indicates the upper left position of the image sensor. */ + attr.imgRect.y = 0; /* The value 0 indicates the upper right position of the image sensor. */ + attr.imgRect.width = 2592; /* The width of the image sensor is 2592. */ + attr.imgRect.height = 1944; /* The height of the image sensor is 1944. */ + /* Write the MIPI CSI configuration. */ + ret = MipiCsiSetComboDevAttr(MipiCsiHandle, &attr); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiSetComboDevAttr fail! ret=%d\n", __func__, ret); + return -1; + } + ``` + +- Set the YUV, RAW data format, and bit depth. + + ```c + int32_t MipiCsiSetExtDataType(DevHandle handle, ExtDataType* dataType); + ``` + + **Table 6** Description of MipiCsiSetExtDataType + + + + | Parameter | Description | + | ---------- | ------------------------------- | + | handle | Controller operation handle. | + | dataType | Pointer to the YUV, raw data format, and bit depth.| + | **Return Value**| **Description** | + | 0 | The operation is successful. | + | Negative value | The operation fails. | + + ```c + int32_t ret; + struct ExtDataType dataType; + + /* Set the YUV, raw data format, and bit depth. */ + dataType.devno = 0; /* Device 0 */ + dataType.num = 0; /* sensor 0 */ + dataType.extDataBitWidth[0] = 12; /* Bit depth array element 0 */ + dataType.extDataBitWidth[1] = 12; /* Bit depth array element 1 */ + dataType.extDataBitWidth[2] = 12; /* Bit depth array element 2 */ + + dataType.extDataType[0] = 0x39; /* Define YUV, raw data format, and bit depth element 0. */ + dataType.extDataType[1] = 0x39; /* Define YUV, raw data format, and bit depth element 1. */ + dataType.extDataType[2] = 0x39; /* Define YUV, raw data format, and bit depth element 2. */ + /* Set the YUV, raw data format, and bit depth. */ + ret = MipiCsiSetExtDataType(MipiCsiHandle, &dataType); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiSetExtDataType fail! ret=%d\n", __func__, ret); + return -1; + } + ``` + +- Set the MIPI RX lane distribution. + + ```c + int32_t MipiCsiSetHsMode(DevHandle handle, LaneDivideMode laneDivideMode); + ``` + + **Table 7** Description of MipiCsiSetHsMode + + + + | Parameter | Description | + | -------------- | -------------- | + | handle | Controller operation handle.| + | laneDivideMode | Lane mode. | + | **Return Value** | **Description**| + | 0 | The operation is successful. | + | Negative value | The operation fails. | + + ```c + int32_t ret; + enum LaneDivideMode mode; + + /* Set the lane mode to 0. */ + mode = LANE_DIVIDE_MODE_0; + /* Set the MIPI RX lane distribution. */ + ret = MipiCsiSetHsMode(MipiCsiHandle, mode); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiSetHsMode fail! ret=%d\n", __func__, ret); + return -1; + } + ``` + +- Set the CMV mode. + + ```c + int32_t MipiCsiSetPhyCmvmode(DevHandle handle, uint8_t devno, PhyCmvMode cmvMode); + ``` + + **Table 8** Description of MipiCsiSetPhyCmvmode + + + + | Parameter | Description | + | ---------- | ---------------- | + | handle | Controller operation handle. | + | cmvMode | CMV mode.| + | devno | Device number. | + | **Return Value**| **Description** | + | 0 | The operation is successful. | + | Negative value | The operation fails. | + + ```c + int32_t ret; + enum PhyCmvMode mode; + uint8_t devno; + + /* Set the CMV mode to 0. */ + mode = PHY_CMV_GE1200MV; + /* The device number is 0. */ + devno = 0; + /* Set the CMV mode. */ + ret = MipiCsiSetPhyCmvmode(MipiCsiHandle, devno, mode); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiSetPhyCmvmode fail! ret=%d\n", __func__, ret); + return -1; + } + ``` + +### Resetting a Sensor or Deasserting the Reset of a Sensor + +- Reset a sensor. + + ```c + int32_t MipiCsiResetSensor(DevHandle handle, uint8_t snsResetSource); + ``` + + **Table 9** Description of MipiCsiResetSensor + + + + | Parameter | Description | + | -------------- | ------------------------------------------------ | + | handle | Controller operation handle. | + | snsResetSource | Sensor's reset signal cable number, which is called reset source of the sensor in software.| + | **Return Value** | **Description** | + | 0 | The operation is successful. | + | Negative value | The operation fails. | + + ```c + int32_t ret; + uint8_t snsResetSource; + + /* The sensor's reset signal cable number is 0. */ + snsResetSource = 0; + /* Reset the sensor. */ + ret = MipiCsiResetSensor(MipiCsiHandle, snsResetSource); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiResetSensor fail! ret=%d\n", __func__, ret); + return -1; + } + ``` + +- Deassert the reset of a sensor. + + ```c + int32_t MipiCsiUnresetSensor(DevHandle handle, uint8_t snsResetSource); + ``` + + **Table 10** Description of MipiCsiUnresetSensor + + + + | Parameter | Description | + | -------------- | ------------------------------------------------ | + | handle | Controller operation handle. | + | snsResetSource | Sensor's reset signal cable number, which is called reset source of the sensor in software.| + | **Return Value** | **Description** | + | 0 | The operation is successful. | + | Negative value | The operation fails. | + + ```c + int32_t ret; + uint8_t snsResetSource; + + /* The sensor's reset signal cable number is 0. */ + snsResetSource = 0; + /* Deassert the reset of the sensor. */ + ret = MipiCsiUnresetSensor(MipiCsiHandle, snsResetSource); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiUnresetSensor fail! ret=%d\n", __func__, ret); + return -1; + } + ``` + +### Resetting the MIPI RX or Deasserting the Reset of the MIPI RX + +- Reset the MIPI RX. + + ```c + int32_t MipiCsiResetRx(DevHandle handle, uint8_t comboDev); + ``` + + **Table 11** Description of MipiCsiResetRx + + + + | Parameter | Description | + | ---------- | --------------------- | + | handle | Controller operation handle. | + | comboDev | MIPI RX or LVDS channel number.| + | **Return Value**| **Description** | + | 0 | The operation is successful. | + | Negative value | The operation fails. | + + ```c + int32_t ret; + uint8_t comboDev; + + /* The channel number is 0.*/ + comboDev = 0; + /* Reset the MIPI RX. */ + ret = MipiCsiResetRx(MipiCsiHandle, comboDev); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiResetRx fail! ret=%d\n", __func__, ret); + return -1; + } + ``` + +- Deassert the reset of the MIPI RX. + + ```c + int32_t MipiCsiUnresetRx(DevHandle handle, uint8_t comboDev); + ``` + + **Table 12** Description of MipiCsiUnresetRx + + + + | Parameter | Description | + | ---------- | --------------------- | + | handle | Controller operation handle. | + | comboDev | MIPI RX or LVDS channel number.| + | **Return Value**| **Description** | + | 0 | The operation is successful. | + | Negative value | The operation fails. | + + ```c + int32_t ret; + uint8_t comboDev; + + /* The channel number is 0.*/ + comboDev = 0; + /* Deassert the reset of the MIPI RX. */ + ret = MipiCsiUnresetRx(MipiCsiHandle, comboDev); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiUnresetRx fail! ret=%d\n", __func__, ret); + return -1; + } + ``` + +### Enabling or Disabling the MIPI Clock + +- Enable the MIPI clock. + + ```c + int32_t MipiCsiEnableClock(DevHandle handle, uint8_t comboDev); + ``` + + **Table 13** Description of MipiCsiEnableClock + + + + | Parameter | Description | + | ---------- | -------------- | + | handle | Controller operation handle.| + | comboDev | Channel number. | + | **Return Value**| **Description**| + | 0 | The operation is successful. | + | Negative value | The operation fails. | + + ```c + int32_t ret; + uint8_t comboDev; + + /* The channel number is 0.*/ + comboDev = 0; + /* Enable the MIPI clock. */ + ret = MipiCsiEnableClock(MipiCsiHandle, comboDev); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiEnableClock fail! ret=%d\n", __func__, ret); + return -1; + } + ``` + +- Disable the MIPI clock. + + ```c + int32_t MipiCsiDisableClock(DevHandle handle, uint8_t comboDev); + ``` + + **Table 14** Description of MipiCsiDisableClock + + + + | Parameter | Description | + | ---------- | -------------- | + | handle | Controller operation handle.| + | comboDev | Channel number. | + | **Return Value**| **Description**| + | 0 | The operation is successful. | + | Negative value | The operation fails. | + + ```c + int32_t ret; + uint8_t comboDev; + + /* The channel number is 0.*/ + comboDev = 0; + /* Disable the MIPI clock. */ + ret = MipiCsiDisableClock(MipiCsiHandle, comboDev); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiDisableClock fail! ret=%d\n", __func__, ret); + return -1; + } + ``` + +### Enabling or Disabling the MIPI Sensor Clock + +- Enable the MIPI sensor clock. + + ```c + int32_t MipiCsiEnableSensorClock(DevHandle handle, uint8_t snsClkSource); + ``` + + **Table 15** Description of MipiCsiEnableSensorClock + + + + | Parameter | Description | + | ------------ | ------------------------------------------------ | + | handle | Controller operation handle. | + | snsClkSource | Sensor's clock signal cable number, which is called clock source of the sensor in software.| + | **Return Value** | **Description** | + | 0 | The operation is successful. | + | Negative value | The operation fails. | + + ```c + int32_t ret; + uint8_t snsClkSource; + + /* The sensor's clock signal cable number is 0. */ + snsClkSource = 0; + /* Enable the MIPI sensor clock. */ + ret = MipiCsiEnableSensorClock(MipiCsiHandle, snsClkSource); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiEnableSensorClock fail! ret=%d\n", __func__, ret); + return -1; + } + ``` + +- Disable the MIPI sensor clock. + + ```c + int32_t MipiCsiDisableSensorClock(DevHandle handle, uint8_t snsClkSource); + ``` + + **Table 16** Description of MipiCsiDisableSensorClock + + + + | Parameter | Description | + | ------------ | ------------------------------------------------ | + | handle | Controller operation handle. | + | snsClkSource | Sensor's clock signal cable number, which is called clock source of the sensor in software.| + | **Return Value** | **Description** | + | 0 | The operation is successful. | + | Negative value | The operation fails. | + + ```c + int32_t ret; + uint8_t snsClkSource; + + /* The sensor's clock signal cable number is 0. */ + snsClkSource = 0; + /* Disable the MIPI sensor clock. */ + ret = MipiCsiDisableSensorClock(MipiCsiHandle, snsClkSource); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiDisableSensorClock fail! ret=%d\n", __func__, ret); + return -1; + } + ``` + +### Closing a MIPI CSI Controller Operation Handle + +After the MIPI CSI communication, close the MIPI CSI controller handle by calling the following function: + +```c +void MipiCsiClose(DevHandle handle); +``` + +This function releases the resources requested by **MipiCsiOpen**. + +**Table 17** Description of MipiCsiClose + + + + | Parameter | Description | + | ------------ | ------------------------------------------------ | + | handle | MIPI CSI controller operation handle. | + +```c +MipiCsiClose(MIPIHandle); /* Close the operation handle of the MIPI CSI controller. */ +``` + +## Development Example + +The sample code is as follows: + +```c +#include "hdf.h" +#include "MIPI_csi_if.h" + +void PalMipiCsiTestSample(void) +{ + uint8_t id; + int32_t ret; + uint8_t comboDev; + uint8_t snsClkSource; + uint8_t devno; + enum LaneDivideMode mode; + enum PhyCmvMode mode; + struct ComboDevAttr attr; + struct ExtDataType dataType; + DevHandle MipiCsiHandle = NULL; + + /* Controller ID */ + id = 0; + /* Open the controller operation handle. */ + MipiCsiHandle = MipiCsiOpen(id); + if (MipiCsiHandle == NULL) { + HDF_LOGE("MipiCsiOpen: failed!\n"); + return; + } + + /* Set the lane mode to 0. */ + mode = LANE_DIVIDE_MODE_0; + /* Set the MIPI RX lane distribution. */ + ret = MipiCsiSetHsMode(MipiCsiHandle, mode); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiSetHsMode fail! ret=%d\n", __func__, ret); + return; + } + + /* The channel number is 0.*/ + comboDev = 0; + /* Enable the MIPI clock. */ + ret = MipiCsiEnableClock(MipiCsiHandle, comboDev); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiEnableClock fail! ret=%d\n", __func__, ret); + return; + } + + /* Reset the MIPI RX. */ + ret = MipiCsiResetRx(MipiCsiHandle, comboDev); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiResetRx fail! ret=%d\n", __func__, ret); + return; + } + + /* The sensor's clock signal cable number is 0. */ + snsClkSource = 0; + /* Enable the MIPI sensor clock. */ + ret = MipiCsiEnableSensorClock(MipiCsiHandle, snsClkSource); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiEnableSensorClock fail! ret=%d\n", __func__, ret); + return; + } + + /* Reset the sensor. */ + ret = MipiCsiResetSensor(MipiCsiHandle, snsResetSource); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiResetSensor fail! ret=%d\n", __func__, ret); + return; + } + + /* Set MIPI parameters. */ + (void)memset_s(&attr, sizeof(ComboDevAttr), 0, sizeof(ComboDevAttr)); + attr.devno = 0; /* Device 0 */ + attr.inputMode = INPUT_MODE_MIPI; /* The input mode is MIPI. */ + attr.dataRate = MIPI_DATA_RATE_X1; /* The data rate is 1 pixel per clock cycle. */ + attr.imgRect.x = 0; /* The value 0 indicates the upper left position of the image sensor. */ + attr.imgRect.y = 0; /* The value 0 indicates the upper right position of the image sensor. */ + attr.imgRect.width = 2592; /* The width of the image sensor is 2592. */ + attr.imgRect.height = 1944; /* The height of the image sensor is 1944. */ + /* Write the MIPI CSI configuration. */ + ret = MipiCsiSetComboDevAttr(MipiCsiHandle, &attr); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiSetComboDevAttr fail! ret=%d\n", __func__, ret); + return; + } + + /* Set the CMV mode to 0. */ + mode = PHY_CMV_GE1200MV; + /* The device number is 0. */ + devno = 0; + /* Set the CMV mode. */ + ret = MipiCsiSetPhyCmvmode(MipiCsiHandle, devno, mode); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiSetPhyCmvmode fail! ret=%d\n", __func__, ret); + return; + } + + /* The channel number is 0.*/ + comboDev = 0; + /* Deassert the reset of the MIPI RX. */ + ret = MipiCsiUnresetRx(MipiCsiHandle, comboDev); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiUnresetRx fail! ret=%d\n", __func__, ret); + return; + } + + /* Disable the MIPI clock. */ + ret = MipiCsiDisableClock(MipiCsiHandle, comboDev); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiDisableClock fail! ret=%d\n", __func__, ret); + return; + } + + /* The sensor's reset signal cable number is 0. */ + snsResetSource = 0; + /* Deassert the reset of the sensor. */ + ret = MipiCsiUnresetSensor(MipiCsiHandle, snsResetSource); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiUnresetSensor fail! ret=%d\n", __func__, ret); + return; + } + + /* Disable the MIPI sensor clock. */ + ret = MipiCsiDisableSensorClock(MipiCsiHandle, snsClkSource); + if (ret != 0) { + HDF_LOGE("%s: MipiCsiDisableSensorClock fail! ret=%d\n", __func__, ret); + return; + } + + /* Close the MIPI CSI device handle. */ + MipiCsiClose(MipiCsiHandle); +} +``` diff --git a/en/device-dev/driver/figures/process-of-using-MIPI-CSI.png b/en/device-dev/driver/figures/process-of-using-MIPI-CSI.png index 433774c644171cc6eeb267db5d08990e13606178..fcb1930b3d7e59165209b7c4a05c0cc6e82058c8 100644 Binary files a/en/device-dev/driver/figures/process-of-using-MIPI-CSI.png and b/en/device-dev/driver/figures/process-of-using-MIPI-CSI.png differ diff --git a/en/device-dev/website.md b/en/device-dev/website.md index 53019a18f1c6c90400102c5675168086dd1174a1..0bf7d860f20f80ae04a4d90c97f9c5782146f6f1 100644 --- a/en/device-dev/website.md +++ b/en/device-dev/website.md @@ -308,7 +308,7 @@ - [Startup](subsystems/subsys-boot.md) - [DFX](subsystems/subsys-dfx.md) - Featured Topics - - [HPM Bundle](bundles/Readme-EN.md) + - HPM Bundle - [Development Specifications](bundles/bundles-standard-rules.md) - Development Guidelines - [Bundle Development](bundles/bundles-guide-overview.md) @@ -333,7 +333,7 @@ - [Samples](https://gitee.com/openharmony/app_samples/blob/master/README.md) - [Codelabs](https://gitee.com/openharmony/codelabs/blob/master/README.md) - References - - [FAQs](faqs/Readme-EN.md) + - FAQs - [Overview of FAQs](faqs/faqs-overview.md) - [Environment Setup](faqs/faqs-environment-setup.md) - [Compilation and Building Subsystem](faqs/faqs-building.md) diff --git a/en/website.md b/en/website.md index 40f4427b9262c95e75d1378605b54c894dc95c1e..ae9d754ed82bc293c436393d20c455b9cd4cb9ff 100644 --- a/en/website.md +++ b/en/website.md @@ -1,515 +1,31 @@ -- [Application Development Overview](application-dev-guide.md) -- Quick Start - - [Getting Started with Application Development](quick-start/Readme-EN.md) - - DevEco Studio (OpenHarmony) User Guide - - [Overview](quick-start/deveco-studio-overview.md) - - [Version Change History](quick-start/deveco-studio-release-notes.md) - - [Configuring the OpenHarmony SDK](quick-start/configuring-openharmony-sdk.md) - - [Creating an OpenHarmony Project](quick-start/create-openharmony-project.md) - - [Using the Project Wizard to Create a Project](quick-start/use-wizard-to-create-project.md) - - [Importing a Sample to Create a Project](quick-start/import-sample-to-create-project.md) - - [Configuring the OpenHarmony App Signature](quick-start/configuring-openharmony-app-signature.md) - - [Installing and Running Your OpenHarmony App](quick-start/installing-openharmony-app.md) - - [Directory Structure](quick-start/package-structure.md) -- Development - - UI - - JavaScript-based Web-Like Development Paradigm - - [Overview](ui/ui-js-overview.md) - - Framework - - [File Organization](ui/js-framework-file.md) - - ["js" Tag](ui/js-framework-js-tag.md) - - [app.js](ui/js-framework-js-file.md) - - Syntax - - [HML](ui/js-framework-syntax-hml.md) - - [CSS](ui/js-framework-syntax-css.md) - - [JavaScript](ui/js-framework-syntax-js.md) - - [Lifecycle](ui/js-framework-lifecycle.md) - - [Resource Limitations and Access](ui/js-framework-resource-restriction.md) - - [Multi-Language Capability](ui/js-framework-multiple-languages.md) - - Building the UI - - [Component Overview](ui/ui-js-building-ui-component.md) - - Building the Layout - - [Layout Description](ui/ui-js-building-ui-layout-intro.md) - - [Adding Title and Paragraph Text](ui/ui-js-building-ui-layout-text.md) - - [Adding an Image](ui/ui-js-building-ui-layout-image.md) - - [Adding a Comment](ui/ui-js-building-ui-layout-comment.md) - - [Adding a Container](ui/ui-js-building-ui-layout-external-container.md) - - [Adding Interactions](ui/ui-js-building-ui-interactions.md) - - [Developing Animations](ui/ui-js-building-ui-animation.md) - - [Defining Events](ui/ui-js-building-ui-event.md) - - [Defining Page Routes](ui/ui-js-building-ui-routes.md) - - Common Component Development Guidelines - - [Text](ui/ui-js-components-text.md) - - [Input](ui/ui-js-components-input.md) - - [Button](ui/ui-js-components-button.md) - - [List](ui/ui-js-components-list.md) - - [Picker](ui/ui-js-components-picker.md) - - [Dialog](ui/ui-js-components-dialog.md) - - [Form](ui/ui-js-components-form.md) - - [Stepper](ui/ui-js-components-stepper.md) - - [Tabs](ui/ui-js-component-tabs.md) - - [Image](ui/ui-js-components-images.md) - - Animation Development Guidelines - - CSS Animation - - [Defining Attribute Style Animations](ui/ui-js-animate-attribute-style.md) - - [Defining Animations with the transform Attribute](ui/ui-js-animate-transform.md) - - [Defining Animations with the background-position Attribute](ui/ui-js-animate-background-position-style.md) - - JS Animation - - [Component Animation](ui/ui-js-animate-component.md) - - Interpolator Animation - - [Animation Effect](ui/ui-js-animate-dynamic-effects.md) - - [Animation Frame](ui/ui-js-animate-frame.md) - - [Custom Components](ui/ui-js-custom-components.md) - - TypeScript-based Declarative Development Paradigm - - [Overview](ui/ui-ts-overview.md) - - Framework Overview - - File Organization - - [Directory Structure](ui/ts-framework-directory.md) - - [Rules for Accessing Application Code Files](ui/ts-framework-file-access-rules.md) - - ["js" Tag](ui/ts-framework-js-tag.md) - - Resource Access - - [Media Resource Types](ui/ts-media-resource-type.md) - - [Pixel Units](ui/ts-pixel-units.md) - - [Types](ui/ts-types.md) - - Declarative Syntax - - [Overview](ui/ts-syntax-intro.md) - - General UI Description Specifications - - [Basic Concepts](ui/ts-general-ui-concepts.md) - - Declarative UI Description Specifications - - [Parameterless Configuration](ui/ts-parameterless-configuration.md) - - [Configuration with Mandatory Parameters](ui/ts-configuration-with-mandatory-parameters.md) - - [Attribution Configuration](ui/ts-attribution-configuration.md) - - [Event Configuration](ui/ts-event-configuration.md) - - [Child Component Configuration](ui/ts-child-component-configuration.md) - - Componentization - - [@Component](ui/ts-component-based-component.md) - - [@Entry](ui/ts-component-based-entry.md) - - [@Preview](ui/ts-component-based-preview.md) - - [@Builder](ui/ts-component-based-builder.md) - - [@Extend](ui/ts-component-based-extend.md) - - [@CustomDialog](ui/ts-component-based-customdialog.md) - - About UI State Management - - [Basic Concepts](ui/ts-ui-state-mgmt-concepts.md) - - Managing Component States - - [@State](ui/ts-component-states-state.md) - - [@Prop](ui/ts-component-states-prop.md) - - [@Link](ui/ts-component-states-link.md) - - Managing Application States - - [AppStorage](ui/ts-application-states-appstorage.md) - - [PersistentStorage](ui/ts-application-states-apis-persistentstorage.md) - - [Environment](ui/ts-application-states-apis-environment.md) - - Managing Other States - - [@observed and @objectLink](ui/ts-other-states-observed-objectlink.md) - - [@Consume and @Provide](ui/ts-other-states-consume-provide.md) - - [@Watch](ui/ts-other-states-watch.md) - - About Rendering Control Syntax - - [if/else](ui/ts-rending-control-syntax-if-else.md) - - [ForEach](ui/ts-rending-control-syntax-foreach.md) - - [LazyForEach](ui/ts-rending-control-syntax-lazyforeach.md) - - About @Component - - [build Function](ui/ts-function-build.md) - - [Custom Component Initialization](ui/ts-custom-component-initialization.md) - - [Custom Component Lifecycle Callbacks](ui/ts-custom-component-lifecycle-callbacks.md) - - [Example: Component Creation and Re-Initialization](ui/ts-component-creation-re-initialization.md) - - [Syntactic Sugar](ui/ts-syntactic-sugar.md) - - Experiencing the Declarative UI - - [Creating a Declarative UI Project](ui/ui-ts-creating-project.md) - - [Getting to Know Components](ui/ui-ts-components.md) - - [Creating a Simple Page](ui/ui-ts-creating-simple-page.md) - - Defining Page Layout and Connection - - [Building a Food Data Model](ui/ui-ts-building-data-model.md) - - [Building a Food Category List Layout](ui/ui-ts-building-category-list-layout.md) - - [Building a Food Category Grid Layout](ui/ui-ts-building-category-grid-layout.md) - - [Implementing Page Redirection and Data Transmission](ui/ui-ts-page-redirection-data-transmission.md) - - Basic Functions - - Agent-Powered Scheduled Reminders - - [Overview](background-agent-scheduled-reminder/background-agent-scheduled-reminder-overview.md) - - [Development Guidelines](background-agent-scheduled-reminder/background-agent-scheduled-reminder-guide.md) - - Background Task Management - - [Background Task Management Overview](background-task-management/background-task-overview.md) - - [Background Task Management Development](background-task-management/background-task-dev-guide.md) - - WebGL - - [WebGL Overview](webgl/webgl-overview.md) - - [WebGL Development](webgl/webgl-guidelines.md) - - Media - - Audio - - [Audio Overview](media/audio-overview.md) - - [Audio Playback Development](media/audio-playback.md) - - [Audio Playback Development Using AudioRenderer](media/audio-renderer.md) - - [Audio Recording Development](media/audio-recorder.md) - - [Audio Recorder Development Using AudioCapturer](media/audio-capturer) - - Video - - [Video Playback Development](media/video-playback.md) - - [Video Recording Development](media/video-recorder.md) - - Security - - User Authentication - - [User Authentication Overview](security/userauth-overview.md) - - [User Authentication Development](security/userauth-guidelines.md) - - Connectivity - - IPC & RPC - - [IPC & RPC Overview](connectivity/ipc-rpc-overview.md) - - [IPC & RPC Development Guidelines](connectivity/ipc-rpc-development-guideline.md) - - [Subscribing to State Changes of a Remote Object](connectivity/subscribe-remote-state.md) - - Data Management - - Distributed Data Service - - [Distributed Data Service Overview](database/database-mdds-overview.md) - - [Distributed Data Service Development](database/database-mdds-guidelines.md) - - Relational Database Overview - - [RDB Overview](database/database-relational-overview.md) - - [RDB Development](database/database-relational-guidelines.md) - - Lightweight Data Store - - [Lightweight Data Store Overview](database/database-preference-overview.md) - - [Lightweight Data Store Development](database/database-preference-guidelines.md) - - Device - - USB Service - - [USB Service Overview](device/usb-overview.md) - - [USB Service Development](device/usb-guidelines.md) - - Location - - [Location Overview](device/device-location-overview.md) - - [Obtaining Device Location Information](device/device-location-info.md) - - [Geocoding and Reverse Geocoding Capabilities](device/device-location-geocoding.md) - - DFX - - Application Event Logging - - [Overview of Application Event Logging](dfx/hiappevent-overview.md) - - [Development Guidelines on Application Event Logging](dfx/hiappevent-guidelines.md) -- Tools - - DevEco Studio (OpenHarmony) User Guide - - [Overview](quick-start/deveco-studio-overview.md) - - [Version Change History](quick-start/deveco-studio-release-notes.md) - - [Configuring the OpenHarmony SDK](quick-start/configuring-openharmony-sdk.md) - - [Creating an OpenHarmony Project](quick-start/create-openharmony-project.md) - - [Configuring the OpenHarmony App Signature](quick-start/configuring-openharmony-app-signature.md) - - [Installing and Running Your OpenHarmony App](quick-start/installing-openharmony-app.md) -- Hands-On Tutorials - - [Samples](https://gitee.com/openharmony/app_samples/blob/master/README.md) -- API References - - Compent Reference (JavaScript-based Web-like Development Paradigm) - - [Components](reference/arkui-js/js-components.md) - - [Common](reference/arkui-js/js-components-common.md) - - [Universal Attributes](reference/arkui-js/js-components-common-attributes.md) - - [Universal Styles](reference/arkui-js/js-components-common-styles.md) - - [Universal Events](reference/arkui-js/js-components-common-events.md) - - [Universal Methods](reference/arkui-js/js-components-common-methods.md) - - [Animation Styles](reference/arkui-js/js-components-common-animation.md) - - [Gradient Styles](reference/arkui-js/js-components-common-gradient.md) - - [Transition Styles](reference/arkui-js/js-components-common-transition.md) - - [Custom Font Styles](reference/arkui-js/js-components-common-customizing-font.md) - - [Atomic Layout](reference/arkui-js/js-components-common-atomic-layout.md) - - [Container Component](reference/arkui-js/js-components-container.md) - - [badge](reference/arkui-js/js-components-container-badge.md) - - [dialog](reference/arkui-js/js-components-container-dialog.md) - - [div](reference/arkui-js/js-components-container-div.md) - - [form](reference/arkui-js/js-components-container-form.md) - - [list](reference/arkui-js/js-components-container-list.md) - - [list-item](reference/arkui-js/js-components-container-list-item.md) - - [list-item-group](reference/arkui-js/js-components-container-list-item-group.md) - - [panel](reference/arkui-js/js-components-container-panel.md) - - [popup](reference/arkui-js/js-components-container-popup.md) - - [refresh](reference/arkui-js/js-components-container-refresh.md) - - [stack](reference/arkui-js/js-components-container-stack.md) - - [stepper](reference/arkui-js/js-components-container-stepper.md) - - [stepper-item](reference/arkui-js/js-components-container-stepper-item.md) - - [swiper](reference/arkui-js/js-components-container-swiper.md) - - [tabs](reference/arkui-js/js-components-container-tabs.md) - - [tab-bar](reference/arkui-js/js-components-container-tab-bar.md) - - [tab-content](reference/arkui-js/js-components-container-tab-content.md) - - [Basic Components](reference/arkui-js/js-components-basic.md) - - [button](reference/arkui-js/js-components-basic-button.md) - - [chart](reference/arkui-js/js-components-basic-chart.md) - - [divider](reference/arkui-js/js-components-basic-divider.md) - - [image](reference/arkui-js/js-components-basic-image.md) - - [image-animator](reference/arkui-js/js-components-basic-image-animator.md) - - [input](reference/arkui-js/js-components-basic-input.md) - - [label](reference/arkui-js/js-components-basic-label.md) - - [marquee](reference/arkui-js/js-components-basic-marquee.md) - - [menu](reference/arkui-js/js-components-basic-menu.md) - - [option](reference/arkui-js/js-components-basic-option.md) - - [picker](reference/arkui-js/js-components-basic-picker.md) - - [picker-view](reference/arkui-js/js-components-basic-picker-view.md) - - [piece](reference/arkui-js/js-components-basic-piece.md) - - [progress](reference/arkui-js/js-components-basic-progress.md) - - [qrcode](reference/arkui-js/js-components-basic-qrcode.md) - - [rating](reference/arkui-js/js-components-basic-rating.md) - - [richtext](reference/arkui-js/js-components-basic-richtext.md) - - [search](reference/arkui-js/js-components-basic-search.md) - - [select](reference/arkui-js/js-components-basic-select.md) - - [slider](reference/arkui-js/js-components-basic-slider.md) - - [span](reference/arkui-js/js-components-basic-span.md) - - [switch](reference/arkui-js/js-components-basic-switch.md) - - [text](reference/arkui-js/js-components-basic-text.md) - - [textarea](reference/arkui-js/js-components-basic-textarea.md) - - [toolbar](reference/arkui-js/js-components-basic-toolbar.md) - - [toolbar-item](reference/arkui-js/js-components-basic-toolbar-item.md) - - [toggle](reference/arkui-js/js-components-basic-toggle.md) - - [Media Components](reference/arkui-js/js-components-media.md) - - [video](reference/arkui-js/js-components-media-video.md) - - [Canvas Components](reference/arkui-js/js-components-canvas.md) - - [canvas](reference/arkui-js/js-components-canvas-canvas.md) - - [CanvasRenderingContext2D](reference/arkui-js/js-components-canvas-canvasrenderingcontext2d.md) - - [Image](reference/arkui-js/js-components-canvas-image.md) - - [CanvasGradient](reference/arkui-js/js-components-canvas-canvasgradient.md) - - [ImageData](reference/arkui-js/js-components-canvas-imagedata.md) - - [Path2D](reference/arkui-js/js-components-canvas-path2d.md) - - [ImageBitmap](reference/arkui-js/js-components-canvas-imagebitmap.md) - - [OffscreenCanvas](reference/arkui-js/js-components-canvas-offscreencanvas.md) - - [OffscreenCanvasRenderingContext2D](reference/arkui-js/js-offscreencanvasrenderingcontext2d.md) - - [Grid](reference/arkui-js/js-components-grid.md) - - [Basic Concepts](reference/arkui-js/js-components-grid-basic-concepts.md) - - [grid-container](reference/arkui-js/js-components-grid-container.md) - - [grid-row](reference/arkui-js/js-components-grid-row.md) - - [grid-col](reference/arkui-js/js-components-grid-col.md) - - [SVG Components](reference/arkui-js/js-svg.md) - - [Universal Attributes](reference/arkui-js/js-components-svg-common-attributes.md) - - [svg](reference/arkui-js/js-components-svg.md) - - [rect](reference/arkui-js/js-components-svg-rect.md) - - [circle](reference/arkui-js/js-components-svg-circle.md) - - [ellipse](reference/arkui-js/js-components-svg-ellipse.md) - - [path](reference/arkui-js/js-components-svg-path.md) - - [line](reference/arkui-js/js-components-svg-line.md) - - [polyline](reference/arkui-js/js-components-svg-polyline.md) - - [polygon](reference/arkui-js/js-components-svg-polygon.md) - - [text](reference/arkui-js/js-components-svg-text.md) - - [tspan](reference/arkui-js/js-components-svg-tspan.md) - - [textPath](reference/arkui-js/js-components-svg-textpath.md) - - [animate](reference/arkui-js/js-components-svg-animate.md) - - [animateMotion](reference/arkui-js/js-components-svg-animatemotion.md) - - [animateTransform](reference/arkui-js/js-components-svg-animatetransform.md) - - [Custom Components](reference/arkui-js/js-components-custom.md) - - [Basic Usage](reference/arkui-js/js-components-custom-basic-usage.md) - - [Custom Events](reference/arkui-js/js-components-custom-events.md) - - [props](reference/arkui-js/js-components-custom-props.md) - - [Event Parameter](reference/arkui-js/js-components-custom-event-parameter.md) - - [slot](reference/arkui-js/js-components-custom-slot.md) - - [Lifecycle Definition](reference/arkui-js/js-components-custom-lifecycle.md) - - [Appendix](reference/arkui-js/js-appendix.md) - - [Type Attributes](reference/arkui-js/js-appendix-types.md) - - Compent Reference (TypeScript-based Declarative Development Paradigm) - - [Components](reference/arkui-ts/ts-components.md) - - [Universal Components](reference/arkui-ts/ts-universal-components.md) - - [Universal Events](reference/arkui-ts/ts-universal-events.md) - - [Click Event](reference/arkui-ts/ts-universal-events-click.md) - - [Touch](reference/arkui-ts/ts-universal-events-touch.md) - - [Show/Hide Event](reference/arkui-ts/ts-universal-events-show-hide.md) - - [Key Event](reference/arkui-ts/ts-universal-events-key.md) - - [Component Area Change Event](reference/arkui-ts/ts-universal-events-component-area-change.md) - - [Universal Attributes](reference/arkui-ts/ts-universal-attributes.md) - - [Size](reference/arkui-ts/ts-universal-attributes-size.md) - - [Location](reference/arkui-ts/ts-universal-attributes-location.md) - - [Layout Constraints](reference/arkui-ts/ts-universal-attributes-layout-constraints.md) - - [Flex Layout](reference/arkui-ts/ts-universal-attributes-flex-layout.md) - - [Border Configuration](reference/arkui-ts/ts-universal-attributes-border.md) - - [Background](reference/arkui-ts/ts-universal-attributes-background.md) - - [Opacity](reference/arkui-ts/ts-universal-attributes-opacity.md) - - [Visibility](reference/arkui-ts/ts-universal-attributes-visibility.md) - - [Enable/Disable](reference/arkui-ts/ts-universal-attributes-enable.md) - - [Overlay](reference/arkui-ts/ts-universal-attributes-overlay.md) - - [Z-order Control](reference/arkui-ts/ts-universal-attributes-z-order.md) - - [Transformation](reference/arkui-ts/ts-universal-attributes-transformation.md) - - [Image Effect Configuration](reference/arkui-ts/ts-universal-attributes-image-effect.md) - - [Shape Clipping](reference/arkui-ts/ts-universal-attributes-sharp-clipping.md) - - [Text Style](reference/arkui-ts/ts-universal-attributes-text-style.md) - - [Grid](reference/arkui-ts/ts-universal-attributes-grid.md) - - [Gradient Color](reference/arkui-ts/ts-universal-attributes-gradient-color.md) - - [Popup Control](reference/arkui-ts/ts-universal-attributes-popup.md) - - [Menu Control](reference/arkui-ts/ts-universal-attributes-menu.md) - - [Click Control](reference/arkui-ts/ts-universal-attributes-touchable.md) - - [Touch Target](reference/arkui-ts/ts-universal-attributes-response-region.md) - - [Gesture Processing](reference/arkui-ts/ts-gesture-processing.md) - - [Gesture Binding Methods](reference/arkui-ts/ts-gesture-settings.md) - - [Basic Gestures](reference/arkui-ts/ts-basic-gestures.md) - - [TapGesture](reference/arkui-ts/ts-basic-gestures-tapgesture.md) - - [LongPressGesture](reference/arkui-ts/ts-basic-gestures-longpressgesture.md) - - [PanGesture](reference/arkui-ts/ts-basic-gestures-pangesture.md) - - [PinchGesture](reference/arkui-ts/ts-basic-gestures-pinchgesture.md) - - [RotationGesture](reference/arkui-ts/ts-basic-gestures-rotationgesture.md) - - [SwipeGesture](reference/arkui-ts/ts-basic-gestures-swipegesture.md) - - [Combined Gestures](reference/arkui-ts/ts-combined-gestures.md) - - [Basic Components](reference/arkui-ts/ts-basic-components.md) - - [Blank](reference/arkui-ts/ts-basic-components-blank.md) - - [Button](reference/arkui-ts/ts-basic-components-button.md) - - [DataPanel](reference/arkui-ts/ts-basic-components-datapanel.md) - - [Divider](reference/arkui-ts/ts-basic-components-divider.md) - - [Gauge](reference/arkui-ts/ts-basic-components-gauge.md) - - [Image](reference/arkui-ts/ts-basic-components-image.md) - - [ImageAnimator](reference/arkui-ts/ts-basic-components-imageanimator.md) - - [LoadingProgress](reference/arkui-ts/ts-basic-components-loadingprogress.md) - - [Marquee](reference/arkui-ts/ts-basic-components-marquee.md) - - [Progress](reference/arkui-ts/ts-basic-components-progress.md) - - [QRCode](reference/arkui-ts/ts-basic-components-qrcode.md) - - [Rating](reference/arkui-ts/ts-basic-components-rating.md) - - [Select](reference/arkui-ts/ts-basic-components-select.md) - - [Slider](reference/arkui-ts/ts-basic-components-slider.md) - - [Span](reference/arkui-ts/ts-basic-components-span.md) - - [Text](reference/arkui-ts/ts-basic-components-text.md) - - [TextArea](reference/arkui-ts/ts-basic-components-textarea.md) - - [TextInput](reference/arkui-ts/ts-basic-components-textinput.md) - - [Toggle](reference/arkui-ts/ts-basic-components-toggle.md) - - [TextClock](reference/arkui-ts/ts-basic-components-textclock.md) - - [Container Components](reference/arkui-ts/ts-components-container.md) - - [AlphabetIndexer](reference/arkui-ts/ts-container-alphabet-indexer.md) - - [Badge](reference/arkui-ts/ts-container-badge.md) - - [Column](reference/arkui-ts/ts-container-column.md) - - [ColumnSplit](reference/arkui-ts/ts-container-columnsplit.md) - - [Counter](reference/arkui-ts/ts-container-counter.md) - - [Flex](reference/arkui-ts/ts-container-flex.md) - - [GridContainer](reference/arkui-ts/ts-container-gridcontainer.md) - - [Grid](reference/arkui-ts/ts-container-grid.md) - - [GridItem](reference/arkui-ts/ts-container-griditem.md) - - [List](reference/arkui-ts/ts-container-list.md) - - [ListItem](reference/arkui-ts/ts-container-listitem.md) - - [Navigator](reference/arkui-ts/ts-container-navigator.md) - - [Navigation](reference/arkui-ts/ts-container-navigation.md) - - [Panel](reference/arkui-ts/ts-container-panel.md) - - [Row](reference/arkui-ts/ts-container-row.md) - - [RowSplit](reference/arkui-ts/ts-container-rowsplit.md) - - [Scroll](reference/arkui-ts/ts-container-scroll.md) - - [ScrollBar](reference/arkui-ts/ts-container-scrollbar.md) - - [Stack](reference/arkui-ts/ts-container-stack.md) - - [Swiper](reference/arkui-ts/ts-container-swiper.md) - - [Tabs](reference/arkui-ts/ts-container-tabs.md) - - [TabContent](reference/arkui-ts/ts-container-tabcontent.md) - - [Refresh](reference/arkui-ts/ts-container-refresh.md) - - [Drawing Components](reference/arkui-ts/ts-drawing-components.md) - - [Circle](reference/arkui-ts/ts-drawing-components-circle.md) - - [Ellipse](reference/arkui-ts/ts-drawing-components-ellipse.md) - - [Line](reference/arkui-ts/ts-drawing-components-line.md) - - [Polyline](reference/arkui-ts/ts-drawing-components-polyline.md) - - [Polygon](reference/arkui-ts/ts-drawing-components-polygon.md) - - [Path](reference/arkui-ts/ts-drawing-components-path.md) - - [Rect](reference/arkui-ts/ts-drawing-components-rect.md) - - [Shape](reference/arkui-ts/ts-drawing-components-shape.md) - - [Canvas Components](reference/arkui-ts/ts-components-canvas.md) - - [Canvas](reference/arkui-ts/ts-components-canvas-canvas.md) - - [CanvasRenderingContext2D](reference/arkui-ts/ts-canvasrenderingcontext2d.md) - - [OffscreenCanvasRenderingConxt2D](reference/arkui-ts/ts-offscreencanvasrenderingcontext2d.md) - - [Lottie](reference/arkui-ts/ts-components-canvas-lottie.md) - - [Path2D](reference/arkui-ts/ts-components-canvas-path2d.md) - - [CanvasGradient](reference/arkui-ts/ts-components-canvas-canvasgradient.md) - - [ImageBitmap](reference/arkui-ts/ts-components-canvas-imagebitmap.md) - - [ImageData](reference/arkui-ts/ts-components-canvas-imagedata.md) - - [Animation](reference/arkui-ts/ts-animation.md) - - [Attribute Animation](reference/arkui-ts/ts-animatorproperty.md) - - [Explicit Animation](reference/arkui-ts/ts-explicit-animation.md) - - [Transition Animation](reference/arkui-ts/ts-transition-animation.md) - - [Page Transition](reference/arkui-ts/ts-page-transition-animation.md) - - [Component Transition](reference/arkui-ts/ts-transition-animation-component.md) - - [Transition of Shared Elements](reference/arkui-ts/ts-transition-animation-shared-elements.md) - - [Motion Path Animation](reference/arkui-ts/ts-motion-path-animation.md) - - [Matrix Transformation](reference/arkui-ts/ts-matrix-transformation.md) - - [Interpolation Calculation](reference/arkui-ts/ts-interpolation-calculation.md) - - [Global UI Methods](reference/arkui-ts/ts-global-ui-methods.md) - - [Alert Dialog Box](reference/arkui-ts/ts-methods-alert-dialog-box.md) - - [Custom Dialog box](reference/arkui-ts/ts-methods-custom-dialog-box.md) - - [Image Cache](reference/arkui-ts/ts-methods-image-cache.md) - - [Media Query](reference/arkui-ts/ts-methods-media-query.md) - - [List Selection Dialog Box](reference/arkui-ts/ts-methods-action-sheet.md) - - [Appendix](reference/arkui-ts/ts-appendix.md) - - [Built-in Enums](reference/arkui-ts/ts-appendix-enums.md) - - APIs - - Ability Framework - - [FeatureAbility Module](reference/apis/js-apis-featureAbility.md) - - [ParticleAbility Module](reference/apis/js-apis-particleAbility.md) - - [DataAbilityHelper Module](reference/apis/js-apis-dataAbilityHelper.md) - - [DataUriUtils Module](reference/apis/js-apis-DataUriUtils.md) - - [Bundle Module](reference/apis/js-apis-Bundle.md) - - [Context Module](reference/apis/js-apis-Context.md) - - Event Notification - - [CommonEvent Module](reference/apis/js-apis-commonEvent.md) - - [Notification Module](reference/apis/js-apis-notification.md) - - [Reminder Agent](reference/apis/js-apis-reminderAgent.md) - - Resource Management - - [Resource Manager](reference/apis/js-apis-resource-manager.md) - - [Internationalization (intl)](reference/apis/js-apis-intl.md) - - [Internationalization (i18n)](reference/apis/js-apis-i18n.md) - - Media - - [Audio Management](reference/apis/js-apis-audio.md) - - [Media](reference/apis/js-apis-media.md) - - Security - - [User Authentication](reference/apis/js-apis-useriam-userauth.md) - - [Access Control](reference/apis/js-apis-abilityAccessCtrl.md) - - Data Management - - [Lightweight Storage (deprecated since 8)](reference/apis/js-apis-data-storage.md) - - [Distributed Data Management](reference/apis/js-apis-distributed-data.md) - - [Relational Database](reference/apis/js-apis-data-rdb.md) - - [Result Set](reference/apis/js-apis-data-resultset.md) - - [DataAbilityPredicates](reference/apis/js-apis-data-ability.md) - - [Settings](reference/apis/js-apis-settings.md) - - File Management - - [File Management](reference/apis/js-apis-fileio.md) - - [Statfs](reference/apis/js-apis-statfs.md) - - [Environment](reference/apis/js-apis-environment.md) - - [Public File Access and Management](reference/apis/js-apis-filemanager.md) - - [App Storage Statistics](reference/apis/js-apis-storage-statistics.md) - - [Volume Management](reference/apis/js-apis-volumemanager.md) - - Account Management - - [Distributed Account Management](reference/apis/js-apis-distributed-account.md) - - [App Account Management](reference/apis/js-apis-appAccount.md) - - Telephony Service - - [Call](reference/apis/js-apis-call.md) - - [SMS](reference/apis/js-apis-sms.md) - - [SIM Management](reference/apis/js-apis-sim.md) - - [Radio](reference/apis/js-apis-radio.md) - - [observer](reference/apis/js-apis-observer.md) - - [Cellular Data](reference/apis/js-apis-telephony-data.md) - - Network and Connectivity - - [WLAN](reference/apis/js-apis-wifi.md) - - [Bluetooth](reference/apis/js-apis-bluetooth.md) - - [RPC](reference/apis/js-apis-rpc.md) - - Device Management - - [Sensor](reference/apis/js-apis-sensor.md) - - [Vibrator](reference/apis/js-apis-vibrator.md) - - [Brightness](reference/apis/js-apis-brightness.md) - - [Battery Info](reference/apis/js-apis-battery-info.md) - - [Power Management](reference/apis/js-apis-power.md) - - [Thermal Management](reference/apis/js-apis-thermal.md) - - [Running Lock](reference/apis/js-apis-runninglock.md) - - [Device Info](reference/apis/js-apis-device-info.md) - - [systemParameter](reference/apis/js-apis-system-parameter.md) - - [Device Management](reference/apis/js-apis-device-manager.md) - - [Window](reference/apis/js-apis-window.md) - - [Display](reference/apis/js-apis-display.md) - - [Update](reference/apis/js-apis-update.md) - - [USB](reference/apis/js-apis-usb.md) - - [Location](reference/apis/js-apis-geolocation.md) - - Basic Features - - [Application Context](reference/apis/js-apis-basic-features-app-context.md) - - [Console Logs](reference/apis/js-apis-basic-features-logs.md) - - [Page Routing](reference/apis/js-apis-basic-features-routes.md) - - [Pop-up Window](reference/apis/js-apis-basic-features-pop-up.md) - - [Application Configuration](reference/apis/js-apis-basic-features-configuration.md) - - [Timer](reference/apis/js-apis-basic-features-timer.md) - - [Setting the System Time](reference/apis/js-apis-system-time.md) - - [Animation](reference/apis/js-apis-basic-features-animator.md) - - [WebGL](reference/apis/js-apis-webgl.md) - - [WebGL2](reference/apis/js-apis-webgl2.md) - - [Screenshot](reference/apis/js-apis-screenshot.md) - - DFX - - [HiAppEvent](reference/apis/js-apis-hiappevent.md) - - [Performance Tracing](reference/apis/js-apis-hitracemeter.md) - - [Fault Logger](reference/apis/js-apis-faultLogger.md) - - [Distributed Call Chain Tracing](reference/apis/js-apis-hitracechain.md) - - [HiLog](reference/apis/js-apis-hilog.md) - - [HiChecker](reference/apis/js-apis-hichecker.md) - - [HiDebug](reference/apis/js-apis-hidebug.md) - - Language Base Class Library - - [Obtaining Process Information](reference/apis/js-apis-process.md) - - [URL String Parsing](reference/apis/js-apis-url.md) - - [URI String Parsing](reference/apis/js-apis-uri.md) - - [Util](reference/apis/js-apis-util.md) - - [XML Parsing and Generation](reference/apis/js-apis-xml.md) - - [XML-to-JavaScript Conversion](reference/apis/js-apis-convertxml.md) - - [Worker Startup](reference/apis/js-apis-worker.md) - - [Linear Container ArrayList](reference/apis/js-apis-arraylist.md) - - [Linear Container Deque](reference/apis/js-apis-deque.md) - - [Linear Container List](reference/apis/js-apis-list.md) - - [Linear Container LinkedList](reference/apis/js-apis-linkedlist.md) - - [Linear Container Queue](reference/apis/js-apis-queue.md) - - [Linear Container Stack](reference/apis/js-apis-stack.md) - - [Linear Container Vector](reference/apis/js-apis-vector.md) - - [Nonlinear Container HashSet](reference/apis/js-apis-hashset.md) - - [Nonlinear Container HashMap](reference/apis/js-apis-hashmap.md) - - [Nonlinear Container PlainArray](reference/apis/js-apis-plainarray.md) - - [Nonlinear Container TreeMap](reference/apis/js-apis-treemap.md) - - [Nonlinear Container TreeSet](reference/apis/js-apis-treeset.md) - - [Nonlinear Container LightWeightMap](reference/apis/js-apis-lightweightmap.md) - - [Nonlinear Container LightWeightSet](reference/apis/js-apis-lightweightset.md) \ No newline at end of file +# Learn About OpenHarmony + +- [OpenHarmony Project](OpenHarmony-Overview.md) +- [Glossary](device-dev/glossary/glossary.md) +- OpenHarmony Release Notes + - OpenHarmony 3.x Releases + - [OpenHarmony v3.1 Beta (2021-12-31)](release-notes/OpenHarmony-v3.1-beta.md) + - [OpenHarmony v3.0.1 LTS (2022-01-12)](release-notes/OpenHarmony-v3.0.1-LTS.md) + - [OpenHarmony v3.0 LTS (2021-09-30)](release-notes/OpenHarmony-v3.0-LTS.md) + + - OpenHarmony 2.x Releases + - [OpenHarmony v2.2 beta2 (2021-08-04)](release-notes/OpenHarmony-v2.2-beta2.md) + - [OpenHarmony 2.0 Canary (2021-06-01)](release-notes/OpenHarmony-2-0-Canary.md) + + - OpenHarmony 1.x Releases + - [OpenHarmony v1.1.4 LTS (2022-02-11)](release-notes/OpenHarmony-v1-1-4-LTS.md) + - [OpenHarmony v1.1.3 LTS (2021-09-30)](release-notes/OpenHarmony-v1-1-3-LTS.md) + - [OpenHarmony v1.1.2 LTS (2021-08-04)](release-notes/OpenHarmony-v1.1.2-LTS.md) + - [OpenHarmony 1.1.1 LTS (2021-06-22)](release-notes/OpenHarmony-1-1-1-LTS.md) + - [OpenHarmony 1.1.0 LTS (2021-04-01)](release-notes/OpenHarmony-1-1-0-LTS.md) + - [OpenHarmony 1.0 (2020-09-10)](release-notes/OpenHarmony-1-0.md) +- Contribution + - [Contribution](contribute/contribution.md) + - [Code of Conduct](contribute/code-of-conduct.md) + - [Code Contribution](contribute/code-contribution.md) + - [Contribution Process](contribute/contribution-process.md) + - [Auto-Test](readme/test_subsystem.md) + - [Documentation Contribution](contribute/documentation-contribution.md) + - [Writing Instructions](contribute/writing-instructions.md) + - [Communication in Community](contribute/communication-in-community.md) + - [FAQs](contribute/FAQ.md) \ No newline at end of file diff --git a/zh-cn/OpenHarmony-Overview_zh.md b/zh-cn/OpenHarmony-Overview_zh.md index f7e698c5051ce34b1848af423eb8c80805284e07..a20a54b234aa6cc76ec2c62464fbe831d22b96ac 100644 --- a/zh-cn/OpenHarmony-Overview_zh.md +++ b/zh-cn/OpenHarmony-Overview_zh.md @@ -1,4 +1,4 @@ -# OpenHarmony开源项目 +# OpenHarmony开源项目 - [项目介绍](#section1270210396435) - [技术架构](#section2502124574318) @@ -346,7 +346,10 @@ OpenHarmony支持如下几种系统类型: ## 快速入门 -入口:[device-dev/quick-start/Readme-CN.md](device-dev/quick-start/Readme-CN.md) +- 设备开发快速入门:[device-dev/quick-start/Readme-CN.md](device-dev/quick-start/Readme-CN.md) +- 应用开发快速入门:[application-dev/quick-start/Readme-CN.md](application-dev/quick-start/Readme-CN.md) + + ## 代码仓地址 diff --git a/zh-cn/application-dev/ability/Readme-CN.md b/zh-cn/application-dev/ability/Readme-CN.md index f3b879e4b906488fff13331e10d006dcd98f0a51..98d1c3389afdb77a5df81a32eb38e4f4ae599b1f 100644 --- a/zh-cn/application-dev/ability/Readme-CN.md +++ b/zh-cn/application-dev/ability/Readme-CN.md @@ -1,5 +1,6 @@ # Ability开发 - [Ability框架概述](ability-brief.md) + - FA模型 - [FA模型综述](fa-brief.md) - [PageAbility开发指导](fa-pageability.md) @@ -7,12 +8,10 @@ - [DataAbility开发指导](fa-dataability.md) - [FormAbility开发指导](fa-formability.md) - Stage模型 - - [Stage模型综述](stage-brief.md) - [Ability开发指导](stage-ability.md) - [ServiceExtensionAbility开发指导](stage-serviceextension.md) - - [FormExtensionAbility开发指导](stage-formextension.md) - - [应用迁移开发指导](stage-ability-continuation.md) + - [跨端迁移开发指导](stage-ability-continuation.md) - [Call调用开发指导](stage-call.md) - 其他 - - [WantAgent使用指导](wantagent.md) - - [Ability助手使用指导](ability-assistant-guidelines.md) \ No newline at end of file + - [Ability助手使用指导](ability-assistant-guidelines.md) + - [测试框架使用指导](ability-delegator.md) \ No newline at end of file diff --git a/zh-cn/application-dev/ability/ability-delegator.md b/zh-cn/application-dev/ability/ability-delegator.md new file mode 100755 index 0000000000000000000000000000000000000000..891e6642e5015a6a860d0f1b566003b9cfe4fbfe --- /dev/null +++ b/zh-cn/application-dev/ability/ability-delegator.md @@ -0,0 +1,129 @@ +# 测试框架使用指导 + +Delegator测试框架是OpenHarmony提供的一套开发者应用自测试框架,旨在为开发者提供针对应用的自测试环境。开发者可以通过delegator类启动对应Ability,并通过Delegator类提供的能力对Ability进行生命周期切换和监听,同时支持shellCMD输入和测试结果打印显示等功能。 + +## 测试框架启动 + +测试框架启动有两种方式,方式一:通过aa test命令启动,方式二:通过IDE启动。 +### aa test启动 + +开发者可通过 aa test 命令启动启动测试框架,开发者可以自行指定使用的runner以及runner所在hap包的package name/module name,具体命令示例如下: + +**FA模型:** + +```javascript +aa test -p com.example.myapplicationfaets -s unittest OpenHarmonyTestRunner -s class ActsAbilityTest -w 20 +``` + +**Stage模型:** +```javascript +aa test -m com.example.myapplicationfaets -s unittest OpenHarmonyTestRunner -s class ActsAbilityTest -w 20 +``` +| 参数 | 是否必选 | 参数说明 | +| --------------- | -------- | ------------------------------------------------------------ | +| -p | 是 | TestRunner所在hap包的package name,FA模型使用。 | +| -m | 是 | TestRunner所在hap包的module name,stage模型使用。 | +| -s unittest | 是 | 启用的TestRunner名称,TestRunner名称和文件名需要保持一致。 | +| -w | 否 | 测试用例超时时间,如果未指定,测试框架会一直等待测试代码调用finishTest才退出。 | +| -s | 否 | 支持以key-value的方式输入任何参数,输入的参数可通过AbilityDelegatorArgs.parameters以key-value的方式获取。 | + +### IDE启动 + +IDE文档中介绍,待IDE文档上库补充链接。 + +## TestRunner介绍 + +TestRunner是测试框架测试流程入口类,当测试流程启动时,系统会调用TestRunner内相关接口,开发者需要派生该类,并重写onPrepare、onRun方法。IDE在创建应用模板时会初始化一个默认TestRunner,并在onRun方法启动默认的TestAbility。开发者也可以修改TestAbility测试代码内容,也可以修改默认的TestRunner内onPrepare、onRun方法,自行实现测试代码。具体详细内容请参考TestRunnerAPI接口说明[TestRunner](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-testRunner.md)。 + +## AbilityMonitor介绍 + +AbilityMonitor是测试框架提供用来绑定并监听Ability类,开发者可以使用AbilityMonitor绑定Ability,并将AbilityMonitor添加到监听列表。绑定后Ability的创建、生命周期变化等会触发AbilityMonitor内相关回调函数,开发者可以在对应回调函数内进行测试验证。具体详细内容请参考AbilityMonitor API接口说明[AbilityMonitor](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-application-abilityMonitor.md)。 + +**示例** + +```javascript +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' + +function onAbilityCreateCallback() { + console.info("onAbilityCreateCallback"); +} + +var monitor = { + abilityName: "abilityname", + onAbilityCreate: onAbilityCreateCallback +} + +var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); +abilityDelegator.addAbilityMonitor(monitor).then((void) => { + console.info("addAbilityMonitor promise"); +}); +``` + +## AbilityDelegator介绍 + +AbilityDelegator是测试框架主要功能类,提供了启动Ability、获取Ability示例、调度Ability生命周期、对Ability生命周期进行监听、打印测试结果等功能。 + +**导入模块** + +```javascript +import AbilityDelegatorRegistry from '@ohos.application.abilityDelegatorRegistry' +``` + +```javascript +var abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator() +``` + +### 启动Ability并监听Ability状态变化 + +配合AbilityMonitor使用,可以实现对Ability启动、Ability实例获取、监听状态变化功能。 + +**示例:** + +```javascript +var abilityDelegator; +var ability; +var timeout = 100; + +function onAbilityCreateCallback() { + console.info("onAbilityCreateCallback"); +} + +var monitor = { + abilityName: "abilityname", + onAbilityCreate: onAbilityCreateCallback +} + +abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); +abilityDelegator.waitAbilityMonitor(monitor, timeout, (err, data) => { + ability = data; + console.info("waitAbilityMonitor callback"); +}); + +var want = { + bundleName: "bundleName", + abilityName: "abilityName" +}; + +abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); +abilityDelegator.startAbility(want, (err, data) => { + console.info("startAbility callback"); +}); +``` + +### 调度Ability生命周期 + +AbilityDelegator提供对Ability生命周期进行显示调度,支持Foreground、Background,配合AbilityMonitor中对Ability生命周期监听方法,可以完整的测试Ability生命周期变化。具体详细内容请参考AbilityDelegator API接口说明[AbilityDelegator](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-application-abilityDelegator.md#abilitydelegator)。 + +### 执行shellCMD命令 + +AbilityDelegator提供执行shellCMD命令功能,开发者可以在测试代码中执行shell命令,该功能仅在测试环境中生效,非测试环境该接口调用无效果。 +**示例:** + +```javascript + var abilityDelegator; + var cmd = "cmd"; + abilityDelegator = AbilityDelegatorRegistry.getAbilityDelegator(); + abilityDelegator.executeShellCommand(cmd, (err,data) => { + console.info("executeShellCommand callback"); + }); +``` \ No newline at end of file diff --git a/zh-cn/application-dev/ability/fa-pageability.md b/zh-cn/application-dev/ability/fa-pageability.md index be05ac164e0c7d39c4f409b122fe5178f07f1a94..0c8426bcc7ff3e2badadc7437ad76b9dc052c5dd 100644 --- a/zh-cn/application-dev/ability/fa-pageability.md +++ b/zh-cn/application-dev/ability/fa-pageability.md @@ -1,14 +1,14 @@ # PageAbility开发指导 -## PageAbility介绍 +## 概述 +### 功能简介 +PageAbility是具备ArkUI的Ability,是用户具体可见并可以交互的Ability实例,开发者通过IDE创建Ability时,IDE会自动创建相关模板代码。PageAbility相关能力通过单例featureAbility暴露,生命周期相关回调通过app.js/app.ets中回调函数暴露。 -Page模板(以下简称“Page”)是FA唯一支持的模板,用于提供与用户交互的能力。 - -## PageAbility的生命周期 +### PageAbility的生命周期 **Ability生命周期介绍**(Ability Life Cycle)是Ability被调度到INACTIVE、ACTIVE、BACKGROUND等各个状态的统称(主要涉及PageAbility类型和ServiceAbility类型的Ability)。 - - **PageAbility类型的Ability生命周期流转如下图所示** +**PageAbility生命周期流转如下图所示** ![PageAbility-Lifecycle](figures/page-ability-lifecycle.png) @@ -25,76 +25,32 @@ Page模板(以下简称“Page”)是FA唯一支持的模板,用于提供 - **BACKGROUND**: 后台状态,表示当前Ability退到后台,Ability在被销毁后由BACKGROUND状态进入INITIAL状态,或者重新被激活后由BACKGROUND状态进入ACTIVE状态。 -**PageAbility类型Ability生命周期回调如下图所示:** +**PageAbility生命周期回调如下图所示:** ![fa-pageAbility-lifecycle](figures/fa-pageAbility-lifecycle.png) -PageAbility提供如下生命周期回调,开发者可以在 app.js/app.ets 中重写生相关命周期函数 。 - -* onShow() - - Ability由后台不可见状态切换到前台可见状态调用onShow方法,此时用户在屏幕可以看到该Ability。 - -* onHide() - - Ability由前台切换到后台不可见状态时调用onHide方法,此时用户在屏幕看不到该Ability。 - -* onDestroy() - - 应用退出,销毁Ability对象前调用onDestroy方法,开发者可以在该方法里做一些回收资源、清空缓存等应用退出前的准备工作。 - -* onCreate() - - Ability第一次启动创建Ability时调用onCreate方法,开发者可以在该方法里做一些应用初始化工作。 +PageAbility提供命周期回调,开发者可以在 app.js/app.ets 中重写生相关命周期函数 。 -* onInactive() +## 开发指导 +### featureAbility接口说明 - Ability失去焦点时调用onInactive方法,Ability在进入后台状态时会先失去焦点,再进入后台。 +**表1** featureAbility接口介绍 -* onActive() +| 接口名 | 描述 | +| --------------------------------------------------- | --------------- | +| void startAbility(parameter: StartAbilityParameter) | 启动Ability | +| Context getContext(): | 获取应用Context | +| void terminateSelf() | 结束Ability | +| bool hasWindowFocus() | 是否获取焦点 | - Ability切换到前台,并且已经获取焦点时调用onActive方法。 - -* 示例 - -```javascript -export default { - onCreate() { - console.info('Application onCreate') - }, - onDestroy() { - console.info('Application onDestroy') - }, - onShow(){ - console.info('Application onShow') - }, - onHide(){ - console.info('Application onHide') - }, - onInactive(){ - console.info('Application onInactive') - }, - onActive(){ - console.info('Application onActive') - }, -} -``` -## 启动本地PageAbility +### 启动本地PageAbility - * 导入模块 +* 导入模块 ``` import featureAbility from '@ohos.ability.featureAbility' ``` -``` - featureAbility.startAbility(parameter: StartAbilityParameter, callback: AsyncCallback) -``` - -* 接口说明 - - 启动新的ability(callback形式) - * 示例 ```javascript @@ -158,7 +114,7 @@ featureAbility.startAbility({ }, ); ``` -## 启动远程PageAbility +### 启动远程PageAbility * 导入模块 @@ -166,14 +122,6 @@ featureAbility.startAbility({ import featureAbility from '@ohos.ability.featureAbility' ``` -``` -featureAbility.startAbility(parameter: StartAbilityParameter) -``` -* 接口说明 - - 启动远程的ability(promise形式) - 前提:通过deviceManager获取远程deviceid - * 示例 ```javascript @@ -186,4 +134,46 @@ var promise = await featureAbility.startAbility({ }, } ); -``` \ No newline at end of file +``` +### 生命周期接口说明 +**表2** 生命周期回调函数介绍 + +| 接口名 | 描述 | +| ------------ | ------------------------------------------------------------ | +| onShow() | Ability由后台不可见状态切换到前台可见状态调用onShow方法,此时用户在屏幕可以看到该Ability | +| onHide() | Ability由前台切换到后台不可见状态时调用onHide方法,此时用户在屏幕看不到该Ability。 | +| onDestroy() | 应用退出,销毁Ability对象前调用onDestroy方法,开发者可以在该方法里做一些回收资源、清空缓存等应用退出前的准备工作。 | +| onCreate() | Ability第一次启动创建Ability时调用onCreate方法,开发者可以在该方法里做一些应用初始化工作。 | +| onInactive() | Ability失去焦点时调用onInactive方法,Ability在进入后台状态时会先失去焦点,再进入后台。 | +| onActive() | Ability切换到前台,并且已经获取焦点时调用onActive方法。 | + +* 示例 +开发者需要重写app.js/app.ets 中相关生命周期回调函数,IDE模板默认生成onCreate()和onDestroy()方法,其他方法需要开发者自行实现。 +```javascript +export default { + onCreate() { + console.info('Application onCreate') + }, + onDestroy() { + console.info('Application onDestroy') + }, + onShow(){ + console.info('Application onShow') + }, + onHide(){ + console.info('Application onHide') + }, + onInactive(){ + console.info('Application onInactive') + }, + onActive(){ + console.info('Application onActive') + }, +} +``` +### 开发实例 +针对pageAbility开发,有以下示例工程可供参考: + +- [DMS](https://gitee.com/openharmony/app_samples/tree/master/ability/DMS) + +在本示例中完整展示了启动本地Ability、启动远程Ability的使用方法。 \ No newline at end of file diff --git a/zh-cn/application-dev/ability/figures/continuation-info.png b/zh-cn/application-dev/ability/figures/continuation-info.png new file mode 100755 index 0000000000000000000000000000000000000000..69c38949921686520378a118df2e9f82912967a8 Binary files /dev/null and b/zh-cn/application-dev/ability/figures/continuation-info.png differ diff --git a/zh-cn/application-dev/ability/stage-ability-continuation.md b/zh-cn/application-dev/ability/stage-ability-continuation.md old mode 100644 new mode 100755 index 1c391834f07554f3744e31e8dff6b02e16d8e83d..b7e67a1b330d7277e522a4cca8038701994e87d6 --- a/zh-cn/application-dev/ability/stage-ability-continuation.md +++ b/zh-cn/application-dev/ability/stage-ability-continuation.md @@ -1,178 +1,232 @@ -# 应用迁移开发指导 +# 跨端迁移开发指导 ## 场景介绍 -迁移的主要工作是实现将应用当前任务,包括页面部分数据、栈信息等,迁移到远端设备。迁移成功后,本端任务将被清除;若失败则不会,可允许再次迁移。 - - +迁移的主要工作是实现将应用当前任务,包括页面控件状态变量、分布式对象等,迁移到远端设备。页面控件状态变量用于同步页面UI数据,分布式对象用于同步内存中的数据。 ## 接口说明 -迁移提供的能力如下,具体的API详见接口文档 +迁移提供的能力如下,具体的API详见[接口文档](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-application-ability.md)。 **表1** 应用迁移API接口功能介绍 |接口名 | 描述| |:------ | :------| -| onContinue(wantParams : {[key: string]: any}) | 迁移发起端在该回调中保存迁移所需要的数据,同时返回是否同意迁移:true表示同意,false表示拒绝。 | +| onContinue(wantParams : {[key: string]: any}): OnContinueResult | 迁移**发起端**在该回调中保存迁移所需要的数据,同时返回是否同意迁移:0表示同意,拒绝返回相应错误码。 | +| onCreate(want: Want,param:LaunchParam): void | 迁移**目标端**在该回调中完成数据恢复,并触发页面恢复。 | +| **enum** OnContinueResult | onContinue的返回值类型:AGREE表示同意;REJECT表示拒绝;MISMATCH表示版本不匹配 | -## 开发步骤 +**图1** 迁移开发示意图 -### 迁移应用 +![continuation_dev](figures/continuation-info.png) +## 开发步骤 +### 迁移应用 1. 配置 - 配置应用支持迁移 - ​ 在config.json中配置continuable字段:true表示支持迁移,false表示不支持,默认为false. + 在module.json5中配置continuable字段:true表示支持迁移,false表示不支持,默认为false。配置为false的应用将被系统识别为无法迁移。 - ``` + ```javascript "continuable": true ``` - ​ 配置为false的应用将无法在任务中心进行迁移。 + * 配置应用启动类型 - ​ 迁移当前只支持多实例应用,需要在在config.json中配置launchType字段为standard + 迁移当前只支持多实例应用,需要在在module.json5中配置launchType字段为standard - ``` + ```javascript "launchType": "standard" ``` + + + * 申请分布式权限 + + 支持跨端迁移的应用需要在module.json5申请分布式权限 DISTRIBUTED_DATASYNC。 + + ```javascript + "requestPermissions": [ + { + "name": "ohos.permission.DISTRIBUTED_DATASYNC" + }, + ``` + + 这个权限需要在应用首次启动的时候弹窗让用户授予,可以通过在ability的onWindowStageCreate中添加如下代码实现 + + ```javascript + requestPermissions = async () => { + let permissions: Array = [ + "ohos.permission.DISTRIBUTED_DATASYNC" + ]; + let needGrantPermission = false + let accessManger = accessControl.createAtManager() + Logger.info("app permission get bundle info") + let bundleInfo = await bundle.getApplicationInfo(BUNDLE_NAME, 0, 100) + Logger.info(`app permission query permission ${bundleInfo.accessTokenId.toString()}`) + for (const permission of permissions) { + Logger.info(`app permission query grant status ${permission}`) + try { + let grantStatus = await accessManger.verifyAccessToken(bundleInfo.accessTokenId, permission) + if (grantStatus === PERMISSION_REJECT) { + needGrantPermission = true + break; + } + } catch (err) { + Logger.error(`app permission query grant status error ${permission} ${JSON.stringify(err)}`) + needGrantPermission = true + break; + } + } + if (needGrantPermission) { + Logger.info("app permission needGrantPermission") + try { + await this.context.requestPermissionsFromUser(permissions) + } catch (err) { + Logger.error(`app permission ${JSON.stringify(err)}`) + } + } else { + Logger.info("app permission already granted") + } + } + ``` + -2. 实现onContinue接口 +2. 实现onContinue接口 - 导入模块 + onContinue接口在**发起端**被调用,主要用于在迁移发起时,通知开发者保存控件状态变量和内存中数据,准备迁移。当应用准备完成后,需要返回OnContinueResult.AGREE(0)表示同意迁移,否则返回相应的错误码拒绝迁移。如果不实现该接口,系统将默认为拒绝迁移。 - ``` + 导入模块 + + ```javascript import Ability from '@ohos.application.Ability'; + import AbilityConstant from '@ohos.application.AbilityConstant'; ``` - - - 要实现迁移,此接口必须实现并返回true,否则默认为拒绝迁移。 + + - 要实现迁移,此接口必须实现并返回AGREE,否则默认为拒绝迁移。 - 示例 ```javascript - onContinue(wantParams : {[key: string]: any}) { - console.log("MainAbility onContinue") - return true; - } + onContinue(wantParam : {[key: string]: any}) { + Logger.info("onContinue using distributedObject") + // set user input data into want params + wantParam["input"] = AppStorage.Get('ContinueInput'); + Logger.info(`onContinue input = ${wantParam["input"]}`); + return AbilityConstant.OnContinueResult.AGREE + } ``` 3. 在onCreate接口中实现迁移逻辑 - - 远端设备上,在onCreate中根据launchReason判断该次启动是否为迁移LaunchReason.CONTINUATION(3) + onCreate接口在迁移**目标端**被调用,在目标端ability被拉起时,通知开发者同步已保存的内存数据和控件状态,完成后触发页面的恢复。如果不实现该接口中迁移相关逻辑,ability将会作为普通的启动方式拉起,无法恢复页面。 + - 远端设备上,在onCreate中根据launchReason判断该次启动是否为迁移LaunchReason.CONTINUATION + - 完成数据恢复后,开发者需要调用**restoreWindowStage**来触发页面恢复。 - + * 示例 ```javascript - onCreate(want , launchParam) { - // Ability is creating, initialize resources for this ability - console.log("MainAbility onCreate", launchParam.launchReason); - if (launchParam.launchReason == LaunchReason.CONTINUATION) { - this.contentStorage = new ContenStorage(); + onCreate(want, launchParam) { + Logger.info(`MainAbility onCreate ${AbilityConstant.LaunchReason.CONTINUATION}`) + globalThis.abilityWant = want; + if (launchParam.launchReason == AbilityConstant.LaunchReason.CONTINUATION) { + let input = want.parameters.input // get user data from want params + AppStorage.SetOrCreate('ContinueInput', input) + Logger.info(`onCreate for continuation sessionId: ${this.sessionId}`) + + this.contentStorage = new ContentStorage(); this.context.restoreWindowStage(this.contentStorage); } } - ``` ### 迁移数据 -1. 使用自定义数据 +1. 使用分布式对象 - - wantParams中可以填写key-value形式自定义数据,key类型string,填充的数据将随want被传输到远端,用于携带一些简单、轻量的数据。 + 分布式数据对象提供了与本地变量类似的操作,实现两个设备的数据同步,当设备1的应用A的分布式数据对象增、删、改数据后,设备2的应用A也可以获取到对应的数据变化,同时还能监听数据变更以及对端数据对象的上下线。用法详见[分布式对象指导文档](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/database/database-distributedobject-guidelines.md)。 + 迁移场景中,分布式对象(distributedDataObject)主要用于将本机内存数据同步到目标设备。 - ```javascript - onContinue(wantParams : {[key: string]: any}) { - console.log("Continue My Data") - wantParams["myData"] = "my1234567"; - return true; - } - ``` - - - 同时在远端判断如果是迁移,可以从want.parameters中取出在发起端保存的自定义数据。 + - 发起端在onContinue中,将待迁移的数据存入分布式对象中,然后设置好session id,并通过wantParams将session id传到远端设备。 - ```javascript - onCreate(want , launchParam) { - if (launchParam.launchReason == LaunchReason.CONTINUATION) { - console.log("onCreate LaunchReason = CONTINUATION",want.parameters["myData"]); // my1234567 - ... - this.context.restoreWindowStage(this.contentStorage); - } + ```javascript + import Ability from '@ohos.application.Ability'; + import distributedObject from '@ohos.data.distributedDataObject'; + + var g_object = distributedObject.createDistributedObject({name:undefined}); + + export default class MainAbility extends Ability { + contentStorage : ContenStorage + sessionId : string; + + onContinue(wantParam : {[key: string]: any}) { + Logger.info("onContinue using distributedObject") + this.sessionId = distributedObject.genSessionId(); + //set distributed data object session id + g_object.setSessionId(this.sessionId); + g_object.name = "Amy"; + // set session id into want params + wantParam["session"] = this.sessionId; + return AbilityConstant.OnContinueResult.AGREE } - ``` + ``` + - 目标设备在onCreate中,取出发起端传过来的session id,建立分布式对象并关联该session id,这样就能实现分布式对象的同步。需要注意的是,在调用restoreWindowStage之前,迁移需要的分布式对象必须全部关联完,保证能够获取到正确的数据。 - -2. 使用分布式对象 - - 使用分布式对象可以传输更多的数据到远端设备,更多用法详见分布式对象接口文档。 - - - 发起端在onContinue中,将待迁移的数据存入分布式对象中,然后设置好session id,并通过wantParams将session id传到远端设备。 - - - - 远端设备在onCreate中,取出发起端传过来的session id,建立分布式对象并关联该session id,这样就能实现分布式对象的同步。需要注意的是,在调用restoreWindowStage之前,迁移需要的分布式对象必须全部关联完,保证能够获取到正确的数据。 - - - * 示例 - ```javascript - import Ability from '@ohos.application.Ability'; - import distributedObject from '@ohos.data.distributedDataObject'; - - var g_object = distributedObject.createDistributedObject({name:undefined}); - - export default class MainAbility extends Ability { - contentStorage : ContenStorage - sessionId : string; - onCreate(want , launchParam) { - if (launchParam.launchReason == 3) { - this.sessionId = want.parameters["session"] // 取出session id - - function statusCallback(sessionId, networkid, status) { - console.info("object status change sessionId: " + sessionId + " status: " + status + - "g_object.name: " + g_object.name); // 回调中可以取到同步过来的分布式对象内容 name = Amy - } - g_object.on("status", statusCallback); // 注册分布式对象同步结果的监听 - - g_object.setSessionId(this.sessionId); // 将本地分布式对象也关联发起端的session id - - this.contentStorage = new ContenStorage(); - this.context.restoreWindowStage(this.contentStorage); - } - } - - onContinue(wantParams : {[key: string]: any}) { - console.log("using distributedObject") - this.sessionId = "654321"; - g_object.setSessionId(this.sessionId); //1 设置分布式对象的session id - g_object.name = "Amy"; // 填入数据 - wantParams["session"] = this.sessionId; // 将session id 通过want传到远端 - return true; - } + import Ability from '@ohos.application.Ability'; + import distributedObject from '@ohos.data.distributedDataObject'; + + var g_object = distributedObject.createDistributedObject({name:undefined}); + + export default class MainAbility extends Ability { + contentStorage : ContentStorage + sessionId : string; + + statusCallback(sessionId, networkid, status) { + Logger.info(`continuation object status change, sessionId: ${sessionId}, status: ${status}, g_object.name: ${g_object.name}`) + } + + onCreate(want, launchParam) { + Logger.info(`MainAbility onCreate ${AbilityConstant.LaunchReason.CONTINUATION}`) + if (launchParam.launchReason == AbilityConstant.LaunchReason.CONTINUATION) { + // get distributed data object session id from want params + this.sessionId = want.parameters.session + Logger.info(`onCreate for continuation sessionId: ${this.sessionId}`) + + g_object.on("status", this.statusCallback); + // set session id, so it will sync data from remote device + g_object.setSessionId(this.sessionId); + + this.contentStorage = new ContentStorage(); + this.context.restoreWindowStage(this.contentStorage); + } + } + } ``` - + - +以上完整的示例见sample diff --git a/zh-cn/application-dev/reference/apis/js-apis-Bundle.md b/zh-cn/application-dev/reference/apis/js-apis-Bundle.md index e042623c8f99ae2f4ae268d3d35513d053e31bc0..aaa75bf9566b287d0bf692e1dc980af75e86de60 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-Bundle.md +++ b/zh-cn/application-dev/reference/apis/js-apis-Bundle.md @@ -15,11 +15,11 @@ SystemCapability.BundleManager.BundleFramework ## 权限列表 -| 权限 | 权限等级 | 描述 | -|-------| --------- | ---- | -| ohos.permission.GET_BUNDLE_INFO | normal | 仅限查询本应用信息 | +| 权限 | 权限等级 | 描述 | +| ---------------------------------------- | ------------ | --------- | +| ohos.permission.GET_BUNDLE_INFO | normal | 仅限查询本应用信息 | | ohos.permission.GET_BUNDLE_INFO_PRIVILEGED | system_basic | 可查询所有应用信息 | -| ohos.permission.INSTALL_BUNDLE | system_core | 可安装、卸载应用 | +| ohos.permission.INSTALL_BUNDLE | system_core | 可安装、卸载应用 | ## bundle.getApplicationInfo @@ -37,16 +37,16 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | ------ | ---- | ------------------------------------------------------------ | -| bundleName | string | 是 | 要查询的应用程序包名称。 | -| bundleFlags | number | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。 | -| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | +| 名称 | 类型 | 必填 | 描述 | +| ----------- | ------ | ---- | --------------------------------------- | +| bundleName | string | 是 | 要查询的应用程序包名称。 | +| bundleFlags | number | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。 | +| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | **返回值:** -| 类型 | 说明 | -| ----------- | -------- | +| 类型 | 说明 | +| ------------------------- | ------------------ | | Promise\ | Promise形式返回应用程序信息。 | **示例:** @@ -81,12 +81,12 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | ------------------------------- | ---- | ------------------------------------------------------------ | -| bundleName | string | 是 | 要查询的应用程序包名称。 | -| bundleFlags | number | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。 | -| userId | number | 是 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | -| callback | AsyncCallback\ | 是 | 程序启动作为入参的回调函数,返回应用程序信息。 | +| 名称 | 类型 | 必填 | 描述 | +| ----------- | ------------------------------- | ---- | --------------------------------------- | +| bundleName | string | 是 | 要查询的应用程序包名称。 | +| bundleFlags | number | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。 | +| userId | number | 是 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | +| callback | AsyncCallback\ | 是 | 程序启动作为入参的回调函数,返回应用程序信息。 | **示例:** @@ -120,11 +120,11 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | ------------------------------- | ---- | ------------------------------------------------------------ | -| bundleName | string | 是 | 要查询的应用程序包名称。 | -| bundleFlags | number | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。 | -| callback | AsyncCallback\ | 是 | 程序启动作为入参的回调函数,返回应用程序信息。 | +| 名称 | 类型 | 必填 | 描述 | +| ----------- | ------------------------------- | ---- | --------------------------------------- | +| bundleName | string | 是 | 要查询的应用程序包名称。 | +| bundleFlags | number | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。 | +| callback | AsyncCallback\ | 是 | 程序启动作为入参的回调函数,返回应用程序信息。 | **示例:** @@ -157,15 +157,15 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ---------- | ---------- | ---- | ----------------------------------------------------------- | -| bundleFlag | BundleFlag | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。 | -| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | +| 名称 | 类型 | 必填 | 描述 | +| ---------- | ---------- | ---- | --------------------------------------- | +| bundleFlag | BundleFlag | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。 | +| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | **返回值:** -| 类型 | 说明 | -| --------------------------- | ----------------------------------- | +| 类型 | 说明 | +| --------------------------- | -------------------------- | | Promise> | Promise形式返回所有可用的BundleInfo | **示例:** @@ -199,10 +199,10 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ---------- | --------------------------------- | ---- | ------------------------------------------------------------ | -| bundleFlag | BundleFlag | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。| -| callback | AsyncCallback> | 是 | 程序启动作为入参的回调函数,返回所有可用的BundleInfo。 | +| 名称 | 类型 | 必填 | 描述 | +| ---------- | --------------------------------- | ---- | --------------------------------------- | +| bundleFlag | BundleFlag | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。 | +| callback | AsyncCallback> | 是 | 程序启动作为入参的回调函数,返回所有可用的BundleInfo。 | **示例:** @@ -234,11 +234,11 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ---------- | --------------------------------- | ---- | ------------------------------------------------------------ | -| bundleFlag | BundleFlag | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。| -| userId | number | 是 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | -| callback | AsyncCallback> | 是 | 程序启动作为入参的回调函数,返回所有可用的BundleInfo。 | +| 名称 | 类型 | 必填 | 描述 | +| ---------- | --------------------------------- | ---- | --------------------------------------- | +| bundleFlag | BundleFlag | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。 | +| userId | number | 是 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | +| callback | AsyncCallback> | 是 | 程序启动作为入参的回调函数,返回所有可用的BundleInfo。 | **示例:** @@ -272,16 +272,16 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | ------ | ---- | ------------------------------------------------------------ | -| bundleName | string | 是 | 包名 | -| bundleFlags | number | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。 | -| options | BundleOptions | 否 | 包含userid。 | +| 名称 | 类型 | 必填 | 描述 | +| ----------- | ------------- | ---- | --------------------------------------- | +| bundleName | string | 是 | 包名 | +| bundleFlags | number | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。 | +| options | BundleOptions | 否 | 包含userid。 | **返回值:** -| 类型 | 说明 | -| -------------------- | ------------------------------------------ | +| 类型 | 说明 | +| -------------------- | ---------------------------- | | Promise\ | 返回值为Promise对象,Promise中包含包信息。 | **示例:** @@ -318,11 +318,11 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | -------------------------- | ---- | ------------------------------------------------------------ | -| bundleName | string | 是 | 包名 | -| bundleFlags | number | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。 | -| callback | AsyncCallback\ | 是 | 程序启动作为入参的回调函数,返回包信息。 | +| 名称 | 类型 | 必填 | 描述 | +| ----------- | -------------------------- | ---- | --------------------------------------- | +| bundleName | string | 是 | 包名 | +| bundleFlags | number | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。 | +| callback | AsyncCallback\ | 是 | 程序启动作为入参的回调函数,返回包信息。 | **示例:** @@ -355,12 +355,12 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | -------------------------- | ---- | ------------------------------------------------------------ | -| bundleName | string | 是 | 包名 | -| bundleFlags | number | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。 | -| options | BundleOptions | 是 | 包含userid。 | -| callback | AsyncCallback\ | 是 | 程序启动作为入参的回调函数,返回包信息。 | +| 名称 | 类型 | 必填 | 描述 | +| ----------- | -------------------------- | ---- | --------------------------------------- | +| bundleName | string | 是 | 包名 | +| bundleFlags | number | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。 | +| options | BundleOptions | 是 | 包含userid。 | +| callback | AsyncCallback\ | 是 | 程序启动作为入参的回调函数,返回包信息。 | **示例:** @@ -396,15 +396,15 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | ------ | ---- | ------------------------------------------------------ | -| bundleFlags | number | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。 | -| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | +| 名称 | 类型 | 必填 | 描述 | +| ----------- | ------ | ---- | --------------------------------------- | +| bundleFlags | number | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。 | +| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | **返回值:** -| 类型 | 说明 | -| -------------------------------- | ------------------------------------------------ | +| 类型 | 说明 | +| -------------------------------- | ------------------------------- | | Promise> | 返回值为Promise对象,Promise中包含应用信息列表。 | **示例:** @@ -438,11 +438,11 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | -------------------------------------- | ---- | ------------------------------------------------------ | -| bundleFlags | number | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。| -| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | -| callback | AsyncCallback> | 是 | 程序启动作为入参的回调函数,返回应用信息列表。 | +| 名称 | 类型 | 必填 | 描述 | +| ----------- | -------------------------------------- | ---- | --------------------------------------- | +| bundleFlags | number | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。 | +| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | +| callback | AsyncCallback> | 是 | 程序启动作为入参的回调函数,返回应用信息列表。 | **示例:** @@ -475,10 +475,10 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | -------------------------------------- | ---- | ------------------------------------------------------ | -| bundleFlags | number | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。| -| callback | AsyncCallback> | 是 | 程序启动作为入参的回调函数,返回应用信息列表。 | +| 名称 | 类型 | 必填 | 描述 | +| ----------- | -------------------------------------- | ---- | --------------------------------------- | +| bundleFlags | number | 是 | 用于指定返回的应用信息对象中包含信息的标记。默认值:0,取值范围:大于等于0。 | +| callback | AsyncCallback> | 是 | 程序启动作为入参的回调函数,返回应用信息列表。 | **示例:** @@ -509,15 +509,15 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | ------ | ---- | -------------------------------------------------------- | -| bundleName | string | 是 | 要查询的应用程序包名称。 | -| abilityName | string | 是 | 表示待查询的Ability名称。 | +| 名称 | 类型 | 必填 | 描述 | +| ----------- | ------ | ---- | ---------------- | +| bundleName | string | 是 | 要查询的应用程序包名称。 | +| abilityName | string | 是 | 表示待查询的Ability名称。 | **返回值:** -| 类型 | 说明 | -| ---------------------------- | ---------------------------- | +| 类型 | 说明 | +| --------------------- | --------------------- | | Promise\ | Promise形式返回Ability信息。 | **示例:** @@ -549,11 +549,11 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | ------ | ---- | --------------------------------------------------------- | -| bundleName | string | 是 | 要查询的应用程序包名称。 | -| abilityName | string | 是 | 表示待查询的Ability名称。 | -| callback | AsyncCallback\ | 是 | 程序启动作为入参的回调函数,返回Ability信息。| +| 名称 | 类型 | 必填 | 描述 | +| ----------- | --------------------------- | ---- | -------------------------- | +| bundleName | string | 是 | 要查询的应用程序包名称。 | +| abilityName | string | 是 | 表示待查询的Ability名称。 | +| callback | AsyncCallback\ | 是 | 程序启动作为入参的回调函数,返回Ability信息。 | **示例:** @@ -585,15 +585,15 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | ------ | ---- | -------------------------------------------------------- | -| bundleName | string | 是 | 要查询的应用程序包名称。 | -| abilityName | string | 是 | 表示待查询的Ability名称。 | +| 名称 | 类型 | 必填 | 描述 | +| ----------- | ------ | ---- | ---------------- | +| bundleName | string | 是 | 要查询的应用程序包名称。 | +| abilityName | string | 是 | 表示待查询的Ability名称。 | **返回值:** -| 类型 | 说明 | -| ---------------------------- | ---------------------------- | +| 类型 | 说明 | +| ---------------- | ------------------ | | Promise\ | Promise形式返回应用名称信息。 | **示例:** @@ -625,11 +625,11 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | ------ | ---- | --------------------------------------------------------- | -| bundleName | string | 是 | 要查询的应用程序包名称。 | -| abilityName | string | 是 | 表示待查询的Ability名称。 | -| callback | AsyncCallback\ | 是 | 返回应用名称信息。| +| 名称 | 类型 | 必填 | 描述 | +| ----------- | ---------------------- | ---- | ---------------- | +| bundleName | string | 是 | 要查询的应用程序包名称。 | +| abilityName | string | 是 | 表示待查询的Ability名称。 | +| callback | AsyncCallback\ | 是 | 返回应用名称信息。 | **示例:** @@ -661,14 +661,14 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | ------ | ---- | ------------ | -| info | AbilityInfo | 是 | Ability的配置信息 | +| 名称 | 类型 | 必填 | 描述 | +| ---- | ----------- | ---- | ------------ | +| info | AbilityInfo | 是 | Ability的配置信息 | **返回值:** -| 类型 | 说明 | -| ---------------------------- | ------------------------| +| 类型 | 说明 | +| ----------------- | ------------------------- | | Promise\ | Promise形式返回boolean代表是否启用。 | **示例:** @@ -702,10 +702,10 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | ------ | ---- | --------------------------------------------------------- | -| info | AbilityInfo | 是 | Ability的配置信息 | -| callback | AsyncCallback\ | 是 | 返回boolean代表是否启用 | +| 名称 | 类型 | 必填 | 描述 | +| -------- | ----------------------- | ---- | --------------- | +| info | AbilityInfo | 是 | Ability的配置信息 | +| callback | AsyncCallback\ | 是 | 返回boolean代表是否启用 | **示例:** @@ -739,14 +739,14 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | ------ | ---- | -------------------------------------------------------- | -| bundleName | string | 是 | 要查询的应用程序包名称。 | +| 名称 | 类型 | 必填 | 描述 | +| ---------- | ------ | ---- | ------------ | +| bundleName | string | 是 | 要查询的应用程序包名称。 | **返回值:** -| 类型 | 说明 | -| ---------------------------- | ------------------------| +| 类型 | 说明 | +| ----------------- | ------------------------- | | Promise\ | Promise形式返回boolean代表是否启用。 | **示例:** @@ -777,15 +777,15 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | ------ | ---- | --------------------------------------------------------- | -| bundleName | string | 是 | 要查询的应用程序包名称。 | -| callback | AsyncCallback\ | 是 | 返回boolean代表是否启用 | +| 名称 | 类型 | 必填 | 描述 | +| ---------- | ----------------------- | ---- | --------------- | +| bundleName | string | 是 | 要查询的应用程序包名称。 | +| callback | AsyncCallback\ | 是 | 返回boolean代表是否启用 | **示例:** ```js -let bundleName : "com.example.myapplication"; +let bundleName = "com.example.myapplication"; bundle.isApplicationEnabled(bundleName, (err, data) => { if (err) { console.error('Operation failed. Cause: ' + JSON.stringify(err)); @@ -811,16 +811,16 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | ------ | ---- | ------------------------------------------------------------ | -| want | Want | 是 | 包含要查询的应用程序包名称的意图。 | -| bundleFlags | number | 是 | 用于指定返回abilityInfo信息。默认值:0,取值范围:大于等于0。 | -| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0 | +| 名称 | 类型 | 必填 | 描述 | +| ----------- | ------ | ---- | ------------------------------------- | +| want | Want | 是 | 包含要查询的应用程序包名称的意图。 | +| bundleFlags | number | 是 | 用于指定返回abilityInfo信息。默认值:0,取值范围:大于等于0。 | +| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0 | **返回值:** -| 类型 | 说明 | -| ---------------------------- | ---------------------------- | +| 类型 | 说明 | +| ---------------------------- | --------------------- | | Promise> | Promise形式返回Ability信息。 | **示例:** @@ -854,12 +854,12 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | ---------------------------------- | ---- | ------------------------------------------------------------ | -| want | Want | 是 | 指示包含要查询的应用程序包名称的意图。 | -| bundleFlags | number | 是 | 用于指定返回abilityInfo信息。默认值:0,取值范围:大于等于0。 | -| userId | number | 是 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0 | -| callback | AsyncCallback> | 是 | 程序启动作为入参的回调函数,返回Ability信息。 | +| 名称 | 类型 | 必填 | 描述 | +| ----------- | ---------------------------------- | ---- | ------------------------------------- | +| want | Want | 是 | 指示包含要查询的应用程序包名称的意图。 | +| bundleFlags | number | 是 | 用于指定返回abilityInfo信息。默认值:0,取值范围:大于等于0。 | +| userId | number | 是 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0 | +| callback | AsyncCallback> | 是 | 程序启动作为入参的回调函数,返回Ability信息。 | **示例:** @@ -891,11 +891,11 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | ---------------------------------- | ---- | ------------------------------------------------------------ | -| want | Want | 是 | 指示包含要查询的应用程序包名称的意图。 | -| bundleFlags | number | 是 | 用于指定返回abilityInfo信息。默认值:0,取值范围:大于等于0。 | -| callback | AsyncCallback> | 是 | 程序启动作为入参的回调函数,返回Ability信息。 | +| 名称 | 类型 | 必填 | 描述 | +| ----------- | ---------------------------------- | ---- | ------------------------------------- | +| want | Want | 是 | 指示包含要查询的应用程序包名称的意图。 | +| bundleFlags | number | 是 | 用于指定返回abilityInfo信息。默认值:0,取值范围:大于等于0。 | +| callback | AsyncCallback> | 是 | 程序启动作为入参的回调函数,返回Ability信息。 | **示例:** @@ -932,13 +932,13 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ---------- | ------ | ---- | -------- | -| bundleName | string | 是 | 要查询的应用程序包名称。 | +| 名称 | 类型 | 必填 | 描述 | +| ---------- | ------ | ---- | ------------ | +| bundleName | string | 是 | 要查询的应用程序包名称。 | **返回值:** -| 类型 | 说明 | -| --------------------- | ------------------------------------------------------------ | +| 类型 | 说明 | +| -------------- | -------------------------------------- | | Promise\ | 返回值为Promise对象,Promise中包含拉起指定应用的Want对象。 | **示例:** @@ -969,10 +969,10 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ---------- | ------ | ---- | -------- | -| bundleName | string | 是 | 要查询的应用程序包名称。 | -| callback | AsyncCallback\ | 是 | 程序启动作为入参的回调函数,返回拉起指定应用的want对象。 | +| 名称 | 类型 | 必填 | 描述 | +| ---------- | -------------------- | ---- | ------------------------------ | +| bundleName | string | 是 | 要查询的应用程序包名称。 | +| callback | AsyncCallback\ | 是 | 程序启动作为入参的回调函数,返回拉起指定应用的want对象。 | **示例:** @@ -1000,13 +1000,13 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ---------- | ------ | ---- | -------- | -| uid | number | 是 | 要查询的uid。 | +| 名称 | 类型 | 必填 | 描述 | +| ---- | ------ | ---- | -------- | +| uid | number | 是 | 要查询的uid。 | **返回值:** -| 类型 | 说明 | -| --------------------- | ------------------------------------------------------------ | +| 类型 | 说明 | +| ---------------- | --------------------------------- | | Promise\ | 返回值为Promise对象,Promise中包含指定uid的包名。 | **示例:** @@ -1033,10 +1033,10 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ---------- | ------ | ---- | -------- | -| uid | number | 是 | 要查询的uid。 | -| callback | AsyncCallback\ | 是 | 程序启动作为入参的回调函数,返回指定uid的包名。 | +| 名称 | 类型 | 必填 | 描述 | +| -------- | ---------------------- | ---- | ------------------------- | +| uid | number | 是 | 要查询的uid。 | +| callback | AsyncCallback\ | 是 | 程序启动作为入参的回调函数,返回指定uid的包名。 | **示例:** @@ -1144,16 +1144,16 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | ------ | ---- | ------------------------------------------------------------ | -| want | Want | 是 | 包含要查询的应用程序包名称的意图。 | -| extensionFlags | number | 是 | 用于指定返回ExtensionAbilityInfo信息。默认值:0,取值范围:大于等于0。 | -| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0 | +| 名称 | 类型 | 必填 | 描述 | +| -------------- | ------ | ---- | ---------------------------------------- | +| want | Want | 是 | 包含要查询的应用程序包名称的意图。 | +| extensionFlags | number | 是 | 用于指定返回ExtensionAbilityInfo信息。默认值:0,取值范围:大于等于0。 | +| userId | number | 否 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0 | **返回值:** -| 类型 | 说明 | -| ---------------------------- | ---------------------------- | +| 类型 | 说明 | +| ------------------------------------- | ------------------------------ | | Promise> | Promise形式返回ExtensionAbility信息。 | **示例:** @@ -1191,12 +1191,12 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | ---------------------------------- | ---- | ------------------------------------------------------------ | -| want | Want | 是 | 指示包含要查询的应用程序包名称的意图。 | -| extensionFlags | number | 是 | 用于指定返回ExtensionAbilityInfo信息。默认值:0,取值范围:枚举值,大于等于0。 | -| userId | number | 是 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0 | -| callback | AsyncCallback> | 是 | 程序启动作为入参的回调函数,返回ExtensionAbility信息。 | +| 名称 | 类型 | 必填 | 描述 | +| -------------- | ---------------------------------------- | ---- | ---------------------------------------- | +| want | Want | 是 | 指示包含要查询的应用程序包名称的意图。 | +| extensionFlags | number | 是 | 用于指定返回ExtensionAbilityInfo信息。默认值:0,取值范围:枚举值,大于等于0。 | +| userId | number | 是 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0 | +| callback | AsyncCallback> | 是 | 程序启动作为入参的回调函数,返回ExtensionAbility信息。 | **示例:** @@ -1232,11 +1232,11 @@ SystemCapability.BundleManager.BundleFramework **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ----------- | ---------------------------------- | ---- | ------------------------------------------------------------ | -| want | Want | 是 | 指示包含要查询的应用程序包名称的意图。 | -| extensionFlags | number | 是 | 用于指定返回ExtensionAbilityInfo信息。默认值:0,取值范围:大于等于0。 | -| callback | AsyncCallback> | 是 | 程序启动作为入参的回调函数,返回ExtensionAbility信息。 | +| 名称 | 类型 | 必填 | 描述 | +| -------------- | ---------------------------------------- | ---- | ---------------------------------------- | +| want | Want | 是 | 指示包含要查询的应用程序包名称的意图。 | +| extensionFlags | number | 是 | 用于指定返回ExtensionAbilityInfo信息。默认值:0,取值范围:大于等于0。 | +| callback | AsyncCallback> | 是 | 程序启动作为入参的回调函数,返回ExtensionAbility信息。 | **示例:** @@ -1259,40 +1259,40 @@ bundle.queryExtensionAbilityInfosByWant(want, extensionFlags, (err, data) => { **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework -| 名称 | 读写属性 | 类型 | 必填 | 描述 | -| ----------- | -------- | ------ | ---- | ------------------------------------------------------------ | -| deviceId | 只读 | string | 否 | 表示运行指定Ability的设备ID。 | -| bundleName | 只读 | string | 是 | 表示包描述。如果在Want中同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。 | -| abilityName | 只读 | string | 是 | 表示待启动的Ability名称。如果在Want中同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。 | -| uri | 只读 | string | 否 | 资源标识符。 | -| shortName | 只读 | string | 否 | ElementName的简名。 | +| 名称 | 读写属性 | 类型 | 必填 | 描述 | +| ----------- | ---- | ------ | ---- | ---------------------------------------- | +| deviceId | 只读 | string | 否 | 表示运行指定Ability的设备ID。 | +| bundleName | 只读 | string | 是 | 表示包描述。如果在Want中同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。 | +| abilityName | 只读 | string | 是 | 表示待启动的Ability名称。如果在Want中同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。 | +| uri | 只读 | string | 否 | 资源标识符。 | +| shortName | 只读 | string | 否 | ElementName的简名。 | ## InstallErrorCode **系统能力:** SystemCapability.BundleManager.BundleFramework -| 名称 | 默认值 | 说明 | -| ------ | ------ | ------ | -| SUCCESS | 0 | 安装成功 | -| STATUS_INSTALL_FAILURE | 1 | 安装失败(不存在安装的应用) | -| STATUS_INSTALL_FAILURE_ABORTED | 2 | 安装中止 | -| STATUS_INSTALL_FAILURE_INVALID | 3 | 安装参数无效 | -| STATUS_INSTALL_FAILURE_CONFLICT | 4 | 安装冲突 (常见于升级和已有应用基本信息不一致) | -| STATUS_INSTALL_FAILURE_STORAGE | 5 | 存储包信息失败 | -| STATUS_INSTALL_FAILURE_INCOMPATIBLE | 6 | 安装不兼容(常见于版本降级安装或者签名信息错误) | -| STATUS_UNINSTALL_FAILURE | 7 | 卸载失败 (不存在卸载的应用) | -| STATUS_UNINSTALL_FAILURE_BLOCKED | 8 | 卸载中止 (没有使用) | -| STATUS_UNINSTALL_FAILURE_ABORTED | 9 | 卸载中止 (参数无效导致) | -| STATUS_UNINSTALL_FAILURE_CONFLICT | 10 | 卸载冲突 (卸载系统应用失败, 结束应用进程失败) | -| STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT | 0x0B | 安装失败 (下载超时) | -| STATUS_INSTALL_FAILURE_DOWNLOAD_FAILED | 0x0C | 安装失败 (下载失败) | -| STATUS_RECOVER_FAILURE_INVALID8+ | 0x0D | 恢复预置应用失败 | -| STATUS_ABILITY_NOT_FOUND | 0x40 | Ability未找到 | -| STATUS_BMS_SERVICE_ERROR | 0x41 | BMS服务错误 | -| STATUS_FAILED_NO_SPACE_LEFT8+ | 0x42 | 设备空间不足 | -| STATUS_GRANT_REQUEST_PERMISSIONS_FAILED8+ | 0x43 | 应用授权失败 | -| STATUS_INSTALL_PERMISSION_DENIED8+ | 0x44 | 安装权限拒绝 | -| STATUS_UNINSTALL_PERMISSION_DENIED8+ | 0x45 | 卸载权限拒绝 | +| 名称 | 默认值 | 说明 | +| ---------------------------------------- | ---- | ------------------------- | +| SUCCESS | 0 | 安装成功 | +| STATUS_INSTALL_FAILURE | 1 | 安装失败(不存在安装的应用) | +| STATUS_INSTALL_FAILURE_ABORTED | 2 | 安装中止 | +| STATUS_INSTALL_FAILURE_INVALID | 3 | 安装参数无效 | +| STATUS_INSTALL_FAILURE_CONFLICT | 4 | 安装冲突 (常见于升级和已有应用基本信息不一致) | +| STATUS_INSTALL_FAILURE_STORAGE | 5 | 存储包信息失败 | +| STATUS_INSTALL_FAILURE_INCOMPATIBLE | 6 | 安装不兼容(常见于版本降级安装或者签名信息错误) | +| STATUS_UNINSTALL_FAILURE | 7 | 卸载失败 (不存在卸载的应用) | +| STATUS_UNINSTALL_FAILURE_BLOCKED | 8 | 卸载中止 (没有使用) | +| STATUS_UNINSTALL_FAILURE_ABORTED | 9 | 卸载中止 (参数无效导致) | +| STATUS_UNINSTALL_FAILURE_CONFLICT | 10 | 卸载冲突 (卸载系统应用失败, 结束应用进程失败) | +| STATUS_INSTALL_FAILURE_DOWNLOAD_TIMEOUT | 0x0B | 安装失败 (下载超时) | +| STATUS_INSTALL_FAILURE_DOWNLOAD_FAILED | 0x0C | 安装失败 (下载失败) | +| STATUS_RECOVER_FAILURE_INVALID8+ | 0x0D | 恢复预置应用失败 | +| STATUS_ABILITY_NOT_FOUND | 0x40 | Ability未找到 | +| STATUS_BMS_SERVICE_ERROR | 0x41 | BMS服务错误 | +| STATUS_FAILED_NO_SPACE_LEFT8+ | 0x42 | 设备空间不足 | +| STATUS_GRANT_REQUEST_PERMISSIONS_FAILED8+ | 0x43 | 应用授权失败 | +| STATUS_INSTALL_PERMISSION_DENIED8+ | 0x44 | 安装权限拒绝 | +| STATUS_UNINSTALL_PERMISSION_DENIED8+ | 0x45 | 卸载权限拒绝 | ## BundleFlag @@ -1300,21 +1300,21 @@ bundle.queryExtensionAbilityInfosByWant(want, extensionFlags, (err, data) => { **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework -| 名称 | 默认值 | 说明 | -| ------ | ------ | ------ | -| GET_BUNDLE_DEFAULT | 0x00000000 | 获取默认的应用信息 | -| GET_BUNDLE_WITH_ABILITIES | 0x00000001 | 获取包括Ability信息的包信息 | -| GET_ABILITY_INFO_WITH_PERMISSION | 0x00000002 | 获取包括权限的Ability信息 | -| GET_ABILITY_INFO_WITH_APPLICATION | 0x00000004 | 获取包括应用的Ability信息 | -| GET_APPLICATION_INFO_WITH_PERMISSION | 0x00000008 | 获取包括权限的应用信息 | -| GET_BUNDLE_WITH_REQUESTED_PERMISSION | 0x00000010 | 获取包括所需权限的包信息 | -| GET_ABILITY_INFO_WITH_METADATA8+ | 0x00000020 | 获取ability的元数据信息 | +| 名称 | 默认值 | 说明 | +| ---------------------------------------- | ---------- | ------------------- | +| GET_BUNDLE_DEFAULT | 0x00000000 | 获取默认的应用信息 | +| GET_BUNDLE_WITH_ABILITIES | 0x00000001 | 获取包括Ability信息的包信息 | +| GET_ABILITY_INFO_WITH_PERMISSION | 0x00000002 | 获取包括权限的Ability信息 | +| GET_ABILITY_INFO_WITH_APPLICATION | 0x00000004 | 获取包括应用的Ability信息 | +| GET_APPLICATION_INFO_WITH_PERMISSION | 0x00000008 | 获取包括权限的应用信息 | +| GET_BUNDLE_WITH_REQUESTED_PERMISSION | 0x00000010 | 获取包括所需权限的包信息 | +| GET_ABILITY_INFO_WITH_METADATA8+ | 0x00000020 | 获取ability的元数据信息 | | GET_BUNDLE_WITH_EXTENSION_ABILITY9+ | 0x00000020 | 获取包括Ability信息的扩展包信息 | -| GET_APPLICATION_INFO_WITH_METADATA8+ | 0x00000040 | 获取应用的元数据信息 | +| GET_APPLICATION_INFO_WITH_METADATA8+ | 0x00000040 | 获取应用的元数据信息 | | GET_ABILITY_INFO_SYSTEMAPP_ONLY8+ | 0x00000080 | 获取仅包括系统应用的ability信息 | -| GET_ABILITY_INFO_WITH_DISABLE8+ | 0x00000100 | 获取包括被禁用的ability信息 | -| GET_APPLICATION_INFO_WITH_DISABLE8+ | 0x00000200 | 获取包括被禁用的应用信息 | -| GET_ALL_APPLICATION_INFO | 0xFFFF0000 | 获取应用所有的信息 | +| GET_ABILITY_INFO_WITH_DISABLE8+ | 0x00000100 | 获取包括被禁用的ability信息 | +| GET_APPLICATION_INFO_WITH_DISABLE8+ | 0x00000200 | 获取包括被禁用的应用信息 | +| GET_ALL_APPLICATION_INFO | 0xFFFF0000 | 获取应用所有的信息 | ## BundleOptions @@ -1322,9 +1322,9 @@ bundle.queryExtensionAbilityInfosByWant(want, extensionFlags, (err, data) => { **系统能力:** SystemCapability.BundleManager.BundleFramework -| 名称 | 类型 | 可读 | 可写 | 说明 | -| ------ | ------ | ------ | ------ | ------ | -| userId | number | 是 | 是 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | +| 名称 | 类型 | 可读 | 可写 | 说明 | +| ------ | ------ | ---- | ---- | ---------------------------- | +| userId | number | 是 | 是 | 用户ID。默认值:调用方所在用户,取值范围:大于等于0。 | ## BundleInfo @@ -1332,32 +1332,32 @@ bundle.queryExtensionAbilityInfosByWant(want, extensionFlags, (err, data) => { **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework -| 名称 | 类型 | 可读 | 可写 | 说明 | -| ------ | ------ | ------ | ------ | ------ | -| name | string | 是 | 否 | 应用包的名称 | -| type | string | 是 | 否 | 应用包类型 | -| appId | string | 是 | 否 | 应用包里应用程序的id | -| uid | number | 是 | 否 | 应用包里应用程序的uid | -| installTime | number | 是 | 否 | HAP包安装时间 | -| updateTime | number | 是 | 否 | HAP包更新时间 | -| appInfo | ApplicationInfo | 是 | 否 | 应用程序的配置信息 | -| abilityInfos | Array\ | 是 | 否 | Ability的配置信息 | -| reqPermissions | Array\ | 是 | 否 | 应用运行时需向系统申请的权限集合 | -| reqPermissionDetails | Array\ | 是 | 否 | 应用运行时需向系统申请的权限集合的详细信息 | -| vendor | string | 是 | 否 | 应用包的供应商 | -| versionCode | number | 是 | 否 | 应用包的版本号 | -| versionName | string | 是 | 否 | 应用包的版本文本描述信息 | -| compatibleVersion | number | 是 | 否 | 运行应用包所需要最低的SDK版本号 | -| targetVersion | number | 是 | 否 | 运行应用包所需要最高SDK版本号 | -| isCompressNativeLibs | boolean | 是 | 否 | 是否压缩应用包的本地库,默认为true | -| hapModuleInfos | Array\ | 是 | 否 | 模块的配置信息 | -| entryModuleName | string | 是 | 否 | Entry的模块名称 | -| cpuAbi | string | 是 | 否 | 应用包的cpuAbi信息 | -| isSilentInstallation | string | 是 | 否 | 是否通过静默安装 | -| minCompatibleVersionCode | number | 是 | 否 | 分布式场景下的应用包兼容的最低版本 | -| entryInstallationFree | boolean | 是 | 否 | Entry是否支持免安装 | -| reqPermissionStates8+ | Array\ | 是 | 否 | 申请权限的授予状态 | -| extensionAbilityInfo9+ | Array\ | 是 | 否 | ability的可扩展信息 | +| 名称 | 类型 | 可读 | 可写 | 说明 | +| --------------------------------- | ---------------------------- | ---- | ---- | --------------------- | +| name | string | 是 | 否 | 应用包的名称 | +| type | string | 是 | 否 | 应用包类型 | +| appId | string | 是 | 否 | 应用包里应用程序的id | +| uid | number | 是 | 否 | 应用包里应用程序的uid | +| installTime | number | 是 | 否 | HAP包安装时间 | +| updateTime | number | 是 | 否 | HAP包更新时间 | +| appInfo | ApplicationInfo | 是 | 否 | 应用程序的配置信息 | +| abilityInfos | Array\ | 是 | 否 | Ability的配置信息 | +| reqPermissions | Array\ | 是 | 否 | 应用运行时需向系统申请的权限集合 | +| reqPermissionDetails | Array\ | 是 | 否 | 应用运行时需向系统申请的权限集合的详细信息 | +| vendor | string | 是 | 否 | 应用包的供应商 | +| versionCode | number | 是 | 否 | 应用包的版本号 | +| versionName | string | 是 | 否 | 应用包的版本文本描述信息 | +| compatibleVersion | number | 是 | 否 | 运行应用包所需要最低的SDK版本号 | +| targetVersion | number | 是 | 否 | 运行应用包所需要最高SDK版本号 | +| isCompressNativeLibs | boolean | 是 | 否 | 是否压缩应用包的本地库,默认为true | +| hapModuleInfos | Array\ | 是 | 否 | 模块的配置信息 | +| entryModuleName | string | 是 | 否 | Entry的模块名称 | +| cpuAbi | string | 是 | 否 | 应用包的cpuAbi信息 | +| isSilentInstallation | string | 是 | 否 | 是否通过静默安装 | +| minCompatibleVersionCode | number | 是 | 否 | 分布式场景下的应用包兼容的最低版本 | +| entryInstallationFree | boolean | 是 | 否 | Entry是否支持免安装 | +| reqPermissionStates8+ | Array\ | 是 | 否 | 申请权限的授予状态 | +| extensionAbilityInfo9+ | Array\ | 是 | 否 | ability的可扩展信息 | ## ApplicationInfo @@ -1396,10 +1396,10 @@ bundle.queryExtensionAbilityInfosByWant(want, extensionFlags, (err, data) => { **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework -| 名称 | 类型 | 可读 | 可写 | 说明 | -| ------ | ------ | ------ | ------ | ------ | -| moduleName | string | 是 | 否 | 模块名称 | -| moduleSourceDir | string | 是 | 否 | 安装目录 | +| 名称 | 类型 | 可读 | 可写 | 说明 | +| --------------- | ------ | ---- | ---- | ---- | +| moduleName | string | 是 | 否 | 模块名称 | +| moduleSourceDir | string | 是 | 否 | 安装目录 | ## CustomizeData @@ -1407,11 +1407,11 @@ bundle.queryExtensionAbilityInfosByWant(want, extensionFlags, (err, data) => { **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework -| 名称 | 类型 | 可读 | 可写 | 说明 | -| ----- | ------ | ---- | ---- | ---------------- | -| name | string | 是 | 是 | 自定义元数据名称 | -| value | string | 是 | 是 | 自定义元数据值 | -| extra8+ | string | 是 | 是 | 自定义资源 | +| 名称 | 类型 | 可读 | 可写 | 说明 | +| ------------------ | ------ | ---- | ---- | -------- | +| name | string | 是 | 是 | 自定义元数据名称 | +| value | string | 是 | 是 | 自定义元数据值 | +| extra8+ | string | 是 | 是 | 自定义资源 | ## HapModuleInfo @@ -1447,11 +1447,11 @@ Hap模块信息 **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework -| 名称 | 类型 | 可读 | 可写 | 说明 | -| ------ | ------ | ------ | ------ | ------ | -| name | string | 是 | 是 | 需要使用的权限名称 | -| reason | string | 是 | 是 | 描述申请权限的原因 | -| usedScene | UsedScene | 是 | 是 | 权限使用的场景和时机 | +| 名称 | 类型 | 可读 | 可写 | 说明 | +| --------- | --------- | ---- | ---- | ---------- | +| name | string | 是 | 是 | 需要使用的权限名称 | +| reason | string | 是 | 是 | 描述申请权限的原因 | +| usedScene | UsedScene | 是 | 是 | 权限使用的场景和时机 | ## UsedScene @@ -1459,10 +1459,10 @@ Hap模块信息 **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework -| 名称 | 类型 | 可读 | 可写 | 说明 | -| ------ | ------ | ------ | ------ | ------ | -| abilities | Array\ | 是 | 是 | 使用到该权限的Ability集合 | -| when | string | 是 | 是 | 使用该权限的时机 | +| 名称 | 类型 | 可读 | 可写 | 说明 | +| --------- | -------------- | ---- | ---- | ---------------- | +| abilities | Array\ | 是 | 是 | 使用到该权限的Ability集合 | +| when | string | 是 | 是 | 使用该权限的时机 | ## AbilityInfo @@ -1471,36 +1471,36 @@ Ability信息 **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework -| 名称 | 类型 | 可读 | 可写 | 说明 | -| ------ | ------ | ------ | ------ | ------ | -| bundleName | string | 是 | 否 | 应用包名 | -| name | string | 是 | 否 | Ability名称 | -| label | string | 是 | 否 | Ability对用户显示的名称 | -| description | string | 是 | 否 | Ability的描述 | -| icon | string | 是 | 否 | Ability的图标资源文件索引 | -| descriptionId | number | 是 | 否 | Ability的描述id | -| iconId | number | 是 | 否 | Ability的图标id | -| moduleName | string | 是 | 否 | Ability所属的HAP包的名称 | -| process | string | 是 | 否 | Ability的进程,如果不设置,默认为包的名称 | -| targetAbility | string | 是 | 否 | 当前Ability重用的目标Ability | -| backgroundModes | number | 是 | 否 | 表示后台服务的类型 | -| isVisible | boolean | 是 | 否 | 判断Ability是否可以被其他应用调用 | -| formEnabled | boolean | 是 | 否 | 判断Ability是否提供卡片能力 | -| type | AbilityType | 是 | 否 | Ability类型 | -| orientation | DisplayOrientation | 是 | 否 | Ability的显示模式 | -| launchMode | LaunchMode | 是 | 否 | Ability的启动模式 | -| permissions | Array\ | 是 | 否 | 被其他应用Ability调用时需要申请的权限集合 | -| deviceTypes | Array\ | 是 | 否 | Ability支持的设备类型 | -| deviceCapabilities | Array\ | 是 | 否 | Ability需要的设备能力 | -| readPermission | string | 是 | 否 | 读取Ability数据所需的权限 | -| writePermission | string | 是 | 否 | 向Ability写数据所需的权限 | -| applicationInfo | ApplicationInfo | 是 | 否 | 应用程序的配置信息 | -| uri | string | 是 | 否 | 获取Ability的统一资源标识符(URI) | -| labelId | number | 是 | 否 | Ability的标签id | -| subType | AbilitySubType | 是 | 否 | Ability中枚举使用的模板的子类型 | -| metaData8+ | Array\ | 是 | 否 | ability的自定义信息 | -| metaData9+ | Array\ | 是 | 否 | ability的元信息 | -| enabled8+ | boolean | 是 | 否 | ability是否可用 | +| 名称 | 类型 | 可读 | 可写 | 说明 | +| --------------------- | --------------------- | ---- | ---- | ------------------------ | +| bundleName | string | 是 | 否 | 应用包名 | +| name | string | 是 | 否 | Ability名称 | +| label | string | 是 | 否 | Ability对用户显示的名称 | +| description | string | 是 | 否 | Ability的描述 | +| icon | string | 是 | 否 | Ability的图标资源文件索引 | +| descriptionId | number | 是 | 否 | Ability的描述id | +| iconId | number | 是 | 否 | Ability的图标id | +| moduleName | string | 是 | 否 | Ability所属的HAP包的名称 | +| process | string | 是 | 否 | Ability的进程,如果不设置,默认为包的名称 | +| targetAbility | string | 是 | 否 | 当前Ability重用的目标Ability | +| backgroundModes | number | 是 | 否 | 表示后台服务的类型 | +| isVisible | boolean | 是 | 否 | 判断Ability是否可以被其他应用调用 | +| formEnabled | boolean | 是 | 否 | 判断Ability是否提供卡片能力 | +| type | AbilityType | 是 | 否 | Ability类型 | +| orientation | DisplayOrientation | 是 | 否 | Ability的显示模式 | +| launchMode | LaunchMode | 是 | 否 | Ability的启动模式 | +| permissions | Array\ | 是 | 否 | 被其他应用Ability调用时需要申请的权限集合 | +| deviceTypes | Array\ | 是 | 否 | Ability支持的设备类型 | +| deviceCapabilities | Array\ | 是 | 否 | Ability需要的设备能力 | +| readPermission | string | 是 | 否 | 读取Ability数据所需的权限 | +| writePermission | string | 是 | 否 | 向Ability写数据所需的权限 | +| applicationInfo | ApplicationInfo | 是 | 否 | 应用程序的配置信息 | +| uri | string | 是 | 否 | 获取Ability的统一资源标识符(URI) | +| labelId | number | 是 | 否 | Ability的标签id | +| subType | AbilitySubType | 是 | 否 | Ability中枚举使用的模板的子类型 | +| metaData8+ | Array\ | 是 | 否 | ability的自定义信息 | +| metaData9+ | Array\ | 是 | 否 | ability的元信息 | +| enabled8+ | boolean | 是 | 否 | ability是否可用 | ## AbilityType @@ -1508,12 +1508,12 @@ Ability类型 **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework -| 名称 | 类型 | 说明 | -| ------- | ---- | --------------------------- | -| UNKNOWN | 无 | 未知Ability类型 | -| PAGE | 无 | Ability有一个UI界面 | -| SERVICE | 无 | Ability没有UI界面 | -| DATA | 无 | Ability用于提供数据访问服务 | +| 名称 | 类型 | 说明 | +| ------- | ---- | ----------------- | +| UNKNOWN | 无 | 未知Ability类型 | +| PAGE | 无 | Ability有一个UI界面 | +| SERVICE | 无 | Ability没有UI界面 | +| DATA | 无 | Ability用于提供数据访问服务 | ## DisplayOrientation @@ -1521,12 +1521,12 @@ Ability类型 **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework -| 名称 | 类型 | 说明 | -| ------------- | ---- | ------------------------ | -| UNSPECIFIED | 无 | 屏幕方向--不指定 | -| LANDSCAPE | 无 | 屏幕方向--横屏 | -| PORTRAIT | 无 | 屏幕方向--竖屏 | -| FOLLOW_RECENT | 无 | 屏幕方向--紧跟上一个组件 | +| 名称 | 类型 | 说明 | +| ------------- | ---- | ------------- | +| UNSPECIFIED | 无 | 屏幕方向--不指定 | +| LANDSCAPE | 无 | 屏幕方向--横屏 | +| PORTRAIT | 无 | 屏幕方向--竖屏 | +| FOLLOW_RECENT | 无 | 屏幕方向--紧跟上一个组件 | ## LaunchMode @@ -1534,10 +1534,10 @@ Ability类型 **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework -| 名称 | 类型 | 说明 | -| ----------- | ---- | ------------------- | -| SINGLETON | 0 | Ability只有一个示例 | -| STANDARD | 1 | Ability有多个示例 | +| 名称 | 类型 | 说明 | +| --------- | ---- | ------------- | +| SINGLETON | 0 | Ability只有一个示例 | +| STANDARD | 1 | Ability有多个示例 | ## AbilitySubType @@ -1545,9 +1545,9 @@ Ability的子类型 **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework -| 名称 | 类型 | 说明 | -| ----------- | ---- | ----------------------------- | -| UNSPECIFIED | 0 | 未定义Ability子类型 | +| 名称 | 类型 | 说明 | +| ----------- | ---- | -------------------- | +| UNSPECIFIED | 0 | 未定义Ability子类型 | | CA | 1 | Ability子类型是带有 UI 的服务 | @@ -1557,18 +1557,18 @@ ExtensionAbility的类型 **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework -| 名称 | 类型 | 说明 | -| -------------------- | ---- | ----------------------------- | -| FORM9+ | 0 | ExtensionAbility的类型包括卡片 | +| 名称 | 类型 | 说明 | +| ------------------------------ | ---- | ------------------------- | +| FORM9+ | 0 | ExtensionAbility的类型包括卡片 | | WORK_SCHEDULER9+ | 1 | ExtensionAbility的类型包括行程安排 | -| INPUT_METHOD9+ | 2 | ExtensionAbility的类型包括输入法 | -| SERVICE9+ | 3 | ExtensionAbility的类型包括服务 | -| ACCESSIBILITY9+ | 4 | ExtensionAbility的类型包括无障碍 | -| DATA_SHARE9+ | 5 | ExtensionAbility的类型包括数据共享 | -| FILE_SHARE9+ | 6 | ExtensionAbility的类型包括文件共享 | -| STATIC_SUBSCRIBER9+ | 7 | ExtensionAbility的类型包括订阅者 | -| WALLPAPER9+ | 8 | ExtensionAbility的类型包括墙纸 | -| UNSPECIFIED9+ | 9 | ExtensionAbility未指定类型 | +| INPUT_METHOD9+ | 2 | ExtensionAbility的类型包括输入法 | +| SERVICE9+ | 3 | ExtensionAbility的类型包括服务 | +| ACCESSIBILITY9+ | 4 | ExtensionAbility的类型包括无障碍 | +| DATA_SHARE9+ | 5 | ExtensionAbility的类型包括数据共享 | +| FILE_SHARE9+ | 6 | ExtensionAbility的类型包括文件共享 | +| STATIC_SUBSCRIBER9+ | 7 | ExtensionAbility的类型包括订阅者 | +| WALLPAPER9+ | 8 | ExtensionAbility的类型包括墙纸 | +| UNSPECIFIED9+ | 9 | ExtensionAbility未指定类型 | ## ExtensionFlag9+ @@ -1576,11 +1576,11 @@ ExtensionAbility的类型 **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework -| 名称 | 默认值 | 说明 | -| ------ | ------ | ------ | -| GET_EXTENSION_INFO_DEFAULT9+ | 0x00000000 | 获取默认的extensionAbilityInfo | -| GET_EXTENSION_INFO_WITH_PERMISSION9+ | 0x00000002 | 获取携带权限信息的extensionAbilityInfo | -| GET_EXTENSION_INFO_WITH_APPLICATION9+ | 0x00000004 | 获取携带应用信息的extensionAbilityInfo | +| 名称 | 默认值 | 说明 | +| ---------------------------------------- | ---------- | ------------------------------ | +| GET_EXTENSION_INFO_DEFAULT9+ | 0x00000000 | 获取默认的extensionAbilityInfo | +| GET_EXTENSION_INFO_WITH_PERMISSION9+ | 0x00000002 | 获取携带权限信息的extensionAbilityInfo | +| GET_EXTENSION_INFO_WITH_APPLICATION9+ | 0x00000004 | 获取携带应用信息的extensionAbilityInfo | | GET_EXTENSION_INFO_WITH_METADATA9+ | 0x00000020 | 获取携带元数据信息的extensionAbilityInfo | @@ -1590,11 +1590,11 @@ ExtensionAbility的类型 **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework -| 名称 | 类型 | 说明 | -| ----------- | ---- | ------------------- | -| AUTO_MODE | -1 | 自动模式 | -| DARK_MODE | 0 | 夜间模式 | -| LIGHT_MODE | 1 | 灯光模式 | +| 名称 | 类型 | 说明 | +| ---------- | ---- | ---- | +| AUTO_MODE | -1 | 自动模式 | +| DARK_MODE | 0 | 夜间模式 | +| LIGHT_MODE | 1 | 灯光模式 | ## GrantStatus @@ -1603,10 +1603,10 @@ ExtensionAbility的类型 **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework -| 名称 | 类型 | 说明 | -| ----------- | ---- | ------------------- | -| PERMISSION_DENIED | -1 | 拒绝许可 | -| PERMISSION_GRANTED | 0 | 批准 | +| 名称 | 类型 | 说明 | +| ------------------ | ---- | ---- | +| PERMISSION_DENIED | -1 | 拒绝许可 | +| PERMISSION_GRANTED | 0 | 批准 | ## ExtensionAbilityInfo9+ @@ -1615,22 +1615,22 @@ ExtensionAbility信息 **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework -| 名称 | 类型 | 可读 | 可写 | 说明 | -| ------ | ------ | ------ | ------ | ------ | -| bundleName9+ | string | 是 | 否 | 应用包名 | -| moduleName9+ | string | 是 | 否 | ExtensionAbility所属的HAP包的名称 | -| name9+ | string | 是 | 否 | ExtensionAbility名称 | -| labelId9+ | number | 是 | 否 | ExtensionAbility的标签id | -| descriptionId9+ | number | 是 | 否 | ExtensionAbility的描述id | -| iconId9+ | number | 是 | 否 | ExtensionAbility的图标id | -| isVisible9+ | boolean | 是 | 否 | 判断ExtensionAbility是否可以被其他应用调用 | -| extensionAbilityType9+ | bundle.ExtensionAbilityType | 是 | 否 | ExtensionAbility类型 | -| permissions9+ | Array\ | 是 | 否 | 被其他应用ExtensionAbility调用时需要申请的权限集合 | -| applicationInfo9+ | ApplicationInfo | 是 | 否 | 应用程序的配置信息 | -| metaData9+ | Array\ | 是 | 否 | ExtensionAbility的元信息 | -| enabled9+ | boolean | 是 | 否 | ExtensionAbility是否可用 | -| readPermission9+ | string | 是 | 否 | 读取ExtensionAbility数据所需的权限 | -| writePermission9+ | string | 是 | 否 | 向ExtensionAbility写数据所需的权限 | +| 名称 | 类型 | 可读 | 可写 | 说明 | +| --------------------------------- | --------------------------- | ---- | ---- | --------------------------------- | +| bundleName9+ | string | 是 | 否 | 应用包名 | +| moduleName9+ | string | 是 | 否 | ExtensionAbility所属的HAP包的名称 | +| name9+ | string | 是 | 否 | ExtensionAbility名称 | +| labelId9+ | number | 是 | 否 | ExtensionAbility的标签id | +| descriptionId9+ | number | 是 | 否 | ExtensionAbility的描述id | +| iconId9+ | number | 是 | 否 | ExtensionAbility的图标id | +| isVisible9+ | boolean | 是 | 否 | 判断ExtensionAbility是否可以被其他应用调用 | +| extensionAbilityType9+ | bundle.ExtensionAbilityType | 是 | 否 | ExtensionAbility类型 | +| permissions9+ | Array\ | 是 | 否 | 被其他应用ExtensionAbility调用时需要申请的权限集合 | +| applicationInfo9+ | ApplicationInfo | 是 | 否 | 应用程序的配置信息 | +| metaData9+ | Array\ | 是 | 否 | ExtensionAbility的元信息 | +| enabled9+ | boolean | 是 | 否 | ExtensionAbility是否可用 | +| readPermission9+ | string | 是 | 否 | 读取ExtensionAbility数据所需的权限 | +| writePermission9+ | string | 是 | 否 | 向ExtensionAbility写数据所需的权限 | ## Metadata9+ @@ -1639,8 +1639,8 @@ ExtensionAbility信息 **系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework -| 名称 | 类型 | 可读 | 可写 | 说明 | -| ----- | ------ | ---- | ---- | ---------------- | -| name9+ | string | 是 | 是 | 元数据名称 | -| value9+ | string | 是 | 是 | 元数据值 | -| resource9+ | string | 是 | 是 | 元数据资源 | \ No newline at end of file +| 名称 | 类型 | 可读 | 可写 | 说明 | +| --------------------- | ------ | ---- | ---- | ----- | +| name9+ | string | 是 | 是 | 元数据名称 | +| value9+ | string | 是 | 是 | 元数据值 | +| resource9+ | string | 是 | 是 | 元数据资源 | \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-appAccount.md b/zh-cn/application-dev/reference/apis/js-apis-appAccount.md index 99ad55ca4046d399f0b5b23e6a22f030f12601eb..8a960e6896c07b12ee9752cfbf2a41df09f34802 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-appAccount.md +++ b/zh-cn/application-dev/reference/apis/js-apis-appAccount.md @@ -20,8 +20,8 @@ createAppAccountManager(): AppAccountManager **系统能力:** SystemCapability.Account.AppAccount **返回值:** -| 类型 | 说明 | -| ----------------- | ------------------------ | +| 类型 | 说明 | +| ----------------- | ------------ | | AppAccountManager | 获取应用帐号模块的实例。 | **示例:** @@ -43,10 +43,10 @@ addAccount(name: string, callback: AsyncCallback<void>): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------- | ---- | ------------------------------------------ | -| name | string | 是 | 要添加的应用帐户的名称。 | -| callback | AsyncCallback<void> | 是 | 将此应用的帐号名添加到帐号管理服务的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | --------------------- | +| name | string | 是 | 要添加的应用帐户的名称。 | +| callback | AsyncCallback<void> | 是 | 将此应用的帐号名添加到帐号管理服务的回调。 | **示例:** @@ -67,11 +67,11 @@ addAccount(name: string, extraInfo: string, callback: AsyncCallback<void>) **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| --------- | ------------------------- | ---- | ------------------------------------------------------------ | -| name | string | 是 | 要添加的应用帐户的名称。 | -| extraInfo | string | 是 | 要添加的应用帐户的额外信息(例如token等),额外的信息不能是应用帐号的敏感信息。 | -| callback | AsyncCallback<void> | 是 | 将此应用程序的帐号名和额外信息添加到帐号管理服务中的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| --------- | ------------------------- | ---- | ---------------------------------------- | +| name | string | 是 | 要添加的应用帐户的名称。 | +| extraInfo | string | 是 | 要添加的应用帐户的额外信息(例如token等),额外的信息不能是应用帐号的敏感信息。 | +| callback | AsyncCallback<void> | 是 | 将此应用程序的帐号名和额外信息添加到帐号管理服务中的回调。 | **示例:** @@ -94,16 +94,16 @@ addAccount(name: string, extraInfo?: string): Promise<void> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| --------- | ------ | ---- | ------------------------------------------------------------ | -| name | string | 是 | 要添加的应用帐户的名称。 | -| extraInfo | string | 是 | 要添加的应用帐户的额外信息,额外的信息不能是应用帐号的敏感信息。 | +| 参数名 | 类型 | 必填 | 说明 | +| --------- | ------ | ---- | -------------------------------- | +| name | string | 是 | 要添加的应用帐户的名称。 | +| extraInfo | string | 是 | 要添加的应用帐户的额外信息,额外的信息不能是应用帐号的敏感信息。 | **返回值:** -| 类型 | 说明 | -| ------------------- | ---------------------------------- | -| Promise<void> | romise实例,用于获取异步返回结果。 | +| 类型 | 说明 | +| ------------------- | --------------------- | +| Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -126,12 +126,12 @@ addAccountImplicitly(owner: string, authType: string, options: {[key: string]: a **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | --------------------- | ---- | ------------------------------ | -| owner | string | 是 | 要添加的应用帐户的所有者包名。 | -| authType | string | 是 | 要添加的应用帐户的鉴权类型。 | -| options | {[key: string]: any} | 是 | 鉴权所需要的可选项。 | -| callback | AuthenticatorCallback | 是 | 认证器回调,用于返回鉴权结果。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------- | ---- | --------------- | +| owner | string | 是 | 要添加的应用帐户的所有者包名。 | +| authType | string | 是 | 要添加的应用帐户的鉴权类型。 | +| options | {[key: string]: any} | 是 | 鉴权所需要的可选项。 | +| callback | AuthenticatorCallback | 是 | 认证器回调,用于返回鉴权结果。 | **示例:** @@ -167,10 +167,10 @@ deleteAccount(name: string, callback: AsyncCallback<void>): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------- | ---- | ---------------------------------- | -| name | string | 是 | 要删除的应用帐户的名称。 | -| callback | AsyncCallback<void> | 是 | 帐号管理服务中删除应用帐号的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ----------------- | +| name | string | 是 | 要删除的应用帐户的名称。 | +| callback | AsyncCallback<void> | 是 | 帐号管理服务中删除应用帐号的回调。 | **示例:** @@ -191,14 +191,14 @@ deleteAccount(name: string): Promise<void> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ------ | ------ | ---- | ------------------------ | -| name | string | 是 | 要删除的应用帐户的名称。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---- | ------ | ---- | ------------ | +| name | string | 是 | 要删除的应用帐户的名称。 | **返回值:** -| 类型 | 说明 | -| :------------------ | :---------------------------------- | +| 类型 | 说明 | +| :------------------ | :-------------------- | | Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -222,11 +222,11 @@ disableAppAccess(name: string, bundleName: string, callback: AsyncCallback<vo **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---------- | ------------------------- | ---- | ------------------------------------------------------------ | -| name | string | 是 | 要禁用访问的第三方应用帐户的名称。 | -| bundleName | string | 是 | 第三方应用的包名。 | -| callback | AsyncCallback<void> | 是 | 禁止指定第三方应用帐户的名称访问指定包名称的第三方应用的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------------------------- | ---- | ------------------------------- | +| name | string | 是 | 要禁用访问的第三方应用帐户的名称。 | +| bundleName | string | 是 | 第三方应用的包名。 | +| callback | AsyncCallback<void> | 是 | 禁止指定第三方应用帐户的名称访问指定包名称的第三方应用的回调。 | **示例:** @@ -247,15 +247,15 @@ disableAppAccess(name: string, bundleName: string): Promise<void> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---------- | ------ | ---- | ---------------------------------- | -| name | string | 是 | 要禁用访问的第三方应用帐户的名称。 | -| bundleName | string | 是 | 第三方应用的包名。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------ | ---- | ----------------- | +| name | string | 是 | 要禁用访问的第三方应用帐户的名称。 | +| bundleName | string | 是 | 第三方应用的包名。 | **返回值:** -| 类型 | 说明 | -| :------------------ | :---------------------------------- | +| 类型 | 说明 | +| :------------------ | :-------------------- | | Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -279,11 +279,11 @@ enableAppAccess(name: string, bundleName: string, callback: AsyncCallback<voi **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---------- | ------------------------- | ---- | ------------------------------------------------------------ | -| name | string | 是 | 应用帐号名称。 | -| bundleName | string | 是 | 第三方应用的包名。 | -| callback | AsyncCallback<void> | 是 | 允许指定第三方应用帐户的名称访问指定包名称的第三方应用的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------------------------- | ---- | ------------------------------- | +| name | string | 是 | 应用帐号名称。 | +| bundleName | string | 是 | 第三方应用的包名。 | +| callback | AsyncCallback<void> | 是 | 允许指定第三方应用帐户的名称访问指定包名称的第三方应用的回调。 | **示例:** @@ -304,15 +304,15 @@ enableAppAccess(name: string, bundleName: string): Promise<void> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---------- | ------ | ---- | ------------------ | -| name | string | 是 | 应用帐号名称。 | -| bundleName | string | 是 | 第三方应用的包名。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------ | ---- | --------- | +| name | string | 是 | 应用帐号名称。 | +| bundleName | string | 是 | 第三方应用的包名。 | **返回值:** -| 类型 | 说明 | -| :------------------ | :---------------------------------- | +| 类型 | 说明 | +| :------------------ | :-------------------- | | Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -337,10 +337,10 @@ checkAppAccountSyncEnable(name: string, callback: AsyncCallback<boolean>): **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ---------------------------- | ---- | -------------------------------------------- | -| name | string | 是 | 应用帐号名称。 | -| callback | AsyncCallback<boolean> | 是 | 检查指定应用帐号是否允许应用数据同步的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------- | ---- | ---------------------- | +| name | string | 是 | 应用帐号名称。 | +| callback | AsyncCallback<boolean> | 是 | 检查指定应用帐号是否允许应用数据同步的回调。 | **示例:** @@ -364,14 +364,14 @@ checkAppAccountSyncEnable(name: string): Promise<boolean> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ------ | ------ | ---- | -------------- | -| name | string | 是 | 应用帐号名称。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---- | ------ | ---- | ------- | +| name | string | 是 | 应用帐号名称。 | **返回值:** -| 类型 | 说明 | -| :--------------------- | :---------------------------------- | +| 类型 | 说明 | +| :--------------------- | :-------------------- | | Promise<boolean> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -395,12 +395,12 @@ setAccountCredential(name: string, credentialType: string, credential: string,ca **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------------- | ------------------------- | ---- | ---------------------------- | -| name | string | 是 | 应用程序帐户的名称。 | -| credentialType | string | 是 | 要设置的凭据的类型。 | -| credential | string | 是 | 要设置的凭据。 | -| callback | AsyncCallback<void> | 是 | 设置此应用帐号的凭据的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------------- | ------------------------- | ---- | -------------- | +| name | string | 是 | 应用程序帐户的名称。 | +| credentialType | string | 是 | 要设置的凭据的类型。 | +| credential | string | 是 | 要设置的凭据。 | +| callback | AsyncCallback<void> | 是 | 设置此应用帐号的凭据的回调。 | **示例:** @@ -421,16 +421,16 @@ setAccountCredential(name: string, credentialType: string, credential: string): **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------------- | ------ | ---- | -------------------- | -| name | string | 是 | 应用帐户的名称。 | -| credentialType | string | 是 | 要设置的凭据的类型。 | -| credential | string | 是 | 要设置的凭据。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------------- | ------ | ---- | ---------- | +| name | string | 是 | 应用帐户的名称。 | +| credentialType | string | 是 | 要设置的凭据的类型。 | +| credential | string | 是 | 要设置的凭据。 | **返回值:** -| 类型 | 说明 | -| :------------------ | :---------------------------------- | +| 类型 | 说明 | +| :------------------ | :-------------------- | | Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -454,11 +454,11 @@ setAccountExtraInfo(name: string, extraInfo: string, callback: AsyncCallback< **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| --------- | ------------------------- | ---- | -------------------------------- | -| name | string | 是 | 应用帐户的名称。 | -| extraInfo | string | 是 | 要设置的额外信息。 | -| callback | AsyncCallback<void> | 是 | 设置此应用帐号的额外信息的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| --------- | ------------------------- | ---- | ---------------- | +| name | string | 是 | 应用帐户的名称。 | +| extraInfo | string | 是 | 要设置的额外信息。 | +| callback | AsyncCallback<void> | 是 | 设置此应用帐号的额外信息的回调。 | **示例:** @@ -479,15 +479,15 @@ setAccountExtraInfo(name: string, extraInfo: string): Promise<void> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| --------- | ------ | ---- | ------------------ | -| name | string | 是 | 应用帐户的名称。 | -| extraInfo | string | 是 | 要设置的额外信息。 | +| 参数名 | 类型 | 必填 | 说明 | +| --------- | ------ | ---- | --------- | +| name | string | 是 | 应用帐户的名称。 | +| extraInfo | string | 是 | 要设置的额外信息。 | **返回值:** -| 类型 | 说明 | -| :------------------ | :---------------------------------- | +| 类型 | 说明 | +| :------------------ | :-------------------- | | Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -513,11 +513,11 @@ setAppAccountSyncEnable(name: string, isEnable: boolean, callback: AsyncCallback **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------- | ---- | -------------------------------------------------- | -| name | string | 是 | 应用帐户的名称。 | -| isEnable | boolean | 是 | 是否允许应用数据同步。 | -| callback | AsyncCallback<void> | 是 | 设置指定的应用帐号是否允许应用程序数据同步的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ------------------------- | +| name | string | 是 | 应用帐户的名称。 | +| isEnable | boolean | 是 | 是否允许应用数据同步。 | +| callback | AsyncCallback<void> | 是 | 设置指定的应用帐号是否允许应用程序数据同步的回调。 | **示例:** @@ -540,15 +540,15 @@ setAppAccountSyncEnable(name: string, isEnable: boolean): Promise<void> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------- | ---- | ---------------------- | -| name | string | 是 | 应用帐户的名称。 | -| isEnable | boolean | 是 | 是否允许应用数据同步。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------- | ---- | ----------- | +| name | string | 是 | 应用帐户的名称。 | +| isEnable | boolean | 是 | 是否允许应用数据同步。 | **返回值:** -| 类型 | 说明 | -| :------------------ | :---------------------------------- | +| 类型 | 说明 | +| :------------------ | :-------------------- | | Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -572,12 +572,12 @@ setAssociatedData(name: string, key: string, value: string, callback: AsyncCallb **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------- | ---- | ---------------------------------- | -| name | string | 是 | 应用帐户的名称。 | -| key | string | 是 | 要设置的数据的键,密钥可以自定义。 | -| value | string | 是 | 要设置的数据的值。 | -| callback | AsyncCallback<void> | 是 | 设置与此应用帐号关联的数据的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ----------------- | +| name | string | 是 | 应用帐户的名称。 | +| key | string | 是 | 要设置的数据的键,密钥可以自定义。 | +| value | string | 是 | 要设置的数据的值。 | +| callback | AsyncCallback<void> | 是 | 设置与此应用帐号关联的数据的回调。 | **示例:** @@ -597,16 +597,16 @@ setAssociatedData(name: string, key: string, value: string): Promise<void> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ------ | ------ | ---- | ---------------------------------- | -| name | string | 是 | 应用帐户的名称。 | -| key | string | 是 | 要设置的数据的键,密钥可以自定义。 | -| value | string | 是 | 要设置的数据的值。 | +| 参数名 | 类型 | 必填 | 说明 | +| ----- | ------ | ---- | ----------------- | +| name | string | 是 | 应用帐户的名称。 | +| key | string | 是 | 要设置的数据的键,密钥可以自定义。 | +| value | string | 是 | 要设置的数据的值。 | **返回值:** -| 类型 | 说明 | -| :------------------ | :---------------------------------- | +| 类型 | 说明 | +| :------------------ | :-------------------- | | Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -630,11 +630,11 @@ getAccountCredential(name: string, credentialType: string, callback: AsyncCallba **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------------- | --------------------------- | ---- | ---------------------------- | -| name | string | 是 | 应用帐号名称。 | -| credentialType | string | 是 | 要获取的凭据的类型。 | -| callback | AsyncCallback<string> | 是 | 获取此应用帐号的凭据的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------------- | --------------------------- | ---- | -------------- | +| name | string | 是 | 应用帐号名称。 | +| credentialType | string | 是 | 要获取的凭据的类型。 | +| callback | AsyncCallback<string> | 是 | 获取此应用帐号的凭据的回调。 | **示例:** @@ -656,15 +656,15 @@ getAccountCredential(name: string, credentialType: string): Promise<string> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------------- | ------ | ---- | -------------------- | -| name | string | 是 | 应用帐号名称。 | -| credentialType | string | 是 | 要获取的凭据的类型。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------------- | ------ | ---- | ---------- | +| name | string | 是 | 应用帐号名称。 | +| credentialType | string | 是 | 要获取的凭据的类型。 | **返回值:** -| 类型 | 说明 | -| :-------------------- | :---------------------------------- | +| 类型 | 说明 | +| :-------------------- | :-------------------- | | Promise<string> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -688,10 +688,10 @@ getAccountExtraInfo(name: string, callback: AsyncCallback<string>): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | --------------------------- | ---- | -------------------------------- | -| name | string | 是 | 应用帐号名称。 | -| callback | AsyncCallback<string> | 是 | 获取此应用帐号的额外信息的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------- | ---- | ---------------- | +| name | string | 是 | 应用帐号名称。 | +| callback | AsyncCallback<string> | 是 | 获取此应用帐号的额外信息的回调。 | **示例:** @@ -713,14 +713,14 @@ getAccountExtraInfo(name: string): Promise<string> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ------ | ------ | ---- | -------------- | -| name | string | 是 | 应用帐号名称。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---- | ------ | ---- | ------- | +| name | string | 是 | 应用帐号名称。 | **返回值:** -| 类型 | 说明 | -| :-------------------- | :---------------------------------- | +| 类型 | 说明 | +| :-------------------- | :-------------------- | | Promise<string> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -744,11 +744,11 @@ getAssociatedData(name: string, key: string, callback: AsyncCallback<string&g **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | --------------------------- | ---- | ---------------------------------- | -| name | string | 是 | 应用帐号名称。 | -| key | string | 是 | 要获取的数据的key。 | -| callback | AsyncCallback<string> | 是 | 获取与此应用帐号关联的数据的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------- | ---- | ----------------- | +| name | string | 是 | 应用帐号名称。 | +| key | string | 是 | 要获取的数据的key。 | +| callback | AsyncCallback<string> | 是 | 获取与此应用帐号关联的数据的回调。 | **示例:** @@ -770,15 +770,15 @@ getAssociatedData(name: string, key: string): Promise<string> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ------ | ------ | ---- | ------------------- | -| name | string | 是 | 应用帐号名称。 | -| key | string | 是 | 要获取的数据的key。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---- | ------ | ---- | ----------- | +| name | string | 是 | 应用帐号名称。 | +| key | string | 是 | 要获取的数据的key。 | **返回值:** -| 类型 | 说明 | -| :-------------------- | :---------------------------------- | +| 类型 | 说明 | +| :-------------------- | :-------------------- | | Promise<string> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -804,9 +804,9 @@ getAllAccessibleAccounts(callback: AsyncCallback<Array<AppAccountInfo>& **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------------------------------ | ---- | ---------------- | -| callback | AsyncCallback<Array<AppAccountInfo>> | 是 | 应用帐号信息列表 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | -------- | +| callback | AsyncCallback<Array<AppAccountInfo>> | 是 | 应用帐号信息列表 | **示例:** @@ -830,8 +830,8 @@ getAllAccessibleAccounts(): Promise<Array<AppAccountInfo>> **参数:** -| 类型 | 说明 | -| ------------------------------------------ | ----------------------------------- | +| 类型 | 说明 | +| ---------------------------------------- | --------------------- | | Promise<Array<AppAccountInfo>> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -857,10 +857,10 @@ getAllAccounts(owner: string, callback: AsyncCallback<Array<AppAccountInfo **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------------------------------ | ---- | ---------------- | -| owner | string | 是 | 应用包名称 | -| callback | AsyncCallback<Array<AppAccountInfo>> | 是 | 应用帐号信息列表 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | -------- | +| owner | string | 是 | 应用包名称 | +| callback | AsyncCallback<Array<AppAccountInfo>> | 是 | 应用帐号信息列表 | **示例:** @@ -885,14 +885,14 @@ getAllAccounts(owner: string): Promise<Array<AppAccountInfo>> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ------ | ------ | ---- | ---------- | -| owner | string | 是 | 应用包名称 | +| 参数名 | 类型 | 必填 | 说明 | +| ----- | ------ | ---- | ----- | +| owner | string | 是 | 应用包名称 | **参数:** -| 类型 | 说明 | -| ------------------------------------------ | ----------------------------------- | +| 类型 | 说明 | +| ---------------------------------------- | --------------------- | | Promise<Array<AppAccountInfo>> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -917,11 +917,11 @@ on(type: 'change', owners: Array<string>, callback: Callback<Array<A **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------------------------- | ---- | ------------------------------------------------------------ | -| type | 'change' | 是 | 关于帐户更改事件,当帐户所有者更新帐户时,订阅者将收到通知。 | -| owners | Array<string> | 是 | 指示帐户的所有者。 | -| callback | Callback<Array<AppAccountInfo>> | 是 | 订阅指定帐号所有者的帐户变更事件的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ------------------------------ | +| type | 'change' | 是 | 关于帐户更改事件,当帐户所有者更新帐户时,订阅者将收到通知。 | +| owners | Array<string> | 是 | 指示帐户的所有者。 | +| callback | Callback<Array<AppAccountInfo>> | 是 | 订阅指定帐号所有者的帐户变更事件的回调。 | **示例:** @@ -948,10 +948,10 @@ off(type: 'change', callback?: Callback>): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------------------------------- | ---- | ------------------------ | -| type | 'change' | 是 | 关于帐户更改事件。 | -| callback | Callback> | 否 | 取消订阅帐号事件的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------------------------- | ---- | ------------ | +| type | 'change' | 是 | 关于帐户更改事件。 | +| callback | Callback> | 否 | 取消订阅帐号事件的回调。 | **示例:** @@ -981,13 +981,13 @@ authenticate(name: string, owner: string, authType: string, options: {[key: stri **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | --------------------- | ---- | ------------------------------ | -| name | string | 是 | 要鉴权的应用帐户的名称。 | -| owner | string | 是 | 要鉴权的应用帐户的所有者包名。 | -| authType | string | 是 | 鉴权类型。 | -| options | {[key: string]: any} | 是 | 鉴权所需的可选项。 | -| callback | AuthenticatorCallback | 是 | 认证器回调,用于返回鉴权结果。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------- | ---- | --------------- | +| name | string | 是 | 要鉴权的应用帐户的名称。 | +| owner | string | 是 | 要鉴权的应用帐户的所有者包名。 | +| authType | string | 是 | 鉴权类型。 | +| options | {[key: string]: any} | 是 | 鉴权所需的可选项。 | +| callback | AuthenticatorCallback | 是 | 认证器回调,用于返回鉴权结果。 | **示例:** @@ -1023,12 +1023,12 @@ getOAuthToken(name: string, owner: string, authType: string, callback: AsyncCall **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | --------------------------- | ---- | ---------------------- | -| name | string | 是 | 应用帐户的名称。 | -| owner | string | 是 | 应用帐户的所有者包名。 | -| authType | string | 是 | 鉴权类型。 | -| callback | AsyncCallback<string> | 是 | 查询结果的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------- | ---- | ----------- | +| name | string | 是 | 应用帐户的名称。 | +| owner | string | 是 | 应用帐户的所有者包名。 | +| authType | string | 是 | 鉴权类型。 | +| callback | AsyncCallback<string> | 是 | 查询结果的回调。 | **示例:** @@ -1050,16 +1050,16 @@ getOAuthToken(name: string, owner: string, authType: string): Promise<string& **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------ | ---- | ---------------------- | -| name | string | 是 | 应用帐户的名称。 | -| owner | string | 是 | 应用帐户的所有者包名。 | -| authType | string | 是 | 鉴权类型。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------ | ---- | ----------- | +| name | string | 是 | 应用帐户的名称。 | +| owner | string | 是 | 应用帐户的所有者包名。 | +| authType | string | 是 | 鉴权类型。 | **参数:** -| 类型 | 说明 | -| --------------------- | ----------------------------------- | +| 类型 | 说明 | +| --------------------- | --------------------- | | Promise<string> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -1083,12 +1083,12 @@ setOAuthToken(name: string, authType: string, token: string, callback: AsyncCall **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------- | ---- | ---------------- | -| name | string | 是 | 应用帐户的名称。 | -| authType | string | 是 | 鉴权类型。 | -| token | string | 是 | OAuth令牌。 | -| callback | AsyncCallback<void> | 是 | 设置结果的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | -------- | +| name | string | 是 | 应用帐户的名称。 | +| authType | string | 是 | 鉴权类型。 | +| token | string | 是 | OAuth令牌。 | +| callback | AsyncCallback<void> | 是 | 设置结果的回调。 | **示例:** @@ -1109,16 +1109,16 @@ setOAuthToken(name: string, authType: string, token: string): Promise<void> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------ | ---- | ---------------- | -| name | string | 是 | 应用帐户的名称。 | -| authType | string | 是 | 鉴权类型。 | -| token | string | 是 | OAuth令牌。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------ | ---- | -------- | +| name | string | 是 | 应用帐户的名称。 | +| authType | string | 是 | 鉴权类型。 | +| token | string | 是 | OAuth令牌。 | **参数:** -| 类型 | 说明 | -| ------------------- | ----------------------------------- | +| 类型 | 说明 | +| ------------------- | --------------------- | | Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -1142,13 +1142,13 @@ deleteOAuthToken(name: string, owner: string, authType: string, token: string, c **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------- | ---- | ---------------------- | -| name | string | 是 | 应用帐户的名称。 | -| owner | string | 是 | 应用帐户的所有者包名。 | -| authType | string | 是 | 鉴权类型。 | -| token | string | 是 | 要删除的OAuth令牌。 | -| callback | AsyncCallback<void> | 是 | 删除结果的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------------------------- | ---- | ------------ | +| name | string | 是 | 应用帐户的名称。 | +| owner | string | 是 | 应用帐户的所有者包名。 | +| authType | string | 是 | 鉴权类型。 | +| token | string | 是 | 要删除的OAuth令牌。 | +| callback | AsyncCallback<void> | 是 | 删除结果的回调。 | **示例:** @@ -1169,17 +1169,17 @@ deleteOAuthToken(name: string, owner: string, authType: string, token: string): **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------ | ---- | ---------------------- | -| name | string | 是 | 应用帐户的名称。 | -| owner | string | 是 | 应用帐户的所有者包名。 | -| authType | string | 是 | 鉴权类型。 | -| token | string | 是 | 要删除的OAuth令牌。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------ | ---- | ------------ | +| name | string | 是 | 应用帐户的名称。 | +| owner | string | 是 | 应用帐户的所有者包名。 | +| authType | string | 是 | 鉴权类型。 | +| token | string | 是 | 要删除的OAuth令牌。 | **参数:** -| 类型 | 说明 | -| ------------------- | ----------------------------------- | +| 类型 | 说明 | +| ------------------- | --------------------- | | Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -1203,13 +1203,13 @@ setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVi **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---------- | ------------------------- | ---- | ------------------------ | -| name | string | 是 | 应用帐户的名称。 | -| authType | string | 是 | 鉴权类型。 | -| bundleName | string | 是 | 被设置可见性的应用包名。 | -| isVisible | boolean | 是 | 是否可见。 | -| callback | AsyncCallback<void> | 是 | 设置结果的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------------------------- | ---- | ------------ | +| name | string | 是 | 应用帐户的名称。 | +| authType | string | 是 | 鉴权类型。 | +| bundleName | string | 是 | 被设置可见性的应用包名。 | +| isVisible | boolean | 是 | 是否可见。 | +| callback | AsyncCallback<void> | 是 | 设置结果的回调。 | **示例:** @@ -1230,24 +1230,23 @@ setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVi **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---------- | ------- | ---- | ------------------------ | -| name | string | 是 | 应用帐户的名称。 | -| authType | string | 是 | 鉴权类型。 | -| bundleName | string | 是 | 被设置可见性的应用包名。 | -| isVisible | boolean | 是 | 是否可见。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------- | ---- | ------------ | +| name | string | 是 | 应用帐户的名称。 | +| authType | string | 是 | 鉴权类型。 | +| bundleName | string | 是 | 被设置可见性的应用包名。 | +| isVisible | boolean | 是 | 是否可见。 | **参数:** -| 类型 | 说明 | -| ------------------- | ----------------------------------- | +| 类型 | 说明 | +| ------------------- | --------------------- | | Promise<void> | Promise实例,用于获取异步返回结果。 | **示例:** ``` const appAccountManager = account_appAccount.createAppAccountManager(); - const appAccountManager = account_appAccount.createAppAccountManager(); appAccountManager.setOAuthTokenVisibility("LiSi", "readAge", "com.example.ohos.accountjsdemo", true).then(() => { console.log('setOAuthTokenVisibility successfully'); }).catch((err) => { @@ -1265,12 +1264,12 @@ checkOAuthTokenVisibility(name: string, authType: string, bundleName: string, ca **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---------- | ---------------------------- | ---- | -------------------------- | -| name | string | 是 | 应用帐户的名称。 | -| authType | string | 是 | 鉴权类型。 | -| bundleName | string | 是 | 用于检查可见性的应用包名。 | -| callback | AsyncCallback<boolean> | 是 | 检查结果的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ---------------------------- | ---- | ------------- | +| name | string | 是 | 应用帐户的名称。 | +| authType | string | 是 | 鉴权类型。 | +| bundleName | string | 是 | 用于检查可见性的应用包名。 | +| callback | AsyncCallback<boolean> | 是 | 检查结果的回调。 | **示例:** @@ -1292,16 +1291,16 @@ checkOAuthTokenVisibility(name: string, authType: string, bundleName: string): P **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---------- | ------ | ---- | -------------------------- | -| name | string | 是 | 应用帐户的名称。 | -| authType | string | 是 | 鉴权类型。 | -| bundleName | string | 是 | 用于检查可见性的应用包名。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------ | ---- | ------------- | +| name | string | 是 | 应用帐户的名称。 | +| authType | string | 是 | 鉴权类型。 | +| bundleName | string | 是 | 用于检查可见性的应用包名。 | **参数:** -| 类型 | 说明 | -| ---------------------- | ----------------------------------- | +| 类型 | 说明 | +| ---------------------- | --------------------- | | Promise<boolean> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -1325,11 +1324,11 @@ getAllOAuthTokens(name: string, owner: string, callback: AsyncCallback<Array& **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------------------------------------------------ | ---- | ---------------------- | -| name | string | 是 | 应用帐户的名称。 | -| owner | string | 是 | 应用帐户的所有者包名。 | -| callback | AsyncCallback<Array<OAuthTokenInfo>> | 是 | 查询结果的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ----------- | +| name | string | 是 | 应用帐户的名称。 | +| owner | string | 是 | 应用帐户的所有者包名。 | +| callback | AsyncCallback<Array<OAuthTokenInfo>> | 是 | 查询结果的回调。 | **示例:** @@ -1351,15 +1350,15 @@ getAllOAuthTokens(name: string, owner: string): Promise<Array<OAuthTokenIn **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ------ | ------ | ---- | ---------------------- | -| name | string | 是 | 应用帐户的名称。 | -| owner | string | 是 | 应用帐户的所有者包名。 | +| 参数名 | 类型 | 必填 | 说明 | +| ----- | ------ | ---- | ----------- | +| name | string | 是 | 应用帐户的名称。 | +| owner | string | 是 | 应用帐户的所有者包名。 | **参数:** -| 类型 | 说明 | -| ------------------------------------------ | ----------------------------------- | +| 类型 | 说明 | +| ---------------------------------------- | --------------------- | | Promise<Array<OAuthTokenInfo>> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -1383,11 +1382,11 @@ getOAuthList(name: string, authType: string, callback: AsyncCallback<Array< **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ---------------------------------------- | ---- | ---------------------- | -| name | string | 是 | 应用帐户的名称。 | -| owner | string | 是 | 应用帐户的所有者包名。 | -| callback | AsyncCallback<Array<string>> | 是 | 查询结果的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ----------- | +| name | string | 是 | 应用帐户的名称。 | +| owner | string | 是 | 应用帐户的所有者包名。 | +| callback | AsyncCallback<Array<string>> | 是 | 查询结果的回调。 | **示例:** @@ -1409,15 +1408,15 @@ getOAuthList(name: string, authType: string): Promise<Array<string>> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ------ | ------ | ---- | ---------------------- | -| name | string | 是 | 应用帐户的名称。 | -| owner | string | 是 | 应用帐户的所有者包名。 | +| 参数名 | 类型 | 必填 | 说明 | +| ----- | ------ | ---- | ----------- | +| name | string | 是 | 应用帐户的名称。 | +| owner | string | 是 | 应用帐户的所有者包名。 | **参数:** -| 类型 | 说明 | -| ---------------------------------- | ----------------------------------- | +| 类型 | 说明 | +| ---------------------------------- | --------------------- | | Promise<Array<string>> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -1441,10 +1440,10 @@ getAuthenticatorCallback(sessionId: string, callback: AsyncCallback<Authentic **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| --------- | ------------------------------------------ | ---- | ---------------- | -| sessionId | string | 是 | 鉴权会话的标识。 | -| callback | AsyncCallback<AuthenticatorCallback> | 是 | 查询结果的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| --------- | ---------------------------------------- | ---- | -------- | +| sessionId | string | 是 | 鉴权会话的标识。 | +| callback | AsyncCallback<AuthenticatorCallback> | 是 | 查询结果的回调。 | **示例:** @@ -1476,14 +1475,14 @@ getAuthenticatorCallback(sessionId: string): Promise<AuthenticatorCallback> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| --------- | ------ | ---- | ---------------- | -| sessionId | string | 是 | 鉴权会话的标识。 | +| 参数名 | 类型 | 必填 | 说明 | +| --------- | ------ | ---- | -------- | +| sessionId | string | 是 | 鉴权会话的标识。 | **参数:** -| 类型 | 说明 | -| ------------------------------------ | ----------------------------------- | +| 类型 | 说明 | +| ------------------------------------ | --------------------- | | Promise<AuthenticatorCallback> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -1516,10 +1515,10 @@ getAuthenticatorInfo(owner: string, callback: AsyncCallback<AuthenticatorInfo **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------------------------------------- | ---- | ---------------------- | -| owner | string | 是 | 应用帐户的所有者包名。 | -| callback | AsyncCallback<AuthenticatorInfo> | 是 | 查询结果的回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------------------------------------- | ---- | ----------- | +| owner | string | 是 | 应用帐户的所有者包名。 | +| callback | AsyncCallback<AuthenticatorInfo> | 是 | 查询结果的回调。 | **示例:** @@ -1541,14 +1540,14 @@ getAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ------ | ------ | ---- | ---------------------- | -| owner | string | 是 | 应用帐户的所有者包名。 | +| 参数名 | 类型 | 必填 | 说明 | +| ----- | ------ | ---- | ----------- | +| owner | string | 是 | 应用帐户的所有者包名。 | **参数:** -| 类型 | 说明 | -| -------------------------------- | ----------------------------------- | +| 类型 | 说明 | +| -------------------------------- | --------------------- | | Promise<AuthenticatorInfo> | Promise实例,用于获取异步返回结果。 | **示例:** @@ -1568,10 +1567,10 @@ getAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo> **系统能力:** 以下各项对应的系统能力均为SystemCapability.Account.AppAccount。 -| 参数名 | 类型 | 必填 | 说明 | -| ------ | ------ | ---- | ---------------------- | -| owner | string | 是 | 应用帐户的所有者包名。 | -| name | string | 是 | 应用帐户的名称。 | +| 参数名 | 类型 | 必填 | 说明 | +| ----- | ------ | ---- | ----------- | +| owner | string | 是 | 应用帐户的所有者包名。 | +| name | string | 是 | 应用帐户的名称。 | ## OAuthTokenInfo8+ @@ -1579,10 +1578,10 @@ getAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo> **系统能力:** 以下各项对应的系统能力均为SystemCapability.Account.AppAccount。 -| 参数名 | 类型 | 必填 | 说明 | -| -------- | ------ | ---- | ---------------- | -| authType | string | 是 | 令牌的鉴权类型。 | -| token | string | 是 | 令牌的取值。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------ | ---- | -------- | +| authType | string | 是 | 令牌的鉴权类型。 | +| token | string | 是 | 令牌的取值。 | ## AuthenticatorInfo8+ @@ -1590,11 +1589,11 @@ getAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo> **系统能力:** 以下各项对应的系统能力均为SystemCapability.Account.AppAccount。 -| 参数名 | 类型 | 必填 | 说明 | -| ------- | ------ | ---- | -------------------- | -| owner | string | 是 | 认证器的所有者包名。 | -| iconId | string | 是 | 认证器的图标标识。 | -| labelId | string | 是 | 认证器的标签标识。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ------ | ---- | ---------- | +| owner | string | 是 | 认证器的所有者包名。 | +| iconId | string | 是 | 认证器的图标标识。 | +| labelId | string | 是 | 认证器的标签标识。 | ## Constants8+ @@ -1602,19 +1601,19 @@ getAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo> **系统能力:** 以下各项对应的系统能力均为SystemCapability.Account.AppAccount。 -| 名称 | 默认值 | 描述 | -| ----------------------------- | ---------------------- | ------------------------- | -| ACTION_ADD_ACCOUNT_IMPLICITLY | "addAccountImplicitly" | 表示操作_隐式添加帐号。 | -| ACTION_AUTHENTICATE | "authenticate" | 表示操作_鉴权。 | -| KEY_NAME | "name" | 表示键名_应用帐户名称。 | +| 名称 | 默认值 | 描述 | +| ----------------------------- | ---------------------- | ------------- | +| ACTION_ADD_ACCOUNT_IMPLICITLY | "addAccountImplicitly" | 表示操作_隐式添加帐号。 | +| ACTION_AUTHENTICATE | "authenticate" | 表示操作_鉴权。 | +| KEY_NAME | "name" | 表示键名_应用帐户名称。 | | KEY_OWNER | "owner" | 表示键名_应用帐户所有者。 | -| KEY_TOKEN | "token" | 表示键名_令牌。 | -| KEY_ACTION | "action" | 表示键名_操作。 | -| KEY_AUTH_TYPE | "authType" | 表示键名_鉴权类型。 | -| KEY_SESSION_ID | "sessionId" | 表示键名_会话标识。 | -| KEY_CALLER_PID | "callerPid" | 表示键名_调用方PID。 | -| KEY_CALLER_UID | "callerUid" | 表示键名_调用方UID。 | -| KEY_CALLER_BUNDLE_NAME | "callerBundleName" | 表示键名_调用方包名。 | +| KEY_TOKEN | "token" | 表示键名_令牌。 | +| KEY_ACTION | "action" | 表示键名_操作。 | +| KEY_AUTH_TYPE | "authType" | 表示键名_鉴权类型。 | +| KEY_SESSION_ID | "sessionId" | 表示键名_会话标识。 | +| KEY_CALLER_PID | "callerPid" | 表示键名_调用方PID。 | +| KEY_CALLER_UID | "callerUid" | 表示键名_调用方UID。 | +| KEY_CALLER_BUNDLE_NAME | "callerBundleName" | 表示键名_调用方包名。 | ## ResultCode8+ @@ -1622,27 +1621,27 @@ getAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo> **系统能力:** 以下各项对应的系统能力均为SystemCapability.Account.AppAccount。 -| 名称 | 默认值 | 描述 | -| ----------------------------------- | ------ | ------------------------ | -| SUCCESS | 0 | 表示操作成功。 | -| ERROR_ACCOUNT_NOT_EXIST | 10001 | 表示应用帐户不存在。 | -| ERROR_APP_ACCOUNT_SERVICE_EXCEPTION | 10002 | 表示应用帐户服务异常。 | -| ERROR_INVALID_PASSWORD | 10003 | 表示密码无效。 | -| ERROR_INVALID_REQUEST | 10004 | 表示请求无效。 | -| ERROR_INVALID_RESPONSE | 10005 | 表示响应无效。 | -| ERROR_NETWORK_EXCEPTION | 10006 | 表示网络异常。 | -| ERROR_OAUTH_AUTHENTICATOR_NOT_EXIST | 10007 | 表示认证器不存在。 | -| ERROR_OAUTH_CANCELED | 10008 | 表示鉴权取消。 | -| ERROR_OAUTH_LIST_TOO_LARGE | 10009 | 表示开放授权列表过大。 | -| ERROR_OAUTH_SERVICE_BUSY | 10010 | 表示开放授权服务忙碌。 | -| ERROR_OAUTH_SERVICE_EXCEPTION | 10011 | 表示开放授权服务异常。 | -| ERROR_OAUTH_SESSION_NOT_EXIST | 10012 | 表示鉴权会话不存在。 | -| ERROR_OAUTH_TIMEOUT | 10013 | 表示鉴权超时。 | -| ERROR_OAUTH_TOKEN_NOT_EXIST | 10014 | 表示开放授权令牌不存在。 | -| ERROR_OAUTH_TOKEN_TOO_MANY | 10015 | 表示开放授权令牌过多。 | -| ERROR_OAUTH_UNSUPPORT_ACTION | 10016 | 表示不支持的鉴权操作。 | -| ERROR_OAUTH_UNSUPPORT_AUTH_TYPE | 10017 | 表示不支持的鉴权类型。 | -| ERROR_PERMISSION_DENIED | 10018 | 表示权限不足。 | +| 名称 | 默认值 | 描述 | +| ----------------------------------- | ----- | ------------ | +| SUCCESS | 0 | 表示操作成功。 | +| ERROR_ACCOUNT_NOT_EXIST | 10001 | 表示应用帐户不存在。 | +| ERROR_APP_ACCOUNT_SERVICE_EXCEPTION | 10002 | 表示应用帐户服务异常。 | +| ERROR_INVALID_PASSWORD | 10003 | 表示密码无效。 | +| ERROR_INVALID_REQUEST | 10004 | 表示请求无效。 | +| ERROR_INVALID_RESPONSE | 10005 | 表示响应无效。 | +| ERROR_NETWORK_EXCEPTION | 10006 | 表示网络异常。 | +| ERROR_OAUTH_AUTHENTICATOR_NOT_EXIST | 10007 | 表示认证器不存在。 | +| ERROR_OAUTH_CANCELED | 10008 | 表示鉴权取消。 | +| ERROR_OAUTH_LIST_TOO_LARGE | 10009 | 表示开放授权列表过大。 | +| ERROR_OAUTH_SERVICE_BUSY | 10010 | 表示开放授权服务忙碌。 | +| ERROR_OAUTH_SERVICE_EXCEPTION | 10011 | 表示开放授权服务异常。 | +| ERROR_OAUTH_SESSION_NOT_EXIST | 10012 | 表示鉴权会话不存在。 | +| ERROR_OAUTH_TIMEOUT | 10013 | 表示鉴权超时。 | +| ERROR_OAUTH_TOKEN_NOT_EXIST | 10014 | 表示开放授权令牌不存在。 | +| ERROR_OAUTH_TOKEN_TOO_MANY | 10015 | 表示开放授权令牌过多。 | +| ERROR_OAUTH_UNSUPPORT_ACTION | 10016 | 表示不支持的鉴权操作。 | +| ERROR_OAUTH_UNSUPPORT_AUTH_TYPE | 10017 | 表示不支持的鉴权类型。 | +| ERROR_PERMISSION_DENIED | 10018 | 表示权限不足。 | ## AuthenticatorCallback8+ @@ -1657,10 +1656,10 @@ onResult: (code: number, result: {[key: string]: any}) => void **系统能力:** SystemCapability.Account.AppAccount **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ------ | -------------------- | ---- | ------------ | -| code | number | 是 | 鉴权结果码。 | -| result | {[key: string]: any} | 是 | 鉴权结果。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | -------------------- | ---- | ------ | +| code | number | 是 | 鉴权结果码。 | +| result | {[key: string]: any} | 是 | 鉴权结果。 | **示例:** @@ -1687,9 +1686,9 @@ onRequestRedirected: (request: Want) => void **系统能力:** SystemCapability.Account.AppAccount **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ------- | ---- | ---- | -------------------- | -| request | Want | 是 | 用于跳转的请求信息。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------- | ---- | ---- | ---------- | +| request | Want | 是 | 用于跳转的请求信息。 | **示例:** @@ -1724,12 +1723,12 @@ addAccountImplicitly(authType: string, callerBundleName: string, options: {[key: **系统能力:** SystemCapability.Account.AppAccount **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| ---------------- | --------------------- | ---- | ------------------------------ | -| authType | string | 是 | 应用帐户的鉴权类型。 | -| callerBundleName | string | 是 | 鉴权请求方的包名。 | -| options | {[key: string]: any} | 是 | 鉴权所需要的可选项。 | -| callback | AuthenticatorCallback | 是 | 认证器回调,用于返回鉴权结果。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------------- | --------------------- | ---- | --------------- | +| authType | string | 是 | 应用帐户的鉴权类型。 | +| callerBundleName | string | 是 | 鉴权请求方的包名。 | +| options | {[key: string]: any} | 是 | 鉴权所需要的可选项。 | +| callback | AuthenticatorCallback | 是 | 认证器回调,用于返回鉴权结果。 | ### authenticate8+ @@ -1740,13 +1739,13 @@ authenticate(name: string, authType: string, callerBundleName: string, options: **系统能力:** SystemCapability.Account.AppAccount **参数:** -| 接口名 | 类型 | 必填 | 说明 | -| ---------------- | --------------------- | ---- | ------------------------------ | -| name | string | 是 | 应用帐户的名称。 | -| authType | string | 是 | 应用帐户的鉴权类型。 | -| callerBundleName | string | 是 | 鉴权请求方的包名。 | -| options | {[key: string]: any} | 是 | 鉴权所需要的可选项。 | -| callback | AuthenticatorCallback | 是 | 认证器回调,用于返回鉴权结果。 | +| 接口名 | 类型 | 必填 | 说明 | +| ---------------- | --------------------- | ---- | --------------- | +| name | string | 是 | 应用帐户的名称。 | +| authType | string | 是 | 应用帐户的鉴权类型。 | +| callerBundleName | string | 是 | 鉴权请求方的包名。 | +| options | {[key: string]: any} | 是 | 鉴权所需要的可选项。 | +| callback | AuthenticatorCallback | 是 | 认证器回调,用于返回鉴权结果。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-application-Want.md b/zh-cn/application-dev/reference/apis/js-apis-application-Want.md new file mode 100644 index 0000000000000000000000000000000000000000..84ce31f96d54d081e45a48f7bfa610983735be8f --- /dev/null +++ b/zh-cn/application-dev/reference/apis/js-apis-application-Want.md @@ -0,0 +1,30 @@ +# Want + +> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** +> 本模块首批接口从API version 8 开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 + +Want是系统的基本通信组件。 + + +## 导入模块 + + +``` +import Want from '@ohos.application.Want'; +``` + +## 属性 + +**系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase + +| 名称 | 读写属性 | 类型 | 必填 | 描述 | +| ----------- | -------- | -------------------- | ---- | ------------------------------------------------------------ | +| deviceId | 只读 | string | 否 | 表示运行指定Ability的设备ID。 | +| bundleName | 只读 | string | 否 | 表示包描述。如果在Want中同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。 | +| abilityName | 只读 | string | 否 | 表示待启动的Ability名称。如果在Want中同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。 | +| uri | 只读 | string | 否 | 表示Uri描述。如果在Want中指定了Uri,则Want将匹配指定的Uri信息,包括scheme, schemeSpecificPart, authority和path信息。 | +| type | 只读 | string | 否 | 表示MIME type类型描述,比如:"text/plain" 、 "image/*"等。 | +| flags | 只读 | number | 否 | 表示处理Want的方式。默认传数字,具体参考:[flags说明](#flags说明)。 | +| action | 只读 | string | 否 | 表示action选项描述。 | +| parameters | 只读 | {[key: string]: any} | 否 | 表示WantParams描述。 | +| entities | 只读 | Array\ | 否 | 表示entities相关描述。 | | \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-appmanager.md b/zh-cn/application-dev/reference/apis/js-apis-appmanager.md index fd5d831722260b0bddc5408d02c408c220a98554..86c762a4e1347e01f77480f7df31c095f5787640 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-appmanager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-appmanager.md @@ -82,13 +82,11 @@ isRamConstrainedDevice(): Promise\; **示例:** ```js - IsRamConstrainedDevicePromise(){ app.isRamConstrainedDevicePromise().then((data) => { console.log('success:' + JSON.stringify(data)); }).catch((error) => { console.log('failed:' + JSON.stringify(error)); }); - } ``` ## appManager.isRamConstrainedDevice @@ -108,12 +106,10 @@ isRamConstrainedDevice(callback: AsyncCallback\): void; **示例:** ```js - IsRamConstrainedDeviceCallBack(){ app.isRamConstrainedDevicePromise((err, data) => { console.log('startAbility result failed:' + JSON.stringify(err)); console.log('startAbility result success:' + JSON.stringify(data)); }) - } ``` ## appManager.getAppMemorySize @@ -133,13 +129,11 @@ getAppMemorySize(): Promise\; **示例:** ```js - GetAppMemorySize(){ app.getAppMemorySize().then((data) => { console.log('success:' + JSON.stringify(data)); }).catch((error) => { console.log('failed:' + JSON.stringify(error)); }); - } ``` ## appManager.getAppMemorySize @@ -159,12 +153,56 @@ getAppMemorySize(callback: AsyncCallback\): void; **示例:** ```js - GetAppMemorySizeCallBack(){ app.getAppMemorySize((err, data) => { console.log('startAbility result failed :' + JSON.stringify(err)); console.log('startAbility result success:' + JSON.stringify(data)); }) - } + ``` +## appManager.getProcessRunningInfos8+ + +getProcessRunningInfos(): Promise>; + +获取有关运行进程的信息。 + +**系统能力**:SystemCapability.Ability.AbilityRuntime.Core + +**返回值:** + + | 类型 | 说明 | + | -------- | -------- | + | Promise> | 获取有关运行进程的信息。 | + +**示例:** + + ```js + app.GetProcessRunningInfos().then((data) => { + console.log('success:' + JSON.stringify(data)); + }).catch((error) => { + console.log('failed:' + JSON.stringify(error)); + }); + ``` + +## appManager.getProcessRunningInfos8+ + +getProcessRunningInfos(callback: AsyncCallback>): void; + +获取有关运行进程的信息。 + +**系统能力**:SystemCapability.Ability.AbilityRuntime.Core + +**参数:** + + | 参数名 | 类型 | 必填 | 说明 | + | -------- | -------- | -------- | -------- | + | callback | AsyncCallback> | 否 | 获取有关运行进程的信息。 | + +**示例:** + + ```js + app.GetProcessRunningInfos((err, data) => { + console.log('startAbility result failed :' + JSON.stringify(err)); + console.log('startAbility result success:' + JSON.stringify(data)); + }) ``` ## ProcessRunningInfo diff --git a/zh-cn/application-dev/reference/apis/js-apis-basic-features-animator.md b/zh-cn/application-dev/reference/apis/js-apis-basic-features-animator.md index 95d0cebfeb3662907a6143e1542e9efe41b51453..9f94916032a8000ea9d5eeda565dfc2ff1fd2bee 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-basic-features-animator.md +++ b/zh-cn/application-dev/reference/apis/js-apis-basic-features-animator.md @@ -6,191 +6,31 @@ ## 导入模块 -requestAnimationFrame:无需导入 - -cancelAnimationFrame:无需导入 - -createAnimator: - ``` import animator from '@ohos.animator'; ``` -## 权限列表 - -无 +## createAnimator -## requestAnimationFrame +createAnimator(options: AnimatorOptions): AnimatorResult -requestAnimationFrame(handler[, [ ...args]]): number +定义Animator类。 -请求动画帧,逐帧回调JS函数。 +**系统能力:** SystemCapability.ArkUI.ArkUI.Full -- 参数 +**参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | - | handler | Function | 是 | 表示要逐帧回调的函数。requestAnimationFrame函数回调handler函数时会在第一个参数位置传入timestamp时间戳。它表示requestAnimationFrame开始去执行回调函数的时刻。 | - | ...args | Array<any> | 否 | 附加参数,函数回调时,他们会作为参数传递给handler。 | + | options | [AnimatorOptions](#animatoroptions) | 是 | 定义动画选项,详细请参考AnimatorOptions。| -- 返回值 +**返回值:** | 类型 | 说明 | | -------- | -------- | - | number | requestID请求的ID。 | - -- 示例 - ``` - -
- -
- ``` - - ``` - /* xxx.css */ - .container { - flex-direction: column; - justify-content: center; - align-items: center; - width: 100%; - height: 100%; - } - .btn{ - width: 300px; - margin-top: 40px; - } - ``` - - ``` - /* xxx.js */ - export default { - data: { - requestId: 0, - startTime: 0, - }, - beginAnimation() { - cancelAnimationFrame(this.requestId); - this.requestId = requestAnimationFrame(this.runAnimation); - }, - runAnimation(timestamp) { - if (this.startTime == 0) { - this.startTime = timestamp; - } - var elapsed = timestamp - this.startTime; - if (elapsed < 500) { - console.log('callback handler timestamp: ' + timestamp); - this.requestId = requestAnimationFrame(this.runAnimation); - } - } - } - ``` - - -## cancelAnimationFrame - -cancelAnimationFrame(requestId: number): void - -取消动画帧,取消逐帧回调请求。 - -- 参数 - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | requestId | number | 是 | 逐帧回调函数的标识id。 | - -- 示例 - ``` - -
- - -
- ``` + | [AnimatorResult](#animatorresult) | Animator结果接口。 | - ``` - /* xxx.css */ - .container { - flex-direction: column; - justify-content: center; - align-items: center; - width: 100%; - height: 100%; - } - .btn{ - width: 300px; - margin-top: 40px; - } - ``` +**示例:** - ``` - /* xxx.js */ - export default { - data: { - requestId: 0, - startTime: 0, - }, - beginAnimation() { - cancelAnimationFrame(this.requestId); - this.requestId = requestAnimationFrame(this.runAnimation); - }, - runAnimation(timestamp) { - if (this.startTime == 0) { - this.startTime = timestamp; - } - var elapsed = timestamp - this.startTime; - if (elapsed < 500) { - console.log('callback handler timestamp: ' + timestamp); - this.requestId = requestAnimationFrame(this.runAnimation); - } - }, - stopAnimation() { - cancelAnimationFrame(this.requestId); - } - } - ``` - - -## createAnimator - -createAnimator(options[...]): void - -创建动画对象。 - -- 参数 - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | options | Object | 是 | 表示待创建Animator对象的属性,详情见下表options说明。 | - -- options说明 - | 参数名 | 类型 | 必填 | 说明 | - | -------- | -------- | -------- | -------- | - | duration | number | 否 | 动画播放的时长,单位毫秒,默认为0。 | - | easing | string | 否 | 动画插值曲线,默认为' ease '。 | - | delay | number | 否 | 动画延时播放时长,单位毫秒,默认为0,即不延时。 | - | fill | string | 否 | 动画启停模式,默认值none,详情见:[animation-fill-mode](../arkui-js/js-components-common-animation.md) | - | direction | string | 否 | 动画播放模式,默认值normal,详情见:[animation-direction](../arkui-js/js-components-common-animation.md) | - | iterations | number | 否 | 动画播放次数,默认值1,设置为0时不播放,设置为-1时无限次播放。 | - | begin | number | 否 | 动画插值起点,不设置时默认为0。 | - | end | number | 否 | 动画插值终点,不设置时默认为1。 | - -- animator支持的接口 - | 参数名 | 类型 | 说明 | - | -------- | -------- | -------- | - | update | options | 过程中可以使用这个接口更新动画参数,入参与createAnimator一致。 | - | play | - | 开始动画。 | - | finish | - | 结束动画。 | - | pause | - | 暂停动画。 | - | cancel | - | 取消动画。 | - | reverse | - | 倒播动画。 | - -- animator支持的事件: - | 参数名 | 类型 | 说明 | - | -------- | -------- | -------- | - | frame | number | 逐帧插值回调事件,入参为当前帧的插值 | - | cancel | - | 动画被强制取消 | - | finish | - | 动画播放完成 | - | repeat | - | 动画重新播放 | - -- 示例 ```
@@ -237,3 +77,164 @@ createAnimator(options[...]): void } } ``` + +## AnimatorResult + +定义Animator结果接口。 + +### update + +update(options: AnimatorOptions): void + +更新当前动画器。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + | 参数名 | 类型 | 必填 | 说明 | + | -------- | -------- | -------- | -------- | + | options | [AnimatorOptions](#animatoroptions) | 是 | 定义动画选项。| + +**示例:** +``` +animator.update(options); +``` + +### play + +play(): void + +启动动画。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**示例:** +``` +animator.play(); +``` + +### finish + +finish(): void + +结束动画。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**示例:** +``` +animator.finish(); +``` + +### pause + +pause(): void + +暂停动画。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**示例:** +``` +animator.pause(); +``` + +### cancel + +cancel(): void + +删除动画。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**示例:** +``` +animator.cancel(); +``` + +### reverse + +reverse(): void + +以相反的顺序播放动画。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**示例:** +``` +animator.reverse(); +``` + +### onframe + +onframe: (progress: number) => void + +回调时触发。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + | 参数名 | 类型 | 必填 | 说明 | + | -------- | -------- | -------- | -------- | + | progress | number | 是 | 动画的当前进度。| + +**示例:** +``` +animator.onframe(); +``` + +### onfinish + +onfinish: () => void + +动画完成。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**示例:** +``` +animator.onfinish(); +``` + +### oncancel + +oncancel: () => void + +动画被取消。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**示例:** +``` +animator.oncancel(); +``` + +### onrepeat + +onrepeat: () => void + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**示例:** +``` +animator.onrepeat(); +``` + +动画将重复。 + +## AnimatorOptions + +定义动画选项。 + +**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full + +| 名称 | 参数类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| duration | number | 是 | 动画播放的时长,单位毫秒,默认为0。 | +| easing | string | 是 | 动画插值曲线,默认为ease'。 | +| delay | number | 是 | 动画延时播放时长,单位毫秒,默认为0,即不延时。 | +| fill | "none" \| "forwards" \| "backwards" \| "both" | 是 | 动画执行后是否恢复到初始状态,默认值为"none"。动画执行后,动画结束时的状态(在最后一个关键帧中定义)将保留。 | +| direction | "normal" \| "reverse" \| "alternate" \| "alternate-reverse" | 是 | 动画播放模式,默认值"normal"。| +| iterations | number | 是 | 动画播放次数,默认值1。设置为0时不播放,设置为-1时无限次播放。 | +| begin | number | 是 | 动画插值起点,不设置时默认为0。 | +| end | number | 是 | 动画插值终点,不设置时默认为1。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-basic-features-ohos-prompt.md b/zh-cn/application-dev/reference/apis/js-apis-basic-features-ohos-prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..b843237d0cdd8a3e5ecd9db7630de3ea4c533d85 --- /dev/null +++ b/zh-cn/application-dev/reference/apis/js-apis-basic-features-ohos-prompt.md @@ -0,0 +1,273 @@ +# 弹窗 + +> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明** +> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 + +## 导入模块 + +``` +import prompt from '@ohos.prompt' +``` +## 权限列表 + +无 + +## prompt.showToast + +showToast(options: ShowToastOptions): void + +创建并显示文本提示框。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + | 参数名 | 类型 | 必填 | 说明 | + | -------- | -------- | -------- | -------- | + | options | [ShowToastOptions](#ShowToastOptions) | 是 | 文本弹窗选项。 | + +**示例:** + ``` + export default { + showToast() { + prompt.showToast({ + message: 'Message Info', + duration: 2000, + }); + } + } + ``` +## ShowToastOptions + +文本提示框的选项。 + +**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。 + +| 名称 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| message | string | 是 | 显示的文本信息。 | +| duration | number | 否 | 默认值1500ms,建议区间:1500ms-10000ms。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 若小于1500ms则取默认值,最大取值为10000ms。 | +| bottom | <length> | 否 | 设置弹窗边框距离屏幕底部的位置。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 仅手机和平板设备支持。 | + +## prompt.showDialog + +showDialog(options: ShowDialogOptions): Promise<ShowDialogSuccessResponse> + +创建并显示对话框,对话框响应后同步返回结果。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + | 参数名 | 类型 | 必填 | 说明 | + | -------- | -------- | -------- | -------- | + | options | [ShowDialogOptions](#ShowDialogOptions) | 是 | 对话框选项。| + +**返回值:** + + | 类型 | 说明 | + | -------- | -------- | + | Promise<[ShowDialogSuccessResponse](#ShowDialogSuccessResponse)> | 对话框响应结果。| + +**示例:** + + ``` + export default { + showDialog() { + prompt.showDialog({ + title: 'Title Info', + message: 'Message Info', + buttons: [ + { + text: 'button1', + color: '#000000', + }, + { + text: 'button2', + color: '#000000', + } + ], + }) + .then(data => { + console.info('showDialog success, click button: ' + data.index); + }) + .catch(err => { + console.info('showDialog error: ' + err); + }) + } + } + ``` + +## prompt.showDialog + +showDialog(options: ShowDialogOptions, callback: AsyncCallback<ShowDialogSuccessResponse>):void + +创建并显示对话框,对话框响应结果异步返回。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + + +**参数:** + | 参数名 | 类型 | 必填 | 说明 | + | -------- | -------- | -------- | -------- | + | options | [ShowDialogOptions](#ShowDialogOptions) | 是 | 页面显示对话框信息描述。| + | callback | AsyncCallback<[ShowDialogSuccessResponse](#ShowDialogSuccessResponse)> | 是 | 对话框响应结果回调。 | + +**示例:** + ``` + export default { + callback(err, data) { + if(err) { + console.info('showDialog err: ' + err); + return; + } + console.info('showDialog success callback, click button: ' + data.index); + }, + showDialog() { + prompt.showDialog({ + title: 'showDialog Title Info', + message: 'Message Info', + buttons: [ + { + text: 'button1', + color: '#000000', + }, + { + text: 'button2', + color: '#000000', + } + ] + }, this.callback); + } + } + ``` + +## ShowDialogOptions + +对话框的选项。 + +**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。 + +| 名称 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| title | string | 否 | 标题文本。 | +| message | string | 否 | 内容文本。 | +| buttons | Array | 否 | 对话框中按钮的数组,结构为:{text:'button', color: '\#666666'},支持1-3个按钮。其中第一个为positiveButton;第二个为negativeButton;第三个为neutralButton。 | + +## ShowDialogSuccessResponse + +对话框的响应结果。 + +**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。 + +| 名称 | 类型 | 说明 | +| -------- | -------- | -------- | +| index | number | 选中按钮在buttons数组中的索引。 | + + +## prompt.showActionMenu + +showActionMenu(options: ActionMenuOptions, callback: AsyncCallback<ActionMenuSuccessResponse>):void + +创建并显示操作菜单,菜单响应结果异步返回。 + +**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。 + +**参数:** + | 参数名 | 类型 | 必填 | 说明 | + | -------- | -------- | -------- | -------- | + | options | [ActionMenuOptions](#ActionMenuOptions) | 是 | 操作菜单选项。 | + | callback | AsyncCallback<[ActionMenuSuccessResponse](#ActionMenuSuccessResponse)> | 是 | 菜单响应结果回调。 | + + +**示例:** + ``` + export default { + callback(err, data) { + if(err) { + console.info('showActionMenu err: ' + err); + return; + } + console.info('showActionMenu success callback, click button: ' + data.index); + }, + showActionMenu() { + prompt.showActionMenu({ + title: 'Title Info', + buttons: [ + { + text: 'item1', + color: '#666666', + }, + { + text: 'item2', + color: '#000000', + }, + ] + }, this.callback) + } + } + ``` + +## prompt.showActionMenu + +showActionMenu(options: ActionMenuOptions): Promise + +创建并显示操作菜单,菜单响应后同步返回结果。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + | 参数名 | 类型 | 必填 | 说明 | + | -------- | -------- | -------- | -------- | + | options | [ActionMenuOptions](#ActionMenuOptions) | 是 | 操作菜单选项。 | + +**返回值:** + | 类型 | 说明 | + | -------- | -------- | + | Promise<[ActionMenuSuccessResponse](#ActionMenuSuccessResponse)> | 菜单响应结果。| + +**示例:** + ``` + export default { + showActionMenu() { + prompt.showActionMenu({ + title: 'showActionMenu Title Info', + buttons: [ + { + text: 'item1', + color: '#666666', + }, + { + text: 'item2', + color: '#000000', + }, + ] + }) + .then(data => { + console.info('showActionMenu success, click button: ' + data.index); + }) + .catch(err => { + console.info('showActionMenu error: ' + err); + }) + } + } + ``` +## ActionMenuOptions + +操作菜单的选项。 + +**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。 + +| 名称 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| title | string | 否 | 标题文本。 | +| buttons | Array | 是 | 菜单中菜单项按钮的数组,结构为:{text:'button', color: '\#666666'},支持1-6个按钮。大于6个按钮时弹窗不显示。 | + +## ActionMenuSuccessResponse + +操作菜单的响应结果。 + +**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。 + +| 名称 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| index | number | 否 | 选中按钮在buttons数组中的索引,从0开始。 | + diff --git a/zh-cn/application-dev/reference/apis/js-apis-basic-features-ohos-router.md b/zh-cn/application-dev/reference/apis/js-apis-basic-features-ohos-router.md new file mode 100644 index 0000000000000000000000000000000000000000..a23600c396045139e7b0a8fcf1049e0d632c2273 --- /dev/null +++ b/zh-cn/application-dev/reference/apis/js-apis-basic-features-ohos-router.md @@ -0,0 +1,434 @@ +# 页面路由 + +> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明** +> +> - 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 +> - 页面路由需要在页面渲染完成之后才能调用,在onInit和onReady生命周期中页面还处于渲染阶段,禁止调用页面路由方法。 + +## 导入模块 + +``` +import router from '@ohos.router' +``` + +## 权限列表 + +无 + +## router.push + +push(options: RouterOptions): void + +跳转到应用内的指定页面。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + | 参数名 | 类型 | 必填 | 说明 | + | -------- | -------- | -------- | -------- | + | options | [RouterOptions](#RouterOptions) | 是 | 跳转页面描述信息。 | + + +**示例:** + ``` + // 在当前页面中 + export default { + pushPage() { + router.push({ + url: 'pages/routerpage2/routerpage2', + params: { + data1: 'message', + data2: { + data3: [123, 456, 789] + }, + }, + }); + } + } + ``` + ``` + // 在routerpage2页面中 + export default { + data: { + data1: 'default', + data2: { + data3: [1, 2, 3] + } + }, + onInit() { + console.info('showData1:' + this.data1); + console.info('showData3:' + this.data2.data3); + } + } + ``` + + +## router.replace + +replace(options: RouterOptions): void + +用应用内的某个页面替换当前页面,并销毁被替换的页面。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + | 参数名 | 类型 | 必填 | 说明 | + | -------- | -------- | -------- | -------- | + | options | [RouterOptions](#RouterOptions) | 是 | 替换页面描述信息。 | + +**示例:** + ``` + // 在当前页面中 + export default { + replacePage() { + router.replace({ + url: 'pages/detail/detail', + params: { + data1: 'message', + }, + }); + } + } + ``` + + ``` + // 在detail页面中 + export default { + data: { + data1: 'default' + }, + onInit() { + console.info('showData1:' + this.data1) + } + } + ``` + +## router.back + +back(options?: RouterOptions ): void + +返回上一页面或指定的页面。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + | 参数名 | 类型 | 必填 | 说明 | + | -------- | -------- | -------- | -------- | + | options | [RouterOptions](#RouterOptions) | 是 | 返回页面描述信息,其中参数url指路由跳转时会返回到指定url的界面,如果页面栈上没有url页面,则不响应该情况。如果url未设置,则返回上一页。 | + +**示例:** + ``` + // index页面 + export default { + indexPushPage() { + router.push({ + url: 'pages/detail/detail', + }); + } + } + ``` + + ``` + // detail页面 + export default { + detailPushPage() { + router.push({ + url: 'pages/mall/mall', + }); + } + } + ``` + + ``` + // mall页面通过back,将返回detail页面 + export default { + mallBackPage() { + router.back(); + } + } + ``` + + ``` + // detail页面通过back,将返回index页面 + export default { + defaultBack() { + router.back(); + } + } + ``` + + ``` + // 通过back,返回到detail页面 + export default { + backToDetail() { + router.back({uri:'pages/detail/detail'}); + } + } + ``` + +## router.clear + +clear(): void + +清空页面栈中的所有历史页面,仅保留当前页面作为栈顶页面。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**示例:** + ``` + export default { + clearPage() { + router.clear(); + } + } + ``` + +## router.getLength + +getLength(): string + +获取当前在页面栈内的页面数量。 + +**返回值:** + | 类型 | 说明 | + | -------- | -------- | + | string | 页面数量,页面栈支持最大数值是32。 | + +**示例:** + ``` + export default { + getLength() { + var size = router.getLength(); + console.log('pages stack size = ' + size); + } + } + ``` + +## router.getState + +getState(): RouterState + +获取当前页面的状态信息。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**返回值:** + +| 类型 | 说明 | +| --------------------------- | -------------- | +| [RouterState](#RouterState) | 页面状态信息。 | +## RouterState +页面状态信息。 + +**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full。 + + | 名称 | 类型 | 说明 | + | -------- | -------- | -------- | + | index | number | 表示当前页面在页面栈中的索引。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 从栈底到栈顶,index从1开始递增。 | + | name | string | 表示当前页面的名称,即对应文件名。 | + | path | string | 表示当前页面的路径。 | + +**示例:** + ``` + export default { + getState() { + var page = router.getState(); + console.log('current index = ' + page.index); + console.log('current name = ' + page.name); + console.log('current path = ' + page.path); + } + } + ``` + +## router.enableAlertBeforeBackPage + +enableAlertBeforeBackPage(options: EnableAlertOptions): void + +开启页面返回询问对话框。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + | 参数名 | 类型 | 必填 | 说明 | + | -------- | -------- | -------- | -------- | + | options | [EnableAlertOptions](#EnableAlertOptions) | 是 | 文本弹窗信息描述。 | + +**示例:** + + ``` + export default { + enableAlertBeforeBackPage() { + router.enableAlertBeforeBackPage({ + message: 'Message Info', + success: function() { + console.log('success'); + }, + fail: function() { + console.log('fail'); + }, + }); + } + } + ``` +## EnableAlertOptions + +页面返回询问对话框选项。 + +**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Lite。 + +| 名称 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| message | string | 是 | 询问对话框内容。 | + +## router.disableAlertBeforeBackPage + +disableAlertBeforeBackPage(): void + +禁用页面返回询问对话框。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**示例:** + ``` + export default { + disableAlertBeforeBackPage() { + router.disableAlertBeforeBackPage(); + } + } + ``` + +## router.getParams + +getParams(): Object + +获取发起跳转的页面往当前页传入的参数。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**返回值:** + +| 类型 | 说明 | +| ------ | ---------------------------------- | +| Object | 发起跳转的页面往当前页传入的参数。 | +**示例:** + +- 类Web范示例 + ``` + // 在当前页面中 + export default { + pushPage() { + router.push({ + url: 'pages/detail/detail', + params: { + data1: 'message', + }, + }); + } + } + ``` + ``` + // 在detail页面中 + export default { + onInit() { + console.info('showData1:' + router.getParams().data1); + } + } + ``` + +- 声明式示例 + + ``` + //通过router.push跳转至目标页携带params参数 + import router from '@ohos.router' + + @Entry + @Component + struct Index { + async routePage() { + let options = { + url: 'pages/second', + params: { + text: '这是第一页的值', + data: { + array: [12, 45, 78] + }, + } + } + try { + await router.push(options) + } catch (err) { + console.info(` fail callback, code: ${err.code}, msg: ${err.msg}`) + } + } + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text('这是第一页') + .fontSize(50) + .fontWeight(FontWeight.Bold) + Button() { + Text('next page') + .fontSize(25) + .fontWeight(FontWeight.Bold) + }.type(ButtonType.Capsule) + .margin({ top: 20 }) + .backgroundColor('#ccc') + .onClick(() => { + this.routePage() + }) + } + .width('100%') + .height('100%') + } + } + ``` + + ``` + //在second页面中接收传递过来的参数 + import router from '@ohos.router' + + @Entry + @Component + struct Second { + private content: string = "这是第二页" + @State text: string = router.getParams().text + @State data: any = router.getParams().data + @State secondData : string = '' + + build() { + Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { + Text(`${this.content}`) + .fontSize(50) + .fontWeight(FontWeight.Bold) + Text(this.text) + .fontSize(30) + .onClick(()=>{ + this.secondData = (this.data.array[1]).toString() + }) + .margin({top:20}) + Text('第一页传来的数值' + ' ' + this.secondData) + .fontSize(20) + .margin({top:20}) + .backgroundColor('red') + } + .width('100%') + .height('100%') + } + } + ``` + +## RouterOptions + +路由跳转选项。 + +**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Lite。 + +| 名称 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| url | string | 是 | 表示目标页面的uri,可以用以下两种格式:
- 页面绝对路径,由配置文件中pages列表提供,例如:
  - pages/index/index
  - pages/detail/detail
- 特殊值,如果uri的值是"/",则跳转到首页。 | +| params | Object | 否 | 跳转时要同时传递到目标页面的数据,跳转到目标页面后,参数可以在页面中直接使用,如this.data1(data1为跳转时params参数中的key值)。如果目标页面中已有该字段,则其值会被传入的字段值覆盖。 | + + + > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** + > 页面路由栈支持的最大Page数量为32。 + diff --git a/zh-cn/application-dev/reference/apis/js-apis-bluetooth.md b/zh-cn/application-dev/reference/apis/js-apis-bluetooth.md index 07f05f2c4a91aeeeec49641c44982dfb9c2f18a4..a6725fc83590266ff5cc46a2bb7ad1877b944b18 100755 --- a/zh-cn/application-dev/reference/apis/js-apis-bluetooth.md +++ b/zh-cn/application-dev/reference/apis/js-apis-bluetooth.md @@ -2,7 +2,7 @@ > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 -> +> > 蓝牙模块提供了基础的传统蓝牙能力以及BLE的扫描、广播等功能。 @@ -24,8 +24,6 @@ ohos.permission.DISCOVER_BLUETOOTH ohos.permission.LOCATION - - ## bluetooth.enableBluetooth8+ enableBluetooth(): boolean @@ -38,8 +36,8 @@ enableBluetooth(): boolean **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------- | ------------------------ | | boolean | 打开蓝牙,成功返回true,否则返回false。 | **示例:** @@ -61,8 +59,8 @@ disableBluetooth(): boolean **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------- | ------------------------ | | boolean | 关闭蓝牙,成功返回true,否则返回false。 | **示例:** @@ -84,8 +82,8 @@ getLocalName(): string **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------ | --------- | | string | 蓝牙本地设备名称。 | **示例:** @@ -107,8 +105,8 @@ getState(): BluetoothState **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| --------------------------------- | --------- | | [BluetoothState](#bluetoothstate) | 表示蓝牙开关状态。 | **示例:** @@ -130,8 +128,8 @@ getBtConnectionState(): ProfileConnectionState **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ---------------------------------------- | ------------------- | | [ProfileConnectionState](#profileconnectionstate) | 表示蓝牙设备的Profile连接状态。 | **示例:** @@ -153,14 +151,14 @@ setLocalName(name: string): boolean **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| name | string | 是 | 要设置的蓝牙名称,最大长度为248。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---- | ------ | ---- | --------------------- | +| name | string | 是 | 要设置的蓝牙名称,最大长度为248字节数。 | **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------- | ------------------------------ | | boolean | 设置蓝牙本地设备名称,成功返回true,否则返回false。 | **示例:** @@ -182,14 +180,14 @@ pairDevice(deviceId: string): boolean **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| deviceId | string | 是 | 表示配对的远端设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------ | ---- | ----------------------------------- | +| deviceId | string | 是 | 表示配对的远端设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------- | -------------------------- | | boolean | 发起蓝牙配对,成功返回true,否则返回false。 | **示例:** @@ -212,14 +210,14 @@ getProfileConnState(profileId: ProfileId): ProfileConnectionState **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| ProfileId | profileId | 是 | 表示profile的枚举值,例如:PROFILE_A2DP_SOURCE。 | +| 参数名 | 类型 | 必填 | 说明 | +| --------- | --------- | ---- | ------------------------------------- | +| ProfileId | profileId | 是 | 表示profile的枚举值,例如:PROFILE_A2DP_SOURCE。 | **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ---------------------------------------- | ------------- | | [ProfileConnectionState](#ProfileConnectionState) | profile的连接状态。 | **示例:** @@ -241,14 +239,14 @@ cancelPairedDevice(deviceId: string): boolean **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| deviceId | string | 是 | 表示要删除的远程设备的地址,例如:"XX:XX:XX:XX:XX:XX"。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------ | ---- | ------------------------------------- | +| deviceId | string | 是 | 表示要删除的远程设备的地址,例如:"XX:XX:XX:XX:XX:XX"。 | **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------- | -------------------------- | | boolean | 启动取消配对,成功返回true,否则返回false。 | **示例:** @@ -270,14 +268,14 @@ getRemoteDeviceName(deviceId: string): string **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| deviceId | string | 是 | 表示远程设备的地址,例如:"XX:XX:XX:XX:XX:XX"。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------ | ---- | --------------------------------- | +| deviceId | string | 是 | 表示远程设备的地址,例如:"XX:XX:XX:XX:XX:XX"。 | **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------ | ------------- | | string | 以字符串格式返回设备名称。 | **示例:** @@ -299,14 +297,14 @@ getRemoteDeviceClass(deviceId: string): DeviceClass **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| deviceId | string | 是 | 表示远程设备的地址,例如:"XX:XX:XX:XX:XX:XX"。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------ | ---- | --------------------------------- | +| deviceId | string | 是 | 表示远程设备的地址,例如:"XX:XX:XX:XX:XX:XX"。 | **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| --------------------------- | -------- | | [DeviceClass](#deviceclass) | 远程设备的类别。 | **示例:** @@ -328,8 +326,8 @@ getPairedDevices(): Array<string> **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------------------- | ------------- | | Array<string> | 已配对蓝牙设备的地址列表。 | **示例:** @@ -351,15 +349,15 @@ setBluetoothScanMode(mode: ScanMode, duration: number): boolean **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| mode | [ScanMode](#scanmode) | 是 | 蓝牙扫描模式。 | -| duration | number | 是 | 设备可被发现的持续时间,单位为秒;设置为0则持续可发现。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------- | ---- | ---------------------------- | +| mode | [ScanMode](#scanmode) | 是 | 蓝牙扫描模式。 | +| duration | number | 是 | 设备可被发现的持续时间,单位为秒;设置为0则持续可发现。 | **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------- | -------------------------- | | boolean | 设置蓝牙扫描,成功返回true,否则返回false。 | **示例:** @@ -382,8 +380,8 @@ getBluetoothScanMode(): ScanMode **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| --------------------- | ------- | | [ScanMode](#scanmode) | 蓝牙扫描模式。 | **示例:** @@ -405,8 +403,8 @@ startBluetoothDiscovery(): boolean **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------- | -------------------------- | | boolean | 开启蓝牙扫描,成功返回true,否则返回false。 | **示例:** @@ -433,8 +431,8 @@ stopBluetoothDiscovery(): boolean **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------- | -------------------------- | | boolean | 关闭蓝牙扫描,成功返回true,否则返回false。 | **示例:** @@ -456,15 +454,15 @@ setDevicePairingConfirmation(device: string, accept: boolean): boolean **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| device | string | 是 | 表示远端设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | -| accept | boolean | 是 | 接受配对请求设置为true,否则设置为false。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------- | ---- | -------------------------------- | +| device | string | 是 | 表示远端设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | +| accept | boolean | 是 | 接受配对请求设置为true,否则设置为false。 | **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------- | ---------------------------- | | boolean | 设置设备配对确认,成功返回true,否则返回false。 | **示例:** @@ -491,10 +489,10 @@ on(type: "bluetoothDeviceFind", callback: Callback<Array<string>>): **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"bluetoothDeviceFind"字符串,表示蓝牙设备发现事件。 | -| callback | Callback<Array<string>> | 是 | 表示回调函数的入参,发现的设备集合。回调函数由用户创建通过该接口注册。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ----------------------------------- | ---- | -------------------------------------- | +| type | string | 是 | 填写"bluetoothDeviceFind"字符串,表示蓝牙设备发现事件。 | +| callback | Callback<Array<string>> | 是 | 表示回调函数的入参,发现的设备集合。回调函数由用户创建通过该接口注册。 | **返回值:** @@ -522,10 +520,10 @@ off(type: "bluetoothDeviceFind", callback?: Callback<Array<string>>) **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"bluetoothDeviceFind"字符串,表示蓝牙设备发现事件。 | -| callback | Callback<Array<string>> | 否 | 表示取消订阅蓝牙设备发现事件上报。不填该参数则取消订阅该type对应的所有回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ----------------------------------- | ---- | ---------------------------------------- | +| type | string | 是 | 填写"bluetoothDeviceFind"字符串,表示蓝牙设备发现事件。 | +| callback | Callback<Array<string>> | 否 | 表示取消订阅蓝牙设备发现事件上报。不填该参数则取消订阅该type对应的所有回调。 | **返回值:** @@ -554,10 +552,10 @@ on(type: "pinRequired", callback: Callback<PinRequiredParam>): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"pinRequired"字符串,表示配对请求事件。 | -| callback | Callback<[PinRequiredParam](#pinrequiredparam)> | 是 | 表示回调函数的入参,配对请求。回调函数由用户创建通过该接口注册。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | -------------------------------- | +| type | string | 是 | 填写"pinRequired"字符串,表示配对请求事件。 | +| callback | Callback<[PinRequiredParam](#pinrequiredparam)> | 是 | 表示回调函数的入参,配对请求。回调函数由用户创建通过该接口注册。 | **返回值:** @@ -585,10 +583,10 @@ off(type: "pinRequired", callback?: Callback<PinRequiredParam>): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"pinRequired"字符串,表示配对请求事件。 | -| callback | Callback<[PinRequiredParam](#pinrequiredparam)> | 否 | 表示取消订阅蓝牙配对请求事件上报,入参为配对请求参数。不填该参数则取消订阅该type对应的所有回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ---------------------------------------- | +| type | string | 是 | 填写"pinRequired"字符串,表示配对请求事件。 | +| callback | Callback<[PinRequiredParam](#pinrequiredparam)> | 否 | 表示取消订阅蓝牙配对请求事件上报,入参为配对请求参数。不填该参数则取消订阅该type对应的所有回调。 | **返回值:** @@ -617,10 +615,10 @@ on(type: "bondStateChange", callback: Callback<BondStateParam>): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"bondStateChange"字符串,表示蓝牙配对状态改变事件。 | -| callback | Callback<[BondStateParam](#bondstate)> | 是 | 表示回调函数的入参,配对的状态。回调函数由用户创建通过该接口注册。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ------------------------------------ | +| type | string | 是 | 填写"bondStateChange"字符串,表示蓝牙配对状态改变事件。 | +| callback | Callback<[BondStateParam](#bondstate)> | 是 | 表示回调函数的入参,配对的状态。回调函数由用户创建通过该接口注册。 | **返回值:** @@ -648,10 +646,10 @@ off(type: "bondStateChange", callback?: Callback<BondStateParam>): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"bondStateChange"字符串,表示蓝牙配对状态改变事件。 | -| callback | Callback<[BondStateParam](#bondstate)> | 否 | 表示取消订阅蓝牙配对状态改变事件上报。不填该参数则取消订阅该type对应的所有回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ---------------------------------------- | +| type | string | 是 | 填写"bondStateChange"字符串,表示蓝牙配对状态改变事件。 | +| callback | Callback<[BondStateParam](#bondstate)> | 否 | 表示取消订阅蓝牙配对状态改变事件上报。不填该参数则取消订阅该type对应的所有回调。 | **返回值:** @@ -680,10 +678,10 @@ on(type: "stateChange", callback: Callback<BluetoothState>): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"stateChange"字符串,表示蓝牙状态改变事件。 | -| callback | Callback<[BluetoothState](#bluetoothstate)> | 是 | 表示回调函数的入参,蓝牙状态。回调函数由用户创建通过该接口注册。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | -------------------------------- | +| type | string | 是 | 填写"stateChange"字符串,表示蓝牙状态改变事件。 | +| callback | Callback<[BluetoothState](#bluetoothstate)> | 是 | 表示回调函数的入参,蓝牙状态。回调函数由用户创建通过该接口注册。 | **返回值:** @@ -711,10 +709,10 @@ off(type: "stateChange", callback?: Callback<BluetoothState>): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"stateChange"字符串,表示蓝牙状态改变事件。 | -| callback | Callback<[BluetoothState](#bluetoothstate)> | 否 | 表示取消订阅蓝牙状态改变事件上报。不填该参数则取消订阅该type对应的所有回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ---------------------------------------- | +| type | string | 是 | 填写"stateChange"字符串,表示蓝牙状态改变事件。 | +| callback | Callback<[BluetoothState](#bluetoothstate)> | 否 | 表示取消订阅蓝牙状态改变事件上报。不填该参数则取消订阅该type对应的所有回调。 | **返回值:** @@ -743,11 +741,11 @@ sppListen(name: string, option: SppOption, callback: AsyncCallback<number> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| name | string | 是 | 服务的名称。 | -| option | [SppOption](#sppoption) | 是 | spp监听配置参数。 | -| callback | AsyncCallback<number> | 是 | 表示回调函数的入参,服务端Socket的id。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------- | ---- | ----------------------- | +| name | string | 是 | 服务的名称。 | +| option | [SppOption](#sppoption) | 是 | spp监听配置参数。 | +| callback | AsyncCallback<number> | 是 | 表示回调函数的入参,服务端Socket的id。 | **示例:** @@ -776,10 +774,10 @@ sppAccept(serverSocket: number, callback: AsyncCallback<number>): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| serverSocket | number | 是 | 服务端socket的id。 | -| callback | AsyncCallback<number> | 是 | 表示回调函数的入参,客户端socket的id。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------------ | --------------------------- | ---- | ----------------------- | +| serverSocket | number | 是 | 服务端socket的id。 | +| callback | AsyncCallback<number> | 是 | 表示回调函数的入参,客户端socket的id。 | **示例:** @@ -809,11 +807,11 @@ sppConnect(device: string, option: SppOption, callback: AsyncCallback<number& **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| device | string | 是 | 对端设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | -| option | [SppOption](#sppoption) | 是 | spp客户端连接配置参数。 | -| callback | AsyncCallback<number> | 是 | 表示回调函数的入参,客户端socket的id。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------- | ---- | ------------------------------ | +| device | string | 是 | 对端设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | +| option | [SppOption](#sppoption) | 是 | spp客户端连接配置参数。 | +| callback | AsyncCallback<number> | 是 | 表示回调函数的入参,客户端socket的id。 | **示例:** @@ -842,9 +840,9 @@ sppCloseServerSocket(socket: number): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| socket | number | 是 | 服务端监听socket的id。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | --------------- | +| socket | number | 是 | 服务端监听socket的id。 | **示例:** @@ -863,10 +861,10 @@ sppCloseClientSocket(socket: number): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| 参数名 | 类型 | 必填 | 说明 | -| socket | number | 是 | 客户端socket的id。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ------------- | +| 参数名 | 类型 | 必填 | 说明 | +| socket | number | 是 | 客户端socket的id。 | **示例:** @@ -885,16 +883,15 @@ sppWrite(clientSocket: number, data: ArrayBuffer): boolean **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| clientSocket | number | 是 | 客户端socket的id。 | -| data | ArrayBuffer | 是 | 写入的数据。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------------ | ----------- | ---- | ------------- | +| clientSocket | number | 是 | 客户端socket的id。 | +| data | ArrayBuffer | 是 | 写入的数据。 | **返回值:** -| | | -| -------- | -------- | -| 类型 | 说明 | +| 类型 | 说明 | +| ------- | ------------------------- | | boolean | 写数据操作,成功返回true,否则返回false。 | **示例:** @@ -922,11 +919,11 @@ on(type: "sppRead", clientSocket: number, callback: Callback<ArrayBuffer>) **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"sppRead"字符串,表示spp读请求事件。 | -| clientSocket | number | 是 | 客户端socket的id。 | -| callback | Callback<ArrayBuffer> | 是 | 表示回调函数的入参,读取到的数据。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------------ | --------------------------- | ---- | -------------------------- | +| type | string | 是 | 填写"sppRead"字符串,表示spp读请求事件。 | +| clientSocket | number | 是 | 客户端socket的id。 | +| callback | Callback<ArrayBuffer> | 是 | 表示回调函数的入参,读取到的数据。 | **返回值:** @@ -953,11 +950,11 @@ off(type: "sppRead", clientSocket: number, callback?: Callback<ArrayBuffer> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"sppRead"字符串,表示spp读请求事件。 | -| clientSocket | number | 是 | 客户端Socket的id。 | -| callback | Callback<ArrayBuffer> | 否 | 表示取消订阅spp读请求事件上报。不填该参数则取消订阅该type对应的所有回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------------ | --------------------------- | ---- | ---------------------------------------- | +| type | string | 是 | 填写"sppRead"字符串,表示spp读请求事件。 | +| clientSocket | number | 是 | 客户端Socket的id。 | +| callback | Callback<ArrayBuffer> | 否 | 表示取消订阅spp读请求事件上报。不填该参数则取消订阅该type对应的所有回调。 | **返回值:** @@ -980,21 +977,20 @@ getProfile(profileId: ProfileId): A2dpSourceProfile | HandsFreeAudioGatewayProfi **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| ProfileId | profileId | 是 | 表示profile的枚举值,例如:PROFILE_A2DP_SOURCE。 | +| 参数名 | 类型 | 必填 | 说明 | +| --------- | --------- | ---- | ------------------------------------- | +| ProfileId | profileId | 是 | 表示profile的枚举值,例如:PROFILE_A2DP_SOURCE。 | **返回值:** -| | | -| -------- | -------- | -| 类型 | 说明 | +| 类型 | 说明 | +| ---------------------------------------- | ---------------------------------------- | | A2dpSourceProfile 或者 HandsFreeAudioGatewayProfile | 对应的profile的对象实例,当前支持A2dpSourceProfile, HandsFreeAudioGatewayProfile。 | **示例:** ```js -A2dpSourceProfile a2dpSrc = bluetooth.getProfile(PROFILE_A2DP_SOURCE); +let a2dpSrc = bluetooth.getProfile(PROFILE_A2DP_SOURCE); ``` @@ -1010,8 +1006,8 @@ createGattServer(): GattServer **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------------------------- | ------------------------------------ | | [GattServer](#gattserver) | server端类,使用server端方法之前需要创建该类的实例进行操作。 | **示例:** @@ -1031,14 +1027,14 @@ createGattClientDevice(deviceId: string): GattClientDevice **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| deviceId | string | 是 | 对端设备地址, 例如:"XX:XX:XX:XX:XX:XX"。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ------ | ---- | ------------------------------------ | +| deviceId | string | 是 | 对端设备地址, 例如:"XX:XX:XX:XX:XX:XX"。 | **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------------------------------------- | ------------------------------------ | | [GattClientDevice](#gattclientdevice) | client端类,使用client端方法之前需要创建该类的实例进行操作。 | **示例:** @@ -1060,8 +1056,8 @@ getConnectedBLEDevices(): Array<string> **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------------------- | ------------------- | | Array<string> | 返回和当前设备连接BLE设备地址集合。 | **示例:** @@ -1083,10 +1079,10 @@ startBLEScan(filters: Array<ScanFilter>, options?: ScanOptions): void **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| filters | Array<[ScanFilter](#scanfilter)> | 是 | 表示扫描结果过滤策略集合,如果不使用过滤的方式,该参数设置为null。 | -| options | [ScanOptions](#scanoptions) | 否 | 表示扫描的参数配置,可选参数。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------- | -------------------------------------- | ---- | ----------------------------------- | +| filters | Array<[ScanFilter](#scanfilter)> | 是 | 表示扫描结果过滤策略集合,如果不使用过滤的方式,该参数设置为null。 | +| options | [ScanOptions](#scanoptions) | 否 | 表示扫描的参数配置,可选参数。 | **返回值:** @@ -1147,10 +1143,10 @@ on(type: "BLEDeviceFind", callback: Callback<Array<ScanResult>>): vo **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"BLEDeviceFind"字符串,表示BLE设备发现事件。 | -| callback | Callback<Array<[ScanResult](#scanresult)>> | 是 | 表示回调函数的入参,发现的设备集合。回调函数由用户创建通过该接口注册。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ----------------------------------- | +| type | string | 是 | 填写"BLEDeviceFind"字符串,表示BLE设备发现事件。 | +| callback | Callback<Array<[ScanResult](#scanresult)>> | 是 | 表示回调函数的入参,发现的设备集合。回调函数由用户创建通过该接口注册。 | **返回值:** @@ -1178,10 +1174,10 @@ off(type: "BLEDeviceFind", callback?: Callback<Array<ScanResult>>): **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"BLEDeviceFind"字符串,表示BLE设备发现事件。 | -| callback | Callback<Array<[ScanResult](#scanresult)>> | 否 | 表示取消订阅BLE设备发现事件上报。不填该参数则取消订阅该type对应的所有回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ---------------------------------------- | +| type | string | 是 | 填写"BLEDeviceFind"字符串,表示BLE设备发现事件。 | +| callback | Callback<Array<[ScanResult](#scanresult)>> | 否 | 表示取消订阅BLE设备发现事件上报。不填该参数则取消订阅该type对应的所有回调。 | **返回值:** @@ -1219,9 +1215,9 @@ getConnectionDevices(): Array<string> **返回值:** -| | | -| -------- | -------- | -| 类型 | 说明 | +| | | +| ------------------- | ------------- | +| 类型 | 说明 | | Array<string> | 返回已连接设备的地址列表。 | @@ -1237,16 +1233,16 @@ getDeviceState(device: string): ProfileConnectionState **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| device | string | 是 | 远端设备地址。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ------- | +| device | string | 是 | 远端设备地址。 | | **返回值:** -| | | -| -------- | -------- | -| 类型 | 说明 | +| | | +| ---------------------------------------- | --------------- | +| 类型 | 说明 | | [ProfileConnectionState](#profileconnectionState) | 返回profile的连接状态。 | @@ -1267,23 +1263,23 @@ connect(device: string): boolean **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| device | string | 是 | 远端设备地址。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ------- | +| device | string | 是 | 远端设备地址。 | | **返回值:** -| | | -| -------- | -------- | -| 类型 | 说明 | +| | | +| ------- | ------------------- | +| 类型 | 说明 | | boolean | 成功返回true,失败返回false。 | **示例:** ```js -A2dpSourceProfile a2dpSrc = bluetooth.getProfile(PROFILE_A2DP_SOURCE); -boolean ret = a2dpSrc.connect('XX:XX:XX:XX:XX:XX'); +let a2dpSrc = bluetooth.getProfile(PROFILE_A2DP_SOURCE) +let ret = a2dpSrc.connect('XX:XX:XX:XX:XX:XX'); ``` @@ -1299,23 +1295,23 @@ disconnect(device: string): boolean **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| device | string | 是 | 远端设备地址。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ------- | +| device | string | 是 | 远端设备地址。 | | **返回值:** -| | | -| -------- | -------- | -| 类型 | 说明 | +| | | +| ------- | ------------------- | +| 类型 | 说明 | | boolean | 成功返回true,失败返回false。 | **示例:** ```js -A2dpSourceProfile a2dpSrc = bluetooth.getProfile(PROFILE_A2DP_SOURCE); -boolean ret = a2dpSrc.disconnect('XX:XX:XX:XX:XX:XX'); +let a2dpSrc = bluetooth.getProfile(PROFILE_A2DP_SOURCE); +let boolean ret = a2dpSrc.disconnect('XX:XX:XX:XX:XX:XX'); ``` @@ -1329,10 +1325,10 @@ on(type: "connectionStateChange", callback: Callback<[StateChangeParam](#Stat **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"connectionStateChange"字符串,表示连接状态变化事件。 | -| callback | Callback<[StateChangeParam](#StateChangeParam)> | 是 | 表示回调函数的入参。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ---------------------------------------- | +| type | string | 是 | 填写"connectionStateChange"字符串,表示连接状态变化事件。 | +| callback | Callback<[StateChangeParam](#StateChangeParam)> | 是 | 表示回调函数的入参。 | **返回值:** @@ -1358,10 +1354,10 @@ off(type: "connectionStateChange", callback: Callback<[StateChangeParam](#Sta **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"connectionStateChange"字符串,表示连接状态变化事件。 | -| callback | Callback<[StateChangeParam](#StateChangeParam)> | 是 | 表示回调函数的入参。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ---------------------------------------- | +| type | string | 是 | 填写"connectionStateChange"字符串,表示连接状态变化事件。 | +| callback | Callback<[StateChangeParam](#StateChangeParam)> | 是 | 表示回调函数的入参。 | **返回值:** @@ -1387,22 +1383,22 @@ getPlayingState(device: string): PlayingState **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| device | string | 是 | 远端设备地址。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ------- | +| device | string | 是 | 远端设备地址。 | **返回值:** -| | | -| -------- | -------- | -| 类型 | 说明 | +| | | +| ----------------------------- | ---------- | +| 类型 | 说明 | | [PlayingState](#PlayingState) | 远端设备的播放状态。 | **示例:** ```js -A2dpSourceProfile a2dpSrc = bluetooth.getProfile(PROFILE_A2DP_SOURCE); -PlayingState state = a2dpSrc.getPlayingState('XX:XX:XX:XX:XX:XX'); +let a2dpSrc = bluetooth.getProfile(PROFILE_A2DP_SOURCE); +let state = a2dpSrc.getPlayingState('XX:XX:XX:XX:XX:XX'); ``` @@ -1423,23 +1419,23 @@ connect(device: string): boolean **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| device | string | 是 | 远端设备地址。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ------- | +| device | string | 是 | 远端设备地址。 | | **返回值:** -| | | -| -------- | -------- | -| 类型 | 说明 | +| | | +| ------- | ------------------- | +| 类型 | 说明 | | boolean | 成功返回true,失败返回false。 | **示例:** ```js -HandsFreeAudioGatewayProfile hfpAg = bluetooth.getProfile(PROFILE_HANDS_FREE_AUDIO_GATEWAY); -boolean ret = hfpAg.connect('XX:XX:XX:XX:XX:XX'); +let hfpAg = bluetooth.getProfile(PROFILE_HANDS_FREE_AUDIO_GATEWAY); +let ret = hfpAg.connect('XX:XX:XX:XX:XX:XX'); ``` @@ -1447,7 +1443,7 @@ boolean ret = hfpAg.connect('XX:XX:XX:XX:XX:XX'); disconnect(device: string): boolean -连接设备的HFP服务。 +断开连接设备的HFP服务。 **需要权限**:ohos.permission.DISCOVER_BLUETOOTH @@ -1455,23 +1451,22 @@ disconnect(device: string): boolean **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| device | string | 是 | 远端设备地址。 | +| 参数名 | 类型 | 必填 | 说明 | +| ------ | ------ | ---- | ------- | +| device | string | 是 | 远端设备地址。 | | **返回值:** -| | | -| -------- | -------- | -| 类型 | 说明 | +| 类型 | 说明 | +| ------- | ------------------- | | boolean | 成功返回true,失败返回false。 | **示例:** ```js -HandsFreeAudioGatewayProfile hfpAg = bluetooth.getProfile(PROFILE_HANDS_FREE_AUDIO_GATEWAY); -boolean ret = hfpAg.disconnect('XX:XX:XX:XX:XX:XX'); +let hfpAg = bluetooth.getProfile(PROFILE_HANDS_FREE_AUDIO_GATEWAY); +let ret = hfpAg.disconnect('XX:XX:XX:XX:XX:XX'); ``` @@ -1485,10 +1480,10 @@ on(type: "connectionStateChange", callback: Callback<[StateChangeParam](#Stat **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"connectionStateChange"字符串,表示连接状态变化事件。 | -| callback | Callback<[StateChangeParam](#StateChangeParam)> | 是 | 表示回调函数的入参。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ---------------------------------------- | +| type | string | 是 | 填写"connectionStateChange"字符串,表示连接状态变化事件。 | +| callback | Callback<[StateChangeParam](#StateChangeParam)> | 是 | 表示回调函数的入参。 | **返回值:** @@ -1514,10 +1509,10 @@ off(type: "connectionStateChange", callback: Callback<[StateChangeParam](#Sta **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"connectionStateChange"字符串,表示连接状态变化事件。 | -| callback | Callback<[StateChangeParam](#StateChangeParam)> | 是 | 表示回调函数的入参。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ---------------------------------------- | +| type | string | 是 | 填写"connectionStateChange"字符串,表示连接状态变化事件。 | +| callback | Callback<[StateChangeParam](#StateChangeParam)> | 是 | 表示回调函数的入参。 | **返回值:** @@ -1550,11 +1545,11 @@ startAdvertising(setting: AdvertiseSetting, advData: AdvertiseData, advResponse? **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| setting | [AdvertiseSetting](#advertisesetting) | 是 | BLE广播的相关参数。 | -| advData | [AdvertiseData](#advertisedata) | 是 | BLE广播包内容。 | -| advResponse | [AdvertiseData](#advertisedata) | 否 | BLE回复扫描请求回复响应。 | +| 参数名 | 类型 | 必填 | 说明 | +| ----------- | ------------------------------------- | ---- | -------------- | +| setting | [AdvertiseSetting](#advertisesetting) | 是 | BLE广播的相关参数。 | +| advData | [AdvertiseData](#advertisedata) | 是 | BLE广播包内容。 | +| advResponse | [AdvertiseData](#advertisedata) | 否 | BLE回复扫描请求回复响应。 | **返回值:** @@ -1639,14 +1634,14 @@ server端添加服务。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| service | [GattService](#gattservice) | 是 | 服务端的service数据。BLE广播的相关参数 | +| 参数名 | 类型 | 必填 | 说明 | +| ------- | --------------------------- | ---- | ------------------------ | +| service | [GattService](#gattservice) | 是 | 服务端的service数据。BLE广播的相关参数 | **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------- | -------------------------- | | boolean | 添加服务操作,成功返回true,否则返回false。 | **示例:** @@ -1698,15 +1693,15 @@ removeService(serviceUuid: string): boolean **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| serviceUuid | string | 是 | service的UUID,例如“00001810-0000-1000-8000-00805F9B34FB”。 | +| 参数名 | 类型 | 必填 | 说明 | +| ----------- | ------ | ---- | ---------------------------------------- | +| serviceUuid | string | 是 | service的UUID,例如“00001810-0000-1000-8000-00805F9B34FB”。 | **返回值:** -| | | -| -------- | -------- | -| 类型 | 说明 | +| | | +| ------- | -------------------------- | +| 类型 | 说明 | | boolean | 删除服务操作,成功返回true,否则返回false。 | **示例:** @@ -1747,16 +1742,16 @@ server端特征值发生变化时,主动通知已连接的client设备。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| deviceId | string | 是 | 接收通知的client端设备地址,例如“XX:XX:XX:XX:XX:XX”。 | -| notifyCharacteristic | [NotifyCharacteristic](#notifycharacteristic) | 是 | 通知的特征值数据。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------------------- | ---------------------------------------- | ---- | --------------------------------------- | +| deviceId | string | 是 | 接收通知的client端设备地址,例如“XX:XX:XX:XX:XX:XX”。 | +| notifyCharacteristic | [NotifyCharacteristic](#notifycharacteristic) | 是 | 通知的特征值数据。 | **返回值:** -| | | -| -------- | -------- | -| 类型 | 说明 | +| | | +| ------- | ------------------------ | +| 类型 | 说明 | | boolean | 通知操作,成功返回true,否则返回false。 | **示例:** @@ -1781,15 +1776,15 @@ server端回复client端的读写请求。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| serverResponse | [ServerResponse](#serverresponse) | 是 | server端回复的响应数据。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------------- | --------------------------------- | ---- | --------------- | +| serverResponse | [ServerResponse](#serverresponse) | 是 | server端回复的响应数据。 | **返回值:** -| | | -| -------- | -------- | -| 类型 | 说明 | +| | | +| ------- | -------------------------- | +| 类型 | 说明 | | boolean | 回复响应操作,成功返回true,否则返回false。 | **示例:** @@ -1829,10 +1824,10 @@ server端订阅特征值读请求事件。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"characteristicRead"字符串,表示特征值读请求事件。 | -| callback | Callback<[CharacteristicReadReq](#characteristicreadreq)> | 是 | 表示回调函数的入参,client端发送的读请求数据。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ------------------------------------- | +| type | string | 是 | 填写"characteristicRead"字符串,表示特征值读请求事件。 | +| callback | Callback<[CharacteristicReadReq](#characteristicreadreq)> | 是 | 表示回调函数的入参,client端发送的读请求数据。 | **返回值:** @@ -1877,10 +1872,10 @@ server端取消订阅特征值读请求事件。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"characteristicRead"字符串,表示特征值读请求事件。 | -| callback | Callback<[CharacteristicReadReq](#characteristicreadreq)> | 否 | 表示取消订阅特征值读请求事件上报。不填该参数则取消订阅该type对应的所有回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ---------------------------------------- | +| type | string | 是 | 填写"characteristicRead"字符串,表示特征值读请求事件。 | +| callback | Callback<[CharacteristicReadReq](#characteristicreadreq)> | 否 | 表示取消订阅特征值读请求事件上报。不填该参数则取消订阅该type对应的所有回调。 | **返回值:** @@ -1906,10 +1901,10 @@ server端订阅特征值写请求事件。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"characteristicWrite"字符串,表示特征值写请求事件。 | -| callback | Callback<[DescriptorWriteReq](#descriptorwritereq)> | 是 | 表示回调函数的入参,client端发送的写请求数据。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | -------------------------------------- | +| type | string | 是 | 填写"characteristicWrite"字符串,表示特征值写请求事件。 | +| callback | Callback<[DescriptorWriteReq](#descriptorwritereq)> | 是 | 表示回调函数的入参,client端发送的写请求数据。 | **返回值:** @@ -1957,10 +1952,10 @@ server端取消订阅特征值写请求事件。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"characteristicWrite"字符串,表示特征值写请求事件。 | -| callback | Callback<[CharacteristicWriteReq](#characteristicwritereq)> | 否 | 表示取消订阅特征值写请求事件上报。不填该参数则取消订阅该type对应的所有回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ---------------------------------------- | +| type | string | 是 | 填写"characteristicWrite"字符串,表示特征值写请求事件。 | +| callback | Callback<[CharacteristicWriteReq](#characteristicwritereq)> | 否 | 表示取消订阅特征值写请求事件上报。不填该参数则取消订阅该type对应的所有回调。 | **返回值:** @@ -1986,10 +1981,10 @@ server端订阅描述符读请求事件。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"descriptorRead"字符串,表示描述符读请求事件。 | -| callback | Callback<[DescriptorReadReq](#descriptorreadreq)> | 是 | 表示回调函数的入参,client端发送的读请求数据。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | --------------------------------- | +| type | string | 是 | 填写"descriptorRead"字符串,表示描述符读请求事件。 | +| callback | Callback<[DescriptorReadReq](#descriptorreadreq)> | 是 | 表示回调函数的入参,client端发送的读请求数据。 | **返回值:** @@ -2034,10 +2029,10 @@ server端取消订阅描述符读请求事件。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"descriptorRead"字符串,表示描述符读请求事件。 | -| callback | Callback<[DescriptorReadReq](#descriptorreadreq)> | 否 | 表示取消订阅描述符读请求事件上报。不填该参数则取消订阅该type对应的所有回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ---------------------------------------- | +| type | string | 是 | 填写"descriptorRead"字符串,表示描述符读请求事件。 | +| callback | Callback<[DescriptorReadReq](#descriptorreadreq)> | 否 | 表示取消订阅描述符读请求事件上报。不填该参数则取消订阅该type对应的所有回调。 | **返回值:** @@ -2063,10 +2058,10 @@ server端订阅描述符写请求事件。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"descriptorWrite"字符串,表示描述符写请求事件。 | -| callback | Callback<[DescriptorWriteReq](#descriptorwritereq)> | 是 | 表示回调函数的入参,client端发送的写请求数据。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ---------------------------------- | +| type | string | 是 | 填写"descriptorWrite"字符串,表示描述符写请求事件。 | +| callback | Callback<[DescriptorWriteReq](#descriptorwritereq)> | 是 | 表示回调函数的入参,client端发送的写请求数据。 | **返回值:** @@ -2114,10 +2109,10 @@ server端取消订阅描述符写请求事件。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"descriptorWrite"字符串,表示描述符写请求事件。 | -| callback | Callback<[DescriptorWriteReq](#descriptorwritereq)> | 否 | 表示取消订阅描述符读请求事件上报。不填该参数则取消订阅该type对应的所有回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ---------------------------------------- | +| type | string | 是 | 填写"descriptorWrite"字符串,表示描述符写请求事件。 | +| callback | Callback<[DescriptorWriteReq](#descriptorwritereq)> | 否 | 表示取消订阅描述符写请求事件上报。不填该参数则取消订阅该type对应的所有回调。 | **返回值:** @@ -2143,10 +2138,10 @@ server端订阅BLE连接状态变化事件。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"connectStateChange"字符串,表示BLE连接状态变化事件。 | -| callback | Callback<[BLEConnectChangedState](#bleconnectchangedstate)> | 是 | 表示回调函数的入参,连接状态。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ---------------------------------------- | +| type | string | 是 | 填写"connectStateChange"字符串,表示BLE连接状态变化事件。 | +| callback | Callback<[BLEConnectChangedState](#bleconnectchangedstate)> | 是 | 表示回调函数的入参,连接状态。 | **返回值:** @@ -2177,10 +2172,10 @@ server端取消订阅BLE连接状态变化事件。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"connectStateChange"字符串,表示BLE连接状态变化事件。 | -| callback | Callback<[BLEConnectChangedState](#bleconnectchangedstate)> | 否 | 表示取消订阅BLE连接状态变化事件。不填该参数则取消订阅该type对应的所有回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ---------------------------------------- | +| type | string | 是 | 填写"connectStateChange"字符串,表示BLE连接状态变化事件。 | +| callback | Callback<[BLEConnectChangedState](#bleconnectchangedstate)> | 否 | 表示取消订阅BLE连接状态变化事件。不填该参数则取消订阅该type对应的所有回调。 | **返回值:** @@ -2211,8 +2206,8 @@ client端发起连接远端蓝牙低功耗设备。 **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------- | ------------------------- | | boolean | 连接操作成功返回true,操作失败返回false。 | **示例:** @@ -2235,9 +2230,9 @@ client端断开与远端蓝牙低功耗设备的连接。 **返回值:** -| 类型 | 说明 | -| -------- | -------- | -| boolean | 连接操作,成功返回true,操作失败返回false。 | +| 类型 | 说明 | +| ------- | ---------------------------- | +| boolean | 断开连接操作,成功返回true,操作失败返回false。 | **示例:** @@ -2259,8 +2254,8 @@ close(): boolean **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------- | -------------------------- | | boolean | 关闭操作,成功返回true,操作失败返回false。 | **示例:** @@ -2285,9 +2280,9 @@ client端获取蓝牙低功耗设备的所有服务,即服务发现 。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| callback | AsyncCallback<Array<[GattService](#gattservice)>> | 是 | client进行服务发现,通过注册回调函数获取。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ------------------------ | +| callback | AsyncCallback<Array<[GattService](#gattservice)>> | 是 | client进行服务发现,通过注册回调函数获取。 | **返回值:** @@ -2329,8 +2324,8 @@ client端获取蓝牙低功耗设备的所有服务,即服务发现。 **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ---------------------------------------- | --------------------------- | | Promise<Array<[GattService](#gattservice)>> | client进行服务发现,通过promise形式获取。 | **示例:** @@ -2360,10 +2355,10 @@ client端读取蓝牙低功耗设备特定服务的特征值。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| characteristic | [BLECharacteristic](#blecharacteristic) | 是 | 待读取的特征值。 | -| callback | AsyncCallback<[BLECharacteristic](#blecharacteristic)> | 是 | client读取特征值,通过注册回调函数获取。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------------- | ---------------------------------------- | ---- | ----------------------- | +| characteristic | [BLECharacteristic](#blecharacteristic) | 是 | 待读取的特征值。 | +| callback | AsyncCallback<[BLECharacteristic](#blecharacteristic)> | 是 | client读取特征值,通过注册回调函数获取。 | **返回值:** @@ -2414,15 +2409,15 @@ client端读取蓝牙低功耗设备特定服务的特征值。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| characteristic | [BLECharacteristic](#blecharacteristic) | 是 | 待读取的特征值。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------------- | --------------------------------------- | ---- | -------- | +| characteristic | [BLECharacteristic](#blecharacteristic) | 是 | 待读取的特征值。 | **返回值:** -| | | -| -------- | -------- | -| 类型 | 说明 | +| | | +| ---------------------------------------- | -------------------------- | +| 类型 | 说明 | | Promise<[BLECharacteristic](#blecharacteristic)> | client读取特征值,通过promise形式获取。 | **示例:** @@ -2461,10 +2456,10 @@ client端读取蓝牙低功耗设备特定的特征包含的描述符。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| descriptor | [BLEDescriptor](#bledescriptor) | 是 | 待读取的描述符。 | -| callback | AsyncCallback<[BLECharacteristic](#blecharacteristic)> | 是 | client读取描述符,通过注册回调函数获取。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ---------------------------------------- | ---- | ----------------------- | +| descriptor | [BLEDescriptor](#bledescriptor) | 是 | 待读取的描述符。 | +| callback | AsyncCallback<[BLECharacteristic](#blecharacteristic)> | 是 | client读取描述符,通过注册回调函数获取。 | **返回值:** @@ -2505,15 +2500,15 @@ client端读取蓝牙低功耗设备特定的特征包含的描述符。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| descriptor | [BLEDescriptor](#bledescriptor) | 是 | 待读取的描述符。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------------------------------- | ---- | -------- | +| descriptor | [BLEDescriptor](#bledescriptor) | 是 | 待读取的描述符。 | **返回值:** -| | | -| -------- | -------- | -| 类型 | 说明 | +| | | +| ---------------------------------------- | -------------------------- | +| 类型 | 说明 | | Promise<[BLEDescriptor](#bledescriptor)> | client读取描述符,通过promise形式获取。 | **示例:** @@ -2542,14 +2537,14 @@ client端向低功耗蓝牙设备写入特定的特征值。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| characteristic | [BLECharacteristic](#blecharacteristic) | 是 | 蓝牙设备特征对应的二进制值及其它参数。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------------- | --------------------------------------- | ---- | ------------------- | +| characteristic | [BLECharacteristic](#blecharacteristic) | 是 | 蓝牙设备特征对应的二进制值及其它参数。 | **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------- | --------------------------- | | boolean | 写特征值操作成功返回true,操作失败返回false。 | **示例:** @@ -2592,14 +2587,14 @@ client端向低功耗蓝牙设备特定的描述符写入二进制数据。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| descriptor | [BLEDescriptor](#bledescriptor) | 是 | 蓝牙设备描述符的二进制值及其它参数。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---------- | ------------------------------- | ---- | ------------------ | +| descriptor | [BLEDescriptor](#bledescriptor) | 是 | 蓝牙设备描述符的二进制值及其它参数。 | **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------- | --------------------------- | | boolean | 写描述符操作成功返回true,操作失败返回false。 | **示例:** @@ -2633,14 +2628,14 @@ client协商远端蓝牙低功耗设备的最大传输单元(Maximum Transmiss **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| mtu | number | 是 | 设置范围为22~512字节。 | +| 参数名 | 类型 | 必填 | 说明 | +| ---- | ------ | ---- | -------------- | +| mtu | number | 是 | 设置范围为22~512字节。 | **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------- | ---------------------------- | | boolean | MTU协商操作成功返回true,操作失败返回false。 | **示例:** @@ -2663,15 +2658,15 @@ setNotifyCharacteristicChanged(characteristic: BLECharacteristic, enable: boolea **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| characteristic | [BLECharacteristic](#blecharacteristic) | 是 | 蓝牙低功耗特征。 | -| enable | boolean | 是 | 启用接收notify设置为true,否则设置为false。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------------- | --------------------------------------- | ---- | ----------------------------- | +| characteristic | [BLECharacteristic](#blecharacteristic) | 是 | 蓝牙低功耗特征。 | +| enable | boolean | 是 | 启用接收notify设置为true,否则设置为false。 | **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| ------- | ------------------------- | | boolean | 设置操作成功返回true,操作失败返回false。 | **示例:** @@ -2694,10 +2689,10 @@ on(type: "BLECharacteristicChange", callback: Callback<BLECharacteristic>) **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"BLECharacteristicChange"字符串,表示特征值变化事件。 | -| callback | Callback<[BLECharacteristic](#blecharacteristic)> | 是 | 表示蓝牙低功耗设备的特征值变化事件的回调函数。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ---------------------------------------- | +| type | string | 是 | 填写"BLECharacteristicChange"字符串,表示特征值变化事件。 | +| callback | Callback<[BLECharacteristic](#blecharacteristic)> | 是 | 表示蓝牙低功耗设备的特征值变化事件的回调函数。 | **返回值:** @@ -2728,10 +2723,10 @@ off(type: "BLECharacteristicChange", callback?: Callback<BLECharacteristic> **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"BLECharacteristicChange"字符串,表示特征值变化事件。 | -| callback | Callback<[BLECharacteristic](#blecharacteristic)> | 否 | 表示取消订阅蓝牙低功耗设备的特征值变化事件。不填该参数则取消订阅该type对应的所有回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ---------------------------------------- | +| type | string | 是 | 填写"BLECharacteristicChange"字符串,表示特征值变化事件。 | +| callback | Callback<[BLECharacteristic](#blecharacteristic)> | 否 | 表示取消订阅蓝牙低功耗设备的特征值变化事件。不填该参数则取消订阅该type对应的所有回调。 | **返回值:** @@ -2757,10 +2752,10 @@ client端订阅蓝牙低功耗设备的连接状态变化事件。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"BLEConnectionStateChange"字符串,表示连接状态变化事件。 | -| callback | Callback<[BLEConnectChangedState](#bleconnectchangedstate)> | 是 | 表示连接状态,已连接或断开。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ---------------------------------------- | +| type | string | 是 | 填写"BLEConnectionStateChange"字符串,表示连接状态变化事件。 | +| callback | Callback<[BLEConnectChangedState](#bleconnectchangedstate)> | 是 | 表示连接状态,已连接或断开。 | **返回值:** @@ -2790,10 +2785,10 @@ off(type: "BLEConnectionStateChange", callback?: Callback<BLEConnectChangedSt **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 填写"BLEConnectionStateChange"字符串,表示连接状态变化事件。 | -| callback | Callback<[BLEConnectChangedState](#bleconnectchangedstate)> | 否 | 表示取消订阅蓝牙低功耗设备的连接状态变化事件。不填该参数则取消订阅该type对应的所有回调。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ---------------------------------------- | +| type | string | 是 | 填写"BLEConnectionStateChange"字符串,表示连接状态变化事件。 | +| callback | Callback<[BLEConnectChangedState](#bleconnectchangedstate)> | 否 | 表示取消订阅蓝牙低功耗设备的连接状态变化事件。不填该参数则取消订阅该type对应的所有回调。 | **返回值:** @@ -2819,9 +2814,9 @@ client获取远端蓝牙低功耗设备名。 **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| callback | AsyncCallback<string> | 是 | client获取对端server设备名,通过注册回调函数获取。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------- | ---- | ------------------------------- | +| callback | AsyncCallback<string> | 是 | client获取对端server设备名,通过注册回调函数获取。 | **返回值:** @@ -2851,8 +2846,8 @@ client获取远端蓝牙低功耗设备名。 **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| --------------------- | ---------------------------------- | | Promise<string> | client获取对端server设备名,通过promise形式获取。 | **示例:** @@ -2879,9 +2874,9 @@ client获取远端蓝牙低功耗设备的信号强度 (Received Signal Strength **参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| callback | AsyncCallback<number> | 是 | 返回信号强度,单位 dBm,通过注册回调函数获取。 | +| 参数名 | 类型 | 必填 | 说明 | +| -------- | --------------------------- | ---- | ------------------------------ | +| callback | AsyncCallback<number> | 是 | 返回信号强度,单位 dBm,通过注册回调函数获取。 | **返回值:** @@ -2912,8 +2907,8 @@ client获取远端蓝牙低功耗设备的信号强度 (Received Signal Strength **返回值:** -| 类型 | 说明 | -| -------- | -------- | +| 类型 | 说明 | +| --------------------- | --------------------------------- | | Promise<number> | 返回信号强度,单位 dBm,通过promise形式获取。 | **示例:** @@ -2932,14 +2927,14 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 默认值 | 说明 | -| -------- | -------- | -------- | -| SCAN_MODE_NONE | 0 | 没有扫描模式。 | -| SCAN_MODE_CONNECTABLE | 1 | 可连接扫描模式。 | -| SCAN_MODE_GENERAL_DISCOVERABLE | 2 | general发现模式。 | -| SCAN_MODE_LIMITED_DISCOVERABLE | 3 | limited发现模式。 | -| SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE | 4 | 可连接general发现模式。 | -| SCAN_MODE_CONNECTABLE_LIMITED_DISCOVERABLE | 5 | 可连接limited发现模式。 | +| 名称 | 默认值 | 说明 | +| ---------------------------------------- | ---- | --------------- | +| SCAN_MODE_NONE | 0 | 没有扫描模式。 | +| SCAN_MODE_CONNECTABLE | 1 | 可连接扫描模式。 | +| SCAN_MODE_GENERAL_DISCOVERABLE | 2 | general发现模式。 | +| SCAN_MODE_LIMITED_DISCOVERABLE | 3 | limited发现模式。 | +| SCAN_MODE_CONNECTABLE_GENERAL_DISCOVERABLE | 4 | 可连接general发现模式。 | +| SCAN_MODE_CONNECTABLE_LIMITED_DISCOVERABLE | 5 | 可连接limited发现模式。 | ## BondState8+ @@ -2947,11 +2942,11 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 默认值 | 说明 | -| -------- | -------- | -------- | -| BOND_STATE_INVALID | 0 | 无效的配对。 | -| BOND_STATE_BONDING | 1 | 正在配对。 | -| BOND_STATE_BONDED | 2 | 已配对。 | +| 名称 | 默认值 | 说明 | +| ------------------ | ---- | ------ | +| BOND_STATE_INVALID | 0 | 无效的配对。 | +| BOND_STATE_BONDING | 1 | 正在配对。 | +| BOND_STATE_BONDED | 2 | 已配对。 | ## SppOption8+ @@ -2960,11 +2955,11 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -| uuid | string | 是 | 是 | spp单据的uuid。 | -| secure | boolean | 是 | 是 | 是否是安全通道。 | -| type | [SppType](#spptype) | 是 | 是 | Spp链路类型。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| ------ | ------------------- | ---- | ---- | ----------- | +| uuid | string | 是 | 是 | spp单据的uuid。 | +| secure | boolean | 是 | 是 | 是否是安全通道。 | +| type | [SppType](#spptype) | 是 | 是 | Spp链路类型。 | ## SppType8+ @@ -2973,9 +2968,9 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 默认值 | 说明 | -| -------- | -------- | -------- | -| SPP_RFCOMM | 0 | 表示rfcomm链路类型。 | +| 名称 | 默认值 | 说明 | +| ---------- | ---- | ------------- | +| SPP_RFCOMM | 0 | 表示rfcomm链路类型。 | ## GattService @@ -2984,12 +2979,12 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -| serviceUuid | string | 是 | 是 | 特定服务(service)的UUID,例如:00001888-0000-1000-8000-00805f9b34fb。 | -| isPrimary | boolean | 是 | 是 | 如果是主服务设置为true,否则设置为false。 | -| characteristics | Array<[BLECharacteristic](#blecharacteristic)> | 是 | 是 | 当前服务包含的特征列表。 | -| includeServices | Array<[GattService](#gattservice)> | 是 | 是 | 当前服务依赖的其它服务。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| --------------- | ---------------------------------------- | ---- | ---- | ---------------------------------------- | +| serviceUuid | string | 是 | 是 | 特定服务(service)的UUID,例如:00001888-0000-1000-8000-00805f9b34fb。 | +| isPrimary | boolean | 是 | 是 | 如果是主服务设置为true,否则设置为false。 | +| characteristics | Array<[BLECharacteristic](#blecharacteristic)> | 是 | 是 | 当前服务包含的特征列表。 | +| includeServices | Array<[GattService](#gattservice)> | 是 | 是 | 当前服务依赖的其它服务。 | ## BLECharacteristic @@ -2998,12 +2993,12 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -| serviceUuid | string | 是 | 是 | 特定服务(service)的UUID,例如:00001888-0000-1000-8000-00805f9b34fb。 | -| characteristicUuid | string | 是 | 是 | 特定特征(characteristic)的UUID,例如:00002a11-0000-1000-8000-00805f9b34fb。 | -| characteristicValue | ArrayBuffer | 是 | 是 | 特征对应的二进制值。 | -| descriptors | Array<[BLEDescriptor](#bledescriptor)> | 是 | 是 | 特定特征的描述符列表。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| ------------------- | ---------------------------------------- | ---- | ---- | ---------------------------------------- | +| serviceUuid | string | 是 | 是 | 特定服务(service)的UUID,例如:00001888-0000-1000-8000-00805f9b34fb。 | +| characteristicUuid | string | 是 | 是 | 特定特征(characteristic)的UUID,例如:00002a11-0000-1000-8000-00805f9b34fb。 | +| characteristicValue | ArrayBuffer | 是 | 是 | 特征对应的二进制值。 | +| descriptors | Array<[BLEDescriptor](#bledescriptor)> | 是 | 是 | 特定特征的描述符列表。 | ## BLEDescriptor @@ -3012,12 +3007,12 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -| serviceUuid | string | 是 | 是 | 特定服务(service)的UUID,例如:00001888-0000-1000-8000-00805f9b34fb。 | -| characteristicUuid | string | 是 | 是 | 特定特征(characteristic)的UUID,例如:00002a11-0000-1000-8000-00805f9b34fb。 | -| descriptorUuid | string | 是 | 是 | 描述符(descriptor)的UUID,例如:00002902-0000-1000-8000-00805f9b34fb。 | -| descriptorValue | ArrayBuffer | 是 | 是 | 描述符对应的二进制值。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| ------------------ | ----------- | ---- | ---- | ---------------------------------------- | +| serviceUuid | string | 是 | 是 | 特定服务(service)的UUID,例如:00001888-0000-1000-8000-00805f9b34fb。 | +| characteristicUuid | string | 是 | 是 | 特定特征(characteristic)的UUID,例如:00002a11-0000-1000-8000-00805f9b34fb。 | +| descriptorUuid | string | 是 | 是 | 描述符(descriptor)的UUID,例如:00002902-0000-1000-8000-00805f9b34fb。 | +| descriptorValue | ArrayBuffer | 是 | 是 | 描述符对应的二进制值。 | ## NotifyCharacteristic @@ -3026,12 +3021,12 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -| serviceUuid | string | 是 | 是 | 特定服务(service)的UUID,例如:00001888-0000-1000-8000-00805f9b34fb。 | -| characteristicUuid | string | 是 | 是 | 特定特征(characteristic)的UUID,例如:00002a11-0000-1000-8000-00805f9b34fb。 | -| characteristicValue | ArrayBuffer | 是 | 是 | 特征对应的二进制值。 | -| confirm | boolean | 是 | 是 | 如果是notification则对端回复确认设置为true,如果是indication则对端不需要回复确认设置为false。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| ------------------- | ----------- | ---- | ---- | ---------------------------------------- | +| serviceUuid | string | 是 | 是 | 特定服务(service)的UUID,例如:00001888-0000-1000-8000-00805f9b34fb。 | +| characteristicUuid | string | 是 | 是 | 特定特征(characteristic)的UUID,例如:00002a11-0000-1000-8000-00805f9b34fb。 | +| characteristicValue | ArrayBuffer | 是 | 是 | 特征对应的二进制值。 | +| confirm | boolean | 是 | 是 | 如果是notification则对端回复确认设置为true,如果是indication则对端不需要回复确认设置为false。 | ## CharacteristicReadReq @@ -3040,13 +3035,13 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -| deviceId | string | 是 | 否 | 表示发送特征值读请求的远端设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | -| transId | number | 是 | 否 | 表示读请求的传输ID,server端回复响应时需填写相同的传输ID。 | -| offset | number | 是 | 否 | 表示读特征值数据的起始位置。例如:k表示从第k个字节开始读,server端回复响应时需填写相同的offset。 | -| characteristicUuid | string | 是 | 否 | 特定特征(characteristic)的UUID,例如:00002a11-0000-1000-8000-00805f9b34fb。 | -| serviceUuid | string | 是 | 否 | 特定服务(service)的UUID,例如:00001888-0000-1000-8000-00805f9b34fb。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| ------------------ | ------ | ---- | ---- | ---------------------------------------- | +| deviceId | string | 是 | 否 | 表示发送特征值读请求的远端设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | +| transId | number | 是 | 否 | 表示读请求的传输ID,server端回复响应时需填写相同的传输ID。 | +| offset | number | 是 | 否 | 表示读特征值数据的起始位置。例如:k表示从第k个字节开始读,server端回复响应时需填写相同的offset。 | +| characteristicUuid | string | 是 | 否 | 特定特征(characteristic)的UUID,例如:00002a11-0000-1000-8000-00805f9b34fb。 | +| serviceUuid | string | 是 | 否 | 特定服务(service)的UUID,例如:00001888-0000-1000-8000-00805f9b34fb。 | ## CharacteristicWriteReq @@ -3055,14 +3050,14 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -| deviceId | string | 是 | 否 | 表示发送特征值写请求的远端设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | -| transId | number | 是 | 否 | 表示写请求的传输ID,server端回复响应时需填写相同的传输ID。 | -| offset | number | 是 | 否 | 表示写特征值数据的起始位置。例如:k表示从第k个字节开始写,server端回复响应时需填写相同的offset。 | -| descriptorUuid | string | 是 | 否 | 表示描述符(descriptor)的UUID,例如:00002902-0000-1000-8000-00805f9b34fb。 | -| characteristicUuid | string | 是 | 否 | 特定特征(characteristic)的UUID,例如:00002a11-0000-1000-8000-00805f9b34fb。 | -| serviceUuid | string | 是 | 否 | 特定服务(service)的UUID,例如:00001888-0000-1000-8000-00805f9b34fb。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| ------------------ | ------ | ---- | ---- | ---------------------------------------- | +| deviceId | string | 是 | 否 | 表示发送特征值写请求的远端设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | +| transId | number | 是 | 否 | 表示写请求的传输ID,server端回复响应时需填写相同的传输ID。 | +| offset | number | 是 | 否 | 表示写特征值数据的起始位置。例如:k表示从第k个字节开始写,server端回复响应时需填写相同的offset。 | +| descriptorUuid | string | 是 | 否 | 表示描述符(descriptor)的UUID,例如:00002902-0000-1000-8000-00805f9b34fb。 | +| characteristicUuid | string | 是 | 否 | 特定特征(characteristic)的UUID,例如:00002a11-0000-1000-8000-00805f9b34fb。 | +| serviceUuid | string | 是 | 否 | 特定服务(service)的UUID,例如:00001888-0000-1000-8000-00805f9b34fb。 | ## DescriptorReadReq @@ -3071,14 +3066,14 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -| deviceId | string | 是 | 否 | 表示发送描述符读请求的远端设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | -| transId | number | 是 | 否 | 表示读请求的传输ID,server端回复响应时需填写相同的传输ID。 | -| offset | number | 是 | 否 | 表示读描述符数据的起始位置。例如:k表示从第k个字节开始读,server端回复响应时需填写相同的offset。 | -| descriptorUuid | string | 是 | 否 | 表示描述符(descriptor)的UUID,例如:00002902-0000-1000-8000-00805f9b34fb。 | -| characteristicUuid | string | 是 | 否 | 特定特征(characteristic)的UUID,例如:00002a11-0000-1000-8000-00805f9b34fb。 | -| serviceUuid | string | 是 | 否 | 特定服务(service)的UUID,例如:00001888-0000-1000-8000-00805f9b34fb。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| ------------------ | ------ | ---- | ---- | ---------------------------------------- | +| deviceId | string | 是 | 否 | 表示发送描述符读请求的远端设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | +| transId | number | 是 | 否 | 表示读请求的传输ID,server端回复响应时需填写相同的传输ID。 | +| offset | number | 是 | 否 | 表示读描述符数据的起始位置。例如:k表示从第k个字节开始读,server端回复响应时需填写相同的offset。 | +| descriptorUuid | string | 是 | 否 | 表示描述符(descriptor)的UUID,例如:00002902-0000-1000-8000-00805f9b34fb。 | +| characteristicUuid | string | 是 | 否 | 特定特征(characteristic)的UUID,例如:00002a11-0000-1000-8000-00805f9b34fb。 | +| serviceUuid | string | 是 | 否 | 特定服务(service)的UUID,例如:00001888-0000-1000-8000-00805f9b34fb。 | ## DescriptorWriteReq @@ -3087,17 +3082,17 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -| deviceId | string | 是 | 否 | 表示发送描述符写请求的远端设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | -| transId | number | 是 | 否 | 表示写请求的传输ID,server端回复响应时需填写相同的传输ID。 | -| offset | number | 是 | 否 | 表示写描述符数据的起始位置。例如:k表示从第k个字节开始写,server端回复响应时需填写相同的offset。 | -| isPrep | boolean | 是 | 否 | 表示写请求是否立即执行。 | -| needRsp | boolean | 是 | 否 | 表示是否要给client端回复响应。 | -| value | ArrayBuffer | 是 | 否 | 表示写入的描述符二进制数据。 | -| descriptorUuid | string | 是 | 否 | 表示描述符(descriptor)的UUID,例如:00002902-0000-1000-8000-00805f9b34fb。 | -| characteristicUuid | string | 是 | 否 | 特定特征(characteristic)的UUID,例如:00002a11-0000-1000-8000-00805f9b34fb。 | -| serviceUuid | string | 是 | 否 | 特定服务(service)的UUID,例如:00001888-0000-1000-8000-00805f9b34fb。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| ------------------ | ----------- | ---- | ---- | ---------------------------------------- | +| deviceId | string | 是 | 否 | 表示发送描述符写请求的远端设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | +| transId | number | 是 | 否 | 表示写请求的传输ID,server端回复响应时需填写相同的传输ID。 | +| offset | number | 是 | 否 | 表示写描述符数据的起始位置。例如:k表示从第k个字节开始写,server端回复响应时需填写相同的offset。 | +| isPrep | boolean | 是 | 否 | 表示写请求是否立即执行。 | +| needRsp | boolean | 是 | 否 | 表示是否要给client端回复响应。 | +| value | ArrayBuffer | 是 | 否 | 表示写入的描述符二进制数据。 | +| descriptorUuid | string | 是 | 否 | 表示描述符(descriptor)的UUID,例如:00002902-0000-1000-8000-00805f9b34fb。 | +| characteristicUuid | string | 是 | 否 | 特定特征(characteristic)的UUID,例如:00002a11-0000-1000-8000-00805f9b34fb。 | +| serviceUuid | string | 是 | 否 | 特定服务(service)的UUID,例如:00001888-0000-1000-8000-00805f9b34fb。 | ## ServerResponse @@ -3106,13 +3101,13 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -| deviceId | string | 是 | 否 | 表示远端设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | -| transId | number | 是 | 否 | 表示请求的传输ID,与订阅的读/写请求事件携带的ID保持一致。 | -| status | number | 是 | 否 | 表示响应的状态,设置为0即可,表示正常。 | -| offset | number | 是 | 否 | 表示请求的读/写起始位置,与订阅的读/写请求事件携带的offset保持一致。 | -| value | ArrayBuffer | 是 | 否 | 表示回复响应的二进制数据。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| -------- | ----------- | ---- | ---- | -------------------------------------- | +| deviceId | string | 是 | 否 | 表示远端设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | +| transId | number | 是 | 否 | 表示请求的传输ID,与订阅的读/写请求事件携带的ID保持一致。 | +| status | number | 是 | 否 | 表示响应的状态,设置为0即可,表示正常。 | +| offset | number | 是 | 否 | 表示请求的读/写起始位置,与订阅的读/写请求事件携带的offset保持一致。 | +| value | ArrayBuffer | 是 | 否 | 表示回复响应的二进制数据。 | ## BLEConnectChangedState @@ -3121,10 +3116,10 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -| deviceId | string | 是 | 否 | 表示远端设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | -| state | [ProfileConnectionState](#profileconnectionState) | 是 | 是 | 表示BLE连接状态的枚举。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| -------- | ---------------------------------------- | ---- | ---- | -------------------------------- | +| deviceId | string | 是 | 否 | 表示远端设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | +| state | [ProfileConnectionState](#profileconnectionState) | 是 | 是 | 表示BLE连接状态的枚举。 | ## ProfileConnectionState @@ -3133,12 +3128,12 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 默认值 | 说明 | -| -------- | -------- | -------- | -| STATE_DISCONNECTED | 0 | 表示profile已断连。 | -| STATE_CONNECTING | 1 | 表示profile正在连接。 | -| STATE_CONNECTED | 2 | 表示profile已连接。 | -| STATE_DISCONNECTING | 3 | 表示profile正在断连。 | +| 名称 | 默认值 | 说明 | +| ------------------- | ---- | -------------- | +| STATE_DISCONNECTED | 0 | 表示profile已断连。 | +| STATE_CONNECTING | 1 | 表示profile正在连接。 | +| STATE_CONNECTED | 2 | 表示profile已连接。 | +| STATE_DISCONNECTING | 3 | 表示profile正在断连。 | ## ScanFilter @@ -3147,11 +3142,11 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -| deviceId | string | 是 | 是 | 表示过滤的BLE设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | -| name | string | 是 | 是 | 表示过滤的BLE设备名。 | -| serviceUuid | string | 是 | 是 | 表示过滤包含该UUID服务的设备,例如:00001888-0000-1000-8000-00805f9b34fb。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| ----------- | ------ | ---- | ---- | ---------------------------------------- | +| deviceId | string | 是 | 是 | 表示过滤的BLE设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | +| name | string | 是 | 是 | 表示过滤的BLE设备名。 | +| serviceUuid | string | 是 | 是 | 表示过滤包含该UUID服务的设备,例如:00001888-0000-1000-8000-00805f9b34fb。 | ## ScanOptions @@ -3160,11 +3155,11 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -| interval | number | 是 | 是 | 表示扫描结果上报延迟时间,默认值为0。 | -| dutyMode | [ScanDuty](#scanduty) | 是 | 是 | 表示扫描模式,默认值为SCAN_MODE_LOW_POWER。 | -| matchMode | [MatchMode](#matchmode) | 是 | 是 | 表示硬件的过滤匹配模式,默认值为MATCH_MODE_AGGRESSIVE。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| --------- | ----------------------- | ---- | ---- | -------------------------------------- | +| interval | number | 是 | 是 | 表示扫描结果上报延迟时间,默认值为0。 | +| dutyMode | [ScanDuty](#scanduty) | 是 | 是 | 表示扫描模式,默认值为SCAN_MODE_LOW_POWER。 | +| matchMode | [MatchMode](#matchmode) | 是 | 是 | 表示硬件的过滤匹配模式,默认值为MATCH_MODE_AGGRESSIVE。 | ## ScanDuty @@ -3173,11 +3168,11 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 默认值 | 说明 | -| -------- | -------- | -------- | -| SCAN_MODE_LOW_POWER | 0 | 表示低功耗模式,默认值。 | -| SCAN_MODE_BALANCED | 1 | 表示均衡模式。 | -| SCAN_MODE_LOW_LATENCY | 2 | 表示低延迟模式。 | +| 名称 | 默认值 | 说明 | +| --------------------- | ---- | ------------ | +| SCAN_MODE_LOW_POWER | 0 | 表示低功耗模式,默认值。 | +| SCAN_MODE_BALANCED | 1 | 表示均衡模式。 | +| SCAN_MODE_LOW_LATENCY | 2 | 表示低延迟模式。 | ## MatchMode @@ -3186,10 +3181,10 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 默认值 | 说明 | -| -------- | -------- | -------- | -| MATCH_MODE_AGGRESSIVE | 1 | 表示硬件上报扫描结果门限较低,比如扫描到的功率较低或者一段时间扫描到的次数较少也触发上报,默认值。 | -| MATCH_MODE_STICKY | 2 | 表示硬件上报扫描结果门限较高,更高的功率门限以及扫描到多次才会上报。 | +| 名称 | 默认值 | 说明 | +| --------------------- | ---- | ---------------------------------------- | +| MATCH_MODE_AGGRESSIVE | 1 | 表示硬件上报扫描结果门限较低,比如扫描到的功率较低或者一段时间扫描到的次数较少也触发上报,默认值。 | +| MATCH_MODE_STICKY | 2 | 表示硬件上报扫描结果门限较高,更高的功率门限以及扫描到多次才会上报。 | ## ScanResult @@ -3198,11 +3193,11 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -| deviceId | string | 是 | 否 | 表示扫描到的设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | -| rssi | number | 是 | 否 | 表示扫描到的设备的rssi值。 | -| data | ArrayBuffer | 是 | 否 | 表示扫描到的设备发送的广播包。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| -------- | ----------- | ---- | ---- | ---------------------------------- | +| deviceId | string | 是 | 否 | 表示扫描到的设备地址,例如:"XX:XX:XX:XX:XX:XX"。 | +| rssi | number | 是 | 否 | 表示扫描到的设备的rssi值。 | +| data | ArrayBuffer | 是 | 否 | 表示扫描到的设备发送的广播包。 | ## BluetoothState @@ -3211,15 +3206,15 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 默认值 | 说明 | -| -------- | -------- | -------- | -| STATE_OFF | 0 | 表示蓝牙已关闭。 | -| STATE_TURNING_ON | 1 | 表示蓝牙正在打开。 | -| STATE_ON | 2 | 表示蓝牙已打开。 | -| STATE_TURNING_OFF | 3 | 表示蓝牙正在关闭。 | -| STATE_BLE_TURNING_ON | 4 | 表示蓝牙正在打开LE-only模式。 | -| STATE_BLE_ON | 5 | 表示蓝牙正处于LE-only模式。 | -| STATE_BLE_TURNING_OFF | 6 | 表示蓝牙正在关闭LE-only模式。 | +| 名称 | 默认值 | 说明 | +| --------------------- | ---- | ------------------ | +| STATE_OFF | 0 | 表示蓝牙已关闭。 | +| STATE_TURNING_ON | 1 | 表示蓝牙正在打开。 | +| STATE_ON | 2 | 表示蓝牙已打开。 | +| STATE_TURNING_OFF | 3 | 表示蓝牙正在关闭。 | +| STATE_BLE_TURNING_ON | 4 | 表示蓝牙正在打开LE-only模式。 | +| STATE_BLE_ON | 5 | 表示蓝牙正处于LE-only模式。 | +| STATE_BLE_TURNING_OFF | 6 | 表示蓝牙正在关闭LE-only模式。 | ## AdvertiseSetting @@ -3228,11 +3223,11 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -| interval | number | 是 | 是 | 表示广播间隔,最小值设置32个slot表示20ms,最大值设置16777215个slot,默认值设置为1600个slot表示1s。 | -| txPower | number | 是 | 是 | 表示发送功率,最小值设置-127,最大值设置1,默认值设置-7,单位dbm。 | -| connectable | boolean | 是 | 是 | 表示是否是可连接广播,默认值设置为true。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| ----------- | ------- | ---- | ---- | ---------------------------------------- | +| interval | number | 是 | 是 | 表示广播间隔,最小值设置32个slot表示20ms,最大值设置16777215个slot,默认值设置为1600个slot表示1s。 | +| txPower | number | 是 | 是 | 表示发送功率,最小值设置-127,最大值设置1,默认值设置-7,单位dbm。 | +| connectable | boolean | 是 | 是 | 表示是否是可连接广播,默认值设置为true。 | ## AdvertiseData @@ -3241,11 +3236,11 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -| serviceUuids | Array<string> | 是 | 是 | 表示要广播的服务 UUID 列表。 | -| manufactureData | Array<[ManufactureData](#manufacturedata)> | 是 | 是 | 表示要广播的广播的制造商信息列表。 | -| serviceData | Array<[ServiceData](#servicedata)> | 是 | 是 | 表示要广播的服务数据列表。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| --------------- | ---------------------------------------- | ---- | ---- | --------------------------- | +| serviceUuids | Array<string> | 是 | 是 | 表示要广播的服务 UUID 列表。 | +| manufactureData | Array<[ManufactureData](#manufacturedata)> | 是 | 是 | 表示要广播的广播的制造商信息列表。 | +| serviceData | Array<[ServiceData](#servicedata)> | 是 | 是 | 表示要广播的服务数据列表。 | ## ManufactureData @@ -3254,10 +3249,10 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -| manufactureId | Array<string> | 是 | 是 | 表示制造商的ID,由蓝牙SIG分配。 | -| manufactureValue | ArrayBuffer | 是 | 是 | 表示制造商发送的制造商数据。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| ---------------- | ------------------- | ---- | ---- | ------------------ | +| manufactureId | Array<string> | 是 | 是 | 表示制造商的ID,由蓝牙SIG分配。 | +| manufactureValue | ArrayBuffer | 是 | 是 | 表示制造商发送的制造商数据。 | ## ServiceData @@ -3266,10 +3261,10 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -| serviceUuid | string | 是 | 是 | 表示服务的UUID。 | -| serviceValue | ArrayBuffer | 是 | 是 | 表示服务数据。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| ------------ | ----------- | ---- | ---- | ---------- | +| serviceUuid | string | 是 | 是 | 表示服务的UUID。 | +| serviceValue | ArrayBuffer | 是 | 是 | 表示服务数据。 | ## PinRequiredParam8+ @@ -3278,10 +3273,10 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -| deviceId | string | 是 | 否 | 表示要配对的设备ID。 | -| pinCode | string | 是 | 否 | 表示要配对的密钥。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| -------- | ------ | ---- | ---- | ----------- | +| deviceId | string | 是 | 否 | 表示要配对的设备ID。 | +| pinCode | string | 是 | 否 | 表示要配对的密钥。 | ## StateChangeParam8+ @@ -3290,10 +3285,10 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -| deviceId | string | 是 | 否 | 表示蓝牙设备地址。 | -| state | [ProfileConnectionState](#ProfileConnectionState) | 是 | 否 | 表示蓝牙设备的profile连接状态。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| -------- | ---------------------------------------- | ---- | ---- | ------------------- | +| deviceId | string | 是 | 否 | 表示蓝牙设备地址。 | +| state | [ProfileConnectionState](#ProfileConnectionState) | 是 | 否 | 表示蓝牙设备的profile连接状态。 | ## DeviceClass8+ @@ -3302,11 +3297,11 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 参数类型 | 可读 | 可写 | 说明 | -| -------- | -------- | -------- | -------- | -------- | -| majorClass | [MajorClass](#majorclass) | 是 | 否 | 表示蓝牙设备主要类别的枚举。 | -| majorMinorClass | [MajorMinorClass](#majorminorclass) | 是 | 否 | 表示主要次要蓝牙设备类别的枚举。 | -| classOfDevice | number | 是 | 否 | 表示设备类别。 | +| 名称 | 参数类型 | 可读 | 可写 | 说明 | +| --------------- | ----------------------------------- | ---- | ---- | ---------------- | +| majorClass | [MajorClass](#majorclass) | 是 | 否 | 表示蓝牙设备主要类别的枚举。 | +| majorMinorClass | [MajorMinorClass](#majorminorclass) | 是 | 否 | 表示主要次要蓝牙设备类别的枚举。 | +| classOfDevice | number | 是 | 否 | 表示设备类别。 | @@ -3316,19 +3311,19 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 默认值 | 说明 | -| -------- | -------- | -------- | -| MAJOR_MISC | 0x0000 | 表示杂项设备。 | -| MAJOR_COMPUTER | 0x0100 | 表示计算机设备。 | -| MAJOR_PHONE | 0x0200 | 表示手机设备。 | -| MAJOR_NETWORKING | 0x0300 | 表示网络设备。 | -| MAJOR_AUDIO_VIDEO | 0x0400 | 表示音频和视频设备。 | -| MAJOR_PERIPHERAL | 0x0500 | 表示外围设备。 | -| MAJOR_IMAGING | 0x0600 | 表示成像设备。 | -| MAJOR_WEARABLE | 0x0700 | 表示可穿戴设备。 | -| MAJOR_TOY | 0x0800 | 表示玩具设备。 | -| MAJOR_HEALTH | 0x0900 | 表示健康设备。 | -| MAJOR_UNCATEGORIZED | 0x1F00 | 表示未分类设备。 | +| 名称 | 默认值 | 说明 | +| ------------------- | ------ | ---------- | +| MAJOR_MISC | 0x0000 | 表示杂项设备。 | +| MAJOR_COMPUTER | 0x0100 | 表示计算机设备。 | +| MAJOR_PHONE | 0x0200 | 表示手机设备。 | +| MAJOR_NETWORKING | 0x0300 | 表示网络设备。 | +| MAJOR_AUDIO_VIDEO | 0x0400 | 表示音频和视频设备。 | +| MAJOR_PERIPHERAL | 0x0500 | 表示外围设备。 | +| MAJOR_IMAGING | 0x0600 | 表示成像设备。 | +| MAJOR_WEARABLE | 0x0700 | 表示可穿戴设备。 | +| MAJOR_TOY | 0x0800 | 表示玩具设备。 | +| MAJOR_HEALTH | 0x0900 | 表示健康设备。 | +| MAJOR_UNCATEGORIZED | 0x1F00 | 表示未分类设备。 | ## MajorMinorClass8+ @@ -3337,94 +3332,94 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 默认值 | 说明 | -| -------- | -------- | -------- | -| COMPUTER_UNCATEGORIZED | 0x0100 | 表示未分类计算机设备。 | -| COMPUTER_DESKTOP | 0x0104 | 表示台式计算机设备。 | -| COMPUTER_SERVER | 0x0108 | 表示服务器设备。 | -| COMPUTER_LAPTOP | 0x010C | 表示便携式计算机设备。 | -| COMPUTER_HANDHELD_PC_PDA | 0x0110 | 表示手持式计算机设备。 | -| COMPUTER_PALM_SIZE_PC_PDA | 0x0114 | 表示掌上电脑设备。 | -| COMPUTER_WEARABLE | 0x0118 | 表示可穿戴计算机设备。 | -| COMPUTER_TABLET | 0x011C | 表示平板电脑设备。 | -| PHONE_UNCATEGORIZED | 0x0200 | 表示未分类手机设备。 | -| PHONE_CELLULAR | 0x0204 | 表示便携式手机设备。 | -| PHONE_CORDLESS | 0x0208 | 表示无线电话设备。 | -| PHONE_SMART | 0x020C | 表示智能手机设备。 | -| PHONE_MODEM_OR_GATEWAY | 0x0210 | 表示调制解调器或网关手机设备。 | -| PHONE_ISDN | 0x0214 | 表示ISDN手机设备。 | -| NETWORK_FULLY_AVAILABLE | 0x0300 | 表示网络完全可用设备。 | -| NETWORK_1_TO_17_UTILIZED | 0x0320 | 表示使用网络1到17设备。 | -| NETWORK_17_TO_33_UTILIZED | 0x0340 | 表示使用网络17到33设备。 | -| NETWORK_33_TO_50_UTILIZED | 0x0360 | 表示使用网络33到50设备。 | -| NETWORK_60_TO_67_UTILIZED | 0x0380 | 表示使用网络60到67设备。 | -| NETWORK_67_TO_83_UTILIZED | 0x03A0 | 表示使用网络67到83设备。 | -| NETWORK_83_TO_99_UTILIZED | 0x03C0 | 表示使用网络83到99设备。 | -| NETWORK_NO_SERVICE | 0x03E0 | 表示网络无服务设备。 -| AUDIO_VIDEO_UNCATEGORIZED | 0x0400 | 表示未分类音频视频设备。 | -| AUDIO_VIDEO_WEARABLE_HEADSET | 0x0404 | 表示可穿戴式音频视频设备。 | -| AUDIO_VIDEO_HANDSFREE | 0x0408 | 表示免提音频视频设备。 | -| AUDIO_VIDEO_MICROPHONE | 0x0410 | 表示麦克风音频视频设备。 | -| AUDIO_VIDEO_LOUDSPEAKER | 0x0414 | 表示扬声器音频视频设备。 | -| AUDIO_VIDEO_HEADPHONES | 0x0418 | 表示头戴式音频视频设备。 | -| AUDIO_VIDEO_PORTABLE_AUDIO | 0x041C | 表示便携式音频视频设备。 | -| AUDIO_VIDEO_CAR_AUDIO | 0x0420 | 表示汽车音频视频设备。 | -| AUDIO_VIDEO_SET_TOP_BOX | 0x0424 | 表示机顶盒音频视频设备。 | -| AUDIO_VIDEO_HIFI_AUDIO | 0x0428 | 表示高保真音响设备。 | -| AUDIO_VIDEO_VCR| 0x042C | 表示录像机音频视频设备。 | -| AUDIO_VIDEO_VIDEO_CAMERA | 0x0430 | 表示照相机音频视频设备。 | -| AUDIO_VIDEO_CAMCORDER | 0x0434 | 表示摄像机音频视频设备。 | -| AUDIO_VIDEO_VIDEO_MONITOR | 0x0438 | 表示监视器音频视频设备。 | -| AUDIO_VIDEO_VIDEO_DISPLAY_AND_LOUDSPEAKER | 0x043C | 表示视频显示器和扬声器设备。 | -| AUDIO_VIDEO_VIDEO_CONFERENCING | 0x0440 | 表示音频视频会议设备。 | -| AUDIO_VIDEO_VIDEO_GAMING_TOY | 0x0448 | 表示游戏玩具音频视频设备。 | -| PERIPHERAL_NON_KEYBOARD_NON_POINTING | 0x0500 | 表示非键盘非指向外围设备。 | -| PERIPHERAL_KEYBOARD | 0x0540 | 表示外设键盘设备。 | -| PERIPHERAL_POINTING_DEVICE | 0x0580 | 表示定点装置外围设备。 | -| PERIPHERAL_KEYBOARD_POINTING| 0x05C0 | 表示键盘指向外围设备。 | -| PERIPHERAL_UNCATEGORIZED | 0x0500 | 表示未分类外围设备。 | -| PERIPHERAL_JOYSTICK | 0x0504 | 表示周边操纵杆设备。 | -| PERIPHERAL_GAMEPAD | 0x0508 | 表示周边游戏板设备。 | -| PERIPHERAL_REMOTE_CONTROL | 0x05C0 | 表示远程控制外围设备。 | -| PERIPHERAL_SENSING_DEVICE | 0x0510 | 表示外围传感设备设备。 | -| PERIPHERAL_DIGITIZER_TABLET | 0x0514 | 表示外围数字化仪平板电脑设备。 | -| PERIPHERAL_CARD_READER | 0x0518 | 表示外围读卡器设备。 | -| PERIPHERAL_DIGITAL_PEN | 0x051C | 表示外设数码笔设备。 | -| PERIPHERAL_SCANNER_RFID | 0x0520 | 表示射频识别扫描仪外围设备。 | -| PERIPHERAL_GESTURAL_INPUT | 0x0522 | 表示手势输入外围设备。 | -| IMAGING_UNCATEGORIZED | 0x0600 | 表示未分类的图像设备。 | -| IMAGING_DISPLAY | 0x0610 | 表示图像显示设备。 | -| IMAGING_CAMERA | 0x0620 | 表示成像照相机设备。 | -| IMAGING_SCANNER | 0x0640 | 表示成像扫描仪设备。 | -| IMAGING_PRINTER | 0x0680 | 表示成像打印机设备。 | -| WEARABLE_UNCATEGORIZED | 0x0700 | 表示未分类的可穿戴设备。 | -| WEARABLE_WRIST_WATCH | 0x0704 | 表示可穿戴腕表设备。 | -| WEARABLE_PAGER | 0x0708 | 表示可穿戴寻呼机设备。 | -| WEARABLE_JACKET | 0x070C | 表示夹克可穿戴设备。 | -| WEARABLE_HELMET | 0x0710 | 表示可穿戴头盔设备。 | -| WEARABLE_GLASSES | 0x0714 | 表示可穿戴眼镜设备。 | -| TOY_UNCATEGORIZED | 0x0800 | 表示未分类的玩具设备。 | -| TOY_ROBOT| 0x0804 | 表示玩具机器人设备。 | -| TOY_VEHICLE | 0x0808 | 表示玩具车设备。 | -| TOY_DOLL_ACTION_FIGURE | 0x080C | 表示人形娃娃玩具设备。 | -| TOY_CONTROLLER | 0x0810 | 表示玩具控制器设备。 | -| TOY_GAME | 0x0814 | 表示玩具游戏设备。 | -| HEALTH_UNCATEGORIZED | 0x0900 | 表示未分类健康设备。 | -| HEALTH_BLOOD_PRESSURE | 0x0904 | 表示血压健康设备。 | -| HEALTH_THERMOMETER | 0x0908 | 表示温度计健康设备。 | -| HEALTH_WEIGHING | 0x090C | 表示体重健康设备。 | -| HEALTH_GLUCOSE | 0x0910 | 表示葡萄糖健康设备。 | -| HEALTH_PULSE_OXIMETER | 0x0914 | 表示脉搏血氧仪健康设备。 | -| HEALTH_PULSE_RATE | 0x0918 | 表示脉搏率健康设备。 | -| HEALTH_DATA_DISPLAY | 0x091C | 表示数据显示健康设备。 | -| HEALTH_STEP_COUNTER | 0x0920 | 表示阶梯计数器健康设备。 | -| HEALTH_BODY_COMPOSITION_ANALYZER | 0x0924 | 表示身体成分分析仪健康设备。 | -| HEALTH_PEAK_FLOW_MOITOR | 0x0928 | 表示湿度计健康设备。 | -| HEALTH_MEDICATION_MONITOR | 0x092C | 表示药物监视仪健康设备。 | -| HEALTH_KNEE_PROSTHESIS | 0x0930 | 表示膝盖假肢健康设备。 | -| HEALTH_ANKLE_PROSTHESIS | 0x0934 | 表示脚踝假肢健康设备。 | -| HEALTH_GENERIC_HEALTH_MANAGER | 0x0938 | 表示通用健康管理设备。 | -| HEALTH_PERSONAL_MOBILITY_DEVICE | 0x093C | 表示个人移动健康设备。 | +| 名称 | 默认值 | 说明 | +| ---------------------------------------- | ------ | --------------- | +| COMPUTER_UNCATEGORIZED | 0x0100 | 表示未分类计算机设备。 | +| COMPUTER_DESKTOP | 0x0104 | 表示台式计算机设备。 | +| COMPUTER_SERVER | 0x0108 | 表示服务器设备。 | +| COMPUTER_LAPTOP | 0x010C | 表示便携式计算机设备。 | +| COMPUTER_HANDHELD_PC_PDA | 0x0110 | 表示手持式计算机设备。 | +| COMPUTER_PALM_SIZE_PC_PDA | 0x0114 | 表示掌上电脑设备。 | +| COMPUTER_WEARABLE | 0x0118 | 表示可穿戴计算机设备。 | +| COMPUTER_TABLET | 0x011C | 表示平板电脑设备。 | +| PHONE_UNCATEGORIZED | 0x0200 | 表示未分类手机设备。 | +| PHONE_CELLULAR | 0x0204 | 表示便携式手机设备。 | +| PHONE_CORDLESS | 0x0208 | 表示无线电话设备。 | +| PHONE_SMART | 0x020C | 表示智能手机设备。 | +| PHONE_MODEM_OR_GATEWAY | 0x0210 | 表示调制解调器或网关手机设备。 | +| PHONE_ISDN | 0x0214 | 表示ISDN手机设备。 | +| NETWORK_FULLY_AVAILABLE | 0x0300 | 表示网络完全可用设备。 | +| NETWORK_1_TO_17_UTILIZED | 0x0320 | 表示使用网络1到17设备。 | +| NETWORK_17_TO_33_UTILIZED | 0x0340 | 表示使用网络17到33设备。 | +| NETWORK_33_TO_50_UTILIZED | 0x0360 | 表示使用网络33到50设备。 | +| NETWORK_60_TO_67_UTILIZED | 0x0380 | 表示使用网络60到67设备。 | +| NETWORK_67_TO_83_UTILIZED | 0x03A0 | 表示使用网络67到83设备。 | +| NETWORK_83_TO_99_UTILIZED | 0x03C0 | 表示使用网络83到99设备。 | +| NETWORK_NO_SERVICE | 0x03E0 | 表示网络无服务设备。 | +| AUDIO_VIDEO_UNCATEGORIZED | 0x0400 | 表示未分类音频视频设备。 | +| AUDIO_VIDEO_WEARABLE_HEADSET | 0x0404 | 表示可穿戴式音频视频设备。 | +| AUDIO_VIDEO_HANDSFREE | 0x0408 | 表示免提音频视频设备。 | +| AUDIO_VIDEO_MICROPHONE | 0x0410 | 表示麦克风音频视频设备。 | +| AUDIO_VIDEO_LOUDSPEAKER | 0x0414 | 表示扬声器音频视频设备。 | +| AUDIO_VIDEO_HEADPHONES | 0x0418 | 表示头戴式音频视频设备。 | +| AUDIO_VIDEO_PORTABLE_AUDIO | 0x041C | 表示便携式音频视频设备。 | +| AUDIO_VIDEO_CAR_AUDIO | 0x0420 | 表示汽车音频视频设备。 | +| AUDIO_VIDEO_SET_TOP_BOX | 0x0424 | 表示机顶盒音频视频设备。 | +| AUDIO_VIDEO_HIFI_AUDIO | 0x0428 | 表示高保真音响设备。 | +| AUDIO_VIDEO_VCR | 0x042C | 表示录像机音频视频设备。 | +| AUDIO_VIDEO_VIDEO_CAMERA | 0x0430 | 表示照相机音频视频设备。 | +| AUDIO_VIDEO_CAMCORDER | 0x0434 | 表示摄像机音频视频设备。 | +| AUDIO_VIDEO_VIDEO_MONITOR | 0x0438 | 表示监视器音频视频设备。 | +| AUDIO_VIDEO_VIDEO_DISPLAY_AND_LOUDSPEAKER | 0x043C | 表示视频显示器和扬声器设备。 | +| AUDIO_VIDEO_VIDEO_CONFERENCING | 0x0440 | 表示音频视频会议设备。 | +| AUDIO_VIDEO_VIDEO_GAMING_TOY | 0x0448 | 表示游戏玩具音频视频设备。 | +| PERIPHERAL_NON_KEYBOARD_NON_POINTING | 0x0500 | 表示非键盘非指向外围设备。 | +| PERIPHERAL_KEYBOARD | 0x0540 | 表示外设键盘设备。 | +| PERIPHERAL_POINTING_DEVICE | 0x0580 | 表示定点装置外围设备。 | +| PERIPHERAL_KEYBOARD_POINTING | 0x05C0 | 表示键盘指向外围设备。 | +| PERIPHERAL_UNCATEGORIZED | 0x0500 | 表示未分类外围设备。 | +| PERIPHERAL_JOYSTICK | 0x0504 | 表示周边操纵杆设备。 | +| PERIPHERAL_GAMEPAD | 0x0508 | 表示周边游戏板设备。 | +| PERIPHERAL_REMOTE_CONTROL | 0x05C0 | 表示远程控制外围设备。 | +| PERIPHERAL_SENSING_DEVICE | 0x0510 | 表示外围传感设备设备。 | +| PERIPHERAL_DIGITIZER_TABLET | 0x0514 | 表示外围数字化仪平板电脑设备。 | +| PERIPHERAL_CARD_READER | 0x0518 | 表示外围读卡器设备。 | +| PERIPHERAL_DIGITAL_PEN | 0x051C | 表示外设数码笔设备。 | +| PERIPHERAL_SCANNER_RFID | 0x0520 | 表示射频识别扫描仪外围设备。 | +| PERIPHERAL_GESTURAL_INPUT | 0x0522 | 表示手势输入外围设备。 | +| IMAGING_UNCATEGORIZED | 0x0600 | 表示未分类的图像设备。 | +| IMAGING_DISPLAY | 0x0610 | 表示图像显示设备。 | +| IMAGING_CAMERA | 0x0620 | 表示成像照相机设备。 | +| IMAGING_SCANNER | 0x0640 | 表示成像扫描仪设备。 | +| IMAGING_PRINTER | 0x0680 | 表示成像打印机设备。 | +| WEARABLE_UNCATEGORIZED | 0x0700 | 表示未分类的可穿戴设备。 | +| WEARABLE_WRIST_WATCH | 0x0704 | 表示可穿戴腕表设备。 | +| WEARABLE_PAGER | 0x0708 | 表示可穿戴寻呼机设备。 | +| WEARABLE_JACKET | 0x070C | 表示夹克可穿戴设备。 | +| WEARABLE_HELMET | 0x0710 | 表示可穿戴头盔设备。 | +| WEARABLE_GLASSES | 0x0714 | 表示可穿戴眼镜设备。 | +| TOY_UNCATEGORIZED | 0x0800 | 表示未分类的玩具设备。 | +| TOY_ROBOT | 0x0804 | 表示玩具机器人设备。 | +| TOY_VEHICLE | 0x0808 | 表示玩具车设备。 | +| TOY_DOLL_ACTION_FIGURE | 0x080C | 表示人形娃娃玩具设备。 | +| TOY_CONTROLLER | 0x0810 | 表示玩具控制器设备。 | +| TOY_GAME | 0x0814 | 表示玩具游戏设备。 | +| HEALTH_UNCATEGORIZED | 0x0900 | 表示未分类健康设备。 | +| HEALTH_BLOOD_PRESSURE | 0x0904 | 表示血压健康设备。 | +| HEALTH_THERMOMETER | 0x0908 | 表示温度计健康设备。 | +| HEALTH_WEIGHING | 0x090C | 表示体重健康设备。 | +| HEALTH_GLUCOSE | 0x0910 | 表示葡萄糖健康设备。 | +| HEALTH_PULSE_OXIMETER | 0x0914 | 表示脉搏血氧仪健康设备。 | +| HEALTH_PULSE_RATE | 0x0918 | 表示脉搏率健康设备。 | +| HEALTH_DATA_DISPLAY | 0x091C | 表示数据显示健康设备。 | +| HEALTH_STEP_COUNTER | 0x0920 | 表示阶梯计数器健康设备。 | +| HEALTH_BODY_COMPOSITION_ANALYZER | 0x0924 | 表示身体成分分析仪健康设备。 | +| HEALTH_PEAK_FLOW_MOITOR | 0x0928 | 表示湿度计健康设备。 | +| HEALTH_MEDICATION_MONITOR | 0x092C | 表示药物监视仪健康设备。 | +| HEALTH_KNEE_PROSTHESIS | 0x0930 | 表示膝盖假肢健康设备。 | +| HEALTH_ANKLE_PROSTHESIS | 0x0934 | 表示脚踝假肢健康设备。 | +| HEALTH_GENERIC_HEALTH_MANAGER | 0x0938 | 表示通用健康管理设备。 | +| HEALTH_PERSONAL_MOBILITY_DEVICE | 0x093C | 表示个人移动健康设备。 | ## PlayingState8+ @@ -3433,10 +3428,10 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 默认值 | 说明 | -| -------- | -------- | -------- | -| STATE_NOT_PLAYING | 0x0000 | 表示未播放。 | -| STATE_PLAYING | 0x0001 | 表示正在播放。 | +| 名称 | 默认值 | 说明 | +| ----------------- | ------ | ------- | +| STATE_NOT_PLAYING | 0x0000 | 表示未播放。 | +| STATE_PLAYING | 0x0001 | 表示正在播放。 | ## ProfileId8+ @@ -3445,7 +3440,7 @@ let rssi = gattClient.getRssiValue().then((data) => { **系统能力**:SystemCapability.Communication.Bluetooth.Core。 -| 名称 | 默认值 | 说明 | -| -------- | -------- | -------- | -| PROFILE_A2DP_SOURCE | 0x0001 | 表示A2DP profile。 | -| PROFILE_HANDS_FREE_AUDIO_GATEWAY | 0x0004 | 表示HFP profile。 | \ No newline at end of file +| 名称 | 默认值 | 说明 | +| -------------------------------- | ------ | --------------- | +| PROFILE_A2DP_SOURCE | 0x0001 | 表示A2DP profile。 | +| PROFILE_HANDS_FREE_AUDIO_GATEWAY | 0x0004 | 表示HFP profile。 | \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-commonEventData.md b/zh-cn/application-dev/reference/apis/js-apis-commonEventData.md index 189cc038db96416207b161bd174dd753215d04a3..bbead21038153a0d76f90f9d4ddfe8cb7a2a1b9c 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-commonEventData.md +++ b/zh-cn/application-dev/reference/apis/js-apis-commonEventData.md @@ -5,12 +5,12 @@ ## CommonEventData -**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.CommonEvent +**系统能力:** 以下各项对应的系统能力均为SystemCapability.Notification.CommonEvent | 名称 | 读写属性 | 类型 | 必填 | 描述 | | ---------- | -------- | -------------------- | ---- | ------------------------------------------------------- | -| event | 只读 | string | 是 | 表示当前接收的公共事件名称 | -| bundleName | 只读 | string | 否 | 表示包名称 | -| code | 只读 | number | 否 | 表示公共事件的结果代码,用于传递int类型的数据 | -| data | 只读 | string | 否 | 表示公共事件的自定义结果数据,用于传递string类型的数据< | -| parameters | 只读 | {[key: string]: any} | 否 | 表示公共事件的附加信息 | \ No newline at end of file +| event | 只读 | string | 是 | 表示当前接收的公共事件名称。 | +| bundleName | 只读 | string | 否 | 表示包名称。 | +| code | 只读 | number | 否 | 表示公共事件的结果代码,用于传递int类型的数据。 | +| data | 只读 | string | 否 | 表示公共事件的自定义结果数据,用于传递string类型的数据。 | +| parameters | 只读 | {[key: string]: any} | 否 | 表示公共事件的附加信息。 | \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-commonEventPublishData.md b/zh-cn/application-dev/reference/apis/js-apis-commonEventPublishData.md index 8f9a240fa4cf05cb1e65b5136a0e46b9a69d07b5..ee39ba0876019444183614f241490531217f6f6b 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-commonEventPublishData.md +++ b/zh-cn/application-dev/reference/apis/js-apis-commonEventPublishData.md @@ -5,15 +5,15 @@ ## CommonEventPublishData -**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.CommonEvent +**系统能力:** 以下各项对应的系统能力均为SystemCapability.Notification.CommonEvent | 名称 | 读写属性 | 类型 | 必填 | 描述 | | --------------------- | -------- | -------------------- | ---- | ---------------------------- | -| bundleName | 只读 | string | 否 | 表示包名称 | -| code | 只读 | number | 否 | 表示公共事件的结果代码 | -| data | 只读 | string | 否 | 表示公共事件的自定义结果数据 | -| subscriberPermissions | 只读 | Array\ | 否 | 表示订阅者的权限 | -| isOrdered | 只读 | boolean | 否 | 表示是否是有序事件 | -| isSticky | 只读 | boolean | 否 | 表示是否是粘性事件 | -| parameters | 只读 | {[key: string]: any} | 否 | 表示公共事件的附加信息 | +| bundleName | 只读 | string | 否 | 表示包名称。 | +| code | 只读 | number | 否 | 表示公共事件的结果代码。 | +| data | 只读 | string | 否 | 表示公共事件的自定义结果数据。 | +| subscriberPermissions | 只读 | Array\ | 否 | 表示订阅者的权限。 | +| isOrdered | 只读 | boolean | 否 | 表示是否是有序事件。 | +| isSticky | 只读 | boolean | 否 | 表示是否是粘性事件。 | +| parameters | 只读 | {[key: string]: any} | 否 | 表示公共事件的附加信息。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-commonEventSubscribeInfo.md b/zh-cn/application-dev/reference/apis/js-apis-commonEventSubscribeInfo.md index 546a275e7be103559b8369ce14d65f906c5a15ba..45fa02c374125ae5ab7b2b8ebff9f9c5cdbb2d09 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-commonEventSubscribeInfo.md +++ b/zh-cn/application-dev/reference/apis/js-apis-commonEventSubscribeInfo.md @@ -5,12 +5,12 @@ ## CommonEventSubscribeInfo -**系统能力:**以下各项对应的系统能力均为SystemCapability.Notification.CommonEvent +**系统能力:** 以下各项对应的系统能力均为SystemCapability.Notification.CommonEvent | 名称 | 读写属性 | 类型 | 必填 | 描述 | | ------------------- | -------- | -------------- | ---- | ------------------------------------------------------------ | -| events | 只读 | Array\ | 是 | 表示要发送的公共事件 | -| publisherPermission | 只读 | string | 否 | 表示发布者的权限 | -| publisherDeviceId | 只读 | string | 否 | 表示设备ID,该值必须是同一ohos网络上的现有设备ID | +| events | 只读 | Array\ | 是 | 表示要发送的公共事件。 | +| publisherPermission | 只读 | string | 否 | 表示发布者的权限。 | +| publisherDeviceId | 只读 | string | 否 | 表示设备ID,该值必须是同一ohos网络上的现有设备ID。 | | userId | 只读 | number | 否 | 表示用户ID。此参数是可选的,默认值当前用户的ID。如果指定了此参数,则该值必须是系统中现有的用户ID。 | -| priority | 只读 | number | 否 | 表示订阅者的优先级。值的范围是-100到1000 | \ No newline at end of file +| priority | 只读 | number | 否 | 表示订阅者的优先级。值的范围是-100到1000。 | \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-commonEventSubscriber.md b/zh-cn/application-dev/reference/apis/js-apis-commonEventSubscriber.md index f2e9d685920e39137a7e3bcf3a9bc30b9beca8f0..bd9fa5fa8d68e66047faade516617e3ac0668bfa 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-commonEventSubscriber.md +++ b/zh-cn/application-dev/reference/apis/js-apis-commonEventSubscriber.md @@ -17,7 +17,7 @@ getCode(callback: AsyncCallback\): void | 参数名 | 类型 | 必填 | 描述 | | -------- | ---------------------- | ---- | ------------------ | -| callback | AsyncCallback\ | 是 | 公共事件的结果代码 | +| callback | AsyncCallback\ | 是 | 公共事件的结果代码。 | **示例:** @@ -104,7 +104,7 @@ setCode(code: number): Promise\ | 参数名 | 类型 | 必填 | 描述 | | ------ | ------ | ---- | ------------------ | -| code | number | 是 | 公共事件的结果代码 | +| code | number | 是 | 公共事件的结果代码。 | **示例:** @@ -160,7 +160,7 @@ getData(): Promise\ | 类型 | 说明 | | ---------------- | ------------------ | -| Promise\ | 公共事件的结果数据 | +| Promise\ | 公共事件的结果数据。 | **示例:** @@ -186,8 +186,8 @@ setData(data: string, callback: AsyncCallback\): void | 参数名 | 类型 | 必填 | 描述 | | -------- | -------------------- | ---- | -------------------- | -| data | string | 是 | 公共事件的结果数据 | -| callback | AsyncCallback\ | 是 | 表示被指定的回调方法 | +| data | string | 是 | 公共事件的结果数据。 | +| callback | AsyncCallback\ | 是 | 表示被指定的回调方法。 | **示例:** @@ -472,7 +472,7 @@ clearAbortCommonEvent(callback: AsyncCallback\): void | 参数名 | 类型 | 必填 | 描述 | | -------- | -------------------- | ---- | -------------------- | -| callback | AsyncCallback\ | 是 | 表示被指定的回调方法 | +| callback | AsyncCallback\ | 是 | 表示被指定的回调方法。 | **示例:** @@ -522,7 +522,7 @@ getAbortCommonEvent(callback: AsyncCallback\): void | 参数名 | 类型 | 必填 | 描述 | | -------- | ----------------------- | ---- | ---------------------------------- | -| callback | AsyncCallback\ | 是 | 表示当前有序公共事件是否取消的状态 | +| callback | AsyncCallback\ | 是 | 表示当前有序公共事件是否取消的状态。 | **示例:** @@ -552,7 +552,7 @@ getAbortCommonEvent(): Promise\ | 类型 | 说明 | | ----------------- | ---------------------------------- | -| Promise\ | 表示当前有序公共事件是否取消的状态 | +| Promise\ | 表示当前有序公共事件是否取消的状态。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-deque.md b/zh-cn/application-dev/reference/apis/js-apis-deque.md index 9d51cccda6d334f75258076f387ace1403cce6f5..0d4365b497b5b20d8fb5e2c516f5d9f8006b8595 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-deque.md +++ b/zh-cn/application-dev/reference/apis/js-apis-deque.md @@ -49,7 +49,7 @@ insertFront(element: T): void **示例:** ``` -let deque = new Deque; +let deque = new Deque(); deque.insertFront("a"); deque.insertFront(1); let b = [1, 2, 3]; @@ -73,7 +73,7 @@ insertEnd(element: T): void **示例:** ``` -let deque = new Deque; +let deque = new Deque(); deque.insertEnd("a"); deque.insertEnd(1); let b = [1, 2, 3]; diff --git a/zh-cn/application-dev/reference/apis/js-apis-featureAbility.md b/zh-cn/application-dev/reference/apis/js-apis-featureAbility.md index 96dc62be64646f9cd93dd73cc7f9bc0840deb393..785a7a075ea7c9a9c047835aa2c300135d7a9c96 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-featureAbility.md +++ b/zh-cn/application-dev/reference/apis/js-apis-featureAbility.md @@ -23,10 +23,10 @@ startAbility(parameter: StartAbilityParameter, callback: AsyncCallback\) **参数:** -| 名称 | 类型 | 必填 | 描述 | -| --------- | --------------------- | ---- | ------------------- | -| parameter | [StartAbilityParameter](#startabilityparameter) | 是 | 表示被启动的Ability。 | -| callback | AsyncCallback\ | 是 | 被指定的回调方法。 | +| 名称 | 类型 | 必填 | 描述 | +| --------- | ---------------------------------------- | ---- | -------------- | +| parameter | [StartAbilityParameter](#startabilityparameter) | 是 | 表示被启动的Ability。 | +| callback | AsyncCallback\ | 是 | 被指定的回调方法。 | **示例:** @@ -62,9 +62,9 @@ startAbility(parameter: StartAbilityParameter): Promise\ **参数:** -| 名称 | 类型 | 必填 | 描述 | -| --------- | ----------------------------------------------- | ---- | --------------------- | -| parameter | [StartAbilityParameter](#startabilityparameter) | 是 | 表示被启动的Ability。 | +| 名称 | 类型 | 必填 | 描述 | +| --------- | ---------------------------------------- | ---- | -------------- | +| parameter | [StartAbilityParameter](#startabilityparameter) | 是 | 表示被启动的Ability。 | **示例:** @@ -100,14 +100,14 @@ acquireDataAbilityHelper(uri: string): DataAbilityHelper **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ---- | ------ | ---- | ------------------------ | -| uri | string | 是 | 指示要打开的文件的路径。 | +| 名称 | 类型 | 必填 | 描述 | +| ---- | ------ | ---- | ------------ | +| uri | string | 是 | 指示要打开的文件的路径。 | **返回值:** -| 类型 | 说明 | -| ----------------- | -------------------------------------------- | +| 类型 | 说明 | +| ----------------- | ------------------------------- | | DataAbilityHelper | 用来协助其他Ability访问DataAbility的工具类。 | **示例:** @@ -129,10 +129,10 @@ startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback\ **参数:** -| 名称 | 类型 | 必填 | 描述 | -| --------- | ----------------------------------------------- | ---- | --------------------- | -| parameter | [StartAbilityParameter](#startabilityparameter) | 是 | 表示被启动的Ability。 | -| callback | AsyncCallback\<[AbilityResult](#abilityresult)> | 是 | 被指定的回调方法。 | +| 名称 | 类型 | 必填 | 描述 | +| --------- | ---------------------------------------- | ---- | -------------- | +| parameter | [StartAbilityParameter](#startabilityparameter) | 是 | 表示被启动的Ability。 | +| callback | AsyncCallback\<[AbilityResult](#abilityresult)> | 是 | 被指定的回调方法。 | **示例:** @@ -166,14 +166,14 @@ startAbilityForResult(parameter: StartAbilityParameter): Promise\ **参数:** -| 名称 | 类型 | 必填 | 描述 | -| --------- | ----------------------------------------------- | ---- | ------------------- | -| parameter | [StartAbilityParameter](#startabilityparameter) | 是 | 表示被启动的Ability | +| 名称 | 类型 | 必填 | 描述 | +| --------- | ---------------------------------------- | ---- | ------------- | +| parameter | [StartAbilityParameter](#startabilityparameter) | 是 | 表示被启动的Ability | **返回值:** -| 类型 | 说明 | -| ----------------------------------------- | -------------- | +| 类型 | 说明 | +| ---------------------------------------- | ------- | | Promise\<[AbilityResult](#abilityresult)> | 返回执行结果。 | **示例:** @@ -222,10 +222,10 @@ terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback\ **参数:** -| 名称 | 类型 | 必填 | 描述 | -| --------- | ------------- | ---- | ------------------- | -| parameter | [AbilityResult](#abilityresult) | 是 | 表示被启动的Ability。 | -| callback | AsyncCallback\ | 是 | 被指定的回调方法。 | +| 名称 | 类型 | 必填 | 描述 | +| --------- | ------------------------------- | ---- | -------------- | +| parameter | [AbilityResult](#abilityresult) | 是 | 表示被启动的Ability。 | +| callback | AsyncCallback\ | 是 | 被指定的回调方法。 | **示例:** @@ -270,14 +270,14 @@ terminateSelfWithResult(parameter: AbilityResult): Promise\ **参数:** -| 名称 | 类型 | 必填 | 描述 | -| --------- | ------------------------------- | ---- | ------------------- | -| parameter | [AbilityResult](#abilityresult) | 是 | 表示被启动的Ability | +| 名称 | 类型 | 必填 | 描述 | +| --------- | ------------------------------- | ---- | ------------- | +| parameter | [AbilityResult](#abilityresult) | 是 | 表示被启动的Ability | **返回值:** -| 类型 | 说明 | -| -------------- | ----------------------- | +| 类型 | 说明 | +| -------------- | --------------- | | Promise\ | 以Promise形式返回结果。 | **示例:** @@ -327,9 +327,9 @@ hasWindowFocus(callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | -| -------- | ----------------------- | ---- | ------------------------------------------------------------ | -| callback | AsyncCallback\ | 是 | 被指定的回调方法。
如果此Ability当前具有视窗焦点,则返回true;否则返回false。 | +| 名称 | 类型 | 必填 | 描述 | +| -------- | ----------------------- | ---- | ---------------------------------------- | +| callback | AsyncCallback\ | 是 | 被指定的回调方法。
如果此Ability当前具有视窗焦点,则返回true;否则返回false。 | **示例:** @@ -350,8 +350,8 @@ hasWindowFocus(): Promise\ **返回值:** -| 类型 | 说明 | -| ----------------- | ---------------------------------------------------------- | +| 类型 | 说明 | +| ----------------- | ------------------------------------- | | Promise\ | 如果此Ability当前具有视窗焦点,则返回true;否则返回false。 | **示例:** @@ -375,9 +375,9 @@ getWant(callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | -| -------- | ----------------------------- | ---- | ------------------ | -| callback | AsyncCallback\<[Want](#want)> | 是 | 被指定的回调方法。 | +| 名称 | 类型 | 必填 | 描述 | +| -------- | ----------------------------- | ---- | --------- | +| callback | AsyncCallback\<[Want](#want)> | 是 | 被指定的回调方法。 | **示例:** @@ -398,8 +398,8 @@ getWant(): Promise\ **返回值:** -| 类型 | 说明 | -| ----------------------- | ------------------------- | +| 类型 | 说明 | +| ----------------------- | ---------------- | | Promise\<[Want](#want)> | 以Promise的形式返回结果。 | **示例:** @@ -421,8 +421,8 @@ getContext(): Context **返回值:** -| 类型 | 说明 | -| ------- | -------------------- | +| 类型 | 说明 | +| ------- | ---------- | | Context | 返回应用程序上下文。 | **示例:** @@ -445,9 +445,9 @@ terminateSelf(callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | -| -------- | -------------------- | ---- | ---------------- | -| callback | AsyncCallback\ | 是 | 被指定的回调方法 | +| 名称 | 类型 | 必填 | 描述 | +| -------- | -------------------- | ---- | -------- | +| callback | AsyncCallback\ | 是 | 被指定的回调方法 | **示例:** @@ -468,8 +468,8 @@ terminateSelf(): Promise\ **返回值:** -| 类型 | 说明 | -| -------------- | ------------------------- | +| 类型 | 说明 | +| -------------- | ---------------- | | Promise\ | 以Promise的形式返回结果。 | **示例:** @@ -490,35 +490,35 @@ connectAbility(request: Want, options:ConnectOptions): number **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ------- | -------------- | ---- | ---------------------------- | -| request | [Want](#want) | 是 | 表示被连接的ServiceAbility。 | -| options | ConnectOptions | 是 | 被指定的回调方法。 | +| 名称 | 类型 | 必填 | 描述 | +| ------- | -------------- | ---- | --------------------- | +| request | [Want](#want) | 是 | 表示被连接的ServiceAbility。 | +| options | ConnectOptions | 是 | 被指定的回调方法。 | **Want类型说明:** **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase -| 名称 | 读写属性 | 类型 | 必填 | 描述 | -| ------------ | -------- | -------- | ---- | ---------------------------------- | -| deviceId | 只读 | string | 否 | 表示被连接的ServiceAbility的设备id,缺省表示连接本地的ServiceAbility。 | -| bundleName | 只读 | string | 是 | 表示被连接的ServiceAbility的包名。 | -| abilityName | 只读 | string | 是 | 表示被连接的ServiceAbility的类名。 | +| 名称 | 读写属性 | 类型 | 必填 | 描述 | +| ----------- | ---- | ------ | ---- | ---------------------------------------- | +| deviceId | 只读 | string | 否 | 表示被连接的ServiceAbility的设备id,缺省表示连接本地的ServiceAbility。 | +| bundleName | 只读 | string | 是 | 表示被连接的ServiceAbility的包名。 | +| abilityName | 只读 | string | 是 | 表示被连接的ServiceAbility的类名。 | **ConnectOptions类型说明:** **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityRuntime.Core -| 名称 | 读写属性 | 类型 | 必填 | 描述 | -| ------------ | -------- | -------- | ---- | ---------------------------------- | -| onConnect | 只读 | function | 是 | 连接成功时的回调函数。 | -| onDisconnect | 只读 | function | 是 | 连接失败时的回调函数。 | -| onFailed | 只读 | function | 是 | ConnectAbility调用失败时的回调函数。 | +| 名称 | 读写属性 | 类型 | 必填 | 描述 | +| ------------ | ---- | -------- | ---- | ------------------------- | +| onConnect | 只读 | function | 是 | 连接成功时的回调函数。 | +| onDisconnect | 只读 | function | 是 | 连接失败时的回调函数。 | +| onFailed | 只读 | function | 是 | ConnectAbility调用失败时的回调函数。 | **返回值:** -| 类型 | 说明 | -| ------ | ------------------------ | +| 类型 | 说明 | +| ------ | -------------------- | | number | 连接的ServiceAbilityID。 | **示例:** @@ -559,10 +559,10 @@ disconnectAbility(connection: number, callback:AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ---------- | ------------- | ---- | ------------------------------ | -| connection | number | 是 | 指定断开连接的ServiceAbilityID | -| callback | AsyncCallback\ | 是 | 被指定的回调方法 | +| 名称 | 类型 | 必填 | 描述 | +| ---------- | -------------------- | ---- | ----------------------- | +| connection | number | 是 | 指定断开连接的ServiceAbilityID | +| callback | AsyncCallback\ | 是 | 被指定的回调方法 | **示例:** @@ -606,14 +606,14 @@ disconnectAbility(connection: number): Promise\ **参数:** -| 名称 | 类型 | 必填 | 描述 | -| ---------- | ------ | ---- | ------------------------------ | -| connection | number | 是 | 指定断开连接的ServiceAbilityID | +| 名称 | 类型 | 必填 | 描述 | +| ---------- | ------ | ---- | ----------------------- | +| connection | number | 是 | 指定断开连接的ServiceAbilityID | **返回值:** -| 类型 | 说明 | -| -------------- | ----------------------- | +| 类型 | 说明 | +| -------------- | --------------- | | Promise\ | 以Promise形式返回结果。 | **示例:** @@ -658,16 +658,18 @@ getWindow(callback: AsyncCallback\): void **参数:** -| 名称 | 类型 | 必填 | 描述 | -| -------- | ----------------------- | ---- | ------------------------------------------------------------ | -| callback | AsyncCallback\ | 是 | 返回与当前能力对应的窗口。 | +| 名称 | 类型 | 必填 | 描述 | +| -------- | ----------------------------- | ---- | ------------- | +| callback | AsyncCallback\ | 是 | 返回与当前能力对应的窗口。 | **示例:** ```javascript -GetWindow(){ +<<<<<<< HEAD +featureAbility.getWindow() +======= featureAbility.getWindow() - } +>>>>>>> 45a0d5bbd5a373948e44b76b9e7eeb3239fe94e7 ``` ## featureAbility.getWindow7+ @@ -680,18 +682,22 @@ getWindow(): Promise\; **返回值:** -| 类型 | 说明 | -| ----------------- | ---------------------------------------------------------- | +| 类型 | 说明 | +| ----------------------- | ------------- | | Promise\ | 返回与当前能力对应的窗口。 | **示例:** ```javascript -GetWindowPromise(){ +<<<<<<< HEAD +featureAbility.getWindow().then((data) => { + console.info("=============getWindowPromise========== " + JSON.stringify(data)); +}); +======= featureAbility.getWindow().then((data) => { console.info("=============getWindowPromise========== " + JSON.stringify(data)); - }); - } + }); +>>>>>>> 45a0d5bbd5a373948e44b76b9e7eeb3239fe94e7 ``` ## ConnectOptions.onConnect7+ @@ -704,10 +710,10 @@ onConnect(elementName: ElementName, remote: rpc.IRemoteObject): void; **参数:** -| 名称 | 类型 | 必填 | 描述 | -| -------- | ----------------------- | ---- | ------------------------------------------------------------ | -| elementName | ElementName | 是 | 元素名。 | -| remote | rpc.IRemoteObject | 是 | rpc远程对象。 | +| 名称 | 类型 | 必填 | 描述 | +| ----------- | ----------------- | ---- | -------- | +| elementName | ElementName | 是 | 元素名。 | +| remote | rpc.IRemoteObject | 是 | rpc远程对象。 | **示例:** @@ -747,9 +753,9 @@ onDisconnect(elementName: ElementName): void; **参数:** -| 名称 | 类型 | 必填 | 描述 | -| -------- | ----------------------- | ---- | ------------------------------------------------------------ | -| elementName | ElementName | 是 | 元素名。 | +| 名称 | 类型 | 必填 | 描述 | +| ----------- | ----------- | ---- | ---- | +| elementName | ElementName | 是 | 元素名。 | **示例:** @@ -789,9 +795,9 @@ ConnectAbility调用失败时的回调函数。 **参数:** -| 名称 | 类型 | 必填 | 描述 | -| -------- | ----------------------- | ---- | ------------------------------------------------------------ | -| code | number | 是 | number类型。 | +| 名称 | 类型 | 必填 | 描述 | +| ---- | ------ | ---- | --------- | +| code | number | 是 | number类型。 | **示例:** @@ -835,13 +841,13 @@ var connId = featureAbility.connectAbility( featureAbility.AbilityWindowConfiguration.WINDOW_MODE_UNDEFINED ``` -| 名称 | 参数 | 描述 | -| --------------------------- | ---- | ---------- | -| WINDOW_MODE_UNDEFINED7+ | 0 | 未定义。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | -| WINDOW_MODE_FULLSCREEN7+ | 1 | 全屏。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | +| 名称 | 参数 | 描述 | +| ---------------------------------------- | ---- | ---------------------------------------- | +| WINDOW_MODE_UNDEFINED7+ | 0 | 未定义。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | +| WINDOW_MODE_FULLSCREEN7+ | 1 | 全屏。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | | WINDOW_MODE_SPLIT_PRIMARY7+ | 100 | 分屏主屏。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | | WINDOW_MODE_SPLIT_SECONDARY7+ | 101 | 分屏次屏。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | -| WINDOW_MODE_FLOATING7+ | 102 | 悬浮窗。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | +| WINDOW_MODE_FLOATING7+ | 102 | 悬浮窗。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | ## AbilityStartSetting @@ -856,34 +862,34 @@ abilityStartSetting属性是一个定义为[key: string]: any的对象,key对 featureAbility.AbilityStartSetting.BOUNDS_KEY ``` -| 名称 | 参数 | 描述 | -| --------------- | --------------- | -------------------------- | -| BOUNDS_KEY7+ | "abilityBounds" | 窗口显示大小属性的名称。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | -| WINDOW_MODE_KEY7+ | "windowMode" | 窗口显示模式属性的名称。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | -| DISPLAY_ID_KEY7+ | "displayId" | 窗口显示设备ID属性的名称。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | +| 名称 | 参数 | 描述 | +| ---------------------------- | --------------- | ---------------------------------------- | +| BOUNDS_KEY7+ | "abilityBounds" | 窗口显示大小属性的名称。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | +| WINDOW_MODE_KEY7+ | "windowMode" | 窗口显示模式属性的名称。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | +| DISPLAY_ID_KEY7+ | "displayId" | 窗口显示设备ID属性的名称。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | ## ErrorCode 获取错误代码。 -| 变量 | 值 | 说明 | -| ----------------------------- | ---- | ------------------------------------------------------------ | -| NO_ERROR7+ | 0 | 没有错误。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | -| INVALID_PARAMETER7+ | -1 | 无效的参数。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | -| ABILITY_NOT_FOUND7+ | -2 | 找不到能力。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | -| PERMISSION_DENY7+ | -3 | 拒绝许可。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | +| 变量 | 值 | 说明 | +| ------------------------------ | ---- | ---------------------------------------- | +| NO_ERROR7+ | 0 | 没有错误。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | +| INVALID_PARAMETER7+ | -1 | 无效的参数。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | +| ABILITY_NOT_FOUND7+ | -2 | 找不到能力。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | +| PERMISSION_DENY7+ | -3 | 拒绝许可。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | ## DataAbilityOperationType 指示数据的操作类型。 -| 变量 | 值 | 说明 | -| ----------------------------- | ---- | ------------------------------------------------------------ | -| TYPE_INSERT7+ | 1 | 插入类型。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | -| TYPE_UPDATE7+ | 2 | 修改类型。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | -| TYPE_DELETE7+ | 3 | 删除类型。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | -| TYPE_ASSERT7+ | 4 | 声明类型。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | +| 变量 | 值 | 说明 | +| ------------------------ | ---- | ---------------------------------------- | +| TYPE_INSERT7+ | 1 | 插入类型。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | +| TYPE_UPDATE7+ | 2 | 修改类型。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | +| TYPE_DELETE7+ | 3 | 删除类型。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | +| TYPE_ASSERT7+ | 4 | 声明类型。
**系统能力**:SystemCapability.Ability.AbilityRuntime.FAModel | @@ -891,59 +897,59 @@ featureAbility.AbilityStartSetting.BOUNDS_KEY **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase -| 名称 | 读写属性 | 类型 | 必填 | 描述 | -| ---------- | -------- | --------------------- | ---- | ------------------------------------------------------------ | -| resultCode7+ | 只读 | number | 是 | 指示销毁该能力后返回的结果代码。您可以定义结果代码来识别错误(暂不支持)。 | -| want7+ | 只读 | [Want](#want) | 否 | 指示销毁该能力后返回的数据。您可以定义返回的数据。此参数可以为null。 | +| 名称 | 读写属性 | 类型 | 必填 | 描述 | +| ----------------------- | ---- | ------------- | ---- | ------------------------------------- | +| resultCode7+ | 只读 | number | 是 | 指示销毁该能力后返回的结果代码。您可以定义结果代码来识别错误(暂不支持)。 | +| want7+ | 只读 | [Want](#want) | 否 | 指示销毁该能力后返回的数据。您可以定义返回的数据。此参数可以为null。 | ## StartAbilityParameter **系统能力**:以下各项对应的系统能力均为SystemCapability.AbilityRuntime.FAModel -| 名称 | 读写属性 | 类型 | 必填 | 描述 | -| ------------------- | -------- | -------------------- | ---- | ------------------------------------------------------------ | -| want | 只读 | [Want](#want) | 是 | 表示需要包含有关目标启动能力的信息。 | -| abilityStartSetting | 只读 | {[key: string]: any} | 否 | 表示能力的特殊属性,当开发者启动能力时,该属性可以作为调用中的输入参数传递。 | +| 名称 | 读写属性 | 类型 | 必填 | 描述 | +| ------------------- | ---- | -------------------- | ---- | -------------------------------------- | +| want | 只读 | [Want](#want) | 是 | 表示需要包含有关目标启动能力的信息。 | +| abilityStartSetting | 只读 | {[key: string]: any} | 否 | 表示能力的特殊属性,当开发者启动能力时,该属性可以作为调用中的输入参数传递。 | ## Want **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase -| 名称 | 读写属性 | 类型 | 必填 | 描述 | -| ----------- | -------- | -------------------- | ---- | ------------------------------------------------------------ | -| deviceId | 只读 | string | 否 | 表示运行指定Ability的设备ID。 | -| bundleName | 只读 | string | 否 | 表示包描述。如果在Want中同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。 | -| abilityName | 只读 | string | 否 | 表示待启动的Ability名称。如果在Want中同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。 | -| uri | 只读 | string | 否 | 表示Uri描述。如果在Want中指定了Uri,则Want将匹配指定的Uri信息,包括scheme, schemeSpecificPart, authority和path信息。 | -| type | 只读 | string | 否 | 表示MIME type类型描述,比如:"text/plain" 、 "image/*"等。 | -| flags | 只读 | number | 否 | 表示处理Want的方式。默认传数字,具体参考:[flags说明](#flags说明)。 | -| action | 只读 | string | 否 | 表示action选项描述。 | -| parameters | 只读 | {[key: string]: any} | 否 | 表示WantParams描述。 | -| entities | 只读 | Array\ | 否 | 表示entities相关描述。 | -| extensionAbilityName9+ | 只读 | string | 否 | Want中扩展能力名称的描述。 | -| extensionAbilityType9+ | 只读 | number | 否 | 需求中扩展能力类型的描述。 | +| 名称 | 读写属性 | 类型 | 必填 | 描述 | +| -------------------------------- | ---- | -------------------- | ---- | ---------------------------------------- | +| deviceId | 只读 | string | 否 | 表示运行指定Ability的设备ID。 | +| bundleName | 只读 | string | 否 | 表示包描述。如果在Want中同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。 | +| abilityName | 只读 | string | 否 | 表示待启动的Ability名称。如果在Want中同时指定了BundleName和AbilityName,则Want可以直接匹配到指定的Ability。 | +| uri | 只读 | string | 否 | 表示Uri描述。如果在Want中指定了Uri,则Want将匹配指定的Uri信息,包括scheme, schemeSpecificPart, authority和path信息。 | +| type | 只读 | string | 否 | 表示MIME type类型描述,比如:"text/plain" 、 "image/*"等。 | +| flags | 只读 | number | 否 | 表示处理Want的方式。默认传数字,具体参考:[flags说明](#flags说明)。 | +| action | 只读 | string | 否 | 表示action选项描述。 | +| parameters | 只读 | {[key: string]: any} | 否 | 表示WantParams描述。 | +| entities | 只读 | Array\ | 否 | 表示entities相关描述。 | +| extensionAbilityName9+ | 只读 | string | 否 | Want中扩展能力名称的描述。 | +| extensionAbilityType9+ | 只读 | number | 否 | 需求中扩展能力类型的描述。 | ## flags说明 **系统能力**:以下各项对应的系统能力均为SystemCapability.Ability.AbilityBase -| 名称 | 参数 | 描述 | -| ------------------------------------ | ---------- | ------------------------------------------------------------ | -| FLAG_AUTH_READ_URI_PERMISSION | 0x00000001 | 指示对URI执行读取操作的授权。 | -| FLAG_AUTH_WRITE_URI_PERMISSION | 0x00000002 | 指示对URI执行写入操作的授权。 | -| FLAG_ABILITY_FORWARD_RESULT | 0x00000004 | 将结果返回给元能力。 | -| FLAG_ABILITY_CONTINUATION | 0x00000008 | 确定是否可以将本地设备上的功能迁移到远程设备。 | -| FLAG_NOT_OHOS_COMPONENT | 0x00000010 | 指定组件是否属于OHOS。 | -| FLAG_ABILITY_FORM_ENABLED | 0x00000020 | 指定是否启动某个能力。 | -| FLAG_AUTH_PERSISTABLE_URI_PERMISSION | 0x00000040 | 指示URI上可能持久化的授权。 | -| FLAG_AUTH_PREFIX_URI_PERMISSION | 0x00000080 | 按照前缀匹配的方式验证URI权限。 | -| FLAG_ABILITYSLICE_MULTI_DEVICE | 0x00000100 | 支持分布式调度系统中的多设备启动。 | -| FLAG_START_FOREGROUND_ABILITY | 0x00000200 | 指示无论主机应用程序是否已启动,都将启动使用服务模板的功能。 | -| FLAG_ABILITY_CONTINUATION_REVERSIBLE | 0x00000400 | 表示迁移是可拉回的。 | -| FLAG_INSTALL_ON_DEMAND | 0x00000800 | 如果未安装指定的功能,请安装该功能。 | -| FLAG_INSTALL_WITH_BACKGROUND_MODE | 0x80000000 | 如果未安装,使用后台模式安装该功能。 | +| 名称 | 参数 | 描述 | +| ------------------------------------ | ---------- | ---------------------------------------- | +| FLAG_AUTH_READ_URI_PERMISSION | 0x00000001 | 指示对URI执行读取操作的授权。 | +| FLAG_AUTH_WRITE_URI_PERMISSION | 0x00000002 | 指示对URI执行写入操作的授权。 | +| FLAG_ABILITY_FORWARD_RESULT | 0x00000004 | 将结果返回给元能力。 | +| FLAG_ABILITY_CONTINUATION | 0x00000008 | 确定是否可以将本地设备上的功能迁移到远程设备。 | +| FLAG_NOT_OHOS_COMPONENT | 0x00000010 | 指定组件是否属于OHOS。 | +| FLAG_ABILITY_FORM_ENABLED | 0x00000020 | 指定是否启动某个能力。 | +| FLAG_AUTH_PERSISTABLE_URI_PERMISSION | 0x00000040 | 指示URI上可能持久化的授权。 | +| FLAG_AUTH_PREFIX_URI_PERMISSION | 0x00000080 | 按照前缀匹配的方式验证URI权限。 | +| FLAG_ABILITYSLICE_MULTI_DEVICE | 0x00000100 | 支持分布式调度系统中的多设备启动。 | +| FLAG_START_FOREGROUND_ABILITY | 0x00000200 | 指示无论主机应用程序是否已启动,都将启动使用服务模板的功能。 | +| FLAG_ABILITY_CONTINUATION_REVERSIBLE | 0x00000400 | 表示迁移是可拉回的。 | +| FLAG_INSTALL_ON_DEMAND | 0x00000800 | 如果未安装指定的功能,请安装该功能。 | +| FLAG_INSTALL_WITH_BACKGROUND_MODE | 0x80000000 | 如果未安装,使用后台模式安装该功能。 | | FLAG_ABILITY_CLEAR_MISSION | 0x00008000 | 指示清除其他任务的操作。可以为传递给 **[ohos.app.Context](js-apis-ability-context.md)** 中**startAbility**方法的**Want**设置此标志,并且必须与**flag_ABILITY_NEW_MISSION**一起使用。 | -| FLAG_ABILITY_NEW_MISSION | 0x10000000 | 指示在历史任务堆栈上创建任务的操作。 | +| FLAG_ABILITY_NEW_MISSION | 0x10000000 | 指示在历史任务堆栈上创建任务的操作。 | | FLAG_ABILITY_MISSION_TOP | 0x20000000 | 指示如果启动能力的现有实例已位于任务堆栈的顶部,则将重用该实例。否则,将创建一个新的能力实例。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-formbindingdata.md b/zh-cn/application-dev/reference/apis/js-apis-formbindingdata.md index dcdf3ce6a99b544b4ba88b7df8720055291c9475..6fa3ef45af1fbdeb4e6c4971b19ef14d0a42b6a5 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-formbindingdata.md +++ b/zh-cn/application-dev/reference/apis/js-apis-formbindingdata.md @@ -42,16 +42,12 @@ createFormBindingData(obj?: Object | string): FormBindingData let formBindingDataObj = formBindingData.createFormBindingData(obj); ``` -## formBindingData.FormBindingData - -data: Object +## 属性 FormBindingData相关描述。 -**系统能力**:SystemCapability.Ability.Form - -**参数:** +| 名称 | 可读 | 可写 | 参数类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | -------- | -------- | +| data | 是 | 否 | Object | 是 | js卡片要展示的数据。可以是包含若干键值对的Object或者 json 格式的字符串。
**系统能力**:SystemCapability.Ability.Form | -| 名称 | 类型 | 说明 | -| ---- | -------------- | ------------------------------------------------------------ | -| data | Object或string | js卡片要展示的数据。可以是包含若干键值对的Object或者 json 格式的字符串。 | \ No newline at end of file + \ No newline at end of file diff --git a/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md b/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md index 65c71a03bf58d7f298a1a9d751275be6f10f5609..b8ef5b4109be6a244d4ee04060b1b7d6472214dd 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputdevice.md @@ -26,24 +26,26 @@ getDeviceIds(callback: AsyncCallback<Array<number>>): void **参数:** -| 参数 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| callback | AsyncCallback<Array<number>> | 是 | 回调函数。 | +| 参数 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | ----- | +| callback | AsyncCallback<Array<number>> | 是 | 回调函数。 | **示例:** ``` -data: { - deviceIds: Array, -}, -callback: function(ids) { - this.deviceIds = ids; -}, -testGetDeviceIds: function () { - console.info("InputDeviceJsTest---start---testGetDeviceIds"); - inputDevice.getDeviceIds(this.callback); - console.info("InputDeviceJsTest---end---testGetDeviceIds"); +export default { + data: { + deviceIds: Array, + }, + callback: function(ids) { + this.deviceIds = ids; + }, + testGetDeviceIds: function () { + console.info("InputDeviceJsTest---start---testGetDeviceIds"); + inputDevice.getDeviceIds(this.callback); + console.info("InputDeviceJsTest---end---testGetDeviceIds"); + } } ``` @@ -57,21 +59,23 @@ function getDeviceIds(): Promise> **返回值:** -| 参数 | 说明 | -| -------- | -------- | +| 参数 | 说明 | +| ---------------------- | ------------------ | | Promise> | Promise实例,用于异步获取结果 | **示例:** ``` -testGetDeviceIds: function () { - console.info("InputDeviceJsTest---start---testGetDeviceIds"); - let promise = inputDevice.getDeviceIds(); - promise.then((data)=> { - console.info('GetDeviceIds successed, Data: ' + JSON.stringify(data)) - }).catch((err)=>{ - console.error('Failed GetDeviceIds. Cause: ' + JSON.stringify(err)); - }); +export default { + testGetDeviceIds: function () { + console.info("InputDeviceJsTest---start---testGetDeviceIds"); + let promise = inputDevice.getDeviceIds(); + promise.then((data)=> { + console.info('GetDeviceIds successed, Data: ' + JSON.stringify(data)) + }).catch((err)=>{ + console.error('Failed GetDeviceIds. Cause: ' + JSON.stringify(err)); + }); + } } ``` @@ -89,28 +93,30 @@ getDevice(deviceId: number, callback: AsyncCallback<InputDeviceData>): voi **参数:** -| 参数 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| deviceId | number | 是 | 需要获取信息的设备id。 | -| callback | AsyncCallback<[InputDeviceData](#inputdevicedata)> | 是 | 回调函数,异步返回InputDeviceData对象。 | +| 参数 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | --------------------------- | +| deviceId | number | 是 | 需要获取信息的设备id。 | +| callback | AsyncCallback<[InputDeviceData](#inputdevicedata)> | 是 | 回调函数,异步返回InputDeviceData对象。 | **示例:** ``` -InputDeviceData { - deviceId : 0, - name : "NA", - sources : Array, - axisRanges : Array, -}, -callback: function(deviceData) { - this.InputDeviceData = deviceData; -}, -testGetDevice: function () { - // 示例获取设备id为1的设备信息。 - console.info("InputDeviceJsTest---start---testGetDevice"); - inputDevice.getDevice(1, this.callback); - console.info("InputDeviceJsTest---end---testGetDevice"); +export default { + InputDeviceData { + deviceId : 0, + name : "NA", + sources : Array, + axisRanges : Array, + }, + callback: function(deviceData) { + this.InputDeviceData = deviceData; + }, + testGetDevice: function () { + // 示例获取设备id为1的设备信息。 + console.info("InputDeviceJsTest---start---testGetDevice"); + inputDevice.getDevice(1, this.callback); + console.info("InputDeviceJsTest---end---testGetDevice"); + } } ``` @@ -124,28 +130,30 @@ function getDevice(deviceId: number): Promise **返回值:** -| 参数 | 说明 | -| -------- | -------- | +| 参数 | 说明 | +| ------------------------ | ------------------ | | Promise | Promise实例,用于异步获取结果 | **示例:** ``` -InputDeviceData { - deviceId : 0, - name : "NA", - sources : Array, - axisRanges : Array, -}, -testGetDevice: function () { - // 示例获取设备id为1的设备信息。 - console.info("InputDeviceJsTest---start---testGetDevice"); - let promise = inputDevice.getDevice(1); - promise.then((data)=> { - console.info('GetDeviceId successed, Data: ' + JSON.stringify(data)) - }).catch((err)=>{ - console.error('Failed GetDeviceId. Cause: ' + JSON.stringify(err)); - }); +export default { + InputDeviceData { + deviceId : 0, + name : "NA", + sources : Array, + axisRanges : Array, + }, + testGetDevice: function () { + // 示例获取设备id为1的设备信息。 + console.info("InputDeviceJsTest---start---testGetDevice"); + let promise = inputDevice.getDevice(1); + promise.then((data)=> { + console.info('GetDeviceId successed, Data: ' + JSON.stringify(data)) + }).catch((err)=>{ + console.error('Failed GetDeviceId. Cause: ' + JSON.stringify(err)); + }); + } } ``` @@ -157,10 +165,10 @@ testGetDevice: function () { **系统能力:** 以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice -| 名称 | 参数类型 | 说明 | -| -------- | -------- | -------- | -| id | number | 输入设备的唯一标识,同一个物理设备反复插拔,其设备id会发生变化。 | -| name | string | 输入设备的名字。 | +| 名称 | 参数类型 | 说明 | +| ------- | -------------------------------------- | ---------------------------------------- | +| id | number | 输入设备的唯一标识,同一个物理设备反复插拔,其设备id会发生变化。 | +| name | string | 输入设备的名字。 | | sources | Array<[SourceType](#sourcetype)> | 输入设备支持的源类型。比如有的键盘上附带触摸板,则此设备有keyboard和touchpad两种输入源。 | ## AxisType @@ -173,12 +181,12 @@ testGetDevice: function () { **系统能力:** 以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice -| 名称 | 参数类型 | 说明 | -| ------ | ------------------------- | ---------------- | +| 名称 | 参数类型 | 说明 | +| ------ | ------------------------- | -------- | | source | [SourceType](#sourcetype) | 轴的输入源类型。 | -| axis | [AxisType](axistype) | 轴的类型 | -| max | number | 轴上报的最大值 | -| min | number | 轴上报的最小值 | +| axis | [AxisType](axistype) | 轴的类型 | +| max | number | 轴上报的最大值 | +| min | number | 轴上报的最小值 | @@ -188,11 +196,11 @@ testGetDevice: function () { **系统能力:** 以下各项对应的系统能力均为SystemCapability.MultimodalInput.Input.InputDevice -| 名称 | 参数类型 | 说明 | -| -------- | -------- | -------- | -| keyboard | string | 表示输入设备是键盘。 | +| 名称 | 参数类型 | 说明 | +| ----------- | ------ | ----------- | +| keyboard | string | 表示输入设备是键盘。 | | touchscreen | string | 表示输入设备是触摸屏。 | -| mouse | string | 表示输入设备是鼠标。 | -| trackball | string | 表示输入设备是轨迹球。 | -| touchpad | string | 表示输入设备是触摸板。 | -| joystick | string | 表示输入设备是操纵杆。 | +| mouse | string | 表示输入设备是鼠标。 | +| trackball | string | 表示输入设备是轨迹球。 | +| touchpad | string | 表示输入设备是触摸板。 | +| joystick | string | 表示输入设备是操纵杆。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-inputmonitor.md b/zh-cn/application-dev/reference/apis/js-apis-inputmonitor.md index 49b0847e5a4018f324474e65db36a4c375418adf..5961418759209bd87927d038e8c8b6eedae483a8 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-inputmonitor.md +++ b/zh-cn/application-dev/reference/apis/js-apis-inputmonitor.md @@ -3,7 +3,7 @@ > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > - 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 -> +> > - 本模块接口均为系统接口,三方应用不支持调用。 @@ -31,30 +31,32 @@ on(type: "touch", receiver: TouchEventReceiver): void **系统能力:**SystemCapability.MultimodalInput.Input.InputMonitor **参数:** - | 参数 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 监听输入事件类型,只支持“touch”。 | -| receiver | [TouchEventReceiver](#toucheventreceiver) | 是 | 触摸输入事件回调函数。 | +| 参数 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | -------------------- | +| type | string | 是 | 监听输入事件类型,只支持“touch”。 | +| receiver | [TouchEventReceiver](#toucheventreceiver) | 是 | 触摸输入事件回调函数。 | **示例:** ``` -callback: function (value) { - if (checkEvent(value)) { - //事件满足业务要求,事件被消费 - return true; - } else { - //事件不满足业务要求,事件未被消费 - return false; +export default { + callback: function (value) { + if (checkEvent(value)) { + //事件满足业务要求,事件被消费 + return true; + } else { + //事件不满足业务要求,事件未被消费 + return false; + } + }, + testOn: function () { + console.info("InputMonitorJsTest---start---testOn"); + inputMonitor.on( + "touch", + this.callback + ); + console.info("InputMonitorJsTest---end---testOn"); } -}, -testOn: function () { - console.info("InputMonitorJsTest---start---testOn"); - inputMonitor.on( - "touch", - this.callback - ); - console.info("InputMonitorJsTest---end---testOn"); } ``` @@ -70,31 +72,33 @@ off(type: "touch", receiver: TouchEventReceiver): void **系统能力:**SystemCapability.MultimodalInput.Input.InputMonitor **参数:** - | 参数 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| type | string | 是 | 监听输入事件类型,只支持“touch”。 | -| receiver | [TouchEventReceiver](#toucheventreceiver) | 否 | 触摸输入事件回调函数。 | +| 参数 | 类型 | 必填 | 说明 | +| -------- | ---------------------------------------- | ---- | -------------------- | +| type | string | 是 | 监听输入事件类型,只支持“touch”。 | +| receiver | [TouchEventReceiver](#toucheventreceiver) | 否 | 触摸输入事件回调函数。 | **示例:** ``` -callback: function (value) { - if (checkEvent(value)) { - //事件满足业务要求,事件被消费 - return true; - } else { - //事件不满足业务要求,事件未被消费 - return false; +export default { + callback: function (value) { + if (checkEvent(value)) { + //事件满足业务要求,事件被消费 + return true; + } else { + //事件不满足业务要求,事件未被消费 + return false; + } + }, + testOff: function () { + console.info("InputMonitorJsTest---start---testOff"); + inputMonitor.off( + "touch", + this.callback + ); + console.info("InputMonitorJsTest---end---testOff"); } -}, -testOff: function () { - console.info("InputMonitorJsTest---start---testOff"); - inputMonitor.off( - "touch", - this.callback - ); - console.info("InputMonitorJsTest---end---testOff"); -} + } ``` @@ -110,33 +114,35 @@ testOff: function () { **系统能力:**SystemCapability.MultimodalInput.Input.InputMonitor **参数:** -| 参数 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| touchEvent | [TouchEvent](../arkui-js/js-components-common-events.md) | 是 | 触摸输入事件回调函数,返回true表示输触事件被监听器消费,false表示输触事件未被监听器消费。 | +| 参数 | 类型 | 必填 | 说明 | +| ---------- | ---------------------------------------- | ---- | ---------------------------------------- | +| touchEvent | [TouchEvent](../arkui-js/js-components-common-events.md) | 是 | 触摸输入事件回调函数,返回true表示输触事件被监听器消费,false表示输触事件未被监听器消费。 | **返回值:** - | 类型 | 说明 | -| -------- | -------- | -| Boolean | 返回true表示输触事件被监听器消费,false表示输触事件未被监听器消费。 | +| 类型 | 说明 | +| ------- | -------------------------------------- | +| Boolean | 返回true表示输触事件被监听器消费,false表示输触事件未被监听器消费。 | **示例:** ``` -callback: function (value) { //此处为(touchEvent:TouchEvent): Boolean 方法的实现 - if (checkEvent(value)) { - //事件满足业务要求,事件被消费 - return true; - } else { - //事件不满足业务要求,事件未被消费 - return false; +export default { + callback: function (value) { //此处为(touchEvent:TouchEvent): Boolean 方法的实现 + if (checkEvent(value)) { + //事件满足业务要求,事件被消费 + return true; + } else { + //事件不满足业务要求,事件未被消费 + return false; + } + }, + testOff: function () { + console.info("InputMonitorJsTest---start---testOff"); + inputMonitor.off( + "touch", + this.callback + ); + console.info("InputMonitorJsTest---end---testOff"); } -}, -testOff: function () { - console.info("InputMonitorJsTest---start---testOff"); - inputMonitor.off( - "touch", - this.callback - ); - console.info("InputMonitorJsTest---end---testOff"); } ``` diff --git a/zh-cn/application-dev/reference/apis/js-apis-linkedlist.md b/zh-cn/application-dev/reference/apis/js-apis-linkedlist.md index 768853d1914f671e0915749f1a9e1472186bd6c1..f687e9d5b56c26c82260b65e0a032418562e5f5d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-linkedlist.md +++ b/zh-cn/application-dev/reference/apis/js-apis-linkedlist.md @@ -404,11 +404,10 @@ let result = linkedList.removeLastFound(4); ``` ### clone -clone(): LinkedList<T> -克隆一个与LinkedList相同的实例,并返回克隆后的实例。 +clone(): LinkedList<T> -修改克隆后的实例并不会影响原实例。 +克隆一个与LinkedList相同的实例,并返回克隆后的实例。修改克隆后的实例并不会影响原实例。 **返回值:** @@ -428,6 +427,7 @@ let result = linkedList.clone(); ``` ### forEach + forEach(callbackfn: (value: T, index?: number, LinkedList?: LinkedList<T>) => void, thisArg?: Object): void @@ -462,6 +462,7 @@ linkedList.forEach((value, index) => { ``` ### clear + clear(): void 清除LinkedList中的所有元素,并把length置为0。 @@ -478,6 +479,7 @@ linkedList.clear(); ``` ### set + set(index: number, element: T): T 将此LinkedList中指定位置的元素替换为指定元素。 diff --git a/zh-cn/application-dev/reference/apis/js-apis-list.md b/zh-cn/application-dev/reference/apis/js-apis-list.md index 4a986350a38174f2f037b84ecdec23921972a95a..a4a203c2c367846c6f483e6d22e1aa8fa2b0cc1e 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-list.md +++ b/zh-cn/application-dev/reference/apis/js-apis-list.md @@ -60,7 +60,7 @@ add(element: T): boolean **示例:** ``` -let list = new List; +let list = new List(); let result = list.add("a"); let result1 = list.add(1); let b = [1, 2, 3]; diff --git a/zh-cn/application-dev/reference/apis/js-apis-notification.md b/zh-cn/application-dev/reference/apis/js-apis-notification.md index 220b08370f7f8076732e6d49d4ea438d43fcad38..8f8b24a06499afe935dbdb6e9161e52ff9f93942 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-notification.md +++ b/zh-cn/application-dev/reference/apis/js-apis-notification.md @@ -186,7 +186,7 @@ Notification.cancel(0, "label", cancelCallback) ## Notification.cancel -cancel(id:number, label? :string): Promise\ +cancel(id:number, label?:string): Promise\ 取消与指定id相匹配的已发布通知,label可以指定也可以不指定(Promise形式)。 @@ -2562,7 +2562,7 @@ Notification.getDeviceRemindType() | 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | | ----- | ---- | --- | ------ | ---- | -------- | | id | 是 | 是 | number | 是 | 通知ID。 | -| label | 是 | 是 | string | 否 | 通知标签。< | +| label | 是 | 是 | string | 否 | 通知标签。 | ## SlotType diff --git a/zh-cn/application-dev/reference/apis/js-apis-notificationFlags.md b/zh-cn/application-dev/reference/apis/js-apis-notificationFlags.md index 847757f753b58327aa054f220778dbffc352a1e1..5bec0139381265b8e27a6f585253d7c47c91fcc0 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-notificationFlags.md +++ b/zh-cn/application-dev/reference/apis/js-apis-notificationFlags.md @@ -13,7 +13,7 @@ | -------------- | --- | --------------------------------- | | TYPE_NONE | 0 | 默认标志。 | | TYPE_OPEN | 1 | 通知标志打开。 | -| TYPE_CLOSE | 2 | 通知标志打开。 | +| TYPE_CLOSE | 2 | 通知标志关闭。 | ## NotificationFlags diff --git a/zh-cn/application-dev/reference/apis/js-apis-notificationSubscriber.md b/zh-cn/application-dev/reference/apis/js-apis-notificationSubscriber.md index 01a8ad8549a5f780c5d9d8c69eb3368b86191bc9..f92fc60d9518e7847c3cf64f81517f9d2d27e318 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-notificationSubscriber.md +++ b/zh-cn/application-dev/reference/apis/js-apis-notificationSubscriber.md @@ -101,7 +101,7 @@ onUpdate?:(data: [NotificationSortingMap](#notificationsortingmap)) | 参数名 | 类型 | 必填 | 说明 | | ------------ | ------------------------ | ---- | -------------------------- | -| data | [NotificationSortingMap](#notificationsortingmap) | 是 | | +| data | [NotificationSortingMap](#notificationsortingmap) | 是 | 回调返回接收到的通知信息。 | **示例:** diff --git a/zh-cn/application-dev/reference/apis/js-apis-osAccount.md b/zh-cn/application-dev/reference/apis/js-apis-osAccount.md index 12cc9d84d9602eb68ac52aa30fb52445518f9edc..38af2a5f98606bab9d7f6e5307979ac1f04074f0 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-osAccount.md +++ b/zh-cn/application-dev/reference/apis/js-apis-osAccount.md @@ -483,7 +483,7 @@ removeOsAccount(localId: number): Promise<void> setOsAccountConstraints(localId: number, constraints: Array<string>, enable: boolean,callback: AsyncCallback<void>): void -为指定系统帐号设置/删除约束返回结果。 +为指定系统帐号设置/删除约束,使用callback回调异步返回结果。 此接口为系统接口,三方应用不支持调用。 @@ -514,7 +514,7 @@ setOsAccountConstraints(localId: number, constraints: Array<string>, enabl setOsAccountConstraints(localId: number, constraints: Array<string>, enable: boolean): Promise<void> -为指定系统帐号设置/删除约束回结果。 +为指定系统帐号设置/删除约束,使用Promise方式异步返回结果。 此接口为系统接口,三方应用不支持调用。 diff --git a/zh-cn/application-dev/reference/apis/js-apis-particleAbility.md b/zh-cn/application-dev/reference/apis/js-apis-particleAbility.md index c2b55af5584868611ed11bbd3bfc1d525c39f713..711b207e4c20245b809e4841d3ab6dcb1ca2fb66 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-particleAbility.md +++ b/zh-cn/application-dev/reference/apis/js-apis-particleAbility.md @@ -58,7 +58,7 @@ particleAbility.startAbility( ## particleAbility.startAbility -startAbility(parameter: StartAbilityParameter): Promise; +startAbility(parameter: StartAbilityParameter): Promise\; 使用此方法启动指定的particleAbility(Promise形式)。 diff --git a/zh-cn/application-dev/reference/apis/js-apis-sensor.md b/zh-cn/application-dev/reference/apis/js-apis-sensor.md index 3b46689c13854ce9737ed144048ac16b363fec36..b428321ec03456e6140341452401f8193aa660b1 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-sensor.md +++ b/zh-cn/application-dev/reference/apis/js-apis-sensor.md @@ -1301,7 +1301,7 @@ sensor.off(sensor.SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback); ## sensor.off(SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED) -off(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback?: Callback<GyroscopeResponse>): void +off(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback?: Callback<GyroscopeUncalibratedResponse>): void 取消订阅传感器数据。 @@ -1909,7 +1909,7 @@ getGeomagneticDip(inclinationMatrix: Array<number>): Promise<number> ## sensor. getAngleModify -getAngleModify(currentRotationMatrix: Array<number>, preRotationMatrix: Array<number>,callback: AsyncCallback<Array<number>>): void +getAngleModify(currentRotationMatrix: Array<number>, preRotationMatrix: Array<number>, callback: AsyncCallback<Array<number>>): void 获取两个旋转矩阵之间的角度变化。 diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-app.md b/zh-cn/application-dev/reference/apis/js-apis-system-app.md index 6ceb384650f9b4c8bd8526fb198bc86788f36474..85cd58a7311f9c95214cb7661442f95220c87723 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-system-app.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-app.md @@ -16,21 +16,17 @@ import app from '@system.app'; ## app.getInfo -getInfo(): <AppResponse> +getInfo(): AppResponse 获取当前应用配置文件中声明的信息。 **系统能力:** SystemCapability.ArkUI.ArkUI.Lite **返回值:** -**表1** AppResponse -| 参数名 | 类型 | 说明 | -| -------- | -------- | -------- | -| appID6+ | string | 表示应用的包名,用于标识应用的唯一性。 | -| appName | string | 表示应用的名称。 | -| versionName | string | 表示应用的版本名称。 | -| versionCode | number | 表示应用的版本号。 | +| 参数类型 | 说明 | +| -------- | -------- | +| [AppResponse](#appresponse) | 定义AppResponse信息。 | **示例:** @@ -43,41 +39,6 @@ getInfo(): <AppResponse> } ``` -## app.screenOnVisible - -screenOnVisible(Object): void - -应用申请息屏不返回主表盘,再次亮屏依旧显示应用界面。 - -**系统能力:** SystemCapability.ArkUI.ArkUI.Full - -**参数:** -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| visible | boolean | 否 | 是否启动保活,默认值false。 | -| success | Function | 否 | 接口调用成功的回调函数。 | -| fail | Function | 否 | 接口调用失败的回调函数。 | -| complete | Function | 否 | 接口调用结束的回调函数。 | - -**示例:** - - ``` - export default { - screenOnVisible(){ - app.screenOnVisible({ - visible: true, - success() { - console.log('call app.keepVisible success'); - }, - fail(data, code) { - console.log('call app.keepVisible fail'); - }, - }); - } - } - ``` - - ## app.terminate terminate(): void @@ -94,10 +55,9 @@ terminate(): void app.terminate(); }} ``` - ## app.requestFullWindow -requestFullWindow(duration: number): void +requestFullWindow(options?: RequestFullWindowOptions): void 请求应用以全窗口运行,FA在某些场景下(如半模态FA)会以非全窗口运行,调用该接口会从非全窗口切换为全窗口运行,如果已经以全窗口运行则该接口调用无效。 @@ -108,7 +68,7 @@ requestFullWindow(duration: number): void **参数:** | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| duration | number | 否 | 请求全屏时,设定非全屏到全屏的过渡时间,单位为毫秒,默认时间与非全屏到全屏的距离成正比。 | +| options | [RequestFullWindowOptions](#requestfullwindowoptions) | 否 | 请求全屏时,设定非全屏到全屏的过渡时间,单位为毫秒,默认时间与非全屏到全屏的距离成正比。 | **示例:** @@ -119,4 +79,81 @@ requestFullWindow(duration: number): void duration: 200}); } } - ``` + ``` + +## app.setImageCacheCount + +setImageCacheCount(value: number): void + +设置解码图像计数的图像缓存容量。如果未设置,应用程序将不会缓存任何解码图像。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| value | number | 否 | 解码图像计数的值容量。 | + +## app.setImageRawDataCacheSize + +setImageRawDataCacheSize(value: number): void + +在解码前设置原始图像数据大小的图像缓存容量(以字节为单位)。如果未设置,应用程序将不会缓存任何原始图像数据。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| value | number | 否 | 原始图像数据大小的值容量(以字节为单位)。 | + + +## app.setImageFileCacheSize + +setImageFileCacheSize(value: number): void + +在解码前设置磁盘上的图像文件缓存大小(以字节为单位)。如果未设置,应用程序将在磁盘上缓存100MB图像文件。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| value | number | 否 | 原始图像数据大小的值容量(以字节为单位)。 | + +## AppResponse + +定义AppResponse信息。 + +**系统能力:** 以下各项对应的系统能力有所不同,详见下表。 + +| 名称 | 参数类型 | 必填 | 说明 | +| -------- | -------- | -------- |-------- | +| appID6+ | string | 是 | 表示应用的包名,用于标识应用的唯一性。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full| +| appName | string | 是 | 表示应用的名称。
**系统能力:** SystemCapability.ArkUI.ArkUI.Lite| +| versionName | string | 是 | 表示应用的版本名称。
**系统能力:** SystemCapability.ArkUI.ArkUI.Lite| +| versionCode | number | 是 | 表示应用的版本号。
**系统能力:** SystemCapability.ArkUI.ArkUI.Lite| + +## ScreenOnVisibleOptions + +定义屏幕上可见接口的选项。 + +**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full + +| 名称 | 参数类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| visible | boolean | 否 | 是否启动保活,默认值false。 | +| success | () => void | 否 | 接口调用成功的回调函数。 | +| fail | (data: string, code: number) => void | 否 | 接口调用失败的回调函数。 | +| complete | () => void | 否 | 接口调用结束的回调函数。 | + +## RequestFullWindowOptions + +定义RequestFullWindow接口的选项。 + +**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full + +| 名称 | 参数类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| duration | number | 是 | 定义动画选项的数量。 | + diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-mediaquery.md b/zh-cn/application-dev/reference/apis/js-apis-system-mediaquery.md index 08ca1c593baa21327cd0ce4bf589c16fe1413025..29a7a02c3d111dc386a769351083af1b6a9b8b50 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-system-mediaquery.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-mediaquery.md @@ -15,7 +15,7 @@ import mediaquery from '@system.mediaquery'; ## mediaquery.matchMedia -matchMedia(condition: string): <MediaQueryList> +matchMedia(condition: string): MediaQueryList 根据媒体查询条件,创建MediaQueryList对象。 @@ -28,11 +28,10 @@ matchMedia(condition: string): <MediaQueryList> | condition | string | 是 | 用于查询的条件。 | **返回值:** -**表1** MediaQueryList -| 参数名 | 类型 | 说明 | -| -------- | -------- | -------- | -| MediaQueryList | Object | 表示创建MediaQueryList对象的属性,详情见下表 MediaQueryList说明。 | +| 参数类型 | 说明 | +| -------- | -------- | +| MediaQueryList | 表示创建MediaQueryList对象的属性,详情见下表 MediaQueryList说明。 | **示例:** @@ -44,18 +43,47 @@ export default { } ``` - **表2** MediaQueryList说明 +## MediaQueryEvent -| 参数名 | 类型 | 说明 | -| -------- | -------- | -------- | -| matches | boolean | 如果查询条件匹配成功则返回true,否则返回值为false。只读。 | -| media | string | 序列化的媒体查询条件,只读。 | -| onchange | Function | matches状态变化时的执行函数。 | +定义MediaQuery事件。 +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +| 名称 | 参数类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| matches | boolean | 是 | 匹配结果。 | + +## MediaQueryList + +定义MediaQuery列表信息。 + +### 属性 + +**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full -## MediaQueryList.addListener +| 名称 | 参数类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| media | string | 否 | 序列化媒体查询条件,该参数为只读。 | +| matches | boolean | 是 | 匹配结果。 | + +### onchange + +onchange?: (matches: boolean) => void + +matches状态变化时的执行函数。 -addListener(Object): void +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**参数:** + +| 参数名 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| matches | boolean | 是 | matches状态变化时值。 | + + +### MediaQueryList.addListener + +addListener(callback: (event: MediaQueryEvent) => void): void 给MediaQueryList添加回调函数,回调函数应在onShow生命周期之前添加,即需要在onInit或onReady生命周期里添加。 @@ -65,28 +93,18 @@ addListener(Object): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| callback | Function | 是 | 匹配条件发生变化的响应函数。 | +| callback | (event: MediaQueryEvent) => void | 是 | 匹配条件发生变化的响应函数。 | **示例:** ``` -export default { - onReady() { - var mMediaQueryList = mediaquery.matchMedia('(max-width: 466)'); - function maxWidthMatch(e) { - if (e.matches) { - // do something - } - } - mMediaQueryList.addListener(maxWidthMatch); - }, -} +mMediaQueryList.addListener(maxWidthMatch); ``` -## MediaQueryList.removeListener +### MediaQueryList.removeListener -removeListener(Object): void +removeListener(callback: (event: MediaQueryEvent) => void): void 移除MediaQueryList中的回调函数。 @@ -96,10 +114,14 @@ removeListener(Object): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| callback | Function | 是 | 匹配条件发生变化的响应函数。 | +| callback | (event: MediaQueryEvent) => void) | 是 | 匹配条件发生变化的响应函数。 | **示例:** ``` -query.removeListener(minWidthMatch); -``` \ No newline at end of file +mMediaQueryList.removeListener(maxWidthMatch); +``` + + + + diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-notification.md b/zh-cn/application-dev/reference/apis/js-apis-system-notification.md index e0fac1ec7e40cf7d7f7256648e9003f05cbefc9a..dd4b4c6c9cde639d8cf66f92d4b77b1deab7f5c9 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-system-notification.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-notification.md @@ -13,10 +13,31 @@ import notification from '@system.notification'; ``` +## ActionResult + +**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification + +| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | +| ----------- | --- | ---- | ---------------------------------------------- | ---- | ------------------------- | +| bundleName | 是 | 是 | string | 是 | 单击通知后要重定向到的应用程序的Bundle名。 | +| abilityName | 是 | 是 | string | 是 | 单击通知后要重定向到的应用程序的Ability名称。 | +| uri | 是 | 是 | string | 否 | 要重定向到的页面的uri。 | + + +## ShowNotificationOptions + +**系统能力**:以下各项对应的系统能力均为SystemCapability.Notification.Notification + +| 名称 | 可读 | 可写 | 类型 | 必填 | 描述 | +| ------------- | --- | ---- | ---------------------------------------------- | ---- | ------------------------- | +| contentTitle | 是 | 是 | string | 否 | 通知标题。 | +| contentText | 是 | 是 | string | 否 | 通知内容。 | +| clickAction | 是 | 是 | ActionResult | 否 | 通知被点击后触发的行为。 | + ## notification.show -show(contentTitle: string, contentText: string, clickAction: ActionInfo): void +show(options?: ShowNotificationOptions): void 显示通知。 @@ -26,21 +47,10 @@ show(contentTitle: string, contentText: string, clickAction: ActionInfo): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| contentTitle | string | 否 | 通知标题。 | -| contentText | string | 否 | 通知内容。 | -| clickAction | ActionInfo | 否 | 通知点击后触发的动作。 | - - **表1** ActionInfo - -| 参数名 | 类型 | 必填 | 说明 | -| -------- | -------- | -------- | -------- | -| bundleName | string | 是 | 点击通知后要跳转到的应用的bundleName | -| abilityName | string | 是 | 点击通知后要跳转到的应用的abilityName | -| uri | string | 是 | 要跳转到的uri,可以是下面的两种格式:
- 页面绝对路径,由配置文件中pages列表提供,例如:
  - pages/index/index
  - pages/detail/detail
- 特殊的,如果uri的值是"/",则跳转到首页。 | +| options | ShowNotificationOptions | 否 | 通知标题。 | **示例:** - -``` +```javascript export default { show() { notification.show({ diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-router.md b/zh-cn/application-dev/reference/apis/js-apis-system-router.md index a6264dc54e263d4a3f1223736463d624c95d31de..db092ade8ea510636bfc4f3695c6a89b51b87401 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-system-router.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-router.md @@ -13,7 +13,7 @@ import router from '@system.router'; ## router.push -push(Object): void +push(options: RouterOptions): void 跳转到应用内的指定页面。 @@ -23,8 +23,7 @@ push(Object): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| uri | string | 是 | 表示目标页面的uri,可以用以下两种格式:
- 页面绝对路径,由配置文件中pages列表提供,例如:
  - pages/index/index
  - pages/detail/detail
- 特殊值,如果uri的值是"/",则跳转到首页。 | -| params | Object | 否 | 跳转时要同时传递到目标页面的数据,跳转到目标页面后,参数可以在页面中直接使用,如this.data1(data1为跳转时params参数中的key值)。如果目标页面中已有该字段,则其值会被传入的字段值覆盖。 | +| options | [RouterOptions](#routeroptions) | 是 | 页面路由参数,详细请参考RouterOptions。| **示例:** @@ -68,7 +67,7 @@ export default { ## router.replace -replace(Object): void +replace(options: RouterOptions): void 用应用内的某个页面替换当前页面,并销毁被替换的页面。 @@ -78,8 +77,7 @@ replace(Object): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| uri | string | 是 | 目标页面的uri,可以是以下的两种格式:
- 页面绝对路径,由配置文件中pages列表提供,例如:
  - pages/index/index
  - pages/detail/detail
- 特殊值,如果uri的值是"/",则跳转到首页。 | -| params | Object | 否 | 跳转时要同时传递到目标页面的数据,跳转到目标页面后,参数可以在页面中直接使用,如this.data1(data1为跳转时params参数中的key值)。如果目标页面中已有该字段,则其值会被传入的字段值覆盖。 | +| options | [RouterOptions](#routeroptions) | 是 | 页面路由参数,详细请参考RouterOptions。| **示例:** @@ -112,7 +110,7 @@ export default { ## router.back -back(Object): void +back(options?: BackRouterOptions): void 返回上一页面或指定的页面。 @@ -122,8 +120,7 @@ back(Object): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| uri | string | 否 | 返回到指定uri的界面,如果页面栈上没有uri页面,则不响应该情况。如果uri未设置,则返回上一页。 | -| params | Object | 否 | 跳转时要同时传递到目标页面的数据 | +| options | [BackRouterOptions](#backrouteroptions) | 是 | 详细请参考BackRouterOptions。| **示例:** @@ -183,6 +180,20 @@ export default { > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > 示例中的uri字段是页面路由,由配置文件中的pages列表指定。 +## router.getParams + +getParams(): ParamsInterface + +获取当前页面的参数信息。 + +**系统能力:** SystemCapability.ArkUI.ArkUI.Full + +**返回值:** + +| 类型 | 说明 | +| -------- | -------- | +| [ParamsInterface](#paramsinterface) | 详细请参见ParamsInterface。| + ## router.clear clear(): void @@ -228,20 +239,17 @@ export default { ## router.getState -getState(): <RouterState> +getState(): RouterState 获取当前页面的状态信息。 **系统能力:** SystemCapability.ArkUI.ArkUI.Full **返回值:** -**表1** RouterState -| 参数名 | 类型 | 说明 | -| -------- | -------- | -------- | -| index | number | 表示当前页面在页面栈中的索引。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 从栈底到栈顶,index从1开始递增。 | -| name | string | 表示当前页面的名称,即对应文件名。 | -| path | string | 表示当前页面的路径。 | +| 参数类型 | 说明 | +| -------- | -------- | +| [RouterState](#routerstate) | 详细请参见RouterState。| **示例:** @@ -258,7 +266,7 @@ export default { ## router.enableAlertBeforeBackPage6+ -enableAlertBeforeBackPage(Object): void +enableAlertBeforeBackPage(options: EnableAlertBeforeBackPageOptions): void 开启页面返回询问对话框。 @@ -268,10 +276,7 @@ enableAlertBeforeBackPage(Object): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| message | string | 是 | 询问对话框内容。 | -| success | () => void | 否 | 接口调用成功的回调函数。 | -| fail | () => void | 否 | 接口调用失败的回调函数。 | -| complete | () => void | 否 | 接口调用结束的回调函数。 | +| options | [EnableAlertBeforeBackPageOptions](#EnableAlertbeforebackpageoptions) | 是 | 详细请参见EnableAlertBeforeBackPageOptions。 | **示例:** @@ -293,7 +298,7 @@ export default { ## router.disableAlertBeforeBackPage6+ -disableAlertBeforeBackPage(Object): void +disableAlertBeforeBackPage(options?: DisableAlertBeforeBackPageOptions): void 禁用页面返回询问对话框。 @@ -303,9 +308,7 @@ disableAlertBeforeBackPage(Object): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| success | () => void | 否 | 接口调用成功的回调函数。 | -| fail | () => void | 否 | 接口调用失败的回调函数。 | -| complete | () => void | 否 | 接口调用结束的回调函数。 | +| options | [DisableAlertBeforeBackPageOptions](#disablealertbeforebackpageoptions)| 否 | 详细请参见DisableAlertBeforeBackPageOptions。 | **示例:** @@ -324,3 +327,68 @@ export default { } ``` +## RouterOptions + +定义路由器的选项。 + +**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Lite + +| 名称 | 参数类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| uri | string | 是 | 目标页面的uri,可以是以下的两种格式:
1. 页面的绝对路径,由config.json文件中的页面列表提供。例如:
- pages/index/index
-pages/detail/detail
2. 特定路径。如果URI为斜杠(/),则显示主页。 | +| params | Object | 否 | 跳转时要同时传递到目标页面的数据,跳转到目标页面后,参数可以在页面中直接使用,如this.data1(data1为跳转时params参数中的key值)。如果目标页面中已有该字段,则其值会被传入的字段值覆盖。 | + + +## BackRouterOptions + +定义路由器返回的选项。 + +**系统能力:** 以下各项对应的系统能力有所不同,详见下表。 + +| 名称 | 参数类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| uri | string | 否 | 返回到指定uri的界面,如果页面栈上没有uri页面,则不响应该情况。如果uri未设置,则返回上一页。
**系统能力:** SystemCapability.ArkUI.ArkUI.Full| +| params | Object | 否 | 跳转时要同时传递到目标页面的数据。
**系统能力:** SystemCapability.ArkUI.ArkUI.Lite| + +## RouterState + +定义路由器的状态。 + +**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full + +| 名称 | 参数类型 | 必填 | 说明 | +| -------- | -------- | -------- |-------- | +| index | number | 是 | 表示当前页面在页面栈中的索引。从栈底到栈顶,index从1开始递增。 | +| name | string | 是 | 表示当前页面的名称,即对应文件名。 | +| path | string | 是 | 表示当前页面的路径。 | + +## EnableAlertBeforeBackPageOptions6+ + +定义EnableAlertBe beforeBackPage选项。 + +**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full + +| 名称 | 参数类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| message | string | 是 | 询问对话框内容。 | +| success | (errMsg: string) => void | 否 | 弹出对话框时调用,errMsg表示返回信息。 | +| fail | (errMsg: string) => void | 否 | 接口调用失败的回调函数,errMsg表示返回信息。 | +| complete | () => void | 否 | 接口调用结束的回调函数。 | + +## DisableAlertBeforeBackPageOptions6+ + +定义DisableAlertBeforeBackPage参数选项。 + +**系统能力:** 以下各项对应的系统能力均为SystemCapability.ArkUI.ArkUI.Full + +| 名称 | 参数类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| success | (errMsg: string) => void | 否 | 弹出对话框时调用,errMsg表示返回信息。 | +| fail | (errMsg: string) => void | 否 | 接口调用失败的回调函数,errMsg表示返回信息。| +| complete | () => void | 否 | 接口调用结束的回调函数。 | + +## ParamsInterface + +| 名称 | 参数类型 | 说明 | +| -------- | -------- | -------- | +| [key: string] | Object| 路由参数列表。 | diff --git a/zh-cn/application-dev/reference/apis/js-apis-uripermissionmanager.md b/zh-cn/application-dev/reference/apis/js-apis-uripermissionmanager.md index f09e2458dfda147edba473e448e7d6ead422e85e..9e9ff2be3bef5efbf8eb38e50a6c5da8e1c892a2 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-uripermissionmanager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-uripermissionmanager.md @@ -1,4 +1,4 @@ -# UriPermissionManager +# uriPermissionManager > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:** > 本模块首批接口从API 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。 @@ -11,11 +11,11 @@ Uri权限管理。 ``` -import UriPermissionManager from '@@ohos.application.UriPermissionManager'; +import uriPermissionManager from '@ohos.application.uriPermissionManager'; ``` -## verifyUriPermission +## uriPermissionManager.verifyUriPermission verifyUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number, callback: AsyncCallback<number>): void @@ -25,15 +25,16 @@ verifyUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number SystemCapability.Ability.AbilityRuntime.Core -- 参数: - | 参数名 | 类型 | 必填 | 说明 | +**参数:** + + | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | uri | string | 是 | 指向文件的uri,例如fileshare:///com.samples.filesharetest.FileShare/person/10。 | | flag | wantConstant.Flags | 是 | uri的读权限或写权限。 | | accessTokenId | number | 是 | 每个应用的唯一标识ID,开发者通过包管理接口自行获取。 | | callback | AsyncCallback<number> | 是 | callback形式返回检验结果,返回0表示有权限,返回-1表示无权限。 | -- 示例: +**示例:** ``` let uri = "fileshare:///com.samples.filesharetest.FileShare/person/10" @@ -43,7 +44,7 @@ SystemCapability.Ability.AbilityRuntime.Core ``` -## verifyUriPermission +## uriPermissionManager.verifyUriPermission verifyUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number): Promise<number> @@ -53,19 +54,21 @@ verifyUriPermission(uri: string, flag: wantConstant.Flags, accessTokenId: number SystemCapability.Ability.AbilityRuntime.Core -- 参数: - | 参数名 | 类型 | 必填 | 说明 | +**参数:** + + | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | | uri | string | 是 | 指向文件的uri,例如fileshare:///com.samples.filesharetest.FileShare/person/10。 | | flag | wantConstant.Flags | 是 | uri的读权限或写权限。 | | accessTokenId | number | 是 | 每个应用的唯一标识ID,开发者通过包管理接口自行获取。 | -- 返回值: - | 类型 | 说明 | +**返回值:** + + | 类型 | 说明 | | -------- | -------- | | Promise<number> | 返回0表示有权限,返回-1表示无权限。 | -- 示例: +**示例:** ``` let uri = "fileshare:///com.samples.filesharetest.FileShare/person/10" diff --git a/zh-cn/application-dev/reference/apis/js-apis-vector.md b/zh-cn/application-dev/reference/apis/js-apis-vector.md index e6ddff2aec31f60981b997b5ac4633376b169c8a..ce3854762039015b4b4671a3c3e4f3c8ce8a8abe 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-vector.md +++ b/zh-cn/application-dev/reference/apis/js-apis-vector.md @@ -539,6 +539,7 @@ vector.increaseCapacityTo(8); ``` ### trimToCurrentLength + trimToCurrentLength(): void 把容量限制为当前的length大小。 diff --git a/zh-cn/application-dev/security/Readme-CN.md b/zh-cn/application-dev/security/Readme-CN.md index 37cd1817e37ebba14d1f6692269355dabe02523b..63e1eb9f36c78b1c8adba6b262e0299408f3ecd2 100644 --- a/zh-cn/application-dev/security/Readme-CN.md +++ b/zh-cn/application-dev/security/Readme-CN.md @@ -9,7 +9,7 @@ - [HUKS开发指导](huks-guidelines.md) - Hap包签名工具 - - [Hap包签名工具开发指导](hapsigntool-guidelines.md) + - [Hap包签名工具指导](hapsigntool-guidelines.md) - 访问控制 - [访问控制开发概述](accesstoken-overview.md) diff --git a/zh-cn/application-dev/website.md b/zh-cn/application-dev/website.md index 207bf47591d88f88ddf0a5f7fe0d3ee0a6f174e2..a723fb9ccdacc5ed95a57600b68269c2497c59d3 100644 --- a/zh-cn/application-dev/website.md +++ b/zh-cn/application-dev/website.md @@ -18,7 +18,7 @@ - [应用开发包结构说明](quick-start/package-structure.md) - [资源文件的分类](quick-start/basic-resource-file-categories.md) - 开发 - - [Ability开发](ability/Readme-CN.md) + - Ability开发 - [Ability框架概述](ability/ability-brief.md) - FA模型 - [FA模型综述](ability/fa-brief.md) @@ -35,7 +35,7 @@ - 其他 - [WantAgent使用指导](ability/wantagent.md) - [Ability助手使用指导](ability/ability-assistant-guidelines.md) - - [UI开发](ui/Readme-CN.md) + - UI开发 - [方舟开发框架(ArkUI)概述](ui/arkui-overview.md) - 基于JS扩展的类Web开发范式 - [概述](ui/ui-js-overview.md) diff --git a/zh-cn/device-dev/website.md b/zh-cn/device-dev/website.md index 586eb494bbed246fdd0feb2e51bc1bfd313e0e66..d0b44faff3234d77c7397add1d1db00087f98068 100644 --- a/zh-cn/device-dev/website.md +++ b/zh-cn/device-dev/website.md @@ -362,7 +362,7 @@ - [DFX](subsystems/subsys-dfx.md) - 专题 - - [HPM Part](hpm-part/Readme-CN.md) + - HPM Part - [HPM Part介绍](hpm-part/hpm-part-about.md) - [HPM Part开发指导](hpm-part/hpm-part-development.md) - [HPM Part参考](hpm-part/hpm-part-reference.md) @@ -388,7 +388,7 @@ - 参考 - - [常见问题-设备开发](faqs/Readme-CN.md) + - 常见问题-设备开发 - [常见问题概述](faqs/faqs-overview.md) - [环境搭建常见问题](faqs/faqs-environment-setup.md) - [编译构建子系统常见问题](faqs/faqs-building.md) diff --git a/zh-cn/readme.md b/zh-cn/readme.md index 7a39becf661e51d0bb40da5324cdbdbbed28cc50..2b604a6f15bc7a976219139892cfae6f5f238bfa 100644 --- a/zh-cn/readme.md +++ b/zh-cn/readme.md @@ -1,90 +1,9 @@ -# 导读 +# OpenHarmony开发者文档 -此工程存放OpenHarmony提供的快速入门、开发指南、API参考等开发者文档,欢迎参与OpenHarmony开发者文档开源项目,与我们一起完善开发者文档。 - -## **文档目录结构** - -- [Openharmony概述](OpenHarmony-Overview_zh.md) -- 设备开发 - - 轻量和小型系统开发指导(参考内存<128MB) - - overview:[设备开发导读](device-dev/Readme-CN.md) - - quick-start:[快速入门](device-dev/quick-start/Readme-CN.md)(搭建环境、获取源码、编译、烧录等) - - Basic Capability:开发基础能力 - - Kernel:[轻量系统内核](device-dev/kernel/kernel-mini.md) - - Kernel:[小型系统内核](device-dev/kernel/kernel-small.md) - - Drivers:[驱动](device-dev/driver/Readme-CN.md) - - Subsystems:[子系统](device-dev/subsystems/Readme-CN.md)(编译构建、图形图像、DFX、XTS等子系统) - - Security:[隐私与安全](device-dev/security/Readme-CN.md) - - - guide:开发示例 - - [WLAN连接类产品](device-dev/guide/device-wlan.md)(LED外设控制、集成三方SDK) - - [无屏摄像头类产品](device-dev/guide/device-iotcamera-control.md)(摄像头控制) - - [带屏摄像头类产品](device-dev/guide/device-camera.md)(屏幕和摄像头控制、视觉应用开发) - - - porting:移植适配 - - [轻量和小型系统三方库移植指导](device-dev/porting/porting-thirdparty.md) - - [轻量系统芯片移植指导](device-dev/porting/porting-minichip.md) - - [轻量系统芯片移植案例](device-dev/porting/porting-minichip-cases.md) - - [小型系统芯片移植指导](device-dev/porting/porting-smallchip.md) - - - bundles:HPM Bundle开发 - - [HPM Bundle开发规范](device-dev/bundles/bundles-standard-rules.md) - - [HPM Bundle开发指南](device-dev/bundles/bundles-guide.md) - - [HPM Bundle开发示例](device-dev/bundles/bundles-demo.md) - - - 标准系统开发指导(参考内存≥128MB) - - overview:[设备开发导读](device-dev/Readme-CN.md) - - quick-start:[快速入门](device-dev/quick-start/quickstart-standard.md)(搭建环境、获取源码、编译、烧录等) - - Basic Capability:开发基础能力 - - Kernel:[标准系统内核](device-dev/kernel/kernel-standard.md) - - Drivers:[驱动](device-dev/driver/Readme-CN.md) - - Subsystems:[子系统](device-dev/subsystems/Readme-CN.md)(编译构建、图形图像、DFX、XTS等子系统) - - Security:[隐私与安全](device-dev/security/Readme-CN.md) - - - guide:开发示例 - - [时钟应用](device-dev/guide/device-clock-guide.md) - - [平台驱动](device-dev/guide/device-driver-demo.md) - - [外设驱动](device-dev/guide/device-outerdriver-demo.md) - - - porting:移植适配 - - [标准系统芯片移植指导](device-dev/porting/standard-system-porting-guide.md) - - [一种快速移植OpenHarmony Linux内核的方法](device-dev/porting/porting-linux-kernel.md) - - - bundles:HPM Bundle开发 - - [HPM Bundle开发规范](device-dev/bundles/bundles-standard-rules.md) - - [HPM Bundle开发指南](device-dev/bundles/bundles-guide.md) - - [HPM Bundle开发示例](device-dev/bundles/bundles-demo.md) - - [常见问题](device-dev/faqs/Readme-CN.md) - - -- 应用开发 - - overview:[应用开发导读](application-dev/application-dev-guide.md) - - quick-start:[入门](application-dev/quick-start/Readme-CN.md) - - ability:[Ability框架](application-dev/ability/Readme-CN.md) - - ui:[UI](application-dev/ui/Readme-CN.md) - - media:[媒体](application-dev/media/Readme-CN.md) - - security:[安全](application-dev/security/Readme-CN.md) - - connectivity:[网络与连接](application-dev/connectivity/Readme-CN.md) - - database:[分布式数据服务](application-dev/database/Readme-CN.md) - - usb:[USB服务](application-dev//usb/Readme-CN.md) - - dfx:[DFX](application-dev/dfx/Readme-CN.md) - - reference:[开发参考](application-dev/reference/Readme-CN.md) -- 许可证及版权信息检查工具:[开源合规审查工具](https://gitee.com/openharmony-sig/tools_oat) -- glossary:[术语](device-dev/glossary/glossary.md) - -## **版本更新** - -参考[Release Notes](release-notes/Readme.md)。 - -## **第三方开源软件及许可说明** - -3rd-Party-License:[第三方开源软件及许可证说明](contribute/第三方开源软件及许可证说明.md) - -## **贡献** - -非常欢迎您参与[贡献](contribute/参与贡献.md),我们鼓励开发者以各种方式参与文档反馈和贡献。 - -您可以对现有文档进行评价、简单更改、反馈文档质量问题、贡献您的原创内容,详细请参考[贡献文档](contribute/贡献文档.md)。 - -卓越贡献者将会在开发者社区文档贡献专栏表彰公示。 +本目录是OpenHarmony开发者文档的中文目录。目录内容包括: +- [设备开发文档](device-dev/Readme-CN.md) +- [应用开发文档](application-dev/Readme-CN.md) +- [版本说明](release-notes/Readme.md) +- [子系统介绍](./readme) +- [项目贡献指南](contribute/贡献指南.md) \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/changelog-v3.1-release.md b/zh-cn/release-notes/api-change/v3.1-Release/changelog-v3.1-release.md new file mode 100644 index 0000000000000000000000000000000000000000..570a1c598c434e7aed19caab163158370a293eb3 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/changelog-v3.1-release.md @@ -0,0 +1,16 @@ +# ChangeLog +**关键的接口/组件变更** +## XXX子系统 +### cl.rpc.1 sendRequest返回值类型变更 + +#### 变更影响 +…… + +#### 关键的接口/组件变更 +**模块** +**接口** +**变更后接口** +…… + +#### 适配指导 +…… diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-ability.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-ability.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-ability.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-access-control.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-access-control.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-access-control.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-accessibility.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-accessibility.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-accessibility.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-account.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-account.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-account.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-ace.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-ace.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-ace.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-battery.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-battery.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-battery.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-bundle.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-bundle.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-bundle.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-communicate.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-communicate.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-communicate.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-complier-and-runtime.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-complier-and-runtime.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-complier-and-runtime.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-config-policy.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-config-policy.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-config-policy.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-dfx.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-dfx.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-dfx.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-distributed-data.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-distributed-data.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-distributed-data.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-LTS/js-apidiff-v3.1-LTS.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-distributed-hardware.md similarity index 100% rename from zh-cn/release-notes/api-change/v3.1-LTS/js-apidiff-v3.1-LTS.md rename to zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-distributed-hardware.md diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-event-and-notification.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-event-and-notification.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-event-and-notification.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-file-management.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-file-management.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-file-management.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-geolocation.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-geolocation.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-geolocation.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-global.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-global.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-global.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-graphic.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-graphic.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-graphic.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-misc.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-misc.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-misc.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-multi-modal-input.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-multi-modal-input.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-multi-modal-input.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-multimedia.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-multimedia.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-multimedia.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-network.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-network.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-network.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-recovery.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-recovery.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-recovery.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-resource-scheduler.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-resource-scheduler.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-resource-scheduler.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-security.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-security.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-security.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-sensor.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-sensor.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-sensor.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-settings.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-settings.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-settings.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-soft-bus.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-soft-bus.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-soft-bus.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-telephony.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-telephony.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-telephony.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-update.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-update.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-update.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-usb.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-usb.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-usb.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-user-authentication.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-user-authentication.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-user-authentication.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-v3.1-release.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-v3.1-release.md new file mode 100644 index 0000000000000000000000000000000000000000..4c655b742d78cf5c842eb8c132e3352e2fc8fbef --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-v3.1-release.md @@ -0,0 +1,37 @@ +# JS API Diff + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本的JS API变更,参见各子系统的详细记录: +- [元能力](js-apidiff-ability.md) +- [程序访问控制](js-apidiff-access-control.md) +- [无障碍](js-apidiff-accessibility.md) +- [帐号](js-apidiff-account.md) +- [ArkUI开发框架](js-apidiff-ace.md) +- [电源服务](js-apidiff-battery.md) +- [包管理](js-apidiff-bundle.md) +- [基础通信](js-apidiff-communicate.md) +- [语言编译器运行时](js-apidiff-complier-and-runtime.md) +- [定制](js-apidiff-config-policy.md) +- [DFX](js-apidiff-dfx.md) +- [分布式数据管理](js-apidiff-distributed-data.md) +- [分布式硬件](js-apidiff-distributed-hardware.md) +- [事件通知](js-apidiff-event-and-notification.md) +- [文件管理](js-apidiff-file-management.md) +- [位置服务](js-apidiff-geolocation.md) +- [全球化](js-apidiff-global.md) +- [图形图像](js-apidiff-graphic.md) +- [Misc软件服务](js-apidiff-misc.md) +- [多模输入](js-apidiff-multi-modal-input.md) +- [OS媒体软件](js-apidiff-multimedia.md) +- [网络管理](js-apidiff-network.md) +- [启动恢复](js-apidiff-recovery.md) +- [资源调度](js-apidiff-resource-scheduler.md) +- [安全基础能力](js-apidiff-security.md) +- [泛Sensor服务](js-apidiff-sensor.md) +- [应用](js-apidiff-settings.md) +- [软总线](js-apidiff-soft-bus.md) +- [电话服务](js-apidiff-telephony.md) +- [升级服务](js-apidiff-update.md) +- [USB服务](js-apidiff-usb.md) +- [用户IAM](js-apidiff-user-authentication.md) +- [窗口管理](js-apidiff-window.md) + diff --git a/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-window.md b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-window.md new file mode 100644 index 0000000000000000000000000000000000000000..dce4c7f9e083fd237d29ff4bc4ff0ca53ba0c2f4 --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/js-apidiff-window.md @@ -0,0 +1,14 @@ +# xxx子系统JS API变更 + +OpenHarmony 3.1 Release版本相较于OpenHarmony 3.0 LTS版本,XXX子系统的API变更如下: + +## 接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/native-apidiff-v3.1-release.md b/zh-cn/release-notes/api-change/v3.1-Release/native-apidiff-v3.1-release.md new file mode 100644 index 0000000000000000000000000000000000000000..a9dcb0efdc5d35935032b5fef431320686d37fab --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/native-apidiff-v3.1-release.md @@ -0,0 +1,16 @@ +# Native API 差异报告 + +OpenHarmony 3.1 Release相较于OpenHarmony 3.0 LTS版本的API变更如下: + +## 标准系统接口变更 + +| 模块名称 | 接口名称 | 变更类型 | 变更说明 | +| -------- | -------- | -------- | -------- | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | +| | | | | \ No newline at end of file diff --git a/zh-cn/release-notes/api-change/v3.1-Release/readme.md b/zh-cn/release-notes/api-change/v3.1-Release/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..9f21003ae9cee469038dd19302d295d56cb8389a --- /dev/null +++ b/zh-cn/release-notes/api-change/v3.1-Release/readme.md @@ -0,0 +1,11 @@ +# Readme + +本目录记录了OpenHarmony 3.1 Release版本相较OpenHarmony 3.0 LTS版本的API变化。 + +API详细变更记录如下: +- API差异报告 + API差异报告记录了API的变更情况,包括新增、变更、废弃、删除。 + - [JS API差异报告](js-apidiff-v3.1-release.md) + - [Native API差异报告](native-apidiff-v3.1-release.md) +- [变更说明](changelog-v3.1-release.md) + 变更说明重点记录因API变更对开发者调用API的行为产生的影响,并针对变更影响提供适配指导。