diff --git a/en/application-dev/quick-start/arkts-state-mgmt-concepts.md b/en/application-dev/quick-start/arkts-state-mgmt-concepts.md
index d3f1002dca22fe4522134d662d4c640742d86952..2eae06eca22030673ef35bcf756279444fcd9c60 100644
--- a/en/application-dev/quick-start/arkts-state-mgmt-concepts.md
+++ b/en/application-dev/quick-start/arkts-state-mgmt-concepts.md
@@ -15,8 +15,8 @@ In the multi-dimensional state management mechanism for ArkUI, UI-related data c
| @Link | Primitive data types, classes, and arrays | This decorator is used to establish two-way data binding between the parent and child components. The internal state data of the parent component is used as the data source. Any changes made to one component will be reflected to the other.|
| @Observed | Class | This decorator is used to indicate that the data changes in the class will be managed by the UI page. |
| @ObjectLink | Objects of **@Observed** decorated classes| When the decorated state variable is modified, the parent and sibling components that have the state variable will be notified for UI re-rendering.|
-| @Consume | Primitive data types, classes, and arrays | When the **@Consume** decorated variable detects the update of the **@Provide** decorated variable, the re-rendering of the current custom component is triggered.|
| @Provide | Primitive data types, classes, and arrays | As the data provider, **@Provide** can update the data of child nodes and trigger page re-rendering.|
+| @Consume | Primitive data types, classes, and arrays | When the **@Consume** decorated variable detects the update of the **@Provide** decorated variable, the re-rendering of the current custom component is triggered.|
## State Management with Application-level Variables
@@ -25,5 +25,8 @@ In the multi-dimensional state management mechanism for ArkUI, UI-related data c
- **@StorageLink**: works in a way similar to that of **@Consume**. The difference is that the target object is obtained from the **AppStorage** based on the given name. **@StorageLink** establishes two-way binding between the decorated UI component and **AppStorage** to synchronize data.
- **@StorageProp**: synchronizes UI component attributes with the **AppStorage** unidirectionally. That is, the value change in the **AppStorage** will trigger an update of the corresponding UI component, but the change of the UI component will not cause an update of the attribute value in the **AppStorage**.
- Service logic implementation API: adds, reads, modifies, or deletes the state data of applications. The changes made by this API will be synchronized to the UI component for UI update.
+- **LocalStorage**: provides ability-specific storage.
+- **@LocalStorageLink**: establishes two-way data binding between a component and the **LocalStorage**. Specifically, this is achieved by decorating the component's state variable with **@LocalStorageLink(*key*)**. Wherein, **key** is the attribute key value in the **LocalStorage**.
+- **@LocalStorageProp**: establishes one-way data binding between a component and the **LocalStorage**. Specifically, this is achieved by decorating the component's state variable with **@LocalStorageProp(*key*)**. Wherein, **key** is the attribute key value in the **LocalStorage**.
- **PersistentStorage**: provides a set of static methods for managing persistent data of applications. Persistent data with specific tags can be linked to the **AppStorage**, and then the persistent data can be accessed through the **AppStorage** APIs. Alternatively, the **@StorageLink** decorator can be used to access the variable that matches the specific key.
- **Environment**: provides the **AppStorage** with an array of environment state attributes that are required by the application and describe the device environment where the application runs. It is a singleton object created by the framework when the application is started.
diff --git a/en/application-dev/quick-start/arkts-state-mgmt-page-level.md b/en/application-dev/quick-start/arkts-state-mgmt-page-level.md
index accda367a04ab0c77bdce7557bf47cc73f48c8a3..504665688a8eada31cd51531c7cd8c485d795892 100644
--- a/en/application-dev/quick-start/arkts-state-mgmt-page-level.md
+++ b/en/application-dev/quick-start/arkts-state-mgmt-page-level.md
@@ -82,14 +82,18 @@ struct MyComponent {
## @Prop
-**@Prop** and **@State** have the same semantics but different initialization modes. Variables decorated by **@Prop** must be initialized using the **@State** decorated variable provided by their parent components. The **@Prop** decorated variable can be modified in the component, but the modification is not updated to the parent component; that is, **@Prop** uses one-way data binding.
+**@Prop** and **@State** have the same semantics but different initialization modes. A **@Prop** decorated variable in a component must be initialized using the **@State** decorated variable in its parent component. The **@Prop** decorated variable can be modified in the component, but the modification is not updated to the parent component; the modification to the **@State** decorated variable is synchronized to the **@Prop** decorated variable. That is, **@Prop** establishes one-way data binding.
The **@Prop** decorated state variable has the following features:
- Support for simple types: The number, string, and boolean types are supported.
- Private: Data is accessed only within the component.
- Support for multiple instances: A component can have multiple attributes decorated by **@Prop**.
-- Support for initialization with a value passed to the @Prop decorated variable: When a new instance of the component is created, all **@Prop** decorated variables must be initialized. Initialization inside the component is not supported.
+- Support for initialization with a value passed to the @Prop decorated variable: When a new instance of the component is created, all **@Prop** variables must be initialized. Initialization inside the component is not supported.
+
+> **NOTE**
+>
+> A **@Prop** decorated variable cannot be initialized inside the component.
**Example**
@@ -152,13 +156,13 @@ Two-way binding can be established between the **@Link** decorated variable and
- Support for multiple types: The **@Link** decorated variables support the data types the same as the **@State** decorated variables; that is, the value can be of the following types: class, number, string, boolean, or arrays of these types.
- Private: Data is accessed only within the component.
-- Single data source: The variable of the parent component used for initializing the **@Link** decorated variable must be a **@State** decorated variable.
+- Single data source: The variable used to initialize the **@Link** decorated variable in a component must be a state variable defined in the parent component.
- **Two-way binding**: When a child component changes the **@Link** decorated variable, the **@State** decorated variable of its parent component is also changed.
- Support for initialization with the variable reference passed to the @Link decorated variable: When creating an instance of the component, you must use the naming parameter to initialize all **@Link** decorated variables. **@Link** decorated variables can be initialized by using the reference of the **@State** or **@Link** decorated variable. Wherein, the **@State** decorated variables can be referenced using the **'$'** operator.
> **NOTE**
>
-> **@Link** decorated variables cannot be initialized within the component.
+> A **@Link** decorated variable cannot be initialized inside the component.
**Simple Type Example**
@@ -391,13 +395,13 @@ struct ViewB {
```
-## @Consume and @Provide
+## @Provide and @Consume
As the data provider, **@Provide** can update the data of child nodes and trigger page rendering. After **@Consume** detects that the **@Provide** decorated variable is updated, it will initiate re-rendering of the current custom component.
> **NOTE**
>
-> To avoid infinite loops caused by circular reference, exercise caution when using **@Provide** and **@Consume**.
+> When using **@Provide** and **@Consume**, avoid circular reference that may lead to infinite loops.
### @Provide
diff --git a/en/application-dev/quick-start/figures/arkts-get-started.png b/en/application-dev/quick-start/figures/arkts-get-started.png
index 8858c1d09bc4624ad9ace341b8d4aff2f2c4f2fa..0a83234882aecf0c1cfe390d1b9d49bccdbd0362 100644
Binary files a/en/application-dev/quick-start/figures/arkts-get-started.png and b/en/application-dev/quick-start/figures/arkts-get-started.png differ
diff --git a/en/application-dev/reference/apis/js-apis-curve.md b/en/application-dev/reference/apis/js-apis-curve.md
index 11b95aa03d0135d811ee21f9e672ad1798d23b5c..2c90472a98a38d74e7211eb8dcef2061082f18c8 100644
--- a/en/application-dev/reference/apis/js-apis-curve.md
+++ b/en/application-dev/reference/apis/js-apis-curve.md
@@ -1,6 +1,6 @@
-# Interpolation Calculation
+# @ohos.curves
-The **Curves** module provides APIs for interpolation calculation to construct step, cubic Bezier, and spring curve objects.
+The **Curves** module provides APIs for interpolation calculation to create step, cubic Bezier, and spring curves.
> **NOTE**
>
@@ -19,7 +19,7 @@ import Curves from '@ohos.curves'
initCurve(curve?: Curve): ICurve
-Implements initialization for the interpolation curve, which is used to create an interpolation curve object based on the input parameter.
+Implements initialization for the interpolation curve, which is used to create an interpolation curve based on the input parameter.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
@@ -33,7 +33,7 @@ Implements initialization for the interpolation curve, which is used to create a
| Type | Description |
| ---------------------------------- | ---------------- |
-| [ICurve](#icurve) | Curve object.|
+| [ICurve](#icurve) | Interpolation curve.|
**Example**
@@ -49,7 +49,7 @@ Curves.initCurve(Curve.EaseIn) // Create a default ease-in curve, where the inte
stepsCurve(count: number, end: boolean): ICurve
-Constructs a step curve object.
+Creates a step curve.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
@@ -64,7 +64,7 @@ Constructs a step curve object.
| Type | Description |
| ---------------------------------- | ---------------- |
-| [ICurve](#icurve) | Curve object.|
+| [ICurve](#icurve) | Interpolation curve.|
**Example**
@@ -80,7 +80,7 @@ Curves.stepsCurve(9, true) // Create a step curve.
cubicBezierCurve(x1: number, y1: number, x2: number, y2: number): ICurve
-Constructs a cubic Bezier curve object. The curve values must be between 0 and 1.
+Creates a cubic Bezier curve. The curve values must be between 0 and 1.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
@@ -96,7 +96,7 @@ Constructs a cubic Bezier curve object. The curve values must be between 0 and 1
| Type | Description |
| ---------------------------------- | ---------------- |
-| [ICurve](#icurve) | Curve object.|
+| [ICurve](#icurve) | Interpolation curve.|
**Example**
@@ -112,7 +112,7 @@ Curves.cubicBezierCurve(0.1, 0.0, 0.1, 1.0) // Create a cubic Bezier curve.
springCurve(velocity: number, mass: number, stiffness: number, damping: number): ICurve
-Constructs a spring curve object.
+Creates a spring curve.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
@@ -120,7 +120,7 @@ Constructs a spring curve object.
| Name | Type | Mandatory | Description |
| --------- | ------ | ---- | ----- |
| velocity | number | Yes | Initial velocity. It is applied by external factors to the elastic animation. It aims to help ensure the smooth transition from the previous motion state to the elastic animation.|
-| mass | number | Yes | Mass. Force object of the elastic system, which will have inertia effect on the elastic system. The greater the mass, the greater the amplitude of the oscillation, and the slower the speed of restoring to the equilibrium position.|
+| mass | number | Yes | Mass, which influences the inertia in the spring system. The greater the mass, the greater the amplitude of the oscillation, and the slower the speed of restoring to the equilibrium position.|
| stiffness | number | Yes | Stiffness. It is the degree to which an object deforms by resisting the force applied. In an elastic system, the greater the stiffness, the stronger the ability to resist deformation, and the faster the speed of restoring to the equilibrium position.|
| damping | number | Yes | Damping. It is a pure number and has no real physical meaning. It is used to describe the oscillation and attenuation of the system after being disturbed. The larger the damping, the smaller the number of oscillations of elastic motion, and the smaller the oscillation amplitude.|
@@ -129,7 +129,7 @@ Constructs a spring curve object.
| Type | Description |
| ---------------------------------- | ---------------- |
-| [ICurve](#icurve)| Curve object.|
+| [ICurve](#icurve)| Interpolation curve.|
**Example**
@@ -140,6 +140,68 @@ Curves.springCurve(100, 1, 228, 30) // Create a spring curve.
```
+## Curves.springMotion9+
+
+springMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve
+
+Creates a spring animation curve. If multiple spring animations are applied to the same attribute of an object, each animation replaces their predecessor and inherits the velocity.
+
+**System capability**: SystemCapability.ArkUI.ArkUI.Full
+
+**Parameters**
+| Name | Type | Mandatory | Description |
+| --------- | ------ | ---- | ----- |
+| response | number | No | Duration of one complete oscillation, in seconds.
Default value: **0.55**|
+| dampingFraction | number | No | Damping coefficient.
**0**: undamped. In this case, the spring oscillates forever.
> 0 and < 1: underdamped. In this case, the spring overshoots the equilibrium position.
**1**: critically damped.
> 1: overdamped. In this case, the spring approaches equilibrium gradually.
Default value: **0.825**|
+| overlapDuration | number | No | Duration for animations to overlap, in seconds. When animations overlap, if the **response** values of the two animations are different, they will transit smoothly over this duration.
Default value: **0**|
+
+
+**Return value**
+
+| Type | Description |
+| ---------------------------------- | ---------------- |
+| [ICurve](#icurve)| Curve.
Note: The spring animation curve is physics-based. Its duration depends on the **springMotion** parameters and the previous velocity, rather than the **duration** parameter in **animation** or **animateTo**. The time cannot be normalized. Therefore, the interpolation cannot be obtained by using the [interpolate](#interpolate) function of the curve.|
+
+**Example**
+
+```ts
+import Curves from '@ohos.curves'
+Curves.springMotion() // Create a spring animation curve with default settings.
+Curves.springMotion(0.5) // Create a spring animation curve with the specified response value.
+Curves.springMotion (0.5, 0.6) // Create a spring animation curve with the specified response and dampingFraction values.
+Curves.springMotion(0.5, 0.6, 0) // Create a spring animation curve with the specified parameter values.
+```
+
+
+## Curves.responsiveSpringMotion9+
+
+responsiveSpringMotion(response?: number, dampingFraction?: number, overlapDuration?: number): ICurve
+
+Creates a responsive spring animation curve. It is a special case of [springMotion](#curvesspringmotion9), with the only difference in the default values. It can be used together with **springMotion**.
+
+**System capability**: SystemCapability.ArkUI.ArkUI.Full
+
+**Parameters**
+| Name | Type | Mandatory | Description |
+| --------- | ------ | ---- | ----- |
+| response | number | No | See **response** in **springMotion**. Default value: **0.15**|
+| dampingFraction | number | No | See **dampingFraction** in **springMotion**. Default value: **0.86**|
+| overlapDuration | number | No | See **overlapDuration** in **springMotion**. Default value: **0.25**|
+
+**Return value**
+
+| Type | Description |
+| ---------------------------------- | ---------------- |
+| [ICurve](#icurve)| Curve.
**NOTE**
1. To apply custom settings for a spring animation, you are advised to use **springMotion**. When using **responsiveSpringMotion**, you are advised to retain the default settings.
2. The duration of the responsive spring animation depends on the **responsiveSpringMotion** parameters and the previous velocity, rather than the **duration** parameter in **animation** or **animateTo**. In addition, the interpolation cannot be obtained by using the [interpolate](#interpolate) function of the curve.|
+
+**Example**
+
+```ts
+import Curves from '@ohos.curves'
+Curves.responsiveSpringMotion() // Create a responsive spring animation curve with default settings.
+```
+
+
## ICurve
@@ -194,7 +256,7 @@ Implements initialization to create a curve. This API is deprecated since API ve
steps(count: number, end: boolean): string
-Constructs a step curve object. This API is deprecated since API version 9. You are advised to use [Curves.stepsCurve](#curvesstepscurve9) instead.
+Creates a step curve. This API is deprecated since API version 9. You are advised to use [Curves.stepsCurve](#curvesstepscurve9) instead.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
@@ -211,7 +273,7 @@ Constructs a step curve object. This API is deprecated since API version 9. You
cubicBezier(x1: number, y1: number, x2: number, y2: number): string
-Constructs a cubic Bezier curve object. The curve value must range from 0 to 1. This API is deprecated since API version 9. You are advised to use [Curves.cubicBezierCurve](#curvescubicbeziercurve9) instead.
+Creates a cubic Bezier curve. The curve value must range from 0 to 1. This API is deprecated since API version 9. You are advised to use [Curves.cubicBezierCurve](#curvescubicbeziercurve9) instead.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
@@ -229,7 +291,7 @@ Constructs a cubic Bezier curve object. The curve value must range from 0 to 1.
spring(velocity: number, mass: number, stiffness: number, damping: number): string
-Constructs a spring curve object. This API is deprecated since API version 9. You are advised to use [Curves.springCurve](#curvesspringcurve9) instead.
+Creates a spring curve. This API is deprecated since API version 9. You are advised to use [Curves.springCurve](#curvesspringcurve9) instead.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
@@ -238,7 +300,7 @@ Constructs a spring curve object. This API is deprecated since API version 9. Yo
| Name | Type | Mandatory | Description |
| --------- | ------ | ---- | ----- |
| velocity | number | Yes | Initial velocity. It is applied by external factors to the elastic animation. It aims to help ensure the smooth transition from the previous motion state to the elastic animation.|
-| mass | number | Yes | Mass. Force object of the elastic system, which will have inertia effect on the elastic system. The greater the mass, the greater the amplitude of the oscillation, and the slower the speed of restoring to the equilibrium position.|
+| mass | number | Yes | Mass, which influences the inertia in the spring system. The greater the mass, the greater the amplitude of the oscillation, and the slower the speed of restoring to the equilibrium position.|
| stiffness | number | Yes | Stiffness. It is the degree to which an object deforms by resisting the force applied. In an elastic system, the greater the stiffness, the stronger the ability to resist deformation, and the faster the speed of restoring to the equilibrium position.|
| damping | number | Yes | Damping. It is a pure number and has no real physical meaning. It is used to describe the oscillation and attenuation of the system after being disturbed. The larger the damping, the smaller the number of oscillations of elastic motion, and the smaller the oscillation amplitude.|
@@ -247,6 +309,7 @@ Constructs a spring curve object. This API is deprecated since API version 9. Yo
```ts
// xxx.ets
import Curves from '@ohos.curves'
+
@Entry
@Component
struct ImageComponent {
@@ -256,16 +319,16 @@ struct ImageComponent {
build() {
Column() {
Text()
- .margin({top:100})
+ .margin({ top: 100 })
.width(this.widthSize)
.height(this.heightSize)
.backgroundColor(Color.Red)
- .onClick(()=> {
+ .onClick(() => {
let curve = Curves.cubicBezierCurve(0.25, 0.1, 0.25, 1.0);
this.widthSize = curve.interpolate(0.5) * this.widthSize;
this.heightSize = curve.interpolate(0.5) * this.heightSize;
})
- .animation({duration: 2000 , curve: Curves.stepsCurve(9, true)})
+ .animation({ duration: 2000, curve: Curves.stepsCurve(9, true) })
}.width("100%").height("100%")
}
}
diff --git a/en/application-dev/reference/apis/js-apis-matrix4.md b/en/application-dev/reference/apis/js-apis-matrix4.md
index 97dd9e3f982d9f36d5feb6f17d59a40bb57e1a20..f5b9b27f55ed9d363939bef6f55582423afe4a28 100644
--- a/en/application-dev/reference/apis/js-apis-matrix4.md
+++ b/en/application-dev/reference/apis/js-apis-matrix4.md
@@ -145,11 +145,12 @@ Copies this matrix object.
```ts
// xxx.ets
import matrix4 from '@ohos.matrix4'
+
@Entry
@Component
struct Test {
- private matrix1 = matrix4.identity().translate({x:100})
- private matrix2 = this.matrix1.copy().scale({x:2})
+ private matrix1 = matrix4.identity().translate({ x: 100 })
+ private matrix2 = this.matrix1.copy().scale({ x: 2 })
build() {
Column() {
@@ -160,7 +161,7 @@ struct Test {
Image($r("app.media.bg2"))
.width("40%")
.height(100)
- .margin({top:50})
+ .margin({ top: 50 })
.transform(this.matrix2)
}
}
@@ -199,11 +200,12 @@ Combines the effects of two matrices to generate a new matrix object.
```ts
// xxx.ets
import matrix4 from '@ohos.matrix4'
+
@Entry
@Component
struct Test {
- private matrix1 = matrix4.identity().translate({x:200}).copy()
- private matrix2 = matrix4.identity().scale({x:2}).copy()
+ private matrix1 = matrix4.identity().translate({ x: 200 }).copy()
+ private matrix2 = matrix4.identity().scale({ x: 2 }).copy()
build() {
Column() {
@@ -211,13 +213,13 @@ struct Test {
Image($r("app.media.icon"))
.width("40%")
.height(100)
- .margin({top:50})
+ .margin({ top: 50 })
// Translate the x-axis by 200px, and then scale it twice to obtain the resultant matrix.
Image($r("app.media.icon"))
.transform(this.matrix1.combine(this.matrix2))
.width("40%")
- .height(100)
- .margin({top:50})
+ .height(100)
+ .margin({ top: 50 })
}
}
}
@@ -245,8 +247,9 @@ Inverts this matrix object.
```ts
import matrix4 from '@ohos.matrix4'
// The effect of matrix 1 (width scaled up by 2x) is opposite to that of matrix 2 (width scaled down by 2x).
-let matrix1 = matrix4.identity().scale({x:2})
+let matrix1 = matrix4.identity().scale({ x: 2 })
let matrix2 = matrix1.invert()
+
@Entry
@Component
struct Tests {
@@ -295,10 +298,11 @@ Translates this matrix object along the x, y, and z axes.
```ts
// xxx.ets
import matrix4 from '@ohos.matrix4'
+
@Entry
@Component
struct Test {
- private matrix1 = matrix4.identity().translate({x:100, y:200, z:30})
+ private matrix1 = matrix4.identity().translate({ x: 100, y: 200, z: 30 })
build() {
Column() {
@@ -346,7 +350,7 @@ import matrix4 from '@ohos.matrix4'
@Entry
@Component
struct Test {
- private matrix1 = matrix4.identity().scale({x:2, y:3, z:4, centerX:50, centerY:50})
+ private matrix1 = matrix4.identity().scale({ x:2, y:3, z:4, centerX:50, centerY:50 })
build() {
Column() {
@@ -392,17 +396,18 @@ Rotates this matrix object along the x, y, and z axes.
```ts
// xxx.ets
import matrix4 from '@ohos.matrix4'
+
@Entry
@Component
struct Test {
- private matrix1 = matrix4.identity().rotate({x:1, y:1, z:2, angle:30})
+ private matrix1 = matrix4.identity().rotate({ x: 1, y: 1, z: 2, angle: 30 })
build() {
Column() {
Image($r("app.media.bg1")).transform(this.matrix1)
.width("40%")
.height(100)
- }.width("100%").margin({top:50})
+ }.width("100%").margin({ top: 50 })
}
}
```
diff --git a/en/application-dev/reference/apis/js-apis-system-router.md b/en/application-dev/reference/apis/js-apis-system-router.md
index 60e999026e58bb6510a24540609f9c6bc44aa55d..1d47c8883ae8d3cc4be49d19845ce1b3e3d5bb2a 100644
--- a/en/application-dev/reference/apis/js-apis-system-router.md
+++ b/en/application-dev/reference/apis/js-apis-system-router.md
@@ -1,4 +1,4 @@
-# Page Routing
+# @system.router
The **Router** module provides APIs to access pages through URIs.
@@ -43,8 +43,8 @@ export default {
data1: 'message',
data2: {
data3: [123, 456, 789]
- },
- },
+ }
+ }
});
}
}
@@ -67,7 +67,8 @@ export default {
}
```
->  **NOTE**
+> **NOTE**
+>
> The page routing stack supports a maximum of 32 pages.
@@ -94,8 +95,8 @@ export default {
router.replace({
uri: 'pages/detail/detail',
params: {
- data1: 'message',
- },
+ data1: 'message'
+ }
});
}
}
@@ -135,7 +136,7 @@ Returns to the previous page or a specified page.
export default {
indexPushPage() {
router.push({
- uri: 'pages/detail/detail',
+ uri: 'pages/detail/detail'
});
}
}
@@ -147,7 +148,7 @@ export default {
export default {
detailPushPage() {
router.push({
- uri: 'pages/mall/mall',
+ uri: 'pages/mall/mall'
});
}
}
@@ -183,7 +184,8 @@ export default {
}
```
->  **NOTE**
+> **NOTE**
+>
> In the example, the **uri** field indicates the page route, which is specified by the **pages** list in the **config.json** file.
## router.getParams
@@ -237,7 +239,7 @@ Obtains the number of pages in the current stack.
```js
export default {
getLength() {
- var size = router.getLength();
+ let size = router.getLength();
console.log('pages stack size = ' + size);
}
}
@@ -262,7 +264,7 @@ Obtains state information about the current page.
```js
export default {
getState() {
- var page = router.getState();
+ let page = router.getState();
console.log('current index = ' + page.index);
console.log('current name = ' + page.name);
console.log('current path = ' + page.path);
@@ -296,7 +298,7 @@ export default {
},
cancel: function() {
console.log('cancel');
- },
+ }
});
}
}
@@ -327,7 +329,7 @@ export default {
},
cancel: function() {
console.log('cancel');
- },
+ }
});
}
}
@@ -339,10 +341,10 @@ Defines the page routing parameters.
**System capability**: SystemCapability.ArkUI.ArkUI.Lite
-| Name | Type | Mandatory | Description |
-| ------ | ------ | ---- | ---------------------------------------- |
-| uri | string | Yes | URI of the target page, in either of the following formats:
1. Absolute path, which is provided by the **pages** list in the **config.json** file. Example:
- pages/index/index
- pages/detail/detail
2. Specific path. If the URI is a slash (/), the home page is displayed.|
-| params | Object | No | Data that needs to be passed to the target page during redirection. The target page can use **router.getParams()** to obtain the passed parameters, for example, **this.keyValue** (**keyValue** is the value of a key in **params**). In the web-like paradigm, these parameters can be directly used on the target page. If the field specified by **key** already exists on the target page, the passed value of the key will be displayed.|
+| Name | Type| Mandatory| Description |
+| ------ | -------- | ---- | ------------------------------------------------------------ |
+| uri | string | Yes | URI of the target page, in either of the following formats:
1. Absolute path, which is provided by the **pages** list in the **config.json** file. Example:
- pages/index/index
- pages/detail/detail
2. Specific path. If the URI is a slash (/), the home page is displayed.|
+| params | object | No | Data that needs to be passed to the target page during redirection. The target page can use **router.getParams()** to obtain the passed parameters, for example, **this.keyValue** (**keyValue** is the value of a key in **params**). In the web-like paradigm, these parameters can be directly used on the target page. If the field specified by **key** already exists on the target page, the passed value of the key will be displayed.|
## BackRouterOptions
@@ -351,10 +353,10 @@ Defines the parameters for routing back.
**System capability**: The items in the table below require different system capabilities. For details, see the table.
-| Name | Type | Mandatory | Description |
-| ------ | ------ | ---- | ---------------------------------------- |
-| uri | string | No | URI of the page to return to. If the specified page does not exist in the page stack, the application does not respond. If this parameter is not set, the application returns to the previous page.
**System capability**: SystemCapability.ArkUI.ArkUI.Full|
-| params | Object | No | Data that needs to be passed to the target page during redirection.
**System capability**: SystemCapability.ArkUI.ArkUI.Lite|
+| Name | Type| Mandatory| Description |
+| ------ | -------- | ---- | ------------------------------------------------------------ |
+| uri | string | No | URI of the page to return to. If the specified page does not exist in the page stack, the application does not respond. If this parameter is not set, the application returns to the previous page.
**System capability**: SystemCapability.ArkUI.ArkUI.Full|
+| params | object | No | Data that needs to be passed to the target page during redirection.
**System capability**: SystemCapability.ArkUI.ArkUI.Lite|
## RouterState
diff --git a/en/application-dev/reference/arkui-js/js-components-common-styles.md b/en/application-dev/reference/arkui-js/js-components-common-styles.md
index b32dbc08734817999f0968ebb47bfd41cea2e693..611529aec1de7dc133ff4fab8c784622cb60591a 100644
--- a/en/application-dev/reference/arkui-js/js-components-common-styles.md
+++ b/en/application-dev/reference/arkui-js/js-components-common-styles.md
@@ -42,7 +42,7 @@ You can set universal styles for components in the **style** attribute or **.css
| backdrop-filter5+ | string | - | Syntax: backdrop-filter: blur(px)
Radius of the background blur area within the component layout. If this style is not set, the default value **0** (no blur) is used. Percentage values are not supported.
Example:
- backdrop-filter: blur(10px) |
| window-filter5+ | string | - | Syntax: window-filter: blur(percent), style5+
Blur degree and style for windows within the component layout. If this style is not set, the default value **0%** (no blur area) is used. Different blur degrees and styles for multiple blur areas are not supported. Available values of **style** are as follows: small_light (default value), medium_light, large_light, xlarge_light, small_dark, medium_dark, large_dark, xlarge_dark
Example:
- window-filter: blur(50%)
- window-filter: blur(10%), large_light |
| opacity | number | 1 | Opacity of an element. The value ranges from **0** to **1**. The value **1** means opaque, and **0** means completely transparent. |
-| display | string | flex | Type of the box containing an element. Available values are as follows:
- **flex**: flexible layout
- **none**: not rendered
- **grid**: grid layout (available only **div** supports the **display** style)|
+| display | string | flex | Type of the box containing an element. Available values are as follows:
- **flex**: flexible layout
- **none**: not rendered
- **grid**: grid layout (available only for the **\
** component) |
| visibility | string | visible | Whether to display the box containing an element. The invisible box occupies layout space. (To remove the box, set the **display** attribute to **none**.) Available values are as follows:
- **visible**: The element is visible.
- **hidden**: The box is hidden but still takes up space.
If both **visibility** and **display** are set, only **display** takes effect.|
| flex | number \| string | - | How to divide available space of the parent component for each child component.
You can set one, two
5+, or three
5+ values for this style.
Set one value in either of the following ways:
- A unitless number to set **flex-grow**.
- A valid width value
5+ to set **flex-basis**.
Set two values
5+ in the following ways:
The first value must be a unitless number used to set **flex-grow**. The second value must be either of the following:
- A unitless number to set **flex-shrink**.
- A valid width value to set **flex-basis**.
Set three values
5+ in the following ways:
The first value must be a unitless number used to set **flex-grow**. The second value must be a unitless number used to set **flex-shrink**. The third value must be a valid width value used to set **flex-basis**.
This style takes effect only when the container is any of the following components: **\
**, **\
**, **\**, **\**, and **\5+**.|
| flex-grow | number | 0 | How much a child component will grow. The value specifies allocation of the remaining space on the main axis of the parent component. Size of available space = Container size - Total size of all child components. Value **0** indicates that the child component does not grow.
This style takes effect only when the container is any of the following components: **\**, **\
**, **\**, **\**, and **\5+**.|
diff --git a/en/application-dev/reference/arkui-ts/Readme-EN.md b/en/application-dev/reference/arkui-ts/Readme-EN.md
index 7061cde570c5bf521e9eddc4ef232af1e3a8050b..25736a22dced9dd795af1edd130de06ab02248cf 100644
--- a/en/application-dev/reference/arkui-ts/Readme-EN.md
+++ b/en/application-dev/reference/arkui-ts/Readme-EN.md
@@ -102,7 +102,6 @@
- [Counter](ts-container-counter.md)
- [Flex](ts-container-flex.md)
- [FlowItem](ts-container-flowitem.md)
- - [GridContainer](ts-container-gridcontainer.md)
- [GridCol](ts-container-gridcol.md)
- [GridRow](ts-container-gridrow.md)
- [Grid](ts-container-grid.md)
@@ -124,25 +123,25 @@
- [TabContent](ts-container-tabcontent.md)
- [WaterFlow](ts-container-waterflow.md)
- Media Components
- - [Video](ts-media-components-video.md)
+ - [Video](ts-media-components-video.md)
- Drawing Components
- - [Circle](ts-drawing-components-circle.md)
- - [Ellipse](ts-drawing-components-ellipse.md)
- - [Line](ts-drawing-components-line.md)
- - [Polyline](ts-drawing-components-polyline.md)
- - [Polygon](ts-drawing-components-polygon.md)
- - [Path](ts-drawing-components-path.md)
- - [Rect](ts-drawing-components-rect.md)
- - [Shape](ts-drawing-components-shape.md)
+ - [Circle](ts-drawing-components-circle.md)
+ - [Ellipse](ts-drawing-components-ellipse.md)
+ - [Line](ts-drawing-components-line.md)
+ - [Polyline](ts-drawing-components-polyline.md)
+ - [Polygon](ts-drawing-components-polygon.md)
+ - [Path](ts-drawing-components-path.md)
+ - [Rect](ts-drawing-components-rect.md)
+ - [Shape](ts-drawing-components-shape.md)
- Canvas Components
- - [Canvas](ts-components-canvas-canvas.md)
- - [CanvasRenderingContext2D](ts-canvasrenderingcontext2d.md)
- - [CanvasGradient](ts-components-canvas-canvasgradient.md)
- - [ImageBitmap](ts-components-canvas-imagebitmap.md)
- - [ImageData](ts-components-canvas-imagedata.md)
- - [OffscreenCanvasRenderingContext2D](ts-offscreencanvasrenderingcontext2d.md)
- - [Path2D](ts-components-canvas-path2d.md)
- - [Lottie](ts-components-canvas-lottie.md)
+ - [Canvas](ts-components-canvas-canvas.md)
+ - [CanvasRenderingContext2D](ts-canvasrenderingcontext2d.md)
+ - [CanvasGradient](ts-components-canvas-canvasgradient.md)
+ - [ImageBitmap](ts-components-canvas-imagebitmap.md)
+ - [ImageData](ts-components-canvas-imagedata.md)
+ - [OffscreenCanvasRenderingContext2D](ts-offscreencanvasrenderingcontext2d.md)
+ - [Path2D](ts-components-canvas-path2d.md)
+ - [Lottie](ts-components-canvas-lottie.md)
- Animation
- [AnimatorProperty](ts-animatorproperty.md)
- [Explicit Animatio](ts-explicit-animation.md)
diff --git a/en/application-dev/reference/arkui-ts/figures/alphabet.gif b/en/application-dev/reference/arkui-ts/figures/alphabet.gif
new file mode 100644
index 0000000000000000000000000000000000000000..5a5a3e4bab1f7f104afd27199125972c6cb611c0
Binary files /dev/null and b/en/application-dev/reference/arkui-ts/figures/alphabet.gif differ
diff --git a/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001174264378.gif b/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001174264378.gif
index cc49b51652e53b6caa3888b054dbea94c2f498eb..35b1bf68c0e0c323eb4c5171be6fbf368c6eb576 100644
Binary files a/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001174264378.gif and b/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001174264378.gif differ
diff --git a/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001189634870.gif b/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001189634870.gif
new file mode 100644
index 0000000000000000000000000000000000000000..cba972ca736015ad30288b21bb8069cb540414c2
Binary files /dev/null and b/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001189634870.gif differ
diff --git a/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001212378392.gif b/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001212378392.gif
deleted file mode 100644
index 438c67b65f13bfcd1ee3eb19e4f0c1265ae16278..0000000000000000000000000000000000000000
Binary files a/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001212378392.gif and /dev/null differ
diff --git a/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001257058403.gif b/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001257058403.gif
deleted file mode 100644
index c7532ed87726ac7591901514a7396b617daa10f0..0000000000000000000000000000000000000000
Binary files a/en/application-dev/reference/arkui-ts/figures/en-us_image_0000001257058403.gif and /dev/null differ
diff --git a/en/application-dev/reference/arkui-ts/figures/relativecontainer.png b/en/application-dev/reference/arkui-ts/figures/relativecontainer.png
index 574fcaa48023d14a579eaa843ebc59f1b961a29f..eff44d4efadaeb8dc94da8d166333c5956878f27 100644
Binary files a/en/application-dev/reference/arkui-ts/figures/relativecontainer.png and b/en/application-dev/reference/arkui-ts/figures/relativecontainer.png differ
diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-image.md b/en/application-dev/reference/arkui-ts/ts-basic-components-image.md
index 4bdc96f244d22a65d2689971492f84103f8f134e..eb5d3e065f671025dbdd28450b53f2fa955996c2 100644
--- a/en/application-dev/reference/arkui-ts/ts-basic-components-image.md
+++ b/en/application-dev/reference/arkui-ts/ts-basic-components-image.md
@@ -27,7 +27,7 @@ Obtains an image from the specified source for subsequent rendering and display.
| Name| Type | Mandatory| Description |
| ------ | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
-| src | string \| [PixelMap](../apis/js-apis-image.md#pixelmap7) \| [Resource](ts-types.md#resource) | Yes | Image source. Both local and online images are supported.
When using an image referenced using a relative path, for example, **Image("common/test.jpg")**, the **\** component cannot be called across bundles or modules. Therefore, you are advised to use **$r** to reference image resources that need to be used globally.
- The following image formats are supported: PNG, JPG, BMP, SVG, GIF.
\- Base64 strings are supported. The value format is data:image/[png\|jpeg\|bmp\|webp];base64,[base64 data], where [base64 data] is a Base64 string.
\- Strings with the **datashare://path** prefix are supported, which are used to access the image path provided by a data ability.
\- Strings with the **file:///data/storage** prefix are supported, which are used to read image resources in the **files** folder in the installation directory of the application. Ensure that the files in the directory package path have the read permission. |
+| src | string \| [PixelMap](../apis/js-apis-image.md#pixelmap7) \| [Resource](ts-types.md#resource) | Yes | Image source. Both local and online images are supported.
When using an image referenced using a relative path, for example, `Image("common/test.jpg")`, the **\** component cannot be called across bundles or modules. Therefore, you are advised to use `$r` to reference image resources that need to be used globally.
- The following image formats are supported: PNG, JPG, BMP, SVG, GIF.
\- Base64 strings are supported. The value format is data:image/[png\|jpeg\|bmp\|webp];base64,[base64 data], where [base64 data] is a Base64 string.
\- Strings with the **datashare://path** prefix are supported, which are used to access the image path provided by a data ability. Before loading images, the application must [request the required permissions](../../file-management/medialibrary-overview.md#requesting-permissions).
\- Strings with the **file:///data/storage** prefix are supported, which are used to read image resources in the **files** folder in the installation directory of the application. Ensure that the files in the directory package path have the read permission.|
## Attributes
@@ -38,7 +38,7 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the
| alt | string \| [Resource](ts-types.md#resource)| Placeholder image displayed during loading. Local images are supported. |
| objectFit | [ImageFit](ts-appendix-enums.md#imagefit) | Image scale mode.
Default value: **ImageFit.Cover** |
| objectRepeat | [ImageRepeat](ts-appendix-enums.md#imagerepeat) | Whether the image is repeated.
Default value: **ImageRepeat.NoRepeat**
**NOTE**
This attribute is not applicable to SVG images.|
-| interpolation | [ImageInterpolation](#imageinterpolation) | Interpolation effect of the image. This attribute is intended to alleviate aliasing that occurs when a low-definition image is zoomed in.
Default value: **ImageInterpolation.None**
**NOTE**
This attribute is not applicable to SVG images and **PixelMap** objects. |
+| interpolation | [ImageInterpolation](#imageinterpolation) | Interpolation effect of the image. This attribute is intended to alleviate aliasing that occurs when a low-definition image is zoomed in.
Default value: **ImageInterpolation.None**
**NOTE**
This attribute is not applicable to SVG images.
This attribute is not applicable to **PixelMap** objects.|
| renderMode | [ImageRenderMode](#imagerendermode) | Rendering mode of the image.
Default value: **ImageRenderMode.Original**
**NOTE**
This attribute is not applicable to SVG images.|
| sourceSize | {
width: number,
height: number
} | Size of the decoded image. The original image is decoded into a **pixelMap** of the specified size, in px.
**NOTE**
This attribute is not applicable to **PixelMap** objects.|
| matchTextDirection | boolean | Whether to display the image in the system language direction. When this parameter is set to true, the image is horizontally flipped in the right-to-left (RTL) language context.
Default value: **false** |
@@ -74,11 +74,11 @@ In addition to the [universal attributes](ts-universal-attributes-size.md), the
In addition to the [universal events](ts-universal-events-click.md), the following events are supported.
-| Name | Description |
+| Name | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ |
-| onComplete(callback: (event?: { width: number, height: number, componentWidth: number,
componentHeight: number, loadingStatus: number }) => void) | Triggered when an image is successfully loaded. The size of the loaded image is returned.
- **width**: width of the image, in pixels.
- **height**: height of the image, in pixels.
- **componentWidth**: width of the container component, in pixels.
- **componentHeight**: height of the container component, in pixels.
- **loadingStatus**: image loading status. |
-| onError(callback: (event?: { componentWidth: number, componentHeight: number , message9+: string }) => void) | Triggered when an exception occurs during image loading.
- **componentWidth**: width of the container component, in pixels.
- **componentHeight**: height of the container component, in pixels. |
-| onFinish(event: () => void) | Triggered when the animation playback in the loaded SVG image is complete. If the animation is an infinite loop, this callback is not triggered. |
+| onComplete(callback: (event?: { width: number, height: number, componentWidth: number,
componentHeight: number, loadingStatus: number }) => void) | Triggered when an image is successfully loaded. The size of the loaded image is returned.
- **width**: width of the image, in pixels.
- **height**: height of the image, in pixels.
- **componentWidth**: width of the container component, in pixels.
- **componentHeight**: height of the container component, in pixels.
- **loadingStatus**: image loading status.
|
+| onError(callback: (event?: { componentWidth: number, componentHeight: number , message9+: string }) => void) | Triggered when an exception occurs during image loading.
- **componentWidth**: width of the container component, in pixels.
- **componentHeight**: height of the container component, in pixels.|
+| onFinish(event: () => void) | Triggered when the animation playback in the loaded SVG image is complete. If the animation is an infinite loop, this callback is not triggered.|
## Example
@@ -161,7 +161,7 @@ The default network timeout period is 5 minutes for loading online images. When
```tsx
// @ts-nocheck
import http from '@ohos.net.http';
-import ResponseCode from '@ohos.net.http';
+import ResponseCode from '@ohos.net.http'
import image from '@ohos.multimedia.image'
@@ -176,7 +176,7 @@ struct Index {
Column({space: 10}) {
Button ("Get Online Image")
.onClick(() => {
- this.httpRequest();
+ this.httpRequest()
})
Image(this.image).height(100).width(100)
}
@@ -187,7 +187,7 @@ struct Index {
// Request an online image.
private httpRequest() {
- let httpRequest = http.createHttp();
+ let httpRequest = http.createHttp()
httpRequest.request(
"https://www.example.com/xxx.png", // Enter a specific URL of the online image.
@@ -207,7 +207,7 @@ struct Index {
this.image = pixelMap
})
} else {
- console.log("response code: " + code);
+ console.log("response code: " + code)
}
}
}
@@ -216,9 +216,9 @@ struct Index {
}
```
-> **NOTE**
->
-> For details about the request mode, timeout, and additional request parameters for loading online images, see [request()](../../reference/apis/js-apis-http.md) in the HTTP module.
+> **NOTE**
+>
+> For details about the request mode, timeout, and additional request parameters for loading online images, see [request()](../../reference/apis/js-apis-http.md) in the HTTP module.
### Setting Attributes
@@ -356,7 +356,7 @@ struct ImageExample3 {
```ts
import fileio from '@ohos.fileio'
-import fs from '@ohos.file.fs';
+import fs from '@ohos.file.fs'
import context from '@ohos.application.context'
@Entry
diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md b/en/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md
index eb276513bad3c1f1f1c911f15f14f5f3c74f7dba..25743606575892d60be19fa31fd0e60055d01fb9 100644
--- a/en/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md
+++ b/en/application-dev/reference/arkui-ts/ts-basic-components-imageanimator.md
@@ -27,7 +27,7 @@ ImageAnimator()
| duration | number | Playback duration, in ms. The default duration is 1000 ms. When the duration is **0**, no image is played. The value change takes effect only at the beginning of the next cycle. When a separate duration is set in **images**, the setting of this attribute is invalid.
Default value: **1000**|
| reverse | boolean | Playback sequence. The value **false** indicates that images are played from the first one to the last one, and **true** indicates that images are played from the last one to the first one.
Default value: **false**|
| fixedSize | boolean | Whether the image size is the same as the component size.
**true**: The image size is the same as the component size. In this case, the width, height, top, and left attributes of the image are invalid.
**false**: The width, height, top, and left attributes of each image must be set separately.
Default value: **true**|
-| preDecode | number | Whether to enable pre-decoding. The default value **0** indicates that pre-decoding is disabled. The value **2** indicates that two images following the currently playing frame will be cached in advance to improve performance.
Default value: **0**|
+| preDecode(deprecated) | number | Number of pre-decoded images. The value **2** indicates that two images following the currently playing page will be pre-decoded to improve performance.
This API is deprecated since API version 9.
Default value: **0**|
| fillMode | [FillMode](ts-appendix-enums.md#fillmode) | Status before and after the animation starts. For details about the options, see **FillMode**.
Default value: **FillMode.Forwards**|
| iterations | number | Number of times that the animation is played. By default, the animation is played once. The value **-1** indicates that the animation is played for an unlimited number of times.
Default value: **1**|
@@ -102,7 +102,7 @@ struct ImageAnimatorExample {
left: 0
}
])
- .state(this.state).reverse(this.reverse).fixedSize(false).preDecode(2)
+ .state(this.state).reverse(this.reverse).fixedSize(false)
.fillMode(FillMode.None).iterations(this.iterations).width(340).height(240)
.margin({ top: 100 })
.onStart(() => {
@@ -119,6 +119,7 @@ struct ImageAnimatorExample {
})
.onFinish(() => {
console.info('Finish')
+ this.state = AnimationStatus.Stopped
})
Row() {
Button('start').width(100).padding(5).onClick(() => {
diff --git a/en/application-dev/reference/arkui-ts/ts-basic-components-xcomponent.md b/en/application-dev/reference/arkui-ts/ts-basic-components-xcomponent.md
index 5430e54558a7cfd30a7bc139820d130316a1ad97..f775992c63793b3f41e30d819fab405be931be90 100644
--- a/en/application-dev/reference/arkui-ts/ts-basic-components-xcomponent.md
+++ b/en/application-dev/reference/arkui-ts/ts-basic-components-xcomponent.md
@@ -6,27 +6,26 @@ The **\** can accept and display the EGL/OpenGL ES and media data in
>
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
-
-
## Child Components
- Child components are not supported when **type** is set to **"surface"**.\
- Since API version 9, child components are supported when **type** is set to **"component"**.
+Child components are not supported when **type** is set to **"surface"**.
+
+Since API version 9, child components are supported when **type** is set to **"component"**.
## APIs
- XComponent(value: {id: string, type: string, libraryname?: string, controller?: XComponentController})
+XComponent(value: {id: string, type: string, libraryname?: string, controller?: XComponentController})
**Parameters**
-| Name | Type | Mandatory | Description |
-| --------- | ------ | ---- | ----- |
-| id | string | Yes | Unique ID of the component. The value can contain a maximum of 128 characters.|
-| type | string | Yes | Type of the component. The options are as follows:
- **"surface"**: The content of the component is displayed individually, without being combined with that of other components. This option is used for displaying EGL/OpenGL ES and media data.
- **"component"**9+: The component becomes a container where non-UI logic can be executed to dynamically load the display content.|
-| libraryname | string | No | Name of the dynamic library generated after compilation at the application native layer. This parameter is valid only when the component type is **"surface"**.|
-| controller | [XComponentcontroller](#xcomponentcontroller) | No | Controller bound to the component, which can be used to invoke the methods of the component. This parameter is valid only when the component type is **"surface"**. |
+| Name | Type | Mandatory | Description |
+| ----------- | ---------------------------------------- | ---- | ---------------------------------------- |
+| id | string | Yes | Unique ID of the component. The value can contain a maximum of 128 characters. |
+| type | string | Yes | Type of the component. The options are as follows:
- **"surface"**: The content of the component is displayed individually, without being combined with that of other components. This option is used for displaying EGL/OpenGL ES and media data.
- **"component"**9+: The component becomes a container where non-UI logic can be executed to dynamically load the display content.|
+| libraryname | string | No | Name of the dynamic library generated after compilation at the application native layer. This parameter is valid only when the component type is **"surface"**.|
+| controller | [XComponentcontroller](#xcomponentcontroller) | No | Controller bound to the component, which can be used to invoke methods of the component. This parameter is valid only when the component type is **"surface"**.|
-> **NOTE**
+> **NOTE**
>
> When **type** is set to **"component"**, the **\** functions as a container, where child components are laid out vertically.
>
@@ -46,7 +45,7 @@ The **\** can accept and display the EGL/OpenGL ES and media data in
## Events
-The following events are supported only when **type** is set to **"surface"**. The [universal events and gestures](./Readme-EN.md) are not supported.
+The following events are supported only when **type** is set to **"surface"**. The [universal events](ts-universal-events-click.md) and [universal gestures](ts-gesture-settings.md) are not supported.
### onLoad
@@ -56,9 +55,9 @@ Triggered when the plug-in is loaded.
**Parameters**
-| Name | Type | Mandatory | Description |
-| ------------- | ------ | ---- | ----------------------- |
-| event | object | No | Context of the **\** object. The APIs contained in the context are defined at the C++ layer by developers.|
+| Name | Type | Mandatory | Description |
+| ----- | ------ | ---- | ---------------------------------------- |
+| event | object | No | Context of the **\** object. The APIs contained in the context are defined at the C++ layer by developers.|
### onDestroy
@@ -99,7 +98,7 @@ Sets the width and height of the surface held by the **\**. This API
**Parameters**
-| Name | Type | Mandatory | Description |
+| Name | Type | Mandatory | Description |
| ------------- | ------ | ---- | ----------------------- |
| surfaceWidth | number | Yes | Width of the surface held by the **\**.|
| surfaceHeight | number | Yes | Height of the surface held by the **\**.|
diff --git a/en/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md b/en/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md
index 1b9fba3579fe3c18a8a7d8225e65bdcc2e3d163c..97b08d90ca88b2cef08ac931cc6a6405c2236dd5 100644
--- a/en/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md
+++ b/en/application-dev/reference/arkui-ts/ts-container-alphabet-indexer.md
@@ -134,7 +134,7 @@ struct AlphabetIndexerSample {
.selectedFont({size: 16, weight: FontWeight.Bolder}) // Font style of the selected text.
.popupFont({ size: 30, weight: FontWeight.Bolder}) // Font style of the pop-up text.
.itemSize(28) // Size of an item in the alphabetic index bar.
- .alignStyle(IndexerAlign.Left) // Position of the pop-up window relative to the center of the indexer bar's top border, which is left in this example.
+ .alignStyle(IndexerAlign.Left) // The pop-up window is displayed on the right of the alphabetic index bar.
.onSelect((index: number) => {
console.info(this.value[index] + ' Selected!')
})
@@ -162,4 +162,4 @@ struct AlphabetIndexerSample {
}
```
-
+
diff --git a/en/application-dev/reference/arkui-ts/ts-container-relativecontainer.md b/en/application-dev/reference/arkui-ts/ts-container-relativecontainer.md
index 06c65aa8f4147948d57226c034da55dd5e1e4840..f0e9f85f122e630c6f73f5443d0d4260abaaf5cf 100644
--- a/en/application-dev/reference/arkui-ts/ts-container-relativecontainer.md
+++ b/en/application-dev/reference/arkui-ts/ts-container-relativecontainer.md
@@ -16,7 +16,7 @@ The **\** component is used for element alignment in complex
* A child component can set the container or another child component as the anchor.
* To show in the **\**, child components must have an ID. The container ID is fixed at **__container__**.
* Three positions of the child component in a direction can use three positions of the container or another child components in the same direction as anchors. If anchors are set for more than two positions in a single direction, the third position is skipped.
- * The child component size set on the frontend page is not affected by the **\** rules.
+ * The child component size set on the frontend page is not affected by the **\** rules. If two or more **alignRules** values are set for one direction of the child component, you are not advised to set the size for this direction.
* If offset is required after the alignment, it can be set through **offset**.
* Exceptions
* When a mutual or circular dependency occurs, none of the child components in the container are drawn.
@@ -39,62 +39,60 @@ RelativeContainer()
struct Index {
build() {
Row() {
- Button("Extra button").width(100).height(50)
RelativeContainer() {
- Button("Button 1")
- .width(120)
- .height(30)
+ Row().width(100).height(100)
+ .backgroundColor("#FF3333")
.alignRules({
- middle: { anchor: "__container__", align: HorizontalAlign.Center },
+ top: {anchor: "__container__", align: VerticalAlign.Top},
+ left: {anchor: "__container__", align: HorizontalAlign.Start}
})
- .id("bt1")
- .borderWidth(1)
- .borderColor(Color.Black)
+ .id("row1")
- Text("This is text 2")
- .fontSize(20)
- .padding(10)
+ Row().width(100).height(100)
+ .backgroundColor("#FFCC00")
.alignRules({
- bottom: { anchor: "__container__", align: VerticalAlign.Bottom },
- top: { anchor: "bt1", align: VerticalAlign.Bottom },
- right: { anchor: "bt1", align: HorizontalAlign.Center }
+ top: {anchor: "__container__", align: VerticalAlign.Top},
+ right: {anchor: "__container__", align: HorizontalAlign.End}
})
- .id("tx2")
- .borderWidth(1)
- .borderColor(Color.Black)
- .height(30)
-
- Button("Button 3")
- .width(100)
- .height(100)
+ .id("row2")
+
+ Row().height(100)
+ .backgroundColor("#FF6633")
.alignRules({
- left: { anchor: "bt1", align: HorizontalAlign.End },
- top: { anchor: "tx2", align: VerticalAlign.Center },
- bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
+ top: {anchor: "row1", align: VerticalAlign.Bottom},
+ left: {anchor: "row1", align: HorizontalAlign.End},
+ right: {anchor: "row2", align: HorizontalAlign.Start}
})
- .id("bt3")
- .borderWidth(1)
- .borderColor(Color.Black)
+ .id("row3")
- Text("This is text 4")
- .fontSize(20)
- .padding(10)
+ Row()
+ .backgroundColor("#FF9966")
.alignRules({
- left: { anchor: "tx2", align: HorizontalAlign.End },
- right: { anchor: "__container__", align: HorizontalAlign.End },
- top: { anchor: "__container__", align: VerticalAlign.Top },
- bottom: { anchor: "bt3", align: VerticalAlign.Top }
+ top: {anchor: "row3", align: VerticalAlign.Bottom},
+ bottom: {anchor: "__container__", align: VerticalAlign.Bottom},
+ left: {anchor: "__container__", align: HorizontalAlign.Start},
+ right: {anchor: "row1", align: HorizontalAlign.End}
})
- .id("tx4")
- .borderWidth(1)
- .borderColor(Color.Black)
+ .id("row4")
+
+ Row()
+ .backgroundColor("#FF66FF")
+ .alignRules({
+ top: {anchor: "row3", align: VerticalAlign.Bottom},
+ bottom: {anchor: "__container__", align: VerticalAlign.Bottom},
+ left: {anchor: "row2", align: HorizontalAlign.Start},
+ right: {anchor: "__container__", align: HorizontalAlign.End}
+ })
+ .id("row5")
}
- .width(200).height(200)
- .backgroundColor(Color.Orange)
+ .width(300).height(300)
+ .margin({left: 100})
+ .border({width:2, color: "#6699FF"})
}
.height('100%')
}
}
+
```

diff --git a/en/application-dev/reference/arkui-ts/ts-explicit-animation.md b/en/application-dev/reference/arkui-ts/ts-explicit-animation.md
index daf2238308091eaab298b7a757f0ef6e844eceb3..b2802444ab2e297ffc599263910afea57fee2465 100644
--- a/en/application-dev/reference/arkui-ts/ts-explicit-animation.md
+++ b/en/application-dev/reference/arkui-ts/ts-explicit-animation.md
@@ -20,7 +20,7 @@ animateTo(value: AnimateParam, event: () => void): void
| -------- | -------- | -------- |
| duration | number | Animation duration, in ms.
Default value: **1000**|
| tempo | number | Animation playback speed. A larger value indicates faster animation playback, and a smaller value indicates slower animation playback. The value **0** means that there is no animation.
Default value: **1.0**|
-| curve | Curve \| Curves | Animation curve.
Default value: **Curve.Linear**|
+| curve | [Curve](ts-appendix-enums.md#curve) \| [ICurve](../apis/js-apis-curve.md#icurve) \| string | Animation curve.
Default value: **Curve.Linear**|
| delay | number | Delay of animation playback, in ms. By default, the playback is not delayed.
Default value: **0**|
| iterations | number | Number of times that the animation is played. By default, the animation is played once. The value **-1** indicates that the animation is played for an unlimited number of times.
Default value: **1**|
| playMode | [PlayMode](ts-appendix-enums.md#playmode) | Animation playback mode. By default, the animation is played from the beginning after the playback is complete.
Default value: **PlayMode.Normal**|
diff --git a/en/application-dev/reference/arkui-ts/ts-pixel-units.md b/en/application-dev/reference/arkui-ts/ts-pixel-units.md
index ecdaffd3f3407f079e1044031caaf43a9d2af843..2256aa963c944561e69ccbf110a656347afd448a 100644
--- a/en/application-dev/reference/arkui-ts/ts-pixel-units.md
+++ b/en/application-dev/reference/arkui-ts/ts-pixel-units.md
@@ -8,7 +8,7 @@ The framework provides four pixel units, with vp as the reference data unit.
| px | Physical pixel unit of the screen. |
| vp | Pixel unit specific to the screen density. Pixels in this unit are converted into physical pixels of the screen based on the screen pixel density. This unit is used for values whose unit is not specified.|
| fp | Font pixel, which is similar to vp and varies according to the system font size. |
-| lpx | Logical pixel unit of the window. It is the ratio of the actual screen width to the logical width (configured by **designWidth**. For example, if **designWidth** is set to **720** (default value), then 1lpx is equal to 2px for a screen with an actual width of 1440 physical pixels.|
+| lpx | Logical pixel unit of the window. It is the ratio of the actual screen width to the logical width (configured by **designWidth**). For example, if **designWidth** is set to **720** (default value), then 1lpx is equal to 2px for a screen with an actual width of 1440 physical pixels. |
## Pixel Unit Conversion
diff --git a/en/application-dev/reference/arkui-ts/ts-universal-component-area-change-event.md b/en/application-dev/reference/arkui-ts/ts-universal-component-area-change-event.md
index 2c8ba7c33a29b398ae2144c6435fe0d6a10671a6..2e0e8610515d57f66aa28d424140c657da95f368 100644
--- a/en/application-dev/reference/arkui-ts/ts-universal-component-area-change-event.md
+++ b/en/application-dev/reference/arkui-ts/ts-universal-component-area-change-event.md
@@ -42,4 +42,4 @@ struct AreaExample {
}
```
-
+
\ No newline at end of file
diff --git a/en/application-dev/reference/js-service-widget-ui/js-service-widget-file.md b/en/application-dev/reference/js-service-widget-ui/js-service-widget-file.md
index f355a8fc938732f1e08b31ef3932d23f363db913..20a8a497c4cd041709840826f689ea52fec4b121 100644
--- a/en/application-dev/reference/js-service-widget-ui/js-service-widget-file.md
+++ b/en/application-dev/reference/js-service-widget-ui/js-service-widget-file.md
@@ -59,6 +59,6 @@ Application resources can be accessed via an absolute or relative path. In this
## Configuration Files
-If you are developing a widget in the FA model, configure the **config.json** file. For details, see [FA Widget Development](../../ability/fa-formability.md#configuring-the-widget-configuration-file).
+If you are developing a widget in the FA model, configure the **config.json** file.
-If you are developing a widget in the stage model, configure **ExtensionAbility** under **extensionAbilities** in the **module.json5** file. For details, see [Stage Widget Development](../../ability/stage-formextension.md#configuring-the-widget-configuration-file).
+If you are developing a widget in the stage model, configure **ExtensionAbility** under **extensionAbilities** in the **module.json5** file.
diff --git a/en/application-dev/reference/js-service-widget-ui/js-service-widget-syntax-hml.md b/en/application-dev/reference/js-service-widget-ui/js-service-widget-syntax-hml.md
index 968ea8493c824313dc3828b99b098ba59031420f..2ebbe2b66d3bc4feac7fb0d090e2833e761f88c9 100644
--- a/en/application-dev/reference/js-service-widget-ui/js-service-widget-syntax-hml.md
+++ b/en/application-dev/reference/js-service-widget-ui/js-service-widget-syntax-hml.md
@@ -99,11 +99,11 @@ You can also implement redirection to the target application using a **want**, w
| Selector | Type | Default Value | Description |
| ------ | ------ | -------- | ---------------------------------------- |
| action | string | "router" | Event type.
- **"router"**: redirection event.
- **"message"**: message event.|
-| want | [Want](../apis/js-apis-application-Want.md) | - | Information about the target application. For details, see the **want** format. |
+| want | [Want](../apis/js-apis-app-ability-want.md) | - | Information about the target application. For details, see the **want** format. |
- ```json
- {
+```json
+ {
"data": {
"mainAbility": "xxx.xxx.xxx"
},
@@ -124,9 +124,9 @@ You can also implement redirection to the target application using a **want**, w
}
}
}
- ```
+```
- In API version 8, the [featureAbility.getWant](../apis/js-apis-featureAbility.md) API in the **onCreate** method of the **app.js** or **app.ets** file must be called for the **want** parameter to receive related parameters.
+ In API version 8, the [featureAbility.getWant](../apis/js-apis-ability-featureAbility.md) API in the **onCreate** method of the **app.js** or **app.ets** file must be called for the **want** parameter to receive related parameters.
- Message event properties
diff --git a/en/application-dev/ui/Readme-EN.md b/en/application-dev/ui/Readme-EN.md
index ee237439f5aa89f964314ac12b31beebf2e1f40c..afd987b1607c3a489c7d686e848e61330e4f7a1f 100644
--- a/en/application-dev/ui/Readme-EN.md
+++ b/en/application-dev/ui/Readme-EN.md
@@ -1,7 +1,7 @@
# UI Development
- [ArkUI Overview](arkui-overview.md)
-- UI Development with eTS-based Declarative Development Paradigm
+- UI Development with ArkTS-based Declarative Development Paradigm
- [Overview](ui-ts-overview.md)
- [Declarative UI Development Guidelines](ui-ts-developing-intro.md)
- Declarative UI Development Examples
diff --git a/en/application-dev/ui/arkui-overview.md b/en/application-dev/ui/arkui-overview.md
index f0ed5147f18a7faa02950f74e866143a21ee9c76..42214f4a140f8aa3d6e0f5de8cd44e58d949f3c8 100644
--- a/en/application-dev/ui/arkui-overview.md
+++ b/en/application-dev/ui/arkui-overview.md
@@ -27,7 +27,7 @@ ArkUI is a UI development framework for building OpenHarmony applications. It pr
| Development Paradigm | Description | Applicable To | Target Audience |
| -------- | ---------------------------------------- | ---------------- | ------------------- |
| Declarative development paradigm | Uses [ArkTS](../quick-start/arkts-get-started.md) – a superset of TypeScript with declarative UI syntax, providing UI drawing capabilities from three dimensions: component, animation, and status management. The programming mode used is closer to natural semantics. You can intuitively describe the UI without caring about how the framework implements UI drawing and rendering, leading to simplified and efficient development.| Applications involving technological sophistication and teamwork| Mobile application and system application developers|
- | Web-like development paradigm| Uses the classical three-stage programming model, in which OpenHarmony Markup Language (HML) is used for building layouts, CSS for defining styles, and JS for adding processing logic. UI components are associated with data through one-way data-binding. This means that when data changes, the UI automatically refreshes with the new data. This development paradigm has a low learning curve for frontend web developers, allowing them to quickly transform existing web applications into ArkUI applications.| Small- and medium-sized applications and service widgets with simple UIs | Frontend web developers |
+ | Web-like development paradigm| Uses the classical three-stage programming model, in which OpenHarmony Markup Language (HML) is used for building layouts, CSS for defining styles, and JS for adding processing logic. UI components are associated with data through one-way data-binding. This means that when data changes, the UI automatically refreshes with the new data. This development paradigm has a low learning curve for frontend web developers, allowing them to quickly transform existing web applications into ArkUI applications.| Small- and medium-sized applications and service widgets with simple UIs | Frontend web developers |
## Framework Structure
@@ -37,22 +37,22 @@ As shown above, the two development paradigms share the UI backend engine and la
## Relationship Between UI and Ability Framework
-Ability is an essential part of OpenHarmony applications. The [ability framework](../ability/ability-brief.md) provides two models: Feature Ability (FA) model and stage model. The table below describes the relationship between the two models of the ability framework and the two development paradigms of ArkUI.
+OpenHarmony provides two application models: FA model and stage model. The table below describes the relationship between these two models and the two development paradigms of ArkUI.
**FA Model**
-| Type| UI Development Paradigm | Description|
-| -------- | --------------------------- | --------------------------- |
-| Application| Web-like development paradigm| UI development: HML, CSS, and JS
Service entries: files with fixed file names, which are **app.ets** (Page ability), **service.ts** (Service ability), and **data.ts** (Data ability)
Service logic: JS and TS|
-| | Declarative development paradigm| UI development: ArkTS
Service entries: files with fixed file names, which are **app.ets** (Page ability), **service.ts** (Service ability), and **data.ts** (Data ability)
Service logic: JS and TS|
+| Type | UI Development Paradigm | Description |
+| ---- | -------- | ---------------------------------------- |
+| Application | Web-like development paradigm| UI development: HML, CSS, and JS
Service entries: files with fixed file names, which are **app.ets** (Page ability), **service.ts** (Service ability), and **data.ts** (Data ability)
Service logic: JS and TS|
+| | Declarative development paradigm | UI development: ArkTS
Service entries: files with fixed file names, which are **app.ets** (Page ability), **service.ts** (Service ability), and **data.ts** (Data ability)
Service logic: JS and TS|
| Service widget| Web-like development paradigm| UI development: HML, CSS, and JSON (action)
Service entry: **form.ts**
Service logic: JS and TS|
-| | Declarative development paradigm| Not supported currently|
+| | Declarative development paradigm | Not supported currently |
**Stage Model**
-| Type| UI Development Paradigm | Description|
-| -------- | --------------------------- | --------------------------- |
-| Application| Web-like development paradigm| Not supported currently|
-| | Declarative development paradigm| UI development: ArkTS
Service entries: derived from **ohos.application.Ability**/**ExtensionAbility**
Service logic: TS|
+| Type | UI Development Paradigm | Description |
+| ---- | -------- | ---------------------------------------- |
+| Application | Web-like development paradigm| Not supported currently |
+| | Declarative development paradigm | UI development: ArkTS
Service entries: derived from **ohos.application.Ability**/**ExtensionAbility**
Service logic: TS|
| Service widget| Web-like development paradigm| UI development: HML, CSS, and JSON (action)
Service entries: derived from **FormExtensionAbility**
Service logic: TS|
-| | Declarative development paradigm| Not supported currently|
+| | Declarative development paradigm | Not supported currently |
diff --git a/en/application-dev/ui/js-framework-file.md b/en/application-dev/ui/js-framework-file.md
index 1f69d6c4ea38e7656480ff571649fdf38382d3e5..a2ea27c32aa427546be078b3f20688da9683f145 100644
--- a/en/application-dev/ui/js-framework-file.md
+++ b/en/application-dev/ui/js-framework-file.md
@@ -28,7 +28,7 @@ Functions of the folders are as follows:
>**NOTE**
>
->- Reserved folders \(**i18n** and **resources**\) cannot be renamed.
+>- The **i18n** and **resources** folders cannot be renamed.
>- If the same resource name and directory are used under the share directory and the instance \(**default**\) directory, the resource in the instance directory will be used when you reference the directory.
>- The **share** directory does not support **i18n**.
>- You should create the optional folders \(shown in the directory structure\) as needed after you create the project in DevEco Studio.
diff --git a/en/application-dev/ui/js-framework-multiple-languages.md b/en/application-dev/ui/js-framework-multiple-languages.md
index 49edf2d3336ed95250e5d695d9eba7275351debb..8fd28f736b4a33b46a77070bea3d437f47dd07e8 100644
--- a/en/application-dev/ui/js-framework-multiple-languages.md
+++ b/en/application-dev/ui/js-framework-multiple-languages.md
@@ -9,7 +9,7 @@ You only need to perform operations in [Resource Files](#resource-files) and [Re
## Resource Files
-Resource files store application content in multiple languages. This framework uses JSON files to store resource definitions. Place the resource file of each locale in the i18n directory described in [File Organization](../ui/js-framework-file.md).
+Resource files store application content in multiple languages. This framework uses JSON files to store resource definitions. Place the resource file of each locale in the i18n directory described in [File Organization](js-framework-file.md).
Resource files should be named in _language-script-region_.json format. For example, the resource file for Hong Kong(China) in the traditional script is named zh-Hant-HK. You can omit the region, for example, zh-CN for simplified Chinese, or omit both the script and region, for example, zh for Chinese.
@@ -191,4 +191,4 @@ Table 3 $t function parameters
## Language Acquisition
-For details about how to obtain the language, see [Configuration](../reference/apis/js-apis-configuration.md).
+For details about how to obtain the language, see [Configuration](../reference/apis/js-apis-application-configuration.md).
\ No newline at end of file
diff --git a/en/application-dev/ui/ui-ts-creating-simple-page.md b/en/application-dev/ui/ui-ts-creating-simple-page.md
index d02b74638768c4e61b2355118eedb7cc46358b50..b33ed86346a2c88acace5e6992f75ac99afb9596 100644
--- a/en/application-dev/ui/ui-ts-creating-simple-page.md
+++ b/en/application-dev/ui/ui-ts-creating-simple-page.md
@@ -28,9 +28,8 @@ Before creating a page, create an ArkTS project. For details, see [Creating an A

2. Display food pictures.
-
Create an **\** component and specify a URL for it. To display the **\** component above the **\** component, declare the **\** component first. Image resources are stored in the **rawfile** folder in **resources**. When referencing the resources in the **rawfile** folder, use the `$rawfile('filename')` format, where **filename** indicates the relative path of the file in the **rawfile** folder. `$rawfile` only allows the **\** component to reference image resources.
-
+
```ts
@Entry
@Component
@@ -50,11 +49,10 @@ Before creating a page, create an ArkTS project. For details, see [Creating an A

3. Access images through resources.
-
In addition to specifying the image path, you can also use the media resource symbol **$r** to reference resources based on the resource qualifier rules in the **resources** folder. Right-click the **resources** folder, choose **New** > **Resource Directory** from the shortcut menu, and set **Resource Type** to **Media** (image resource).
-
+
Place **Tomato.png** in the **media** folder. You can then reference the application resources in the `$r('app.type.name')` format, which is `$r('app.media.Tomato')` in this example.
-
+
```ts
@Entry
@Component
@@ -71,11 +69,9 @@ Before creating a page, create an ArkTS project. For details, see [Creating an A
}
}
```
-
-4. Set the width and height of the image, and set the **objectFit** attribute of the image to **ImageFit.Contain**, which means to keep the aspect ratio of the image to ensure that the image is completely displayed within the boundary.
+4. Set the width and height of the image, and set the **objectFit** attribute of the image to **ImageFit.Contain**, which means to keep the aspect ratio of the image to ensure that the image is completely displayed within the boundary.
If the image fills the entire screen, the possible causes are as follows:
-
1. The width and height of the image are not set.
2. The default attribute of **objectFit** of the image is **ImageFit.Cover**, that is, the image is zoomed in or zoomed out to fill the entire display boundary with the aspect ratio locked.
@@ -315,9 +311,8 @@ Use the **Flex** layout to build a food composition table. In this way, cell siz

4. Create the **Nutrient** class in a similar process. **Nutrition** consists of four parts: **Protein**, **Fat**, **Carbohydrates**, and **VitaminC**. The names of the last three parts are omitted in the table and represented by spaces.
-
Set **FlexDirection.Column**, **FlexAlign.SpaceBetween**, and **ItemAlign.Start**.
-
+
```ts
@Component
struct ContentTable {
@@ -411,15 +406,17 @@ Use the **Flex** layout to build a food composition table. In this way, cell siz
}
}
```
+
+ 
5. Use the custom constructor **\@Builder** to simplify the code. It can be found that the food groups in each food composition table are actually of the same UI structure.
-
- 
-
- Currently, all food groups are declared, resulting in code duplication and redundancy. You can use **\@Builder** to build a custom method and abstract the same UI structure declaration. The **\@Builder** decorated method and the **build** method for the **@Component** decorated component are used to declare some UI rendering structures and comply with the same ArkTS syntax. You can define one or more methods decorated by **\@Builder**, but a component decorated by **@Component** can have only one **build** method.
-
- Declare the **IngredientItem** method decorated by **\@Builder** in **ContentTable** to declare the UI descriptions for the category name, content name, and content value.
-
+
+ 
+
+Currently, all food groups are declared, resulting in code duplication and redundancy. You can use **\@Builder** to build a custom method and abstract the same UI structure declaration. The **\@Builder** decorated method and the **build** method for the **@Component** decorated component are used to declare some UI rendering structures and comply with the same ArkTS syntax. You can define one or more methods decorated by **\@Builder**, but a component decorated by **@Component** can have only one **build** method.
+
+Declare the **IngredientItem** method decorated by **\@Builder** in **ContentTable** to declare the UI descriptions for the category name, content name, and content value.
+
```ts
@Component
struct ContentTable {
@@ -441,9 +438,9 @@ Use the **Flex** layout to build a food composition table. In this way, cell siz
}
}
```
-
- When the **IngredientItem** API is called in the **build** method of **ContentTable**, **this** needs to be used to invoke the method in the scope of the component to distinguish the global method call.
-
+
+When the **IngredientItem** API is called in the **build** method of **ContentTable**, **this** needs to be used to invoke the method in the scope of the component to distinguish the global method call.
+
```ts
@Component
struct ContentTable {
@@ -461,9 +458,9 @@ Use the **Flex** layout to build a food composition table. In this way, cell siz
}
}
```
-
- The overall code of the **ContentTable** component is as follows:
-
+
+The overall code of the **ContentTable** component is as follows:
+
```ts
@Component
struct ContentTable {
@@ -509,7 +506,7 @@ Use the **Flex** layout to build a food composition table. In this way, cell siz
}
}
```
-
- 
+
+ 
You've learned how to build a simple food details page. Read on to learn how to define the page layout and connection.
diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-ability-wantConstant.md b/zh-cn/application-dev/reference/apis/js-apis-app-ability-wantConstant.md
index 2e1ae34b79b98cff1b9d24f7e54e13af36fb86c4..de78f53fb4a00138ca88cf8ff0ae5e95a05e3810 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-app-ability-wantConstant.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-app-ability-wantConstant.md
@@ -79,17 +79,4 @@ Flags说明。用于表示处理Want的方式。
| ------------------------------------ | ---------- | ------------------------------------------------------------ |
| 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上可能持久化的授权。
**系统API**: 此接口为系统接口,三方应用不支持调用。 |
-| FLAG_AUTH_PREFIX_URI_PERMISSION | 0x00000080 | 按照前缀匹配的方式验证URI权限。
**系统API**: 此接口为系统接口,三方应用不支持调用。 |
-| FLAG_ABILITYSLICE_MULTI_DEVICE | 0x00000100 | 支持分布式调度系统中的多设备启动。 |
-| FLAG_START_FOREGROUND_ABILITY | 0x00000200 | 指示无论主机应用程序是否已启动,都将启动使用服务模板的功能。 |
-| FLAG_ABILITY_CONTINUATION_REVERSIBLE | 0x00000400 | 表示迁移是可拉回的。
**系统API**: 此接口为系统接口,三方应用不支持调用。 |
-| 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_MISSION_TOP | 0x20000000 | 指示如果启动能力的现有实例已位于任务堆栈的顶部,则将重用该实例。否则,将创建一个新的能力实例。 |
\ No newline at end of file
+| FLAG_INSTALL_ON_DEMAND | 0x00000800 | 如果未安装指定的功能,请安装该功能。 |
\ No newline at end of file
diff --git a/zh-cn/application-dev/reference/apis/js-apis-app-form-formExtensionAbility.md b/zh-cn/application-dev/reference/apis/js-apis-app-form-formExtensionAbility.md
index 8159563dcaef3257e6155125ef9e42bfc8395853..cda81f2471f4b2fce291d5dbff57899c8d2c60ac 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-app-form-formExtensionAbility.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-app-form-formExtensionAbility.md
@@ -90,7 +90,7 @@ export default class MyFormExtensionAbility extends FormExtensionAbility {
onUpdateForm(formId: string): void
-卡片提供方接收更新卡片的通知接口。获取最新数据后调用[FormExtensionContext](js-apis-inner-application-formExtensionContext.md)的updateForm接口刷新卡片数据。
+卡片提供方接收更新卡片的通知接口。获取最新数据后调用formProvider的[updateForm](js-apis-app-form-formProvider.md#updateform)接口刷新卡片数据。
**系统能力**:SystemCapability.Ability.Form
diff --git a/zh-cn/application-dev/reference/apis/js-apis-buffer.md b/zh-cn/application-dev/reference/apis/js-apis-buffer.md
index 3395c225e3a01019355c7a1680387e189886ba9d..bb380a0d3ce4f09730b869af0cb9a5d1f88db939 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-buffer.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-buffer.md
@@ -34,36 +34,6 @@ import buffer from '@ohos.buffer';
| 'binary' | 表示二进制格式,不区分大小写。 |
| 'hex' | 表示十六进制格式,不区分大小写。 |
-## 属性
-
-**系统能力:** SystemCapability.Utils.Lang
-
-| 名称 | 类型 | 可读 | 可写 | 说明 |
-| -------- | -------- | -------- | -------- | -------- |
-| length | number | 是 | 否 | Buffer对象的字节长度。 |
-| buffer | ArrayBuffer | 是 | 否 | ArrayBuffer对象。 |
-| byteOffset | number | 是 | 否 | 当前Buffer所在内存池的偏移量。 |
-
-**错误码:**
-
-以下错误码的详细介绍请参见[语言基础类库错误码](../errorcodes/errorcode-utils.md)。
-
-| 错误码ID | 错误信息 |
-| -------- | -------- |
-| 10200013 | Cannot set property ${propertyName} of Buffer which has only a getter. |
-
-**示例:**
-
-```ts
-import buffer from '@ohos.buffer';
-
-let buf = buffer.from("1236");
-console.log(JSON.stringify(buf.length));
-let arrayBuffer = buf.buffer;
-console.log(JSON.stringify(new Uint8Array(arrayBuffer)));
-console.log(JSON.stringify(buf.byteOffset));
-```
-
## buffer.alloc
alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer
@@ -101,7 +71,7 @@ let buf3 = buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
allocUninitializedFromPool(size: number): Buffer
创建指定大小未被初始化的Buffer对象。内存从缓冲池分配。
-创建的Buffer的内容未知,需要使用[buffer.fill](#bufferfill)函数来初始化Buffer对象。
+创建的Buffer的内容未知,需要使用[fill](#fill)函数来初始化Buffer对象。
**系统能力:** SystemCapability.Utils.Lang
@@ -131,7 +101,7 @@ buf.fill(0);
allocUninitialized(size: number): Buffer
创建指定大小未被初始化的Buffer实例。内存不从缓冲池分配。
-创建的Buffer的内容未知,需要使用[buffer.fill](#bufferfill)函数来初始化Buffer对象。
+创建的Buffer的内容未知,需要使用[fill](#fill)函数来初始化Buffer对象。
**系统能力:** SystemCapability.Utils.Lang
@@ -418,7 +388,7 @@ let buf1 = buffer.from('this is a test');
let buf2 = buffer.from('7468697320697320612074c3a97374', 'hex');
console.log(buf1.toString()); // 打印: this is a test
-console.log(buf2.toString());
+console.log(buf2.toString()); // 打印: this is a test
```
@@ -485,7 +455,71 @@ console.log(buffer.isEncoding('utf/8').toString()); // 打印: false
console.log(buffer.isEncoding('').toString()); // 打印: false
```
-## buffer.compare
+## buffer.transcode
+
+transcode(source: Buffer | Uint8Array, fromEnc: string, toEnc: string): Buffer
+
+将给定的Buffer或Uint8Array对象从一种字符编码重新编码为另一种。
+
+**系统能力:** SystemCapability.Utils.Lang
+
+**参数:**
+
+| 参数名 | 类型 | 必填 | 说明 |
+| -------- | -------- | -------- | -------- |
+| source | Buffer \| Uint8Array | 是 | 实例对象。 |
+| fromEnc | string | 是 | 当前编码。 |
+| toEnc | string | 是 | 目标编码。 |
+
+**返回值:**
+
+| 类型 | 说明 |
+| -------- | -------- |
+| Buffer | 根据当前编码转换成目标编码,并返回一个新的buffer实例。 |
+
+**示例:**
+
+```ts
+import buffer from '@ohos.buffer';
+
+let buf = buffer.alloc(50);
+let newBuf = buffer.transcode(buffer.from('€'), 'utf-8', 'ascii');
+console.log(newBuf.toString('ascii'));
+```
+
+## Buffer
+
+### 属性
+
+**系统能力:** SystemCapability.Utils.Lang
+
+| 名称 | 类型 | 可读 | 可写 | 说明 |
+| -------- | -------- | -------- | -------- | -------- |
+| length | number | 是 | 否 | Buffer对象的字节长度。 |
+| buffer | ArrayBuffer | 是 | 否 | ArrayBuffer对象。 |
+| byteOffset | number | 是 | 否 | 当前Buffer所在内存池的偏移量。 |
+
+**错误码:**
+
+以下错误码的详细介绍请参见[语言基础类库错误码](../errorcodes/errorcode-utils.md)。
+
+| 错误码ID | 错误信息 |
+| -------- | -------- |
+| 10200013 | Cannot set property ${propertyName} of Buffer which has only a getter. |
+
+**示例:**
+
+```ts
+import buffer from '@ohos.buffer';
+
+let buf = buffer.from("1236");
+console.log(JSON.stringify(buf.length));
+let arrayBuffer = buf.buffer;
+console.log(JSON.stringify(new Uint8Array(arrayBuffer)));
+console.log(JSON.stringify(buf.byteOffset));
+```
+
+### compare
compare(target: Buffer | Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): -1 | 0 | 1
@@ -530,7 +564,7 @@ console.log(buf1.compare(buf2, 0, 6, 4).toString()); // 打印: -1
console.log(buf1.compare(buf2, 5, 6, 5).toString()); // 打印: 1
```
-## buffer.copy
+### copy
copy(target: Buffer| Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number
@@ -578,7 +612,7 @@ console.log(buf2.toString('ascii', 0, 25));
// 打印: !!!!!!!!qrst!!!!!!!!!!!!!
```
-## buffer.entries
+### entries
entries(): IterableIterator<[number, number]>
@@ -604,7 +638,7 @@ for (let pair of buf.entries()) {
}
```
-## buffer.equals
+### equals
equals(otherBuffer: Uint8Array | Buffer): boolean
@@ -637,7 +671,7 @@ console.log(buf1.equals(buf2).toString()); // 打印: true
console.log(buf1.equals(buf3).toString()); // 打印: false
```
-## buffer.fill
+### fill
fill(value: string | Buffer | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): Buffer
@@ -678,7 +712,7 @@ console.log(b.toString());
```
-## buffer.includes
+### includes
includes(value: string | number | Buffer | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): boolean
@@ -710,7 +744,7 @@ console.log(buf.includes('this').toString()); // 打印: true
console.log(buf.includes('be').toString()); // 打印: false
```
-## buffer.indexOf
+### indexOf
indexOf(value: string | number | Buffer | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number
@@ -742,7 +776,7 @@ console.log(buf.indexOf('this').toString()); // 打印: 0
console.log(buf.indexOf('is').toString()); // 打印: 2
```
-## buffer.keys
+### keys
keys(): IterableIterator<number>
@@ -767,7 +801,7 @@ for (const key of buf.keys()) {
}
```
-## buffer.lastIndexOf
+### lastIndexOf
lastIndexOf(value: string | number | Buffer | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number
@@ -800,7 +834,7 @@ console.log(buf.lastIndexOf('buffer').toString()); // 打印: 17
```
-## buffer.readBigInt64BE
+### readBigInt64BE
readBigInt64BE(offset?: number): bigint
@@ -841,7 +875,7 @@ let buf1 = buffer.allocUninitializedFromPool(8);
buf1.writeBigInt64BE(0x0102030405060708n, 0);
```
-## buffer.readBigInt64LE
+### readBigInt64LE
readBigInt64LE(offset?: number): bigint
@@ -882,7 +916,7 @@ let buf1 = buffer.allocUninitializedFromPool(8);
buf1.writeBigInt64BE(0x0102030405060708n, 0);
```
-## buffer.readBigUInt64BE
+### readBigUInt64BE
readBigUInt64BE(offset?: number): bigint
@@ -923,7 +957,7 @@ let buf1 = buffer.allocUninitializedFromPool(8);
buf1.writeBigUInt64BE(0xdecafafecacefaden, 0);
```
-## buffer.readBigUInt64LE
+### readBigUInt64LE
readBigUInt64LE(offset?: number): bigint
@@ -964,7 +998,7 @@ let buf1 = buffer.allocUninitializedFromPool(8);
buf1.writeBigUInt64BE(0xdecafafecacefaden, 0);
```
-## buffer.readDoubleBE
+### readDoubleBE
readDoubleBE(offset?: number): number
@@ -1004,7 +1038,7 @@ let buf1 = buffer.allocUninitializedFromPool(8);
buf1.writeDoubleBE(123.456, 0);
```
-## buffer.readDoubleLE
+### readDoubleLE
readDoubleLE(offset?: number): number
@@ -1044,7 +1078,7 @@ let buf1 = buffer.allocUninitializedFromPool(8);
buf1.writeDoubleLE(123.456, 0);
```
-## buffer.readFloatBE
+### readFloatBE
readFloatBE(offset?: number): number
@@ -1084,7 +1118,7 @@ let buf1 = buffer.allocUninitializedFromPool(4);
buf1.writeFloatBE(0xcabcbcbc, 0);
```
-## buffer.readFloatLE
+### readFloatLE
readFloatLE(offset?: number): number
@@ -1124,7 +1158,7 @@ let buf1 = buffer.allocUninitializedFromPool(4);
buf1.writeFloatLE(0xcabcbcbc, 0);
```
-## buffer.readInt8
+### readInt8
readInt8(offset?: number): number
@@ -1165,7 +1199,7 @@ let buf1 = buffer.allocUninitializedFromPool(2);
buf1.writeInt8(0x12);
```
-## buffer.readInt16BE
+### readInt16BE
readInt16BE(offset?: number): number
@@ -1205,7 +1239,7 @@ let buf1 = buffer.alloc(2);
buf1.writeInt16BE(0x1234, 0);
```
-## buffer.readInt16LE
+### readInt16LE
readInt16LE(offset?: number): number
@@ -1245,7 +1279,7 @@ let buf1 = buffer.alloc(2);
buf1.writeInt16BE(0x1234, 0);
```
-## buffer.readInt32BE
+### readInt32BE
readInt32BE(offset?: number): number
@@ -1285,7 +1319,7 @@ let buf1 = buffer.alloc(4);
buf1.writeInt32BE(0x12345678, 0);
```
-## buffer.readInt32LE
+### readInt32LE
readInt32LE(offset?: number): number
@@ -1325,7 +1359,7 @@ let buf1 = buffer.alloc(4);
buf1.writeInt32BE(0x12345678, 0);
```
-## buffer.readIntBE
+### readIntBE
readIntBE(offset: number, byteLength: number): number
@@ -1369,7 +1403,7 @@ buf1.writeIntBE(0x123456789011, 0, 6);
```
-## buffer.readIntLE
+### readIntLE
readIntLE(offset: number, byteLength: number): number
@@ -1411,7 +1445,7 @@ let buf1 = buffer.allocUninitializedFromPool(6);
buf1.writeIntLE(0x123456789011, 0, 6);
```
-## buffer.readUInt8
+### readUInt8
readUInt8(offset?: number): number
@@ -1453,7 +1487,7 @@ let buf1 = buffer.allocUninitializedFromPool(4);
buf1.writeUInt8(0x42);
```
-## buffer.readUInt16BE
+### readUInt16BE
readUInt16BE(offset?: number): number
@@ -1495,7 +1529,7 @@ let buf1 = buffer.allocUninitializedFromPool(4);
buf1.writeUInt16BE(0x1234, 0);
```
-## buffer.readUInt16LE
+### readUInt16LE
readUInt16LE(offset?: number): number
@@ -1537,7 +1571,7 @@ let buf1 = buffer.allocUninitializedFromPool(4);
buf1.writeUInt16LE(0x1234, 0);
```
-## buffer.readUInt32BE
+### readUInt32BE
readUInt32BE(offset?: number): number
@@ -1578,7 +1612,7 @@ let buf1 = buffer.allocUninitializedFromPool(4);
buf1.writeUInt32BE(0x12345678, 0);
```
-## buffer.readUInt32LE
+### readUInt32LE
readUInt32LE(offset?: number): number
@@ -1619,7 +1653,7 @@ let buf1 = buffer.allocUninitializedFromPool(4);
buf1.writeUInt32LE(0x12345678, 0);
```
-## buffer.readUIntBE
+### readUIntBE
readUIntBE(offset: number, byteLength: number): number
@@ -1661,7 +1695,7 @@ let buf1 = buffer.allocUninitializedFromPool(4);
buf1.writeUIntBE(0x13141516, 0, 4);
```
-## buffer.readUIntLE
+### readUIntLE
readUIntLE(offset: number, byteLength: number): number
@@ -1703,7 +1737,7 @@ let buf1 = buffer.allocUninitializedFromPool(4);
buf1.writeUIntLE(0x13141516, 0, 4);
```
-## buffer.subarray
+### subarray
subarray(start?: number, end?: number): Buffer
@@ -1739,7 +1773,7 @@ console.log(buf2.toString('ascii', 0, buf2.length));
// 打印: abc
```
-## buffer.swap16
+### swap16
swap16(): Buffer
@@ -1774,7 +1808,7 @@ buf1.swap16();
console.log(buf1.toString('hex')); // 打印: 0201040306050807
```
-## buffer.swap32
+### swap32
swap32(): Buffer
@@ -1809,7 +1843,7 @@ buf1.swap32();
console.log(buf1.toString('hex')); // 打印: 0403020108070605
```
-## buffer.swap64
+### swap64
swap64(): Buffer
@@ -1843,7 +1877,7 @@ buf1.swap64();
console.log(buf1.toString('hex')); // 打印: 0807060504030201
```
-## buffer.toJSON
+### toJSON
toJSON(): Object
@@ -1869,7 +1903,7 @@ console.log(JSON.stringify(obj))
// 打印: {"type":"Buffer","data":[1,2,3,4,5]}
```
-## buffer.toString
+### toString
toString(encoding?: string, start?: number, end?: number): string
@@ -1904,7 +1938,7 @@ console.log(buf1.toString('utf-8'));
// 打印: abcdefghijklmnopqrstuvwxyz
```
-## buffer.values
+### values
values(): IterableIterator<number>
@@ -1929,7 +1963,7 @@ for (let value of buf1.values()) {
}
```
-## buffer.write
+### write
write(str: string, offset?: number, length?: number, encoding?: string): number
@@ -1975,7 +2009,7 @@ let buffer1 = buffer.alloc(10);
let length = buffer1.write('abcd', 8);
```
-## buffer.writeBigInt64BE
+### writeBigInt64BE
writeBigInt64BE(value: bigint, offset?: number): number
@@ -2014,7 +2048,7 @@ let buf = buffer.allocUninitializedFromPool(8);
buf.writeBigInt64BE(0x0102030405060708n, 0);
```
-## buffer.writeBigInt64LE
+### writeBigInt64LE
writeBigInt64LE(value: bigint, offset?: number): number
@@ -2053,7 +2087,7 @@ let buf = buffer.allocUninitializedFromPool(8);
buf.writeBigInt64LE(0x0102030405060708n, 0);
```
-## buffer.writeBigUInt64BE
+### writeBigUInt64BE
writeBigUInt64BE(value: bigint, offset?: number): number
@@ -2092,7 +2126,7 @@ let buf = buffer.allocUninitializedFromPool(8);
buf.writeBigUInt64BE(0xdecafafecacefaden, 0);
```
-## buffer.writeBigUInt64LE
+### writeBigUInt64LE
writeBigUInt64LE(value: bigint, offset?: number): number
@@ -2131,7 +2165,7 @@ let buf = buffer.allocUninitializedFromPool(8);
buf.writeBigUInt64LE(0xdecafafecacefaden, 0);
```
-## buffer.writeDoubleBE
+### writeDoubleBE
writeDoubleBE(value: number, offset?: number): number
@@ -2170,7 +2204,7 @@ let buf = buffer.allocUninitializedFromPool(8);
buf.writeDoubleBE(123.456, 0);
```
-## buffer.writeDoubleLE
+### writeDoubleLE
writeDoubleLE(value: number, offset?: number): number
@@ -2209,7 +2243,7 @@ let buf = buffer.allocUninitializedFromPool(8);
buf.writeDoubleLE(123.456, 0);
```
-## buffer.writeFloatBE
+### writeFloatBE
writeFloatBE(value: number, offset?: number): number
@@ -2249,7 +2283,7 @@ buf.writeFloatBE(0xcafebabe, 0);
```
-## buffer.writeFloatLE
+### writeFloatLE
writeFloatLE(value: number, offset?: number): number
@@ -2288,7 +2322,7 @@ let buf = buffer.allocUninitializedFromPool(8);
buf.writeFloatLE(0xcafebabe, 0);
```
-## buffer.writeInt8
+### writeInt8
writeInt8(value: number, offset?: number): number
@@ -2329,7 +2363,7 @@ buf.writeInt8(-2, 1);
```
-## buffer.writeInt16BE
+### writeInt16BE
writeInt16BE(value: number, offset?: number): number
@@ -2369,7 +2403,7 @@ buf.writeInt16BE(0x0102, 0);
```
-## buffer.writeInt16LE
+### writeInt16LE
writeInt16LE(value: number, offset?: number): number
@@ -2408,7 +2442,7 @@ let buf = buffer.allocUninitializedFromPool(2);
buf.writeInt16LE(0x0304, 0);
```
-## buffer.writeInt32BE
+### writeInt32BE
writeInt32BE(value: number, offset?: number): number
@@ -2448,7 +2482,7 @@ buf.writeInt32BE(0x01020304, 0);
```
-## buffer.writeInt32LE
+### writeInt32LE
writeInt32LE(value: number, offset?: number): number
@@ -2487,7 +2521,7 @@ let buf = buffer.allocUninitializedFromPool(4);
buf.writeInt32LE(0x05060708, 0);
```
-## buffer.writeIntBE
+### writeIntBE
writeIntBE(value: number, offset: number, byteLength: number): number
@@ -2528,7 +2562,7 @@ buf.writeIntBE(0x1234567890ab, 0, 6);
```
-## buffer.writeIntLE
+### writeIntLE
writeIntLE(value: number, offset: number, byteLength: number): number
@@ -2568,7 +2602,7 @@ let buf = buffer.allocUninitializedFromPool(6);
buf.writeIntLE(0x1234567890ab, 0, 6);
```
-## buffer.writeUInt8
+### writeUInt8
writeUInt8(value: number, offset?: number): number
@@ -2610,7 +2644,7 @@ buf.writeUInt8(0x23, 2);
buf.writeUInt8(0x42, 3);
```
-## buffer.writeUInt16BE
+### writeUInt16BE
writeUInt16BE(value: number, offset?: number): number
@@ -2650,7 +2684,7 @@ buf.writeUInt16BE(0xdead, 0);
buf.writeUInt16BE(0xbeef, 2);
```
-## buffer.writeUInt16LE
+### writeUInt16LE
writeUInt16LE(value: number, offset?: number): number
@@ -2690,7 +2724,7 @@ buf.writeUInt16LE(0xdead, 0);
buf.writeUInt16LE(0xbeef, 2);
```
-## buffer.writeUInt32BE
+### writeUInt32BE
writeUInt32BE(value: number, offset?: number): number
@@ -2729,7 +2763,7 @@ let buf = buffer.allocUninitializedFromPool(4);
buf.writeUInt32BE(0xfeedface, 0);
```
-## buffer.writeUInt32LE
+### writeUInt32LE
writeUInt32LE(value: number, offset?: number): number
@@ -2768,7 +2802,7 @@ let buf = buffer.allocUninitializedFromPool(4);
buf.writeUInt32LE(0xfeedface, 0);
```
-## buffer.writeUIntBE
+### writeUIntBE
writeUIntBE(value: number, offset: number, byteLength: number): number
@@ -2808,7 +2842,7 @@ let buf = buffer.allocUninitializedFromPool(6);
buf.writeUIntBE(0x1234567890ab, 0, 6);
```
-## buffer.writeUIntLE
+### writeUIntLE
writeUIntLE(value: number, offset: number, byteLength: number): number
@@ -2848,38 +2882,6 @@ let buf = buffer.allocUninitializedFromPool(6);
buf.writeUIntLE(0x1234567890ab, 0, 6);
```
-## buffer.transcode
-
-transcode(source: Buffer | Uint8Array, fromEnc: string, toEnc: string): Buffer
-
-将给定的Buffer或Uint8Array对象从一种字符编码重新编码为另一种。
-
-**系统能力:** SystemCapability.Utils.Lang
-
-**参数:**
-
-| 参数名 | 类型 | 必填 | 说明 |
-| -------- | -------- | -------- | -------- |
-| source | Buffer \| Uint8Array | 是 | 实例对象。 |
-| fromEnc | string | 是 | 当前编码。 |
-| toEnc | string | 是 | 目标编码。 |
-
-**返回值:**
-
-| 类型 | 说明 |
-| -------- | -------- |
-| Buffer | 根据当前编码转换成目标编码,并返回一个新的buffer实例。 |
-
-**示例:**
-
-```ts
-import buffer from '@ohos.buffer';
-
-let buf = buffer.alloc(50);
-let newBuf = buffer.transcode(buffer.from('€'), 'utf-8', 'ascii');
-console.log(newBuf.toString('ascii'));
-```
-
## Blob
### 属性
diff --git a/zh-cn/application-dev/reference/apis/js-apis-bundleManager.md b/zh-cn/application-dev/reference/apis/js-apis-bundleManager.md
index 03b369a6edb1f6d1dc07ca72e0550d3984dba1e4..5cc77964eadf4180637d6f63318de3fe67cdc9cb 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-bundleManager.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-bundleManager.md
@@ -216,11 +216,11 @@ let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;
try {
bundleManager.getBundleInfoForSelf(bundleFlags).then((data) => {
hilog.info(0x0000, 'testTag', 'getBundleInfoForSelf successfully. Data: %{public}s', JSON.stringify(data));
- }).catch(error => {
- hilog.error(0x0000, 'testTag', 'getBundleInfoForSelf failed. Cause: %{public}s', error.message);
+ }).catch(err => {
+ hilog.error(0x0000, 'testTag', 'getBundleInfoForSelf failed. Cause: %{public}s', err.message);
});
-} catch (error) {
- hilog.error(0x0000, 'testTag', 'getBundleInfoForSelf failed: %{public}s', error.message);
+} catch (err) {
+ hilog.error(0x0000, 'testTag', 'getBundleInfoForSelf failed: %{public}s', err.message);
}
```
@@ -249,13 +249,13 @@ let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;
try {
bundleManager.getBundleInfoForSelf(bundleFlags, (err, data) => {
if (err) {
- hilog.error(0x0000, 'testTag', 'getBundleInfoForSelf failed: %{public}s', error.message);
+ hilog.error(0x0000, 'testTag', 'getBundleInfoForSelf failed: %{public}s', err.message);
} else {
hilog.info(0x0000, 'testTag', 'getBundleInfoForSelf successfully: %{public}s', JSON.stringify(data));
}
});
} catch (err) {
- hilog.error(0x0000, 'testTag', 'getBundleInfoForSelf failed: %{public}s', error.message);
+ hilog.error(0x0000, 'testTag', 'getBundleInfoForSelf failed: %{public}s', err.message);
}
```
@@ -441,10 +441,10 @@ let userId = 100;
try {
bundleManager.getBundleInfo(bundleName, bundleFlags, userId).then((data) => {
hilog.info(0x0000, 'testTag', 'getBundleInfo successfully. Data: %{public}s', + JSON.stringify(data));
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'getBundleInfo failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'getBundleInfo failed. Cause: %{public}s' + err.message);
}
```
@@ -458,10 +458,10 @@ let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;
try {
bundleManager.getBundleInfo(bundleName, bundleFlags).then((data) => {
hilog.info(0x0000, 'testTag', 'getBundleInfo successfully. Data: %{public}s', + JSON.stringify(data));
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'getBundleInfo failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'getBundleInfo failed. Cause: %{public}s' + err.message);
}
@@ -625,10 +625,10 @@ let userId = 100;
try {
bundleManager.getApplicationInfo(bundleName, appFlags, userId).then((data) => {
hilog.info(0x0000, 'testTag', 'getApplicationInfo successfully. Data: %{public}s', + JSON.stringify(data));
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'getApplicationInfo failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'getApplicationInfo failed. Cause: %{public}s' + err.message);
}
```
@@ -772,10 +772,10 @@ let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;
try {
bundleManager.getAllBundleInfo(bundleFlags).then((data) => {
hilog.info(0x0000, 'testTag', 'getAllBundleInfo successfully. Data: %{public}s', + JSON.stringify(data));
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'getAllBundleInfo failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'getAllBundleInfo failed. Cause: %{public}s' + err.message);
}
```
@@ -919,10 +919,10 @@ let appFlags = bundleManager.ApplicationFlag.GET_APPLICATION_INFO_DEFAULT;
try {
bundleManager.getAllApplicationInfo(appFlags).then((data) => {
hilog.info(0x0000, 'testTag', 'getAllApplicationInfo successfully. Data: %{public}s', + JSON.stringify(data));
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'getAllApplicationInfo failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'getAllApplicationInfo failed. Cause: %{public}s' + err.message);
}
@@ -1095,10 +1095,10 @@ let want = {
try {
bundleManager.queryAbilityInfo(want, abilityFlags, userId).then((data) => {
hilog.info(0x0000, 'testTag', 'queryAbilityInfo successfully. Data: %{public}s', + JSON.stringify(data));
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'queryAbilityInfo failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'queryAbilityInfo failed. Cause: %{public}s' + err.message);
}
```
@@ -1115,10 +1115,10 @@ let want = {
try {
bundleManager.queryAbilityInfo(want, abilityFlags).then((data) => {
hilog.info(0x0000, 'testTag', 'queryAbilityInfo successfully. Data: %{public}s', + JSON.stringify(data));
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'queryAbilityInfo failed. Cause: %{public}s' + err.message);
})
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'queryAbilityInfo failed. Cause: %{public}s' + err.message);
}
```
@@ -1294,10 +1294,10 @@ let want = {
try {
bundleManager.queryExtensionAbilityInfo(want, extensionAbilityType, extensionFlags, userId).then((data) => {
hilog.info(0x0000, 'testTag', 'queryExtensionAbilityInfo successfully. Data: %{public}s', + JSON.stringify(data));
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'queryExtensionAbilityInfo failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'queryExtensionAbilityInfo failed. Cause: %{public}s' + err.message);
}
```
@@ -1315,10 +1315,10 @@ let want = {
try {
bundleManager.queryExtensionAbilityInfo(want, extensionAbilityType, extensionFlags).then((data) => {
hilog.info(0x0000, 'testTag', 'queryExtensionAbilityInfo successfully. Data: %{public}s', + JSON.stringify(data));
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'queryExtensionAbilityInfo failed. Cause: %{public}s' + err.message);
})
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'queryExtensionAbilityInfo failed. Cause: %{public}s' + err.message);
}
```
@@ -1410,10 +1410,10 @@ let uid = 20010005;
try {
bundleManager.getBundleNameByUid(uid).then((data) => {
hilog.info(0x0000, 'testTag', 'getBundleNameByUid successfully. Data: %{public}s', + JSON.stringify(data));
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'getBundleNameByUid failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'getBundleNameByUid failed. Cause: %{public}s' + err.message);
}
```
@@ -1511,10 +1511,10 @@ let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;
try {
bundleManager.getBundleArchiveInfo(hapFilePath, bundleFlags).then((data) => {
hilog.info(0x0000, 'testTag', 'getBundleArchiveInfo successfully. Data: %{public}s', + JSON.stringify(data));
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'getBundleArchiveInfo failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'getBundleArchiveInfo failed. Cause: %{public}s' + err.message);
}
```
@@ -1771,10 +1771,10 @@ try {
hilog.info(0x0001, "testTag", "setAbilityEnabled successfully.");
}
});
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'queryAbilityInfo failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'queryAbilityInfo failed. Cause: %{public}s' + err.message);
}
```
@@ -1836,10 +1836,10 @@ try {
}).catch(err => {
hilog.error(0x0000, 'testTag', 'setAbilityEnabled failed: %{public}s' + err.message);
});
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'queryAbilityInfo failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'queryAbilityInfo failed. Cause: %{public}s' + err.message);
}
```
@@ -1929,10 +1929,10 @@ let bundleName = 'com.example.myapplication';
try {
bundleManager.isApplicationEnabled(bundleName).then((data) => {
hilog.info(0x0000, 'testTag', 'isApplicationEnabled successfully. Data: %{public}s', + JSON.stringify(data));
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'isApplicationEnabled failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'isApplicationEnabled failed. Cause: %{public}s' + err.message);
}
```
@@ -1988,10 +1988,10 @@ try {
hilog.info(0x0000, 'testTag', 'isAbilityEnabled successfully: %{public}s', + JSON.stringify(data));
}
});
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'queryAbilityInfo failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'queryAbilityInfo failed. Cause: %{public}s' + err.message);
}
```
@@ -2050,10 +2050,10 @@ try {
}).catch(err => {
hilog.error(0x0000, 'testTag', 'isAbilityEnabled failed. Cause: %{public}s' + err.message);
});
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'queryAbilityInfo failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'queryAbilityInfo failed. Cause: %{public}s' + err.message);
}
```
@@ -2204,10 +2204,10 @@ let userId = 100;
try {
bundleManager.getLaunchWantForBundle(bundleName, userId).then((data) => {
hilog.info(0x0000, 'testTag', 'getLaunchWantForBundle successfully. Data: %{public}s', + JSON.stringify(data));
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'getLaunchWantForBundle failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'getLaunchWantForBundle failed. Cause: %{public}s' + err.message);
}
```
@@ -2308,10 +2308,10 @@ let abilityName = 'MainAbility';
try {
bundleManager.getProfileByAbility(moduleName, abilityName).then((data) => {
hilog.info(0x0000, 'testTag', 'getProfileByAbility successfully. Data: %{public}s', + JSON.stringify(data));
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'getProfileByAbility failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'getProfileByAbility failed. Cause: %{public}s' + err.message);
}
```
@@ -2325,10 +2325,10 @@ let metadataName = 'com.example.myapplication.metadata';
try {
bundleManager.getProfileByAbility(moduleName, abilityName, metadataName).then((data) => {
hilog.info(0x0000, 'testTag', 'getProfileByAbility successfully. Data: %{public}s', + JSON.stringify(data));
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'getProfileByAbility failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'getProfileByAbility failed. Cause: %{public}s' + err.message);
}
```
@@ -2428,20 +2428,20 @@ let metadataName = 'com.example.myapplication.metadata';
try {
bundleManager.getProfileByExtensionAbility(moduleName, extensionAbilityName).then((data) => {
hilog.info(0x0000, 'testTag', 'getProfileByExtensionAbility successfully. Data: %{public}s', + JSON.stringify(data));
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'getProfileByExtensionAbility failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'getProfileByExtensionAbility failed. Cause: %{public}s' + err.message);
}
try {
bundleManager.getProfileByExtensionAbility(moduleName, extensionAbilityName, metadataName).then((data) => {
hilog.info(0x0000, 'testTag', 'getProfileByExtensionAbility successfully. Data: %{public}s', + JSON.stringify(data));
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'getProfileByExtensionAbility failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'getProfileByExtensionAbility failed. Cause: %{public}s' + err.message);
}
```
@@ -2533,10 +2533,10 @@ let permissionName = "ohos.permission.GET_BUNDLE_INFO";
try {
bundleManager.getPermissionDef(permissionName).then((data) => {
hilog.info(0x0000, 'testTag', 'getPermissionDef successfully. Data: %{public}s', + JSON.stringify(data));
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'getPermissionDef failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'getPermissionDef failed. Cause: %{public}s' + err.message);
}
```
@@ -2646,10 +2646,10 @@ let abilityName = 'MainAbility';
try {
bundleManager.getAbilityLabel(bundleName, moduleName, abilityName).then((data) => {
hilog.info(0x0000, 'testTag', 'getAbilityLabel successfully. Data: %{public}s', + JSON.stringify(data));
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'getAbilityLabel failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'getAbilityLabel failed. Cause: %{public}s' + err.message);
}
```
@@ -2759,10 +2759,10 @@ let abilityName = 'MainAbility';
try {
bundleManager.getAbilityIcon(bundleName, moduleName, abilityName).then((data) => {
hilog.info(0x0000, 'testTag', 'getAbilityIcon successfully. Data: %{public}s', + JSON.stringify(data));
- }).catch(error => {
+ }).catch(err => {
hilog.error(0x0000, 'testTag', 'getAbilityIcon failed. Cause: %{public}s' + err.message);
});
-} catch (error) {
+} catch (err) {
hilog.error(0x0000, 'testTag', 'getAbilityIcon failed. Cause: %{public}s' + err.message);
}
```
diff --git a/zh-cn/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md b/zh-cn/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md
index 817a61707abdbc6f2a6da9f3ef8ad5434263cf69..022abd4251a9d90b9bf0eb4db37a5b5658099686 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-inner-application-uiAbilityContext.md
@@ -44,25 +44,19 @@ startAbility(want: Want, callback: AsyncCallback<void>): void;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000004 | Visibility verification failed. |
-| 16000005 | Static permission denied. The specified process does not have the permission. |
-| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. |
-| 16000008 | Crowdtest App Expiration. |
-| 16000009 | Can not start ability in wukong mode. |
-| 16000010 | Can not operation with continue flag. |
-| 16000011 | Context does not exist. |
-| 16000051 | Network error. The network is abnormal. |
-| 16000052 | Free install not support. The application does not support freeinstall |
-| 16000053 | Not top ability. The application is not top ability. |
-| 16000054 | Free install busyness. There are concurrent tasks, waiting for retry. |
-| 16000055 | Free install timeout. |
-| 16000056 | Can not free install other ability. |
-| 16000057 | Not support cross device free install. |
-| 16200001 | Caller released. The caller has been released. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000004 | Can not start invisible component. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000008 | The crowdtesting application expires. |
+| 16000009 | An ability cannot be started or stopped in Wukong mode. |
+| 16000010 | The call with the continuation flag is forbidden. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16000053 | The ability is not on the top of the UI. |
+| 16000055 | Installation-free timed out. |
+| 16200001 | The caller has been released. |
**示例:**
@@ -115,25 +109,19 @@ startAbility(want: Want, options: StartOptions, callback: AsyncCallback<void&
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000004 | Visibility verification failed. |
-| 16000005 | Static permission denied. The specified process does not have the permission. |
-| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. |
-| 16000008 | Crowdtest App Expiration. |
-| 16000009 | Can not start ability in wukong mode. |
-| 16000010 | Can not operation with continue flag. |
-| 16000011 | Context does not exist. |
-| 16000051 | Network error. The network is abnormal. |
-| 16000052 | Free install not support. The application does not support freeinstall |
-| 16000053 | Not top ability. The application is not top ability. |
-| 16000054 | Free install busyness. There are concurrent tasks, waiting for retry. |
-| 16000055 | Free install timeout. |
-| 16000056 | Can not free install other ability. |
-| 16000057 | Not support cross device free install. |
-| 16200001 | Caller released. The caller has been released. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000004 | Can not start invisible component. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000008 | The crowdtesting application expires. |
+| 16000009 | An ability cannot be started or stopped in Wukong mode. |
+| 16000010 | The call with the continuation flag is forbidden. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16000053 | The ability is not on the top of the UI. |
+| 16000055 | Installation-free timed out. |
+| 16200001 | The caller has been released. |
**示例:**
@@ -195,25 +183,19 @@ startAbility(want: Want, options?: StartOptions): Promise<void>;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000004 | Visibility verification failed. |
-| 16000005 | Static permission denied. The specified process does not have the permission. |
-| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. |
-| 16000008 | Crowdtest App Expiration. |
-| 16000009 | Can not start ability in wukong mode. |
-| 16000010 | Can not operation with continue flag. |
-| 16000011 | Context does not exist. |
-| 16000051 | Network error. The network is abnormal. |
-| 16000052 | Free install not support. The application does not support freeinstall |
-| 16000053 | Not top ability. The application is not top ability. |
-| 16000054 | Free install busyness. There are concurrent tasks, waiting for retry. |
-| 16000055 | Free install timeout. |
-| 16000056 | Can not free install other ability. |
-| 16000057 | Not support cross device free install. |
-| 16200001 | Caller released. The caller has been released. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000004 | Can not start invisible component. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000008 | The crowdtesting application expires. |
+| 16000009 | An ability cannot be started or stopped in Wukong mode. |
+| 16000010 | The call with the continuation flag is forbidden. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16000053 | The ability is not on the top of the UI. |
+| 16000055 | Installation-free timed out. |
+| 16200001 | The caller has been released. |
**示例:**
@@ -268,25 +250,19 @@ startAbilityForResult(want: Want, callback: AsyncCallback<AbilityResult>):
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000004 | Visibility verification failed. |
-| 16000005 | Static permission denied. The specified process does not have the permission. |
-| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. |
-| 16000008 | Crowdtest App Expiration. |
-| 16000009 | Can not start ability in wukong mode. |
-| 16000010 | Can not operation with continue flag. |
-| 16000011 | Context does not exist. |
-| 16000051 | Network error. The network is abnormal. |
-| 16000052 | Free install not support. The application does not support freeinstall |
-| 16000053 | Not top ability. The application is not top ability. |
-| 16000054 | Free install busyness. There are concurrent tasks, waiting for retry. |
-| 16000055 | Free install timeout. |
-| 16000056 | Can not free install other ability. |
-| 16000057 | Not support cross device free install. |
-| 16200001 | Caller released. The caller has been released. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000004 | Can not start invisible component. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000008 | The crowdtesting application expires. |
+| 16000009 | An ability cannot be started or stopped in Wukong mode. |
+| 16000010 | The call with the continuation flag is forbidden. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16000053 | The ability is not on the top of the UI. |
+| 16000055 | Installation-free timed out. |
+| 16200001 | The caller has been released. |
**示例:**
@@ -340,25 +316,19 @@ startAbilityForResult(want: Want, options: StartOptions, callback: AsyncCallback
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000004 | Visibility verification failed. |
-| 16000005 | Static permission denied. The specified process does not have the permission. |
-| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. |
-| 16000008 | Crowdtest App Expiration. |
-| 16000009 | Can not start ability in wukong mode. |
-| 16000010 | Can not operation with continue flag. |
-| 16000011 | Context does not exist. |
-| 16000051 | Network error. The network is abnormal. |
-| 16000052 | Free install not support. The application does not support freeinstall |
-| 16000053 | Not top ability. The application is not top ability. |
-| 16000054 | Free install busyness. There are concurrent tasks, waiting for retry. |
-| 16000055 | Free install timeout. |
-| 16000056 | Can not free install other ability. |
-| 16000057 | Not support cross device free install. |
-| 16200001 | Caller released. The caller has been released. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000004 | Can not start invisible component. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000008 | The crowdtesting application expires. |
+| 16000009 | An ability cannot be started or stopped in Wukong mode. |
+| 16000010 | The call with the continuation flag is forbidden. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16000053 | The ability is not on the top of the UI. |
+| 16000055 | Installation-free timed out. |
+| 16200001 | The caller has been released. |
**示例:**
@@ -422,25 +392,19 @@ startAbilityForResult(want: Want, options?: StartOptions): Promise<AbilityRes
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000004 | Visibility verification failed. |
-| 16000005 | Static permission denied. The specified process does not have the permission. |
-| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. |
-| 16000008 | Crowdtest App Expiration. |
-| 16000009 | Can not start ability in wukong mode. |
-| 16000010 | Can not operation with continue flag. |
-| 16000011 | Context does not exist. |
-| 16000051 | Network error. The network is abnormal. |
-| 16000052 | Free install not support. The application does not support freeinstall |
-| 16000053 | Not top ability. The application is not top ability. |
-| 16000054 | Free install busyness. There are concurrent tasks, waiting for retry. |
-| 16000055 | Free install timeout. |
-| 16000056 | Can not free install other ability. |
-| 16000057 | Not support cross device free install. |
-| 16200001 | Caller released. The caller has been released. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000004 | Can not start invisible component. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000008 | The crowdtesting application expires. |
+| 16000009 | An ability cannot be started or stopped in Wukong mode. |
+| 16000010 | The call with the continuation flag is forbidden. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16000053 | The ability is not on the top of the UI. |
+| 16000055 | Installation-free timed out. |
+| 16200001 | The caller has been released. |
**示例:**
@@ -500,26 +464,19 @@ startAbilityForResultWithAccount(want: Want, accountId: number, callback: AsyncC
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000004 | Visibility verification failed. |
-| 16000005 | Static permission denied. The specified process does not have the permission. |
-| 16000006 | Can not cross user operations. |
-| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. |
-| 16000008 | Crowdtest App Expiration. |
-| 16000009 | Can not start ability in wukong mode. |
-| 16000010 | Can not operation with continue flag. |
-| 16000011 | Context does not exist. |
-| 16000051 | Network error. The network is abnormal. |
-| 16000052 | Free install not support. The application does not support freeinstall |
-| 16000053 | Not top ability. The application is not top ability. |
-| 16000054 | Free install busyness. There are concurrent tasks, waiting for retry. |
-| 16000055 | Free install timeout. |
-| 16000056 | Can not free install other ability. |
-| 16000057 | Not support cross device free install. |
-| 16200001 | Caller released. The caller has been released. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000004 | Can not start invisible component. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000008 | The crowdtesting application expires. |
+| 16000009 | An ability cannot be started or stopped in Wukong mode. |
+| 16000010 | The call with the continuation flag is forbidden. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16000053 | The ability is not on the top of the UI. |
+| 16000055 | Installation-free timed out. |
+| 16200001 | The caller has been released. |
**示例:**
@@ -581,26 +538,19 @@ startAbilityForResultWithAccount(want: Want, accountId: number, options: StartOp
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000004 | Visibility verification failed. |
-| 16000005 | Static permission denied. The specified process does not have the permission. |
-| 16000006 | Can not cross user operations. |
-| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. |
-| 16000008 | Crowdtest App Expiration. |
-| 16000009 | Can not start ability in wukong mode. |
-| 16000010 | Can not operation with continue flag. |
-| 16000011 | Context does not exist. |
-| 16000051 | Network error. The network is abnormal. |
-| 16000052 | Free install not support. The application does not support freeinstall |
-| 16000053 | Not top ability. The application is not top ability. |
-| 16000054 | Free install busyness. There are concurrent tasks, waiting for retry. |
-| 16000055 | Free install timeout. |
-| 16000056 | Can not free install other ability. |
-| 16000057 | Not support cross device free install. |
-| 16200001 | Caller released. The caller has been released. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000004 | Can not start invisible component. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000008 | The crowdtesting application expires. |
+| 16000009 | An ability cannot be started or stopped in Wukong mode. |
+| 16000010 | The call with the continuation flag is forbidden. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16000053 | The ability is not on the top of the UI. |
+| 16000055 | Installation-free timed out. |
+| 16200001 | The caller has been released. |
**示例:**
@@ -669,26 +619,19 @@ startAbilityForResultWithAccount(want: Want, accountId: number, options?: StartO
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000004 | Visibility verification failed. |
-| 16000005 | Static permission denied. The specified process does not have the permission. |
-| 16000006 | Can not cross user operations. |
-| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. |
-| 16000008 | Crowdtest App Expiration. |
-| 16000009 | Can not start ability in wukong mode. |
-| 16000010 | Can not operation with continue flag. |
-| 16000011 | Context does not exist. |
-| 16000051 | Network error. The network is abnormal. |
-| 16000052 | Free install not support. The application does not support freeinstall |
-| 16000053 | Not top ability. The application is not top ability. |
-| 16000054 | Free install busyness. There are concurrent tasks, waiting for retry. |
-| 16000055 | Free install timeout. |
-| 16000056 | Can not free install other ability. |
-| 16000057 | Not support cross device free install. |
-| 16200001 | Caller released. The caller has been released. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000004 | Can not start invisible component. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000008 | The crowdtesting application expires. |
+| 16000009 | An ability cannot be started or stopped in Wukong mode. |
+| 16000010 | The call with the continuation flag is forbidden. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16000053 | The ability is not on the top of the UI. |
+| 16000055 | Installation-free timed out. |
+| 16200001 | The caller has been released. |
**示例:**
@@ -742,18 +685,14 @@ startServiceExtensionAbility(want: Want, callback: AsyncCallback\): void;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000002 | Ability type error. The specified ability type is wrong. |
-| 16000004 | Visibility verification failed. |
-| 16000005 | Static permission denied. The specified process does not have the permission. |
-| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. |
-| 16000008 | Crowdtest App Expiration. |
-| 16000009 | Can not start ability in wukong mode. |
-| 16000011 | Context does not exist. |
-| 16200001 | Caller released. The caller has been released. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000008 | The crowdtesting application expires. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16200001 | The caller has been released. |
**示例:**
@@ -802,18 +741,14 @@ startServiceExtensionAbility(want: Want): Promise\;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000002 | Ability type error. The specified ability type is wrong. |
-| 16000004 | Visibility verification failed. |
-| 16000005 | Static permission denied. The specified process does not have the permission. |
-| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. |
-| 16000008 | Crowdtest App Expiration. |
-| 16000009 | Can not start ability in wukong mode. |
-| 16000011 | Context does not exist. |
-| 16200001 | Caller released. The caller has been released. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000008 | The crowdtesting application expires. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16200001 | The caller has been released. |
**示例:**
@@ -866,15 +801,14 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000002 | Ability type error. The specified ability type is wrong. |
-| 16000004 | Visibility verification failed. |
-| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. |
-| 16000011 | Context does not exist. |
-| 16200001 | Caller released. The caller has been released. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000008 | The crowdtesting application expires. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16200001 | The caller has been released. |
**示例:**
@@ -927,19 +861,14 @@ startServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000002 | Ability type error. The specified ability type is wrong. |
-| 16000004 | Visibility verification failed. |
-| 16000005 | Static permission denied. The specified process does not have the permission. |
-| 16000006 | Can not cross user operations. |
-| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. |
-| 16000008 | Crowdtest App Expiration. |
-| 16000009 | Can not start ability in wukong mode. |
-| 16000011 | Context does not exist. |
-| 16200001 | Caller released. The caller has been released. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000008 | The crowdtesting application expires. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16200001 | The caller has been released. |
**示例:**
@@ -989,15 +918,13 @@ stopServiceExtensionAbility(want: Want, callback: AsyncCallback\): void;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000002 | Ability type error. The specified ability type is wrong. |
-| 16000004 | Visibility verification failed. |
-| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. |
-| 16000011 | Context does not exist. |
-| 16200001 | Caller released. The caller has been released. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16200001 | The caller has been released. |
**示例:**
@@ -1046,15 +973,13 @@ stopServiceExtensionAbility(want: Want): Promise\;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000002 | Ability type error. The specified ability type is wrong. |
-| 16000004 | Visibility verification failed. |
-| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. |
-| 16000011 | Context does not exist. |
-| 16200001 | Caller released. The caller has been released. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16200001 | The caller has been released. |
**示例:**
@@ -1107,16 +1032,13 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number, callback:
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000002 | Ability type error. The specified ability type is wrong. |
-| 16000004 | Visibility verification failed. |
-| 16000006 | Can not cross user operations. |
-| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. |
-| 16000011 | Context does not exist. |
-| 16200001 | Caller released. The caller has been released. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16200001 | The caller has been released. |
**示例:**
@@ -1169,16 +1091,13 @@ stopServiceExtensionAbilityWithAccount(want: Want, accountId: number): Promise\<
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000002 | Ability type error. The specified ability type is wrong. |
-| 16000004 | Visibility verification failed. |
-| 16000006 | Can not cross user operations. |
-| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. |
-| 16000011 | Context does not exist. |
-| 16200001 | Caller released. The caller has been released. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000002 | Incorrect ability type. |
+| 16000005 | The specified process does not have the permission. |
+| 16000006 | Cross-user operations are not allowed. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+| 16200001 | The caller has been released. |
**示例:**
@@ -1226,12 +1145,12 @@ terminateSelf(callback: AsyncCallback<void>): void;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. |
-| 16000011 | Context does not exist. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000004 | Can not start invisible component. |
+| 16000005 | The specified process does not have the permission. |
+| 16000009 | An ability cannot be started or stopped in Wukong mode. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
**示例:**
@@ -1273,12 +1192,12 @@ terminateSelf(): Promise<void>;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. |
-| 16000011 | Context does not exist. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000004 | Can not start invisible component. |
+| 16000005 | The specified process does not have the permission. |
+| 16000009 | An ability cannot be started or stopped in Wukong mode. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
**示例:**
@@ -1321,12 +1240,12 @@ terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<voi
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. |
-| 16000011 | Context does not exist. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000004 | Can not start invisible component. |
+| 16000005 | The specified process does not have the permission. |
+| 16000009 | An ability cannot be started or stopped in Wukong mode. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
**示例:**
@@ -1385,13 +1304,12 @@ terminateSelfWithResult(parameter: AbilityResult): Promise<void>;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000007 | Service busyness. There are concurrent tasks, waiting for retry. |
-| 16000011 | Context does not exist. |
-| 16000050 | Internal Error. |
-
+| 16000001 | The specified ability does not exist. |
+| 16000004 | Can not start invisible component. |
+| 16000005 | The specified process does not have the permission. |
+| 16000009 | An ability cannot be started or stopped in Wukong mode. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
**示例:**
@@ -1452,13 +1370,10 @@ connectServiceExtensionAbility(want: Want, options: ConnectOptions): number;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000002 | Ability type error. The specified ability type is wrong. |
-| 16000004 | Visibility verification failed. |
-| 16000011 | Context does not exist. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000005 | The specified process does not have the permission. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
**示例:**
@@ -1521,14 +1436,10 @@ connectServiceExtensionAbilityWithAccount(want: Want, accountId: number, options
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000002 | Ability type error. The specified ability type is wrong. |
-| 16000004 | Visibility verification failed. |
-| 16000006 | Can not cross user operations. |
-| 16000011 | Context does not exist. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000005 | The specified process does not have the permission. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
**示例:**
@@ -1569,8 +1480,6 @@ disconnectServiceExtensionAbility(connection: number): Promise\;
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
-**系统API**: 此接口为系统接口,三方应用不支持调用。
-
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
@@ -1587,12 +1496,10 @@ disconnectServiceExtensionAbility(connection: number): Promise\;
| 错误码ID | 错误信息 |
| ------- | -------------------------------- |
-| 201 | The application does not have permission to call the interface. |
-| 401 | Invalid input parameter. |
-| 16000001 | Input error. The specified ability name does not exist. |
-| 16000003 | Input error. The specified id does not exist. |
-| 16000011 | Context does not exist. |
-| 16000050 | Internal Error. |
+| 16000001 | The specified ability does not exist. |
+| 16000005 | The specified process does not have the permission. |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
**示例:**
@@ -1626,8 +1533,6 @@ disconnectServiceExtensionAbility(connection: number, callback:AsyncCallback\): void;
| icon | image.PixelMap | 是 | 在最近的任务中显示的ability图标。 |
| callback | AsyncCallback\ | 是 | 指定的回调函数的结果。 |
+**错误码:**
+
+| 错误码ID | 错误信息 |
+| ------- | -------------------------------- |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+
**示例:**
```ts
@@ -2121,6 +2037,13 @@ setMissionIcon(icon: image.PixelMap): Promise\;
| -------- | -------- |
| Promise<void> | 返回一个Promise,包含接口的结果。 |
+**错误码:**
+
+| 错误码ID | 错误信息 |
+| ------- | -------------------------------- |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+
**示例:**
```ts
@@ -2161,6 +2084,13 @@ restoreWindowStage(localStorage: LocalStorage) : void;
| -------- | -------- | -------- | -------- |
| localStorage | image.LocalStorage | 是 | 用于恢复window stage的存储数据。 |
+**错误码:**
+
+| 错误码ID | 错误信息 |
+| ------- | -------------------------------- |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+
**示例:**
```ts
@@ -2182,6 +2112,13 @@ isTerminating(): boolean;
| -------- | -------- |
| bool | true:ability当前处于terminating状态;false:不处于terminating状态。 |
+**错误码:**
+
+| 错误码ID | 错误信息 |
+| ------- | -------------------------------- |
+| 16000011 | The context does not exist. |
+| 16000050 | Internal error. |
+
**示例:**
```ts
diff --git a/zh-cn/application-dev/reference/apis/js-apis-lightweightmap.md b/zh-cn/application-dev/reference/apis/js-apis-lightweightmap.md
index ede65b4423d427eeab3615a47c90b97f86d6e186..3f7df990f645d32d0152e93dd16473662826743a 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-lightweightmap.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-lightweightmap.md
@@ -5,7 +5,9 @@
LightWeightMap可用于存储具有关联关系的key-value键值对集合,存储元素中key值唯一,每个key对应一个value。
-LightWeightMap依据泛型定义,采用轻量级结构,集合中key值的查找依赖于hash算法,通过一个数组存储hash值,然后映射到其他数组中的key值及value值。
+LightWeightMap依据泛型定义,采用轻量级结构,初始默认容量大小为8,每次扩容大小为原始容量的两倍。
+
+集合中key值的查找依赖于hash算法,通过一个数组存储hash值,然后映射到其他数组中的key值及value值。
LightWeightMap和[HashMap](js-apis-hashmap.md)都是用来存储键值对的集合,LightWeightMap占用内存更小。
@@ -158,10 +160,8 @@ hasKey(key: K): boolean;
```ts
let lightWeightMap = new LightWeightMap();
-let result = lightWeightMap.hasKey;
-lightWeightMap.hasKey("squirrel");
lightWeightMap.set("squirrel", 123);
-let result1 = lightWeightMap.hasKey("squirrel");
+let result = lightWeightMap.hasKey("squirrel");
```
@@ -415,7 +415,7 @@ let lightWeightMap = new LightWeightMap();
lightWeightMap.set("squirrel", 123);
lightWeightMap.set("sparrow", 356);
let map = new LightWeightMap();
-lightWeightMap.setAll(map);
+map.setAll(lightWeightMap); // 将lightWeightMap中所有的元素添加到map中
```
@@ -817,7 +817,7 @@ toString(): String
let lightWeightMap = new LightWeightMap();
lightWeightMap.set("squirrel", 123);
lightWeightMap.set("sparrow", 356);
-let iter = lightWeightMap.toString();
+let result = lightWeightMap.toString();
```
### [Symbol.iterator]
diff --git a/zh-cn/application-dev/reference/apis/js-apis-router.md b/zh-cn/application-dev/reference/apis/js-apis-router.md
index 8318a21c284a1adad5681dde515034d7b61f91e6..c53ab60fd9e87d85f752233495ae74c39372b062 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-router.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-router.md
@@ -32,7 +32,7 @@ pushUrl(options: RouterOptions): Promise<void>
| 类型 | 说明 |
| ------------------- | --------- |
-| Promise<void> | 异常返回结果 |
+| Promise<void> | 异常返回结果。 |
**错误码:**
@@ -81,7 +81,7 @@ pushUrl(options: RouterOptions, callback: AsyncCallback<void>): void
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------------------------------- | ---- | --------- |
| options | [RouterOptions](#routeroptions) | 是 | 跳转页面描述信息。 |
-| callback | AsyncCallback<void> | 是 | 异常响应回调 |
+| callback | AsyncCallback<void> | 是 | 异常响应回调。 |
**错误码:**
@@ -185,7 +185,7 @@ pushUrl(options: RouterOptions, mode: RouterMode, callback: AsyncCallback<voi
| ------- | ------------------------------- | ---- | ---------- |
| options | [RouterOptions](#routeroptions) | 是 | 跳转页面描述信息。 |
| mode | [RouterMode](#routermode9) | 是 | 跳转页面使用的模式。 |
-| callback | AsyncCallback<void> | 是 | 异常响应回调 |
+| callback | AsyncCallback<void> | 是 | 异常响应回调。 |
**错误码:**
@@ -239,7 +239,7 @@ replaceUrl(options: RouterOptions): Promise<void>
| 类型 | 说明 |
| ------------------- | --------- |
-| Promise<void> | 异常返回结果 |
+| Promise<void> | 异常返回结果。 |
**错误码:**
@@ -284,7 +284,7 @@ replaceUrl(options: RouterOptions, callback: AsyncCallback<void>): void
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------------------------------- | ---- | ------------------ |
| options | [RouterOptions](#routeroptions) | 是 | 替换页面描述信息。 |
-| callback | AsyncCallback<void> | 是 | 异常响应回调 |
+| callback | AsyncCallback<void> | 是 | 异常响应回调。 |
**错误码:**
@@ -336,7 +336,7 @@ replaceUrl(options: RouterOptions, mode: RouterMode): Promise<void>
| 类型 | 说明 |
| ------------------- | --------- |
-| Promise<void> | 异常返回结果 |
+| Promise<void> | 异常返回结果。 |
**错误码:**
@@ -382,7 +382,7 @@ replaceUrl(options: RouterOptions, mode: RouterMode, callback: AsyncCallback<
| ------- | ------------------------------- | ---- | ---------- |
| options | [RouterOptions](#routeroptions) | 是 | 替换页面描述信息。 |
| mode | [RouterMode](#routermode9) | 是 | 跳转页面使用的模式。 |
-| callback | AsyncCallback<void> | 是 | 异常响应回调 |
+| callback | AsyncCallback<void> | 是 | 异常响应回调。 |
**错误码:**
@@ -636,7 +636,7 @@ export default {
### 基于TS扩展的声明式开发范式
```ts
-//通过router.push跳转至目标页携带params参数
+// 通过router.push跳转至目标页携带params参数
import router from '@ohos.router'
@Entry
@@ -682,7 +682,7 @@ struct Index {
```
```ts
-//在second页面中接收传递过来的参数
+// 在second页面中接收传递过来的参数
import router from '@ohos.router'
@Entry
@@ -804,7 +804,7 @@ router.replace({
});
```
- ## router.replace(deprecated)
+## router.replace(deprecated)
replace(options: RouterOptions, mode: RouterMode): void
diff --git a/zh-cn/application-dev/reference/apis/js-apis-treemap.md b/zh-cn/application-dev/reference/apis/js-apis-treemap.md
index 88172bf388a5c8a9b053e9a4ef7282e7e5c129cd..e05aec4775026b954accbc578e073a4cb8ef97cc 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-treemap.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-treemap.md
@@ -281,7 +281,7 @@ setAll(map: TreeMap): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
-| map | TreeMap | 是 | 被添加元素的treeMap。 |
+| map | TreeMap | 是 | 该map会添加到其调用setAll接口的map对象中。 |
**错误码:**
@@ -298,7 +298,11 @@ let treeMap = new TreeMap();
treeMap.set("squirrel", 123);
treeMap.set("sparrow", 356);
let map = new TreeMap();
-treeMap.setAll(map);
+map.set("demo", 12);
+map.setAll(treeMap); // 将treeMap中的所有元素添加到map中
+map.forEach((value, key) => {
+ console.log("test" + value, key); // 打印结果 12 demo、356 sparrow、123 squirrel
+})
```
diff --git a/zh-cn/application-dev/reference/apis/js-apis-useriam-userauth.md b/zh-cn/application-dev/reference/apis/js-apis-useriam-userauth.md
index 1af4f69de5d24fbe09ee64f4afdbfd27fe79ffd5..d78151eaa8032fb7d2b6420a7a5bcca1989288d5 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-useriam-userauth.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-useriam-userauth.md
@@ -277,7 +277,7 @@ start : () => void
| -------- | ------- |
| 201 | Permission verification failed. |
| 401 | Incorrect parameters. |
-| 12500001 | Execution failed. |
+| 12500001 | Authentication failed. |
| 12500002 | General operation error. |
| 12500003 | The operation is canceled. |
| 12500004 | The operation is time-out. |
@@ -489,7 +489,7 @@ try {
| 名称 | 值 | 说明 |
| ----------------------- | ------ | -------------------- |
| SUCCESS | 12500000 | 执行成功。 |
-| FAIL | 12500001 | 执行失败。 |
+| FAIL | 12500001 | 认证失败。 |
| GENERAL_ERROR | 12500002 | 操作通用错误。 |
| CANCELED | 12500003 | 操作取消。 |
| TIMEOUT | 12500004 | 操作超时。 |
@@ -802,7 +802,7 @@ auth.auth(null, userIAM_userAuth.UserAuthType.FACE, userIAM_userAuth.AuthTrustLe
| 名称 | 值 | 说明 |
| ----------------------- | ------ | -------------------- |
| SUCCESS | 0 | 执行成功。 |
-| FAIL | 1 | 执行失败。 |
+| FAIL | 1 | 认证失败。 |
| GENERAL_ERROR | 2 | 操作通用错误。 |
| CANCELED | 3 | 操作取消。 |
| TIMEOUT | 4 | 操作超时。 |
diff --git a/zh-cn/application-dev/reference/apis/js-apis-webview.md b/zh-cn/application-dev/reference/apis/js-apis-webview.md
index e1fb29b835a0c786fc6bbe3d40234d0f1366ec2d..83c76ef9c38493422b948990548913fe01e4bcc4 100644
--- a/zh-cn/application-dev/reference/apis/js-apis-webview.md
+++ b/zh-cn/application-dev/reference/apis/js-apis-webview.md
@@ -101,7 +101,7 @@ struct WebComponent {
### postMessageEvent
-postMessageEvent(message: string): void
+postMessageEvent(message: WebMessage): void
发送消息。完整示例代码参考[postMessage](#postmessage)
@@ -111,7 +111,7 @@ postMessageEvent(message: string): void
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ------ | ---- | :------------- |
-| message | string | 是 | 要发送的消息。 |
+| message | [WebMessage](#webmessage) | 是 | 要发送的消息。 |
**错误码:**
@@ -153,7 +153,7 @@ struct WebComponent {
### onMessageEvent
-onMessageEvent(callback: (result: string) => void): void
+onMessageEvent(callback: (result: WebMessage) => void): void
注册回调函数,接收HTML5侧发送过来的消息。完整示例代码参考[postMessage](#postmessage)
@@ -163,7 +163,7 @@ onMessageEvent(callback: (result: string) => void): void
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | ---- | :------------------- |
-| result | string | 是 | 接收到的消息。 |
+| result | [WebMessage](#webmessage) | 是 | 接收到的消息。 |
**错误码:**
@@ -192,7 +192,17 @@ struct WebComponent {
try {
this.ports = this.controller.createWebMessagePorts();
this.ports[1].onMessageEvent((msg) => {
- console.log("received message from html5, on message:" + msg);
+ if (typeof(msg) == "string") {
+ console.log("received string message from html5, string is:" + msg);
+ } else if (typeof(msg) == "object") {
+ if (msg instanceof ArrayBuffer) {
+ console.log("received arraybuffer from html5, length is:" + msg.byteLength);
+ } else {
+ console.log("not support");
+ }
+ } else {
+ console.log("not support");
+ }
})
} catch (error) {
console.error(`ErrorCode: ${error.code}, Message: ${error.message}`);
@@ -1464,8 +1474,21 @@ struct WebComponent {
// 2、将其中一个消息端口发送到HTML侧,由HTML侧保存并使用。
this.controller.postMessage('__init_port__', [this.ports[0]], '*');
// 3、另一个消息端口在应用侧注册回调事件。
- this.ports[1].onMessageEvent((result: string) => {
- var msg = 'Got msg from HTML: ' + result;
+ this.ports[1].onMessageEvent((result: WebMessage) => {
+ var msg = 'Got msg from HTML:';
+ if (typeof(result) == "string") {
+ console.log("received string message from html5, string is:" + result);
+ msg = msg + result;
+ } else if (typeof(result) == "object") {
+ if (result instanceof ArrayBuffer) {
+ console.log("received arraybuffer from html5, length is:" + result.byteLength);
+ msg = msg + "lenght is " + result.byteLength;
+ } else {
+ console.log("not support");
+ }
+ } else {
+ console.log("not support");
+ }
this.receivedFromHtml = msg;
})
} catch (error) {
@@ -1523,7 +1546,21 @@ window.addEventListener('message', function (event) {
h5Port = event.ports[0]; // 1. 保存从ets侧发送过来的端口
h5Port.onmessage = function (event) {
// 2. 接收ets侧发送过来的消息.
- var msg = 'Got message from ets:' + event.data;
+ var msg = 'Got message from ets:';
+ var result = event.data;
+ if (typeof(result) == "string") {
+ console.log("received string message from html5, string is:" + result);
+ msg = msg + result;
+ } else if (typeof(result) == "object") {
+ if (result instanceof ArrayBuffer) {
+ console.log("received arraybuffer from html5, length is:" + result.byteLength);
+ msg = msg + "lenght is " + result.byteLength;
+ } else {
+ console.log("not support");
+ }
+ } else {
+ console.log("not support");
+ }
output.innerHTML = msg;
}
}
@@ -4428,6 +4465,15 @@ Web组件返回的请求/响应头对象。
| type | [HitTestTypeV9](#hittesttypev9) | 是 | 否 | 当前被点击区域的元素类型。|
| extra | string | 是 | 否 |点击区域的附加参数信息。若被点击区域为图片或链接,则附加参数信息为其url地址。 |
+## WebMessage
+
+用于描述[WebMessagePort](#webmessageport)所支持的数据类型。
+
+| 类型 | 说明 |
+| -------- | -------------------------------------- |
+| string | 字符串类型数据。 |
+| ArrayBuffer | 二进制类型数据。 |
+
## WebStorageOrigin
提供Web SQL数据库的使用信息。
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md
index ace71744193227a3c9f605b23f6f75b35a914b3e..533a958fc0b8bc20a029de65d4204e72219f22b7 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-image.md
@@ -48,6 +48,7 @@ Image(src: string | PixelMap | Resource)
| syncLoad8+ | boolean | 设置是否同步加载图片,默认是异步加载。同步加载时阻塞UI线程,不会显示占位图。
默认值:false |
| copyOption9+ | [CopyOptions](ts-appendix-enums.md#copyoptions9) | 设置图片是否可复制(SVG图片不支持复制)。
当copyOption设置为非CopyOptions.None时,支持使用长按、鼠标右击、快捷组合键'CTRL+C'等方式进行复制。
默认值:CopyOptions.None |
| colorFilter9+ | [ColorFilter](ts-types.md#colorfilter9) | 给图像设置颜色滤镜效果。 |
+| draggable9+ | boolean | 设置默认拖拽效果。(不能和[onDragStart](ts-universal-events-drag-drop.md)事件同时使用。)
默认值:false |
> **说明:**
>
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md
index eb99d96c45b06369150673cd442cf5bd1d61d746..1f5c45dffa15770a6b9e4f4df8922268c2ff0b9b 100755
--- a/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-basic-components-web.md
@@ -1763,7 +1763,7 @@ onRefreshAccessedHistory(callback: (event?: { url: string, isRefreshed: boolean
}
```
-### onRenderExited
+### onRenderExited9+
onRenderExited(callback: (event?: { renderExitReason: RenderExitReason }) => void)
@@ -3539,24 +3539,28 @@ invoke(origin: string, allow: boolean, retain: boolean): void
| ------ | ------- | ---- | ---- | ---------------------------------------- |
| origin | string | 是 | - | 指定源的字符串索引。 |
| allow | boolean | 是 | - | 设置的地理位置权限状态。 |
-| retain | boolean | 是 | - | 是否允许将地理位置权限状态保存到系统中。可通过[GeolocationPermissions](#geolocationpermissions9)接口管理保存到系统的地理位置权限。 |
+| retain | boolean | 是 | - | 是否允许将地理位置权限状态保存到系统中。可通过[GeolocationPermissions9+](../apis/js-apis-webview.md#geolocationpermissions)接口管理保存到系统的地理位置权限。 |
## WebController
通过WebController可以控制Web组件各种行为。一个WebController对象只能控制一个Web组件,且必须在Web组件和WebController绑定后,才能调用WebController上的方法。
+从API version 9开始不再维护,建议使用[WebviewController9+](../apis/js-apis-webview.md#webviewcontroller)代替。
+
### 创建对象
```
webController: WebController = new WebController()
```
-### requestFocus
+### requestFocus(deprecated)
requestFocus()
使当前web页面获取焦点。
+从API version 9开始不再维护,建议使用[requestFocus9+](../apis/js-apis-webview.md#requestfocus)代替。
+
**示例:**
```ts
@@ -3578,12 +3582,14 @@ requestFocus()
}
```
-### accessBackward
+### accessBackward(deprecated)
accessBackward(): boolean
当前页面是否可后退,即当前页面是否有返回历史记录。
+从API version 9开始不再维护,建议使用[accessBackward9+](../apis/js-apis-webview.md#accessbackward)代替。
+
**返回值:**
| 类型 | 说明 |
@@ -3612,12 +3618,14 @@ accessBackward(): boolean
}
```
-### accessForward
+### accessForward(deprecated)
accessForward(): boolean
当前页面是否可前进,即当前页面是否有前进历史记录。
+从API version 9开始不再维护,建议使用[accessForward9+](../apis/js-apis-webview.md#accessforward)代替。
+
**返回值:**
| 类型 | 说明 |
@@ -3646,12 +3654,14 @@ accessForward(): boolean
}
```
-### accessStep
+### accessStep(deprecated)
accessStep(step: number): boolean
当前页面是否可前进或者后退给定的step步。
+从API version 9开始不再维护,建议使用[accessStep9+](../apis/js-apis-webview.md#accessstep)代替。
+
**参数:**
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
@@ -3687,12 +3697,14 @@ accessStep(step: number): boolean
}
```
-### backward
+### backward(deprecated)
backward(): void
按照历史栈,后退一个页面。一般结合accessBackward一起使用。
+从API version 9开始不再维护,建议使用[backward9+](../apis/js-apis-webview.md#backward)代替。
+
**示例:**
```ts
@@ -3714,12 +3726,14 @@ backward(): void
}
```
-### forward
+### forward(deprecated)
forward(): void
按照历史栈,前进一个页面。一般结合accessForward一起使用。
+从API version 9开始不再维护,建议使用[forward9+](../apis/js-apis-webview.md#forward)代替。
+
**示例:**
```ts
@@ -3775,12 +3789,14 @@ backOrForward(step: number): void
}
```
-### deleteJavaScriptRegister
+### deleteJavaScriptRegister(deprecated)
deleteJavaScriptRegister(name: string)
删除通过registerJavaScriptProxy注册到window上的指定name的应用侧JavaScript对象。删除后立即生效,无须调用[refresh](#refresh)接口。
+从API version 9开始不再维护,建议使用[deleteJavaScriptRegister9+](../apis/js-apis-webview.md#deletejavascriptregister)代替。
+
**参数:**
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
@@ -3809,12 +3825,14 @@ deleteJavaScriptRegister(name: string)
}
```
-### getHitTest
+### getHitTest(deprecated)
getHitTest(): HitTestType
获取当前被点击区域的元素类型。
+从API version 9开始不再维护,建议使用[getHitTest9+](../apis/js-apis-webview.md#gethittest)代替。
+
**返回值:**
| 类型 | 说明 |
@@ -4009,7 +4027,7 @@ getDefaultUserAgent(): string
}
```
-### loadData
+### loadData(deprecated)
loadData(options: { data: string, mimeType: string, encoding: string, baseUrl?: string, historyUrl?: string })
@@ -4019,6 +4037,8 @@ baseUrl为空时,通过”data“协议加载指定的一段字符串。
当baseUrl为“http/https"协议时,编码后的data字符串将被Web组件以类似loadUrl的方式以非编码字符串处理。
+从API version 9开始不再维护,建议使用[loadData9+](../apis/js-apis-webview.md#loaddata)代替。
+
**参数:**
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
@@ -4054,7 +4074,7 @@ baseUrl为空时,通过”data“协议加载指定的一段字符串。
}
```
-### loadUrl
+### loadUrl(deprecated)
loadUrl(options: { url: string | Resource, headers?: Array\ })
@@ -4064,6 +4084,8 @@ loadUrl(options: { url: string | Resource, headers?: Array\ })
而通过registerJavaScriptProxy注入的对象,在loadUrl导航到新的页面也会有效。
+从API version 9开始不再维护,建议使用[loadUrl9+](../apis/js-apis-webview.md#loadurl)代替。
+
**参数:**
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
@@ -4092,12 +4114,14 @@ loadUrl(options: { url: string | Resource, headers?: Array\ })
}
```
-### onActive
+### onActive(deprecated)
onActive(): void
调用此接口通知Web组件进入前台激活状态。
+从API version 9开始不再维护,建议使用[onActive9+](../apis/js-apis-webview.md#onactive)代替。
+
**示例:**
```ts
@@ -4119,12 +4143,14 @@ onActive(): void
}
```
-### onInactive
+### onInactive(deprecated)
onInactive(): void
调用此接口通知Web组件进入未激活状态。
+从API version 9开始不再维护,建议使用[onInactive9+](../apis/js-apis-webview.md#oninactive)代替。
+
**示例:**
```ts
@@ -4146,11 +4172,13 @@ onInactive(): void
}
```
-### zoom
+### zoom(deprecated)
zoom(factor: number): void
调整当前网页的缩放比例。
+从API version 9开始不再维护,建议使用[zoom9+](../apis/js-apis-webview.md#zoom)代替。
+
**参数:**
| 参数名 | 参数类型 | 必填 | 参数描述 |
@@ -4245,12 +4273,14 @@ zoomOut(): boolean
}
```
-### refresh
+### refresh(deprecated)
refresh()
调用此接口通知Web组件刷新网页。
+从API version 9开始不再维护,建议使用[refresh9+](../apis/js-apis-webview.md#refresh)代替。
+
**示例:**
```ts
@@ -4272,12 +4302,14 @@ refresh()
}
```
-### registerJavaScriptProxy
+### registerJavaScriptProxy(deprecated)
registerJavaScriptProxy(options: { object: object, name: string, methodList: Array\ })
注入JavaScript对象到window对象中,并在window对象中调用该对象的方法。注册后,须调用[refresh](#refresh)接口生效。
+从API version 9开始不再维护,建议使用[registerJavaScriptProxy9+](../apis/js-apis-webview.md#registerjavascriptproxy)代替。
+
**参数:**
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
@@ -4338,12 +4370,14 @@ registerJavaScriptProxy(options: { object: object, name: string, methodList: Arr
```
-### runJavaScript
+### runJavaScript(deprecated)
runJavaScript(options: { script: string, callback?: (result: string) => void })
异步执行JavaScript脚本,并通过回调方式返回脚本执行的结果。runJavaScript需要在loadUrl完成后,比如onPageEnd中调用。
+从API version 9开始不再维护,建议使用[runJavaScript9+](../apis/js-apis-webview.md#runjavascript)代替。
+
**参数:**
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
@@ -4397,12 +4431,14 @@ runJavaScript(options: { script: string, callback?: (result: string) => void })
```
-### stop
+### stop(deprecated)
stop()
停止页面加载。
+从API version 9开始不再维护,建议使用[stop9+](../apis/js-apis-webview.md#stop)代替。
+
**示例:**
```ts
@@ -4424,12 +4460,14 @@ stop()
}
```
-### clearHistory
+### clearHistory(deprecated)
clearHistory(): void
删除所有前进后退记录。
+从API version 9开始不再维护,建议使用[clearHistory9+](../apis/js-apis-webview.md#clearhistory)代替。
+
**示例:**
```ts
@@ -5007,40 +5045,6 @@ setCookie(url: string, value: string): boolean
}
```
-### saveCookieSync9+
-saveCookieSync(): boolean
-
-将当前存在内存中的cookie保存到磁盘中,该方法为同步方法。
-
-**返回值:**
-
-| 类型 | 说明 |
-| ------- | -------------------- |
-| boolean | 同步内存cookie到磁盘操作是否成功。 |
-
-**示例:**
-
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController()
-
- build() {
- Column() {
- Button('saveCookieSync')
- .onClick(() => {
- let result = web_webview.WebCookieManager.saveCookieSync()
- console.log("result: " + result)
- })
- Web({ src: 'www.example.com', controller: this.controller })
- }
- }
- }
- ```
-
### saveCookieAsync9+
saveCookieAsync(): Promise\
@@ -5337,837 +5341,81 @@ deleteSessionCookie(): void
}
```
-## WebDataBase9+
-web组件数据库管理对象。
-
-### existHttpAuthCredentials9+
-
-static existHttpAuthCredentials(): boolean
-
-判断是否存在任何已保存的HTTP身份验证凭据,该方法为同步方法。存在返回true,不存在返回false。
-
-**返回值:**
-
-| 类型 | 说明 |
-| ------- | ---------------------------------------- |
-| boolean | 是否存在任何已保存的HTTP身份验证凭据。存在返回true,不存在返回false |
-
-**示例:**
-
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController()
-
- build() {
- Column() {
- Button('existHttpAuthCredentials')
- .onClick(() => {
- let result = web_webview.WebDataBase.existHttpAuthCredentials()
- console.log('result: ' + result)
- })
- Web({ src: 'www.example.com', controller: this.controller })
- }
- }
- }
- ```
-
-### deleteHttpAuthCredentials9+
-
-static deleteHttpAuthCredentials(): void
-
-清除所有已保存的HTTP身份验证凭据,该方法为同步方法。
-
-**示例:**
-
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController()
-
- build() {
- Column() {
- Button('deleteHttpAuthCredentials')
- .onClick(() => {
- web_webview.WebDataBase.deleteHttpAuthCredentials()
- })
- Web({ src: 'www.example.com', controller: this.controller })
- }
- }
- }
- ```
-
-### getHttpAuthCredentials9+
-
-static getHttpAuthCredentials(host: string, realm: string): Array\
-
-检索给定主机和域的HTTP身份验证凭据,该方法为同步方法。检索成功返回一个包含用户名和密码的组数,检索不成功返回空数组。
-
-**参数:**
-
-| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
-| ----- | ------ | ---- | ---- | ---------------- |
-| host | string | 是 | - | HTTP身份验证凭据应用的主机。 |
-| realm | string | 是 | - | HTTP身份验证凭据应用的域。 |
-
-**返回值:**
-
-| 类型 | 说明 |
-| --------------- | ---------------------- |
-| Array\ | 包含用户名和密码的组数,检索失败返回空数组。 |
-
-**示例:**
-
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController()
- host: string = "www.spincast.org"
- realm: string = "protected example"
- username_password: string[]
- build() {
- Column() {
- Button('getHttpAuthCredentials')
- .onClick(() => {
- this.username_password = web_webview.WebDataBase.getHttpAuthCredentials(this.host, this.realm)
- console.log('num: ' + this.username_password.length)
- ForEach(this.username_password, (item) => {
- console.log('username_password: ' + item)
- }, item => item)
- })
- Web({ src: 'www.example.com', controller: this.controller })
- }
- }
- }
- ```
-
-### saveHttpAuthCredentials9+
-
-static saveHttpAuthCredentials(host: string, realm: string, username: string, password: string): void
-
-保存给定主机和域的HTTP身份验证凭据,该方法为同步方法。
-
-**参数:**
-
-| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
-| -------- | ------ | ---- | ---- | ---------------- |
-| host | string | 是 | - | HTTP身份验证凭据应用的主机。 |
-| realm | string | 是 | - | HTTP身份验证凭据应用的域。 |
-| username | string | 是 | - | 用户名。 |
-| password | string | 是 | - | 密码。 |
-
-**示例:**
-
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController()
- host: string = "www.spincast.org"
- realm: string = "protected example"
- build() {
- Column() {
- Button('saveHttpAuthCredentials')
- .onClick(() => {
- web_webview.WebDataBase.saveHttpAuthCredentials(this.host, this.realm, "Stromgol", "Laroche")
- })
- Web({ src: 'www.example.com', controller: this.controller })
- }
- }
- }
- ```
-
-## GeolocationPermissions9+
-
-web组件地理位置权限管理对象。
-
-### allowGeolocation9+
-
-static allowGeolocation(origin: string): void
+## MessageLevel枚举说明
-允许指定来源使用地理位置接口。
+| 名称 | 描述 |
+| ----- | :---- |
+| Debug | 调试级别。 |
+| Error | 错误级别。 |
+| Info | 消息级别。 |
+| Log | 日志级别。 |
+| Warn | 警告级别。 |
-**参数:**
+## RenderExitReason枚举说明
-| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
-| ------ | ------ | ---- | ---- | ---------- |
-| origin | string | 是 | - | 指定源的字符串索引。 |
+onRenderExited接口返回的渲染进程退出的具体原因。
-**示例:**
+| 名称 | 描述 |
+| -------------------------- | ----------------- |
+| ProcessAbnormalTermination | 渲染进程异常退出。 |
+| ProcessWasKilled | 收到SIGKILL,或被手动终止。 |
+| ProcessCrashed | 渲染进程崩溃退出,如段错误。 |
+| ProcessOom | 程序内存不足。 |
+| ProcessExitUnknown | 其他原因。 |
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController()
- origin: string = "file:///"
- build() {
- Column() {
- Button('allowGeolocation')
- .onClick(() => {
- web_webview.GeolocationPermissions.allowGeolocation(this.origin)
- })
- Web({ src: 'www.example.com', controller: this.controller })
- }
- }
- }
- ```
+## MixedMode枚举说明
-### deleteGeolocation9+
+| 名称 | 描述 |
+| ---------- | ---------------------------------- |
+| All | 允许加载HTTP和HTTPS混合内容。所有不安全的内容都可以被加载。 |
+| Compatible | 混合内容兼容性模式,部分不安全的内容可能被加载。 |
+| None | 不允许加载HTTP和HTTPS混合内容。 |
-static deleteGeolocation(origin: string): void
+## CacheMode枚举说明
+| 名称 | 描述 |
+| ------- | ------------------------------------ |
+| Default | 使用未过期的cache加载资源,如果cache中无该资源则从网络中获取。 |
+| None | 加载资源使用cache,如果cache中无该资源则从网络中获取。 |
+| Online | 加载资源不使用cache,全部从网络中获取。 |
+| Only | 只从cache中加载资源。 |
-清除指定来源的地理位置权限状态。
+## FileSelectorMode枚举说明
+| 名称 | 描述 |
+| -------------------- | ---------- |
+| FileOpenMode | 打开上传单个文件。 |
+| FileOpenMultipleMode | 打开上传多个文件。 |
+| FileOpenFolderMode | 打开上传文件夹模式。 |
+| FileSaveMode | 文件保存模式。 |
-**参数:**
+ ## HitTestType枚举说明
-| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
-| ------ | ------ | ---- | ---- | ---------- |
-| origin | string | 是 | - | 指定源的字符串索引。 |
+| 名称 | 描述 |
+| ------------- | ------------------------ |
+| EditText | 可编辑的区域。 |
+| Email | 电子邮件地址。 |
+| HttpAnchor | 超链接,其src为http。 |
+| HttpAnchorImg | 带有超链接的图片,其中超链接的src为http。 |
+| Img | HTML::img标签。 |
+| Map | 地理地址。 |
+| Phone | 电话号码。 |
+| Unknown | 未知内容。 |
-**示例:**
+## SslError9+枚举说明
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController()
- origin: string = "file:///"
- build() {
- Column() {
- Button('deleteGeolocation')
- .onClick(() => {
- web_webview.GeolocationPermissions.deleteGeolocation(this.origin)
- })
- Web({ src: 'www.example.com', controller: this.controller })
- }
- }
- }
- ```
+onSslErrorEventReceive接口返回的SSL错误的具体原因。
-### deleteAllGeolocation9+
+| 名称 | 描述 |
+| ------------ | ----------- |
+| Invalid | 一般错误。 |
+| HostMismatch | 主机名不匹配。 |
+| DateInvalid | 证书日期无效。 |
+| Untrusted | 证书颁发机构不受信任。 |
-static deleteAllGeolocation(): void
+## ProtectedResourceType9+枚举说明
-清除所有来源的地理位置权限状态。
-
-**示例:**
-
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController()
- build() {
- Column() {
- Button('deleteAllGeolocation')
- .onClick(() => {
- web_webview.GeolocationPermissions.deleteAllGeolocation()
- })
- Web({ src: 'www.example.com', controller: this.controller })
- }
- }
- }
- ```
-
-### getAccessibleGeolocation9+
-
-static getAccessibleGeolocation(origin: string, callback: AsyncCallback\): void
-
-以回调方式异步获取指定源的地理位置权限状态。
-
-**参数:**
-
-| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
-| -------- | ------------------------ | ---- | ---- | ---------------------------------------- |
-| origin | string | 是 | - | 指定源的字符串索引。 |
-| callback | AsyncCallback\ | 是 | - | 返回指定源的地理位置权限状态。获取成功,true表示已授权,false表示拒绝访问。获取失败,表示不存在指定源的权限状态。 |
-
-**示例:**
-
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController()
- origin: string = "file:///"
- build() {
- Column() {
- Button('getAccessibleGeolocationAsync')
- .onClick(() => {
- web_webview.GeolocationPermissions.getAccessibleGeolocation(this.origin, (error, result) => {
- if (error) {
- console.log('getAccessibleGeolocationAsync error: ' + JSON.stringify(error))
- return
- }
- console.log('getAccessibleGeolocationAsync result: ' + result)
- })
- })
- Web({ src: 'www.example.com', controller: this.controller })
- }
- }
- }
- ```
-
-### getAccessibleGeolocation9+
-
-static getAccessibleGeolocation(origin: string): Promise\
-
-以Promise方式异步获取指定源的地理位置权限状态。
-
-**参数:**
-
-| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
-| ------ | ------ | ---- | ---- | ---------- |
-| origin | string | 是 | - | 指定源的字符串索引。 |
-
-**返回值:**
-
-| 类型 | 说明 |
-| ------------------ | ---------------------------------------- |
-| Promise\ | Promise实例,用于获取指定源的权限状态,获取成功,true表示已授权,false表示拒绝访问。获取失败,表示不存在指定源的权限状态。 |
-
-**示例:**
-
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController()
- origin: string = "file:///"
- build() {
- Column() {
- Button('getAccessibleGeolocationPromise')
- .onClick(() => {
- web_webview.GeolocationPermissions.getAccessibleGeolocation(this.origin).then(result => {
- console.log('getAccessibleGeolocationPromise result: ' + result)
- }).catch(error => {
- console.log('getAccessibleGeolocationPromise error: ' + JSON.stringify(error))
- })
- })
- Web({ src: 'www.example.com', controller: this.controller })
- }
- }
- }
- ```
-
-### getStoredGeolocation9+
-
-static getStoredGeolocation(callback: AsyncCallback\\>): void
-
-以回调方式异步获取已存储地理位置权限状态的所有源信息。
-
-**参数:**
-
-| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
-| -------- | -------------------------------- | ---- | ---- | -------------------- |
-| callback | AsyncCallback\\> | 是 | - | 返回已存储地理位置权限状态的所有源信息。 |
-
-**示例:**
-
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController()
- build() {
- Column() {
- Button('getStoredGeolocationAsync')
- .onClick(() => {
- web_webview.GeolocationPermissions.getStoredGeolocation((error, origins) => {
- if (error) {
- console.log('getStoredGeolocationAsync error: ' + JSON.stringify(error))
- return
- }
- let origins_str: string = origins.join()
- console.log('getStoredGeolocationAsync origins: ' + origins_str)
- })
- })
- Web({ src: 'www.example.com', controller: this.controller })
- }
- }
- }
- ```
-
-### getStoredGeolocation9+
-
-static getStoredGeolocation(): Promise\\>
-
-以Promise方式异步获取已存储地理位置权限状态的所有源信息。
-
-**参数:**
-
-| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
-| -------- | -------------------------------- | ---- | ---- | -------------------- |
-| callback | AsyncCallback\\> | 是 | - | 返回已存储地理位置权限状态的所有源信息。 |
-
-**返回值:**
-
-| 类型 | 说明 |
-| -------------------------- | -------------------------------- |
-| Promise\\> | Promise实例,用于获取已存储地理位置权限状态的所有源信息。 |
-
-**示例:**
-
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController()
- build() {
- Column() {
- Button('getStoredGeolocationPromise')
- .onClick(() => {
- web_webview.GeolocationPermissions.getStoredGeolocation().then(origins => {
- let origins_str: string = origins.join()
- console.log('getStoredGeolocationPromise origins: ' + origins_str)
- }).catch(error => {
- console.log('getStoredGeolocationPromise error: ' + JSON.stringify(error))
- })
- })
- Web({ src: 'www.example.com', controller: this.controller })
- }
- }
- }
- ```
-
-## WebStorage9+
-通过WebStorage可管理Web SQL数据库接口和HTML5 Web存储接口,每个应用中的所有Web组件共享一个WebStorage。
-### deleteAllData9+
-static deleteAllData(): void
-
-清除Web SQL数据库当前使用的所有存储。
-
-**示例:**
-
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController()
- build() {
- Column() {
- Button('deleteAllData')
- .onClick(() => {
- web_webview.WebStorage.deleteAllData()
- })
- Web({ src: 'www.example.com', controller: this.controller })
- .databaseAccess(true)
- }
- }
- }
- ```
-
-### deleteOrigin9+
-static deleteOrigin(origin : string): void
-
-清除指定源所使用的存储。
-
-**参数:**
-
-| 参数名 | 参数类型 | 必填 | 说明 |
-| ------ | ------ | ---- | ---------- |
-| origin | string | 是 | 指定源的字符串索引。 |
-
-**示例:**
-
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController()
- origin: string = "origin"
- build() {
- Column() {
- Button('getHttpAuthCredentials')
- .onClick(() => {
- web_webview.WebStorage.deleteOrigin(this.origin)
- })
- Web({ src: 'www.example.com', controller: this.controller })
- .databaseAccess(true)
- }
- }
- }
- ```
-
-### getOrigins9+
-static getOrigins(callback: AsyncCallback\>) : void
-
-以回调方式异步获取当前使用Web SQL数据库的所有源的信息。
-
-**参数:**
-
-| 参数名 | 参数类型 | 必填 | 说明 |
-| -------- | ---------------------------------------- | ---- | ----------------------------------- |
-| callback | AsyncCallback> | 是 | 以数组方式返回源的信息,信息内容参考WebStorageOrigin。 |
-
-**示例:**
-
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController()
- origin: string = "origin"
- build() {
- Column() {
- Button('getOrigins')
- .onClick(() => {
- web_webview.WebStorage.getOrigins((error, origins) => {
- if (error) {
- console.log('error: ' + error)
- return
- }
- for (let i = 0; i < origins.length; i++) {
- console.log('origin: ' + origins[i].origin)
- console.log('usage: ' + origins[i].usage)
- console.log('quota: ' + origins[i].quota)
- }
- })
- })
- Web({ src: 'www.example.com', controller: this.controller })
- .databaseAccess(true)
- }
- }
- }
- ```
-
-### getOrigins9+
-static getOrigins() : Promise\>
-
-以Promise方式异步获取当前使用Web SQL数据库的所有源的信息。
-
-**返回值:**
-
-| 类型 | 说明 |
-| ---------------------------------------- | ---------------------------------------- |
-| Promise> | Promise实例,用于获取当前所有源的信息,信息内容参考WebStorageOrigin。 |
-
-**示例:**
-
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController()
- origin: string = "origin"
- build() {
- Column() {
- Button('getOrigins')
- .onClick(() => {
- web_webview.WebStorage.getOrigins()
- .then(origins => {
- for (let i = 0; i < origins.length; i++) {
- console.log('origin: ' + origins[i].origin)
- console.log('usage: ' + origins[i].usage)
- console.log('quota: ' + origins[i].quota)
- }
- })
- .catch(error => {
- console.log('error: ' + error)
- })
- })
- Web({ src: 'www.example.com', controller: this.controller })
- .databaseAccess(true)
- }
- }
- }
- ```
-
-### getOriginQuota9+
-static getOriginQuota(origin : string, callback : AsyncCallback\) : void
-
-使用callback回调异步获取指定源的Web SQL数据库的存储配额,配额以字节为单位。
-
-**参数:**
-
-| 参数名 | 参数类型 | 必填 | 说明 |
-| -------- | ---------------------- | ---- | --------- |
-| origin | string | 是 | 指定源的字符串索引 |
-| callback | AsyncCallback\ | 是 | 指定源的存储配额。 |
-
-**示例:**
-
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController()
- origin: string = "origin"
- build() {
- Column() {
- Button('getOriginQuota')
- .onClick(() => {
- web_webview.WebStorage.getOriginQuota(this.origin, (error, quota) => {
- if (error) {
- console.log('error: ' + error)
- return
- }
- console.log('quota: ' + quota)
- })
- })
- Web({ src: 'www.example.com', controller: this.controller })
- .databaseAccess(true)
- }
- }
- }
- ```
-
-### getOriginQuota9+
-static getOriginQuota(origin : string) : Promise\
-
-以Promise方式异步获取指定源的Web SQL数据库的存储配额,配额以字节为单位。
-
-**参数:**
-
-| 参数名 | 参数类型 | 必填 | 说明 |
-| ------ | ------ | ---- | ---------- |
-| origin | string | 是 | 指定源的字符串索引。 |
-
-**返回值:**
-
-| 类型 | 说明 |
-| ---------------- | ----------------------- |
-| Promise\ | Promise实例,用于获取指定源的存储配额。 |
-
-**示例:**
-
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController();
- origin: string = "origin"
- build() {
- Column() {
- Button('getOriginQuota')
- .onClick(() => {
- web_webview.WebStorage.getOriginQuota(this.origin)
- .then(quota => {
- console.log('quota: ' + quota)
- })
- .catch(error => {
- console.log('error: ' + error)
- })
- })
- Web({ src: 'www.example.com', controller: this.controller })
- .databaseAccess(true)
- }
- }
- }
- ```
-
-### getOriginUsage9+
-static getOriginUsage(origin : string, callback : AsyncCallback\) : void
-
-以回调方式异步获取指定源的Web SQL数据库的存储量,存储量以字节为单位。
-
-**参数:**
-
-| 参数名 | 参数类型 | 必填 | 说明 |
-| -------- | ---------------------- | ---- | ---------- |
-| origin | string | 是 | 指定源的字符串索引。 |
-| callback | AsyncCallback\ | 是 | 指定源的存储量。 |
-
-**示例:**
-
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController();
- origin: string = "origin"
- build() {
- Column() {
- Button('getOriginUsage')
- .onClick(() => {
- web_webview.WebStorage.getOriginUsage(this.origin, (error, usage) => {
- if (error) {
- console.log('error: ' + error)
- return
- }
- console.log('usage: ' + usage)
- })
- })
- Web({ src: 'www.example.com', controller: this.controller })
- .databaseAccess(true)
- }
- }
- }
- ```
-
-### getOriginUsage9+
-static getOriginUsage(origin : string) : Promise\
-
-以Promise方式异步获取指定源的Web SQL数据库的存储量,存储量以字节为单位。
-
-**参数:**
-
-| 参数名 | 参数类型 | 必填 | 说明 |
-| ------ | ------ | ---- | ---------- |
-| origin | string | 是 | 指定源的字符串索引。 |
-
-**返回值:**
-
-| 类型 | 说明 |
-| ---------------- | ---------------------- |
-| Promise\ | Promise实例,用于获取指定源的存储量。 |
-
-**示例:**
-
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController();
- origin: string = "origin"
- build() {
- Column() {
- Button('getOriginQuota')
- .onClick(() => {
- web_webview.WebStorage.getOriginUsage(this.origin)
- .then(usage => {
- console.log('usage: ' + usage)
- })
- .catch(error => {
- console.log('error: ' + error)
- })
- })
- Web({ src: 'www.example.com', controller: this.controller })
- .databaseAccess(true)
- }
- }
- }
- ```
-
-## WebStorageOrigin9+
-
-提供Web SQL数据库的使用信息。
-
-**参数:**
-
-| 参数名 | 参数类型 | 必填 | 说明 |
-| ------ | ------ | ---- | ---------- |
-| origin | string | 是 | 指定源的字符串索引。 |
-| usage | number | 是 | 指定源的存储量。 |
-| quota | number | 是 | 指定源的存储配额。 |
-
-## MessageLevel枚举说明
-
-| 名称 | 描述 |
-| ----- | :---- |
-| Debug | 调试级别。 |
-| Error | 错误级别。 |
-| Info | 消息级别。 |
-| Log | 日志级别。 |
-| Warn | 警告级别。 |
-
-## RenderExitReason枚举说明
-
-onRenderExited接口返回的渲染进程退出的具体原因。
-
-| 名称 | 描述 |
-| -------------------------- | ----------------- |
-| ProcessAbnormalTermination | 渲染进程异常退出。 |
-| ProcessWasKilled | 收到SIGKILL,或被手动终止。 |
-| ProcessCrashed | 渲染进程崩溃退出,如段错误。 |
-| ProcessOom | 程序内存不足。 |
-| ProcessExitUnknown | 其他原因。 |
-
-## MixedMode枚举说明
-
-| 名称 | 描述 |
-| ---------- | ---------------------------------- |
-| All | 允许加载HTTP和HTTPS混合内容。所有不安全的内容都可以被加载。 |
-| Compatible | 混合内容兼容性模式,部分不安全的内容可能被加载。 |
-| None | 不允许加载HTTP和HTTPS混合内容。 |
-
-## CacheMode枚举说明
-| 名称 | 描述 |
-| ------- | ------------------------------------ |
-| Default | 使用未过期的cache加载资源,如果cache中无该资源则从网络中获取。 |
-| None | 加载资源使用cache,如果cache中无该资源则从网络中获取。 |
-| Online | 加载资源不使用cache,全部从网络中获取。 |
-| Only | 只从cache中加载资源。 |
-
-## FileSelectorMode枚举说明
-| 名称 | 描述 |
-| -------------------- | ---------- |
-| FileOpenMode | 打开上传单个文件。 |
-| FileOpenMultipleMode | 打开上传多个文件。 |
-| FileOpenFolderMode | 打开上传文件夹模式。 |
-| FileSaveMode | 文件保存模式。 |
-
- ## HitTestType枚举说明
-
-| 名称 | 描述 |
-| ------------- | ------------------------ |
-| EditText | 可编辑的区域。 |
-| Email | 电子邮件地址。 |
-| HttpAnchor | 超链接,其src为http。 |
-| HttpAnchorImg | 带有超链接的图片,其中超链接的src为http。 |
-| Img | HTML::img标签。 |
-| Map | 地理地址。 |
-| Phone | 电话号码。 |
-| Unknown | 未知内容。 |
-
-## SslError9+枚举说明
-
-onSslErrorEventReceive接口返回的SSL错误的具体原因。
-
-| 名称 | 描述 |
-| ------------ | ----------- |
-| Invalid | 一般错误。 |
-| HostMismatch | 主机名不匹配。 |
-| DateInvalid | 证书日期无效。 |
-| Untrusted | 证书颁发机构不受信任。 |
-
-## ProtectedResourceType9+枚举说明
-
-| 名称 | 描述 | 备注 |
-| --------- | ------------- | -------------------------- |
-| MidiSysex | MIDI SYSEX资源。 | 目前仅支持权限事件上报,MIDI设备的使用还未支持。 |
+| 名称 | 描述 | 备注 |
+| --------- | ------------- | -------------------------- |
+| MidiSysex | MIDI SYSEX资源。 | 目前仅支持权限事件上报,MIDI设备的使用还未支持。 |
## WebDarkMode9+枚举说明
| 名称 | 描述 |
@@ -6176,103 +5424,6 @@ onSslErrorEventReceive接口返回的SSL错误的具体原因。
| On | Web深色模式开启。 |
| Auto | Web深色模式跟随系统。 |
-## WebAsyncController
-
-通过WebAsyncController可以控制Web组件具有异步回调通知的行为,一个WebAsyncController对象控制一个Web组件。
-
-### 创建对象
-
-```
-webController: WebController = new WebController();
-webAsyncController: WebAsyncController = new WebAsyncController(webController);
-```
-
-### storeWebArchive9+
-
-storeWebArchive(baseName: string, autoName: boolean, callback: AsyncCallback): void
-
-以回调方式异步保存当前页面。
-
-**参数:**
-
-| 参数名 | 参数类型 | 必填 | 说明 |
-| -------- | ---------------------------------------- | ---- | ----------------------------------- |
-| baseName | string | 是 | 文件存储路径,该值不能为空。
-| autoName | boolean | 是 | 决定是否自动生成文件名。
如果为false,则将baseName作为文件存储路径。
如果为true,则假定baseName是一个目录,将根据当前页的Url自动生成文件名。
-| callback | AsyncCallback | 是 | 返回文件存储路径,保持网页失败会返回null。 |
-
-**示例:**
-
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController()
- build() {
- Column() {
- Button('saveWebArchive')
- .onClick(() => {
- let webAsyncController = new web_webview.WebAsyncController(this.controller)
- webAsyncController.storeWebArchive("/data/storage/el2/base/", true, (filename) => {
- if (filename != null) {
- console.info(`save web archive success: ${filename}`)
- }
- })
- })
- Web({ src: 'www.example.com', controller: this.controller })
- }
- }
- }
- ```
-
-### storeWebArchive9+
-
-storeWebArchive(baseName: string, autoName: boolean): Promise
-
-以Promise方式异步保存当前页面。
-
-**参数:**
-
-| 参数名 | 参数类型 | 必填 | 说明 |
-| -------- | ---------------------------------------- | ---- | ----------------------------------- |
-| baseName | string | 是 | 文件存储路径,该值不能为空。
-| autoName | boolean | 是 | 决定是否自动生成文件名。
如果为false,则将baseName作为文件存储路径。
如果为true,则假定baseName是一个目录,将根据当前页的Url自动生成文件名。
-
-**返回值:**
-
-| 类型 | 说明 |
-| --------------- | -------------------------------- |
-| Promise | Promise实例,保存成功返回文件路径,保存失败返回null。 |
-
-**示例:**
-
- ```ts
- // xxx.ets
- import web_webview from '@ohos.web.webview'
- @Entry
- @Component
- struct WebComponent {
- controller: WebController = new WebController();
- build() {
- Column() {
- Button('saveWebArchive')
- .onClick(() => {
- let webAsyncController = new web_webview.WebAsyncController(this.controller);
- webAsyncController.storeWebArchive("/data/storage/el2/base/", true)
- .then(filename => {
- if (filename != null) {
- console.info(`save web archive success: ${filename}`)
- }
- })
- })
- Web({ src: 'www.example.com', controller: this.controller })
- }
- }
- }
- ```
-
## WebMessagePort9+
通过WebMessagePort可以进行消息的发送以及接收。
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-lottie.md b/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-lottie.md
index 36064dceb6c9c2435cd52f880fa8a7823dd9952a..df3de28fed5d376b25533ec9b27f0a0a83b79f89 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-lottie.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-components-canvas-lottie.md
@@ -27,7 +27,7 @@ loadAnimation(
path: string, container: object, render: string, loop: boolean, autoplay: boolean, name: string ): AnimationItem
-加载动画,须提前声明Animator('__lottie_ets')对象,并在Canvas完成布局后调用。可配合Canvas组件生命周期接口使用,比如onAppear()与onPageShow()。
+加载动画,须提前声明Animator('__lottie_ets')对象,并在Canvas完成布局后调用。可配合Canvas组件生命周期接口onReady()使用。
**参数:**
diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-location.md b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-location.md
index fe33e7e9bd2a464ec43fd9a138c9b5a2320583d6..2cd02ad07fdec4be3adf55264fb101d2379e4420 100644
--- a/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-location.md
+++ b/zh-cn/application-dev/reference/arkui-ts/ts-universal-attributes-location.md
@@ -17,7 +17,7 @@
| position | [Position](ts-types.md#position8) | 绝对定位,设置元素左上角相对于父容器左上角偏移位置。在布局容器中,设置该属性不影响父容器布局,仅在绘制时进行位置调整。 |
| markAnchor | [Position](ts-types.md#position8) | 设置元素在位置定位时的锚点,以元素左上角作为基准点进行偏移。通常配合position和offset属性使用,单独使用时,效果类似offset
默认值:
{
x: 0,
y: 0
} |
| offset | [Position](ts-types.md#position8) | 相对定位,设置元素相对于自身的偏移量。设置该属性,不影响父容器布局,仅在绘制时进行位置调整。
默认值:
{
x: 0,
y: 0
} |
-| alignRules9+ | {
left?: { anchor: string, align: [HorizontalAlign](ts-appendix-enums.md#horizontalalign) };
right?: { anchor: string, align: [HorizontalAlign](ts-appendix-enums.md#horizontalalign) };
middle?: { anchor: string, align: [HorizontalAlign](ts-appendix-enums.md#horizontalalign) };
top?: { anchor: string, align: [VerticalAlign](ts-appendix-enums.md#verticalalign) };
bottom?: { anchor: string, align: [VerticalAlign](ts-appendix-enums.md#verticalalign) };
center?: { anchor: string, align: [VerticalAlign](ts-appendix-enums.md#verticalalign) }
} | 指定相对容器的对齐规则。
- left:设置左对齐参数。
- right:设置右对齐参数。
- middle:设置中间对齐的参数。
- top:设置顶部对齐的参数。
- bottom:设置底部对齐的参数。
- center:设置中心对齐的参数。
**说明:**
- anchor:设置作为锚点的组件的id值。
- align:设置相对于锚点组件的对齐方式。 |
+| alignRules9+ | {
left?: { anchor: string, align: [HorizontalAlign](ts-appendix-enums.md#horizontalalign) };
right?: { anchor: string, align: [HorizontalAlign](ts-appendix-enums.md#horizontalalign) };
middle?: { anchor: string, align: [HorizontalAlign](ts-appendix-enums.md#horizontalalign) };
top?: { anchor: string, align: [VerticalAlign](ts-appendix-enums.md#verticalalign) };
bottom?: { anchor: string, align: [VerticalAlign](ts-appendix-enums.md#verticalalign) };
center?: { anchor: string, align: [VerticalAlign](ts-appendix-enums.md#verticalalign) }
} | 指定相对容器的对齐规则,仅当父容器为[RelativeContainer](ts-container-relativecontainer.md)时生效。
- left:设置左对齐参数。
- right:设置右对齐参数。
- middle:设置中间对齐的参数。
- top:设置顶部对齐的参数。
- bottom:设置底部对齐的参数。
- center:设置中心对齐的参数。
**说明:**
- anchor:设置作为锚点的组件的id值。
- align:设置相对于锚点组件的对齐方式。 |
## 示例
diff --git a/zh-cn/application-dev/reference/errorcodes/errorcode-useriam.md b/zh-cn/application-dev/reference/errorcodes/errorcode-useriam.md
index d8a1feb3710f7696bc1590cf5cf596c6e8c0faaf..c7bb87386231d1ba66a4ff5c61fd4d49bd307eaf 100644
--- a/zh-cn/application-dev/reference/errorcodes/errorcode-useriam.md
+++ b/zh-cn/application-dev/reference/errorcodes/errorcode-useriam.md
@@ -12,7 +12,7 @@
具体参见[通用错误码](./errorcode-universal.md)
-## 12500001 执行认证失败
+## 12500001 认证失败
**错误信息**
@@ -20,11 +20,11 @@ Authentication failed.
**可能原因**
-出现该错误码一般是系统内部错误,例如内存申请失败、内存拷贝出错等。
+当前凭据与设备里已经录入的凭据比对失败。
**处理步骤**
-重启设备,重新调用接口。
+重新发起认证。
## 12500002 一般的操作错误
diff --git a/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001275267040.png b/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001275267040.png
index 204894213329c4de1edf74d869c1bfd8e8e78d04..6645b56be3acbb8c9f4ddf8c56f9fdf4706b2ed5 100644
Binary files a/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001275267040.png and b/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001275267040.png differ
diff --git a/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001285965546.png b/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001285965546.png
index f07b21dbc89b6722f6374a8bde9bdc893798f120..e2c64018ff0ea390367ea4f26385f79cf1a767ed 100644
Binary files a/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001285965546.png and b/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001285965546.png differ
diff --git a/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001285965778.png b/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001285965778.png
index 6aa63a6876293a994ffe1cc90f6973a949e9e43a..c11661cb1ad14044f1a8cd2a3f94a2cc93cd02b7 100644
Binary files a/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001285965778.png and b/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001285965778.png differ
diff --git a/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001326386753.png b/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001326386753.png
index 97d98319b294e132d43cd4f75a2cc8031995b99f..402a4a35b8ed09f184987165501ebe665f1f9660 100644
Binary files a/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001326386753.png and b/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001326386753.png differ
diff --git a/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001338012765.png b/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001338012765.png
index 7848b0336d1c8fb4e9b8f38e94b8308453b2b464..c9553f714d09d1dae9559eb86bbb801d32d08141 100644
Binary files a/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001338012765.png and b/zh-cn/device-dev/quick-start/figures/zh-cn_image_0000001338012765.png differ