diff --git a/en/application-dev/reference/apis/js-apis-arkui-componentSnapshot.md b/en/application-dev/reference/apis/js-apis-arkui-componentSnapshot.md index b6a2b41d6c9b9ed05603c68f94d8f53426570414..1a1972d66c2648ae0776cbd12d5dc7b769186414 100644 --- a/en/application-dev/reference/apis/js-apis-arkui-componentSnapshot.md +++ b/en/application-dev/reference/apis/js-apis-arkui-componentSnapshot.md @@ -34,6 +34,12 @@ Obtains the snapshot of a component that has been loaded. This API uses an async | id | string | Yes | [ID](../arkui-ts/ts-universal-attributes-component-id.md) of the target component.| | callback | AsyncCallback<image.PixelMap> | Yes | Callback used to return the result. | +**Error codes** + +| ID| Error Message | +| -------- | ------------------- | +| 100001 | if id is not valid. | + **Example** ```js @@ -159,6 +165,12 @@ Renders a custom component in the application background and outputs its snapsho | builder | [CustomBuilder](../arkui-ts/ts-types.md#custombuilder8) | Yes | Builder of the custom component.| | callback | AsyncCallback<image.PixelMap> | Yes | Callback used to return the result.| +**Error codes** + +| ID| Error Message | +| -------- | ----------------------------------------- | +| 100001 | if builder is not a valid build function. | + **Example** ```ts diff --git a/en/application-dev/reference/apis/js-apis-arkui-drawableDescriptor.md b/en/application-dev/reference/apis/js-apis-arkui-drawableDescriptor.md index cbfeab4f4142bb4cca332c0560ccd100b324acc0..25a6deb575728408b625e3c4f32aadfa05ffe960 100644 --- a/en/application-dev/reference/apis/js-apis-arkui-drawableDescriptor.md +++ b/en/application-dev/reference/apis/js-apis-arkui-drawableDescriptor.md @@ -31,6 +31,18 @@ Creates a **DrawableDescriptor** object when the passed resource ID or name belo Creates a **LayeredDrawableDescriptor** object when the passed resource ID or name belongs to a JSON file that contains foreground and background resources. +The content of the **drawble.json** file is as follows: + +```json +{ + "layered-image": + { + "background" : "$media:background", + "foreground" : "$media:foreground" + } +} +``` + **Example** ```ts // xxx.ets @@ -45,7 +57,7 @@ struct Index { Row() { Column() { Image(( (this.resManager.getDrawableDescriptor($r('app.media.icon').id)))) - Image((( (this.resManager.getDrawableDescriptor($r('app.media.icon') + Image((( (this.resManager.getDrawableDescriptor($r('app.media.drawable') .id))).getForeground()).getPixelMap()) }.height('50%') }.width('50%') @@ -68,7 +80,8 @@ Obtains this **pixelMap** object. **Example** ```ts -pixmap: PixelMap = drawable1.getPixelMap(); +pixmap: PixelMap = ( (this.resManager.getDrawableDescriptor($r('app.media.icon') + .id))).getPixelMap(); ``` ## LayeredDrawableDescriptor.getPixelMap @@ -86,7 +99,8 @@ Obtains the **pixelMap** object where the foreground, background, and mask are b **Example** ```ts -pixmap: PixelMap = layeredDrawable1.getPixelMap(); +pixmap: PixelMap = ( (this.resManager.getDrawableDescriptor($r('app.media.drawable') + .id))).getPixelMap(); ``` ## LayeredDrawableDescriptor.getForeground @@ -104,7 +118,8 @@ Obtains the **DrawableDescriptor** object of the foreground. **Example** ```ts -drawable: DrawableDescriptor = layeredDrawable1.getForeground(); +drawable: DrawableDescriptor = ( (this.resManager.getDrawableDescriptor($r('app.media.drawable') + .id))).getForeground(); ``` ## LayeredDrawableDescriptor.getBackground @@ -122,7 +137,8 @@ Obtains the **DrawableDescriptor** object of the background. **Example** ```ts -drawable: DrawableDescriptor = layeredDrawable1.getBackground(); +drawable: DrawableDescriptor = ( (this.resManager.getDrawableDescriptor($r('app.media.drawable') + .id))).getBackground(); ``` ## LayeredDrawableDescriptor.getMask @@ -140,5 +156,6 @@ Obtains the **DrawableDescriptor** object of the mask. **Example** ```ts -drawable: DrawableDescriptor = layeredDrawable1.getMask(); +drawable: DrawableDescriptor = ( (this.resManager.getDrawableDescriptor($r('app.media.drawable') + .id))).getMask(); ``` diff --git a/en/application-dev/reference/apis/js-apis-font.md b/en/application-dev/reference/apis/js-apis-font.md index 0a66ea708e32f95433061f082b3debd9911e753d..9b6d462358a52c439117f0025c440a9cb710259b 100644 --- a/en/application-dev/reference/apis/js-apis-font.md +++ b/en/application-dev/reference/apis/js-apis-font.md @@ -34,12 +34,14 @@ Registers a custom font with the font manager. ## FontOptions +**System capability**: SystemCapability.ArkUI.ArkUI.Full + | Name | Type | Mandatory | Description | | ---------- | ------ | ---- | ------------ | | familyName | string | Yes | Name of the custom font to register. | | familySrc | string | Yes | Path of the custom font to register.| -## Example +**Example** ```ts // xxx.ets @@ -68,7 +70,7 @@ struct FontExample { } } ``` -## font.getSystemFontList +## font.getSystemFontList10+ getSystemFontList(): Array\ @@ -82,7 +84,7 @@ Obtains the list of supported fonts. | -------------------- | ----------------- | | Array\ | List of supported fonts. | -## Example +**Example** ```ts // xxx.ets @@ -105,7 +107,7 @@ struct FontExample { } ``` -## font.getFontByName +## font.getFontByName10+ getFontByName(fontName: string): FontInfo; @@ -127,18 +129,22 @@ Obtains information about a system font based on the font name. ## FontInfo -| Name | Type | Description | -| -------------- | ------- | ------------------------- | -| path | string | File path of the system font. | -| postScriptName | string | PostScript name of the system font.| -| fullName | string | Name of the system font. | -| family | string | Family of the system font. | -| subfamily | string | Subfamily of the system font. | -| weight | number | Weight of the system font. | -| width | number | Width of the system font. | -| italic | boolean | Whether the system font is italic. | -| monoSpace | boolean | Whether the system font is monospaced. | -| symbolic | boolean | Whether the system font supports symbols. | +**System capability**: SystemCapability.ArkUI.ArkUI.Full + +| Name | Type | Mandatory | Description | +| -------------- | ------- | ------------------------- | ------------------------- | +| path | string | Yes| File path of the system font. | +| postScriptName | string | Yes| PostScript name of the system font.| +| fullName | string | Yes| Name of the system font. | +| family | string | Yes| Family of the system font. | +| subfamily | string | Yes| Subfamily of the system font. | +| weight | number | Yes| Weight of the system font. | +| width | number | Yes| Width of the system font. | +| italic | boolean | Yes| Whether the system font is italic. | +| monoSpace | boolean | Yes| Whether the system font is monospaced. | +| symbolic | boolean | Yes| Whether the system font supports symbols. | + +**Example** ```ts // xxx.ets @@ -169,4 +175,3 @@ struct FontExample { } } ``` - diff --git a/en/application-dev/reference/apis/js-apis-matrix4.md b/en/application-dev/reference/apis/js-apis-matrix4.md index 9c8c1a77c0150f8d820ec03701c3bd58ad9c8a17..e2de4ddcedf439f08598e5aa6b7eaca294fb936c 100644 --- a/en/application-dev/reference/apis/js-apis-matrix4.md +++ b/en/application-dev/reference/apis/js-apis-matrix4.md @@ -16,7 +16,7 @@ import matrix4 from '@ohos.matrix4' ## matrix4.init -init(option: [number,number,number,number,number,number,number,number,number,number,number,number,number,number,number,number]): Matrix4Transit +init(options: [number,number,number,number,number,number,number,number,number,number,number,number,number,number,number,number]): Matrix4Transit Matrix constructor, which is used to create a 4 x 4 matrix by using the input parameter. Column-major order is used. @@ -27,7 +27,7 @@ Matrix constructor, which is used to create a 4 x 4 matrix by using the input pa | Name| Type | Mandatory| Description | | ------ | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | -| option | [number,number,number,number,number,number,number,number,number,number,number,number,number,number,number,number] | Yes | A number array whose length is 16 (4 x 4). For details, see **Description of a 4 x 4 matrix**.
Default value:
[1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1] | +| option | [number,number,number,number,number,number,number,number,number,number,number,number,number,number,number,number] | Yes | A number array whose length is 16 (4 x 4). For details, see **Description of a 4 x 4 matrix**.
Default value:
[1, 0, 0, 0,
0, 1, 0, 0,
0, 0, 1, 0,
0, 0, 0, 1] | **Return value** @@ -176,7 +176,7 @@ struct Test { ### combine -combine(option: Matrix4Transit): Matrix4Transit +combine(options: Matrix4Transit): Matrix4Transit Combines the effects of two matrices to generate a new matrix object. @@ -273,7 +273,7 @@ struct Tests { ### translate -translate(option: TranslateOption): Matrix4Transit +translate(options: TranslateOption): Matrix4Transit Translates this matrix object along the x, y, and z axes. @@ -317,7 +317,7 @@ struct Test { ### scale -scale(option: ScaleOption): Matrix4Transit +scale(options: ScaleOption): Matrix4Transit Scales this matrix object along the x, y, and z axes. @@ -362,7 +362,7 @@ struct Test { ### rotate -rotate(option: RotateOption): Matrix4Transit +rotate(options: RotateOption): Matrix4Transit Rotates this matrix object along the x, y, and z axes. @@ -408,7 +408,7 @@ struct Test { ### transformPoint -transformPoint(option: [number, number]): [number, number] +transformPoint(options: [number, number]): [number, number] Applies the current transformation effect to a coordinate point. @@ -466,15 +466,19 @@ struct Test { ## TranslateOption +**System capability**: SystemCapability.ArkUI.ArkUI.Full + | Name| Type | Mandatory| Description | -| ------ | ------ | ---- | ----------------------------------------------------------- | -| x | number | No | Translation distance along the x-axis, in px.
Default value: **0**
Value range: (-∞, +∞)| -| y | number | No | Translation distance along the y-axis, in px.
Default value: **0**
Value range: (-∞, +∞)| -| z | number | No | Translation distance along the z-axis, in px.
Default value: **0**
Value range: (-∞, +∞)| +| ---- | ------ | ---- | ----------------------------------------------------------- | +| x | number | No | Translation distance along the x-axis, in px.
Default value: **0**
Value range: (-∞, +∞)| +| y | number | No | Translation distance along the y-axis, in px.
Default value: **0**
Value range: (-∞, +∞)| +| z | number | No | Translation distance along the z-axis, in px.
Default value: **0**
Value range: (-∞, +∞)| ## ScaleOption -| Name | Type | Mandatory| Description | +**System capability**: SystemCapability.ArkUI.ArkUI.Full + +| Name | Type | Mandatory| Description | | ------- | ------ | ---- | ------------------------------------------------------------ | | x | number | No | Scaling multiple along the x-axis. If the value is greater than 1, the image is scaled up along the x-axis. If the value is less than 1, the image is scaled down along the x-axis.
Default value: **1**
Value range: [0, +∞)
**NOTE**
A value less than 0 evaluates to the default value.| | y | number | No | Scaling multiple along the y-axis. If the value is greater than 1, the image is scaled up along the y-axis. If the value is less than 1, the image is scaled down along the y-axis.
Default value: **1**
Value range: [0, +∞)
**NOTE**
A value less than 0 evaluates to the default value.| @@ -484,7 +488,9 @@ struct Test { ## RotateOption -| Name | Type | Mandatory| Description | +**System capability**: SystemCapability.ArkUI.ArkUI.Full + +| Name | Type | Mandatory| Description | | ------- | ------ | ---- | ------------------------------------------------------- | | x | number | No | X coordinate of the rotation axis vector.
Default value: **1**
Value range: (-∞, +∞)| | y | number | No | Y coordinate of the rotation axis vector.
Default value: **1**
Value range: (-∞, +∞)| diff --git a/en/application-dev/reference/apis/js-apis-plugincomponent.md b/en/application-dev/reference/apis/js-apis-plugincomponent.md index 0ae1baf6eebdadbbdc9d43de1e9c100ac73163db..d6e63c978f5f9891858c102e161b3b9e7eddc29b 100644 --- a/en/application-dev/reference/apis/js-apis-plugincomponent.md +++ b/en/application-dev/reference/apis/js-apis-plugincomponent.md @@ -262,7 +262,7 @@ pluginComponentManager.push( name: "ets/pages/plugin2.js", data: { "js": "ets/pages/plugin.js", - "key_1": 1111, , + "key_1": 1111, }, extraData: { "extra_str": "this is push event" @@ -376,10 +376,24 @@ Listens for events of the request type and returns the requested data, or listen | eventType | string | Yes | Type of the event to listen for. The options are as follows:
**"push"**: The component provider pushes data to the component consumer.
**"request"**: The component consumer proactively requests data from the component provider.| | callback | [OnPushEventCallback](#onpusheventcallback) \| [OnRequestEventCallback](#onrequesteventcallback) | Yes | Callback used to return the result. The type is [OnPushEventCallback](#onpusheventcallback) for the push event and [OnRequestEventCallback](#onrequesteventcallback) for the request event.| - **Example** ```js +function onPushListener(source, template, data, extraData) { + console.log("onPushListener template.source=" + template.source) + console.log("onPushListener source=" + JSON.stringify(source)) + console.log("onPushListener template=" + JSON.stringify(template)) + console.log("onPushListener data=" + JSON.stringify(data)) + console.log("onPushListener extraData=" + JSON.stringify(extraData)) +} +function onRequestListener(source, name, data) { + console.error("onRequestListener"); + console.log("onRequestListener source=" + JSON.stringify(source)); + console.log("onRequestListener name=" + name); + console.log("onRequestListener data=" + JSON.stringify(data)); + + return { template: "ets/pages/plugin.js", data: data }; +} pluginComponentManager.on("push", onPushListener) pluginComponentManager.on("request", onRequestListener) ``` diff --git a/en/application-dev/reference/apis/js-apis-router.md b/en/application-dev/reference/apis/js-apis-router.md index 4319de28861f4056ca47657cf72a4af526b886f6..2d97910441aa8dc3d5fe958c5424a0b449ce0620 100644 --- a/en/application-dev/reference/apis/js-apis-router.md +++ b/en/application-dev/reference/apis/js-apis-router.md @@ -604,7 +604,7 @@ For details about the error codes, see [Router Error Codes](../errorcodes/errorc | ID | Error Message| | --------- | ------- | -| 100001 | if UI execution context not found. | +| 100001 | if UI execution context not found, only throw in standard system. | | 100004 | if the named route is not exist. | **Example** @@ -645,7 +645,7 @@ For details about the error codes, see [Router Error Codes](../errorcodes/errorc | ID | Error Message| | --------- | ------- | -| 100001 | if UI execution context not found. | +| 100001 | if UI execution context not found, only throw in standard system. | | 100004 | if the named route is not exist. | **Example** @@ -693,7 +693,7 @@ For details about the error codes, see [Router Error Codes](../errorcodes/errorc | ID | Error Message| | --------- | ------- | -| 100001 | if can not get the delegate. | +| 100001 | if UI execution context not found, only throw in standard system. | | 100004 | if the named route is not exist. | **Example** @@ -735,7 +735,7 @@ For details about the error codes, see [Router Error Codes](../errorcodes/errorc | ID | Error Message| | --------- | ------- | -| 100001 | if UI execution context not found. | +| 100001 | if UI execution context not found, only throw in standard system. | | 100004 | if the named route is not exist. | **Example** @@ -1054,7 +1054,7 @@ struct Second { Text(this.text) .fontSize(30) .onClick(() => { - this.secondData = (this.data.['array'][1]).toString() + this.secondData = (this.data['array'][1]).toString() }) .margin({ top: 20 }) Text(`This is the data passed from the first page: ${this.secondData}`) diff --git a/en/application-dev/reference/errorcodes/errorcode-router.md b/en/application-dev/reference/errorcodes/errorcode-router.md index 6c805ee9853deda64bce96a325ac7175d6d9bd97..762459918ebeafed876ece076d564d6ffa2a1869 100644 --- a/en/application-dev/reference/errorcodes/errorcode-router.md +++ b/en/application-dev/reference/errorcodes/errorcode-router.md @@ -22,7 +22,7 @@ The operation for obtaining the rendering engine or parsing parameters fails. NA -## 100002 Incorrect URI +## 100002 Incorrect URI During Page Redirection **Error Message** @@ -58,7 +58,21 @@ Too many pages are pushed. Delete unnecessary or invalid pages. -## 200002 Incorrect URI +## 100004 Incorrect Route Name + +**Error Message** + +Named route error. The named route is not exist. + +**Description** + +This error code is reported when the specified route name for redirection is incorrect or does not exist. + +**Possible Causes** + +The specified route name for redirection is incorrect or does not exist. + +## 200002 Incorrect URI During Page Replacement **Error Message**