diff --git a/en/application-dev/reference/apis/js-apis-screen.md b/en/application-dev/reference/apis/js-apis-screen.md index 22f25f8f0185b954270c2169fc657f0676244623..a05dbe9126609118d08b0bb38c158e38b7fd1b0c 100644 --- a/en/application-dev/reference/apis/js-apis-screen.md +++ b/en/application-dev/reference/apis/js-apis-screen.md @@ -724,8 +724,8 @@ Defines virtual screen parameters. | Name | Type| Readable| Writable| Description | | --------- | -------- | ---- | ---- | ------------------------- | | name | string | Yes | Yes | Name of a virtual screen. | -| width | number | Yes | Yes | Width of the virtual screen. | -| height | number | Yes | Yes | Height of the virtual screen. | +| width | number | Yes | Yes | Width of the virtual screen, in pixels.| +| height | number | Yes | Yes | Height of the virtual screen, in pixels.| | density | number | Yes | Yes | Density of the virtual screen. | | surfaceId | string | Yes | Yes | Surface ID of the virtual screen.| @@ -1006,6 +1006,6 @@ Defines the screen mode information. | Name | Type| Readable| Writable| Description | | ----------- | -------- | ---- | ---- | -------------------------------------------------- | | id | number | Yes | Yes | Mode ID. The supported mode is determined by the device resolution and refresh rate.| -| width | number | Yes | Yes | Screen width. | -| height | number | Yes | Yes | Screen height. | +| width | number | Yes | Yes | Width of the screen, in pixels. | +| height | number | Yes | Yes | Height of the screen, in pixels. | | refreshRate | number | Yes | Yes | Screen refresh rate. | diff --git a/en/application-dev/reference/apis/js-apis-sensor.md b/en/application-dev/reference/apis/js-apis-sensor.md index 69845e5552e2c21cb49852513e837c7976dcb8b3..12ef68aa0e07e320485ad46e6bba26132e86798a 100644 --- a/en/application-dev/reference/apis/js-apis-sensor.md +++ b/en/application-dev/reference/apis/js-apis-sensor.md @@ -2876,7 +2876,7 @@ Transforms a rotation vector based on the coordinate system. This API uses an as | Name | Type | Mandatory| Description | | ---------------- | ----------------------------------------- | ---- | ---------------------- | -| inRotationVector | Array<number> | Yes | Rotation matrix. | +| inRotationVector | Array<number> | Yes | Rotation vector. | | coordinates | [CoordinatesOptions](#coordinatesoptions) | Yes | Rotation vector to transform. | | callback | AsyncCallback<Array<number>> | Yes | Callback used to return the rotation vector after being transformed.| @@ -2923,7 +2923,7 @@ Transforms a rotation vector based on the coordinate system. This API uses a pro | Name | Type | Mandatory| Description | | ---------------- | ----------------------------------------- | ---- | ---------------- | -| inRotationVector | Array<number> | Yes | Rotation matrix. | +| inRotationVector | Array<number> | Yes | Rotation vector. | | coordinates | [CoordinatesOptions](#coordinatesoptions) | Yes | Rotation vector to transform.| **Return value** @@ -3179,7 +3179,7 @@ For details about the following error codes, see [Error Codes of sensor.getRotat try { let gravity = [-0.27775216, 0.5351276, 9.788099]; let geomagnetic = [210.87253, -78.6096, -111.44444]; - sensor.getRotationMatrix(gravity, geomagnetic, function (err, data) => { + sensor.getRotationMatrix(gravity, geomagnetic, function (err, data) { if (err) { console.error('Get rotationMatrix failed. Error code: ' + err.code + '; message: ' + err.message); return; @@ -3477,7 +3477,7 @@ Describes the sensor information. | Name | Type| Readable| Writable| Description | | --------------- | -------- | ---------------------- | ---------------------- | ---------------------- | | sensorName | string | Yes | Yes | Sensor name. | -| venderName | string | Yes | Yes | Vendor of the sensor. | +| venderName | string | Yes | Yes | Vendor of the sensor. | | firmwareVersion | string | Yes | Yes | Firmware version of the sensor. | | hardwareVersion | string | Yes | Yes | Hardware version of the sensor. | | sensorId | number | Yes | Yes | Sensor type ID. | @@ -3496,9 +3496,9 @@ Describes the acceleration sensor data. It extends from [Response](#response). | Name| Type | Readable| Writable| Description | | ---- | ------ | ---- | ---- | ------------------------------------ | -| x | number | Yes | Yes | Acceleration along the x-axis of the device, in m/s². | -| y | number | Yes | Yes | Acceleration along the y-axis of the device, in m/s². | -| z | number | Yes | Yes | Acceleration along the z-axis of the device, in m/s². | +| x | number | Yes | Yes | Acceleration along the x-axis of the device, in m/s².| +| y | number | Yes | Yes | Acceleration along the y-axis of the device, in m/s².| +| z | number | Yes | Yes | Acceleration along the z-axis of the device, in m/s².| ## LinearAccelerometerResponse @@ -3510,9 +3510,9 @@ Describes the linear acceleration sensor data. It extends from [Response](#respo | Name| Type | Readable| Writable| Description | | ---- | ------ | ---- | ---- | ---------------------------------------- | -| x | number | Yes | Yes | Linear acceleration along the x-axis of the device, in m/s². | -| y | number | Yes | Yes | Linear acceleration along the y-axis of the device, in m/s². | -| z | number | Yes | Yes | Linear acceleration along the z-axis of the device, in m/s². | +| x | number | Yes | Yes | Linear acceleration along the x-axis of the device, in m/s².| +| y | number | Yes | Yes | Linear acceleration along the y-axis of the device, in m/s².| +| z | number | Yes | Yes | Linear acceleration along the z-axis of the device, in m/s².| ## AccelerometerUncalibratedResponse @@ -3524,12 +3524,12 @@ Describes the uncalibrated acceleration sensor data. It extends from [Response]( | Name | Type | Readable| Writable| Description | | ----- | ------ | ---- | ---- | ------------------------------------------------ | -| x | number | Yes | Yes | Uncalibrated acceleration along the x-axis of the device, in m/s². | -| y | number | Yes | Yes | Uncalibrated acceleration along the y-axis of the device, in m/s². | -| z | number | Yes | Yes | Uncalibrated acceleration along the z-axis of the device, in m/s². | -| biasX | number | Yes | Yes | Uncalibrated acceleration bias along the x-axis of the device, in m/s². | -| biasY | number | Yes | Yes | Uncalibrated acceleration bias along the y-axis of the device, in m/s². | -| biasZ | number | Yes | Yes | Uncalibrated acceleration bias along the z-axis of the device, in m/s². | +| x | number | Yes | Yes | Uncalibrated acceleration along the x-axis of the device, in m/s². | +| y | number | Yes | Yes | Uncalibrated acceleration along the y-axis of the device, in m/s². | +| z | number | Yes | Yes | Uncalibrated acceleration along the z-axis of the device, in m/s². | +| biasX | number | Yes | Yes | Uncalibrated acceleration bias along the x-axis of the device, in m/s². | +| biasY | number | Yes | Yes | Uncalibrated acceleration bias along the y-axis of the device, in m/s².| +| biasZ | number | Yes | Yes | Uncalibrated acceleration bias along the z-axis of the device, in m/s². | ## GravityResponse @@ -3541,9 +3541,9 @@ Describes the gravity sensor data. It extends from [Response](#response). | Name| Type | Readable| Writable| Description | | ---- | ------ | ---- | ---- | ---------------------------------------- | -| x | number | Yes | Yes | Gravitational acceleration along the x-axis of the device, in m/s². | -| y | number | Yes | Yes | Gravitational acceleration along the y-axis of the device, in m/s². | -| z | number | Yes | Yes | Gravitational acceleration along the z-axis of the device, in m/s². | +| x | number | Yes | Yes | Gravitational acceleration along the x-axis of the device, in m/s².| +| y | number | Yes | Yes | Gravitational acceleration along the y-axis of the device, in m/s².| +| z | number | Yes | Yes | Gravitational acceleration along the z-axis of the device, in m/s².| ## OrientationResponse @@ -3831,6 +3831,18 @@ Describes the geographical location. | longitude | number | Yes | Yes | Longitude. | | altitude | number | Yes | Yes | Altitude.| +## LocationOptions + +Describes the geographical location. + +**System capability**: SystemCapability.Sensors.Sensor + +| Name | Type | Readable | Writable | Description | +| --------- | ------ | -------- | -------- | ----------- | +| latitude | number | Yes | Yes | Latitude. | +| longitude | number | Yes | Yes | Longitude. | +| altitude | number | Yes | Yes | Altitude. | + ## sensor.on(deprecated) ### ACCELEROMETER(deprecated) @@ -6231,7 +6243,6 @@ This API is deprecated since API version 9. You are advised to use [sensor.getRo } console.info(JSON.stringify(data)); }) - ``` diff --git a/en/application-dev/reference/apis/js-apis-window.md b/en/application-dev/reference/apis/js-apis-window.md index 4c5e4fdc59b30f0b411d6fe63c50ccd84d84778b..e1be4f9015d04152e8259c187eae5d1764752298 100644 --- a/en/application-dev/reference/apis/js-apis-window.md +++ b/en/application-dev/reference/apis/js-apis-window.md @@ -188,10 +188,10 @@ Describes the rectangular area of the window. | Name | Type| Readable| Writable| Description | | ------ | -------- | ---- | ---- | ------------------ | -| left | number | Yes | Yes | Left boundary of the rectangle.| -| top | number | Yes | Yes | Top boundary of the rectangle.| -| width | number | Yes | Yes | Width of the rectangle. | -| height | number | Yes | Yes | Height of the rectangle. | +| left | number | Yes | Yes | Left boundary of the rectangle, in pixels.| +| top | number | Yes | Yes | Top boundary of the rectangle, in pixels.| +| width | number | Yes | Yes | Width of the rectangle, in pixels.| +| height | number | Yes | Yes | Height of the rectangle, in pixels.| ## AvoidArea7+ @@ -215,8 +215,8 @@ Describes the window size. | Name | Type| Readable| Writable| Description | | ------ | -------- | ---- | ---- | ---------- | -| width | number | Yes | Yes | Window width.| -| height | number | Yes | Yes | Window height.| +| width | number | Yes | Yes | Window width, in pixels.| +| height | number | Yes | Yes | Window height, in pixels.| ## WindowProperties @@ -824,7 +824,7 @@ create(id: string, type: WindowType, callback: AsyncCallback<Window>): voi Creates a subwindow. This API uses an asynchronous callback to return the result. > **NOTE** -> +> > This API is supported since API version 7 and deprecated since API version 9. You are advised to use [createWindow()](#windowcreatewindow9) instead. **Model restriction**: This API can be used only in the FA model. @@ -860,7 +860,7 @@ create(id: string, type: WindowType): Promise<Window> Creates a subwindow. This API uses a promise to return the result. > **NOTE** -> +> > This API is supported since API version 7 and deprecated since API version 9. You are advised to use [createWindow()](#windowcreatewindow9-1) instead. **Model restriction**: This API can be used only in the FA model. @@ -900,7 +900,7 @@ create(ctx: BaseContext, id: string, type: WindowType, callback: AsyncCallback&l Creates a system window. This API uses an asynchronous callback to return the result. > **NOTE** -> +> > This API is supported since API version 7 and deprecated since API version 9. You are advised to use [createWindow()](#windowcreatewindow9) instead. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -936,7 +936,7 @@ create(ctx: BaseContext, id: string, type: WindowType): Promise<Window> Creates a system window. This API uses a promise to return the result. > **NOTE** -> +> > This API is supported since API version 7 and deprecated since API version 9. You are advised to use [createWindow()](#windowcreatewindow9-1) instead. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -975,7 +975,7 @@ find(id: string, callback: AsyncCallback<Window>): void Finds a window based on the ID. This API uses an asynchronous callback to return the result. > **NOTE** -> +> > This API is supported since API version 7 and deprecated since API version 9. You are advised to use [findWindow()](#windowfindwindow9) instead. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -1008,7 +1008,7 @@ find(id: string): Promise<Window> Finds a window based on the ID. This API uses a promise to return the result. > **NOTE** -> +> > This API is supported since API version 7 and deprecated since API version 9. You are advised to use [findWindow()](#windowfindwindow9) instead. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -1045,7 +1045,7 @@ getTopWindow(callback: AsyncCallback<Window>): void Obtains the top window of the current application. This API uses an asynchronous callback to return the result. > **NOTE** -> +> > This API is supported since API version 6 and deprecated since API version 9. You are advised to use [getLastWindow()](#windowgetlastwindow9) instead. **Model restriction**: This API can be used only in the FA model. @@ -1079,7 +1079,7 @@ getTopWindow(): Promise<Window> Obtains the top window of the current application. This API uses a promise to return the result. > **NOTE** -> +> > This API is supported since API version 6 and deprecated since API version 9. You are advised to use [getLastWindow()](#windowgetlastwindow9-1) instead. **Model restriction**: This API can be used only in the FA model. @@ -1112,7 +1112,7 @@ getTopWindow(ctx: BaseContext, callback: AsyncCallback<Window>): void Obtains the top window of the current application. This API uses an asynchronous callback to return the result. > **NOTE** -> +> > This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getLastWindow()](#windowgetlastwindow9) instead. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -1145,7 +1145,7 @@ getTopWindow(ctx: BaseContext): Promise<Window> Obtains the top window of the current application. This API uses a promise to return the result. > **NOTE** -> +> > This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getLastWindow()](#windowgetlastwindow9-1) instead. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -5903,9 +5903,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc **Example** ```ts -import Ability from '@ohos.application.Ability'; +import UIAbility from '@ohos.app.ability.UIAbility'; -class myAbility extends Ability { +class myAbility extends UIAbility { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); let windowClass = null; @@ -5949,9 +5949,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc **Example** ```ts -import Ability from '@ohos.application.Ability'; +import UIAbility from '@ohos.app.ability.UIAbility'; -class myAbility extends Ability { +class myAbility extends UIAbility { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); let windowClass = null; @@ -5994,9 +5994,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc **Example** ```ts -import Ability from '@ohos.application.Ability'; +import UIAbility from '@ohos.app.ability.UIAbility'; -class myAbility extends Ability { +class myAbility extends UIAbility { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); try { @@ -6037,9 +6037,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc **Example** ```ts -import Ability from '@ohos.application.Ability'; +import UIAbility from '@ohos.app.ability.UIAbility'; -class myAbility extends Ability { +class myAbility extends UIAbility { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); let windowClass = null; @@ -6093,9 +6093,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc **Example** ```ts -import Ability from '@ohos.application.Ability'; +import UIAbility from '@ohos.app.ability.UIAbility'; -class myAbility extends Ability { +class myAbility extends UIAbility { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); let windowClass = null; @@ -6141,9 +6141,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc **Example** ```ts -import Ability from '@ohos.application.Ability'; +import UIAbility from '@ohos.app.ability.UIAbility'; -class myAbility extends Ability { +class myAbility extends UIAbility { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); let windowClass = null; @@ -6185,9 +6185,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc **Example** ```ts -import Ability from '@ohos.application.Ability'; +import UIAbility from '@ohos.app.ability.UIAbility'; -class myAbility extends Ability { +class myAbility extends UIAbility { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); let windowClass = null; @@ -6231,9 +6231,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc **Example** ```ts -import Ability from '@ohos.application.Ability'; +import UIAbility from '@ohos.app.ability.UIAbility'; -class myAbility extends Ability { +class myAbility extends UIAbility { storage : LocalStorage onWindowStageCreate(windowStage) { this.storage = new LocalStorage(); @@ -6289,9 +6289,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc **Example** ```ts -import Ability from '@ohos.application.Ability'; +import UIAbility from '@ohos.app.ability.UIAbility'; -class myAbility extends Ability { +class myAbility extends UIAbility { storage : LocalStorage onWindowStageCreate(windowStage) { this.storage = new LocalStorage(); @@ -6340,9 +6340,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc **Example** ```ts -import Ability from '@ohos.application.Ability'; +import UIAbility from '@ohos.app.ability.UIAbility'; -class myAbility extends Ability { +class myAbility extends UIAbility { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); try { @@ -6389,9 +6389,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc **Example** ```ts -import Ability from '@ohos.application.Ability'; +import UIAbility from '@ohos.app.ability.UIAbility'; -class myAbility extends Ability { +class myAbility extends UIAbility { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); try { @@ -6436,9 +6436,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc **Example** ```ts -import Ability from '@ohos.application.Ability'; +import UIAbility from '@ohos.app.ability.UIAbility'; -class myAbility extends Ability { +class myAbility extends UIAbility { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); try { @@ -6475,9 +6475,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc **Example** ```ts -import Ability from '@ohos.application.Ability'; +import UIAbility from '@ohos.app.ability.UIAbility'; -class myAbility extends Ability { +class myAbility extends UIAbility { onWindowStageCreate(windowStage) { console.log('disableWindowDecor'); windowStage.disableWindowDecor(); @@ -6515,9 +6515,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc **Example** ```ts -import Ability from '@ohos.application.Ability'; +import UIAbility from '@ohos.app.ability.UIAbility'; -class myAbility extends Ability { +class myAbility extends UIAbility { onWindowStageCreate(windowStage) { console.log('onWindowStageCreate'); try {