From 2737334157a581d1e9b027cbe8ef4034c0d55931 Mon Sep 17 00:00:00 2001
From: dingchenjie
Date: Thu, 27 Nov 2025 15:51:17 +0800
Subject: [PATCH 1/5] docs: update
react-native-toolbar-android,react-native-graph,react-native-tcp-socket,react-native-keys,react-native-aria
Signed-off-by: dingchenjie
---
en/react-native-aria.md | 93 +++--
en/react-native-community-toolbar-android.md | 184 +++++-----
en/react-native-graph.md | 203 ++++++-----
en/react-native-keys.md | 144 +++++---
en/react-native-tcp-socket.md | 331 +++++++++++-------
zh-cn/react-native-aria.md | 38 +-
.../react-native-community-toolbar-android.md | 50 +--
zh-cn/react-native-graph.md | 54 +--
zh-cn/react-native-keys.md | 47 ++-
zh-cn/react-native-tcp-socket.md | 232 ++++++++----
10 files changed, 834 insertions(+), 542 deletions(-)
diff --git a/en/react-native-aria.md b/en/react-native-aria.md
index 1f56e006..a0552328 100644
--- a/en/react-native-aria.md
+++ b/en/react-native-aria.md
@@ -1,4 +1,4 @@
-> Template version: v0.2.2
+> Template Version: v0.2.2
react-native-aria
@@ -12,14 +12,19 @@
-> [!TIP] [GitHub address](https://github.com/gluestack/react-native-aria/tree/main)
+> [!TIP] [Github Address](https://github.com/gluestack/react-native-aria/tree/main)
-## Installation and Usage
+## Installation & Usage
-React Native ARIA是可增量采用的。每个组件都作为单独的包发布,因此您可以在单个组件中使用它,并随着时间的推移逐渐添加更多组件。所有这些包都在npm上的@react-native-aria范围内发布。
-> [!TIP] 该库已经不再维护,如果执行总包命令,项目运行缺失模块,就需要卸载旧包,在命令后增加--legacy-peer-deps,然后再次下载包文件
+Please check the corresponding version information in the third-party library's Releases:
-Go to the project directory and execute the following instruction:
+| Third-party Version | Release Information | Supported RN Version |
+| ------------------- | ------------------- | -------------------- |
+| 0.2.4 | [react-native-aria release](https://github.com/gluestack/react-native-aria/releases) | 0.72/0.77 |
+
+For older versions not published to npm, please refer to the [Installation Guide](/zh-cn/tgz-usage.md) to install the tgz package.
+
+Navigate to your project directory and run the following command:
#### **yarn**
@@ -27,17 +32,13 @@ Go to the project directory and execute the following instruction:
yarn add react-native-aria@0.2.3
```
-
-
#### **npm**
```bash
npm install react-native-aria@0.2.3
```
-
-
-除了总包之外,我们还提供了一些单独包,如:@react-native-aria/button
+In addition to the main package, we also provide some separate packages, such as: @react-native-aria/button
#### **yarn**
@@ -45,19 +46,13 @@ npm install react-native-aria@0.2.3
yarn add @react-native-aria/button@0.2.7
```
-
-
#### **npm**
```bash
npm install @react-native-aria/button@0.2.7
```
-
-
-The following code shows the basic use scenario of the repository:
-
-> [!WARNING] The name of the imported repository remains unchanged.
+The following code demonstrates the basic usage scenario of useToggleButton:
```js
import React from "react";
@@ -80,7 +75,7 @@ export function ToggleButton(props: any) {
padding: 5, width: 100, height: 30, justifyContent: 'center', alignItems: 'center'
}}
>
- 点击切换
+ Click to toggle
);
@@ -90,7 +85,7 @@ export default ToggleButton
```
-下面的代码展示了useCheckbox与useCheckboxGroup的基本使用场景:
+The following code demonstrates the basic usage scenario of useCheckbox and useCheckboxGroup:
```javascript
import React, { useContext, useRef } from 'react';
@@ -102,7 +97,7 @@ import { useFocusRing } from '@react-native-aria/focus';
let CheckboxGroupContext = React.createContext(null);
-const CheckboxItems = [{ key: 'soccer', value: '足球' }, { key: 'baseball', value: '棒球' }, { key: 'basketball', value: '篮球' }]
+const CheckboxItems = [{ key: 'soccer', value: 'Football' }, { key: 'baseball', value: 'Baseball' }, { key: 'basketball', value: 'Basketball' }]
const findName = (value: string) => {
const item = CheckboxItems.find(i => { return i.key === value; })
return item && item.value
@@ -119,7 +114,7 @@ export function CheckboxGroup(props: any) {
{children}
- 已经选择: {props.value.map(i=>{
+ Selected: {props.value.map(i=>{
return {findName(i)}
})}
@@ -177,7 +172,7 @@ export default CheckboxExample
```
-下面的代码展示了useRadio与useRadioGroup的基本使用场景:
+The following code demonstrates the basic usage scenario of useRadio and useRadioGroup:
```javascript
import React from "react";
@@ -188,7 +183,7 @@ import { useFocusRing } from "@react-native-aria/focus";
let RadioContext = React.createContext({});
-const radioItems = [{ key: 'dogs', value: '狗子' }, { key: 'cats', value: '猫儿' }]
+const radioItems = [{ key: 'dogs', value: 'Dogs' }, { key: 'cats', value: 'Cats' }]
const findName = (value: string) => {
const item = radioItems.find(i => { return i.key === value; })
return item && item.value
@@ -211,7 +206,7 @@ export function RadioGroup(props: any) {
>
{children}
- 已经选择:{findName(state.selectedValue as string)}
+ Selected:{findName(state.selectedValue as string)}
);
}
@@ -250,7 +245,7 @@ export default RadioExample
```
-下面的代码展示了useSwitch的基本使用场景:
+The following code demonstrates the basic usage scenario of useSwitch:
```javascript
import { useToggleState } from "@react-stately/toggle";
@@ -368,7 +363,7 @@ export function Switch(origProps: any) {
{icon}
- {isOn ? "开" : "关"}
+ {isOn ? "On" : "Off"}
);
}
@@ -403,7 +398,7 @@ export default ControlledSwitch
```
-下面的代码展示了useOverlayPosition的基本使用场景:
+The following code demonstrates the basic usage scenario of useOverlayPosition:
```javascript
import React from "react";
@@ -494,7 +489,7 @@ export function Trigger({ placement }: any) {
paddingVertical: 10,
}}
>
- 点我一下
+ Click me
@@ -511,40 +506,40 @@ export default TriggerWrapper
```
-更多hooks请参考[react-native-aria官方文档](https://geekyants.github.io/react-native-aria/docs/)
+For more hooks, please refer to the [react-native-aria official documentation](https://geekyants.github.io/react-native-aria/docs/)
-## Constraints
+## Constraints & Limitations
### Compatibility
-This document is verified based on the following versions:
+To use this library, you need the correct React-Native and RNOH versions. Additionally, you need to use the matching DevEco Studio and phone ROM.
-1. RNOH:0.72.13; SDK:HarmonyOS NEXT Developer Preview1; IDE:DevEco Studio 4.1.3.500; ROM:2.0.0.59;
-2. RNOH:0.72.27; SDK:HarmonyOS-Next-DB1 5.0.0.29(SP1) ; IDE:DevEco Studio 5.0.3.400; ROM:3.0.0.25;
-3. RNOH:0.72.29; SDK:HarmonyOS NEXT Developer Beta6; IDE:DevEco Studio 5.0.3.706; ROM:3.0.0.61;
-4. RNOH:0.72.33; SDK:OpenHarmony 5.0.0.71(API Version 12 Release); IDE:DevEco Studio 5.0.3.900; ROM:NEXT.0.0.71;
+Verified in the following versions:
+
+1. RNOH: 0.72.38; SDK: HarmonyOS-5.0.0(API12); ROM: 5.0.0.107;
+2. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.868; ROM: 6.0.0.112;
## Hooks
-> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library.
+> [!TIP] The "Platform" column indicates the platforms supported by the original third-party library for that property.
-> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android.
+> [!TIP] The "HarmonyOS Support" column: 'Yes' means the property is supported on the HarmonyOS platform; 'No' means it is not supported; 'partially' means partial support. The usage method is consistent across platforms, with effects benchmarked against iOS or Android.
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|-------------------|
-| useToggleButton | Provides the behavior and accessibility implementation for a toggle button component. ToggleButtons allow users to toggle a selection on or off, for example switching between two states or modes. | Function | no | iOS,Android | yes |
-| useCheckbox | Provides the behavior and accessibility implementation for a checkbox component. Checkboxes allow users to select multiple items from a list of individual items, or to mark one individual item as selected. | Function | no | iOS,Android | yes |
-| useCheckboxGroup | Provides the behavior and accessibility implementation for a checkbox group component. Checkbox groups allow users to select multiple items from a list of options. | Function | no | iOS,Android | yes |
-| useRadioGroup | Provides the behavior and accessibility implementation for a radio group component. Radio groups allow users to select a single item from a list of mutually exclusive options. | Function | no | iOS,Android | yes |
-| useSwitch | Provides the behavior and accessibility implementation for a switch component. A switch is similar to a checkbox, but represents on/off values as opposed to selection. | Function | no | iOS,Android | yes |
-| OverlayContainer | Provides React Portal like functionality for React Native apps which can be useful for displaying absolutely positioned components like Menu, Tooltip, Popover. | Function | no | iOS,Android | yes |
-| useOverlayPosition | Handles positioning overlays like popovers and menus relative to a trigger element, and updating the position when the window resizes. | Function | no | iOS,Android | yes |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|-------------|-------------------|
+| useToggleButton | Provides the behavior and accessibility implementation for a toggle button component. ToggleButtons allow users to toggle a selection on or off, for example switching between two states or modes. | Function | No | iOS,Android | Yes |
+| useCheckbox | Provides the behavior and accessibility implementation for a checkbox component. Checkboxes allow users to select multiple items from a list of individual items, or to mark one individual item as selected. | Function | No | iOS,Android | Yes |
+| useCheckboxGroup | Provides the behavior and accessibility implementation for a checkbox group component. Checkbox groups allow users to select multiple items from a list of options. | Function | No | iOS,Android | Yes |
+| useRadioGroup | Provides the behavior and accessibility implementation for a radio group component. Radio groups allow users to select a single item from a list of mutually exclusive options. | Function | No | iOS,Android | Yes |
+| useSwitch | Provides the behavior and accessibility implementation for a switch component. A switch is similar to a checkbox, but represents on/off values as opposed to selection. | Function | No | iOS,Android | Yes |
+| OverlayContainer | Provides React Portal like functionality for React Native apps which can be useful for displaying absolutely positioned components like Menu, Tooltip, Popover. | Function | No | iOS,Android | Yes |
+| useOverlayPosition | Handles positioning overlays like popovers and menus relative to a trigger element, and updating the position when the window resizes. | Function | No | iOS,Android | Yes |
## Known Issues
+1. Immediate voice reading after toggling selection state is currently not supported.
## Others
## License
-This project is licensed under [The MIT License (MIT)](https://github.com/gluestack/react-native-aria/blob/main/LICENSE).
-
+This project is based on [The MIT License (MIT)](https://github.com/gluestack/react-native-aria/blob/main/LICENSE). Feel free to enjoy and contribute to open source.
\ No newline at end of file
diff --git a/en/react-native-community-toolbar-android.md b/en/react-native-community-toolbar-android.md
index 78e9550c..4838ddb5 100644
--- a/en/react-native-community-toolbar-android.md
+++ b/en/react-native-community-toolbar-android.md
@@ -1,4 +1,4 @@
-> Template version: v0.3.0
+> Template Version: v0.3.0
@react-native-community/toolbar-android
@@ -6,36 +6,42 @@
This project is based on [@react-native-toolbar-android/toolbar-android@v0.2.1](https://github.com/react-native-toolbar-android/toolbar-android/tree/v0.2.1).
-This third-party library has been migrated to Gitee and is now available for direct download from npm, the new package name is: `@react-native-ohos/toolbar-android`, The version correspondence details are as follows:
+The third-party library repository has been migrated to Gitee and supports direct download from npm. The new package name is: `@react-native-ohos/toolbar-android`. The specific version relationships are as follows:
-| Version | Package Name | Repository | Release |
-|-----------------| ------------------------------------------------- | ------------------ | -------------------------- |
-| <= 0.2.1-0.0.4 | @react-native-oh-tpl/toolbar-android | [Github(deprecated)](https://github.com/react-native-oh-library/toolbar-android) | [Github Releases(deprecated)](https://github.com/react-native-oh-library/toolbar-android/releases) |
-| >= 0.2.2 | @react-native-ohos/toolbar-android | [Gitee](https://gitee.com/openharmony-sig/rntpc_toolbar-android) | [Gitee Releases](https://gitee.com/openharmony-sig/rntpc_toolbar-android/releases) |
+| Third-party Version | Release Information | Supported RN Version |
+|-----------------| ------------------------------------------------- | ------------------ |
+| <= 0.2.1 | [@react-native-oh-tpl/toolbar-android Releases(deprecated)](https://github.com/react-native-oh-library/toolbar-android/releases) | 0.72
+| >= 0.2.2 | [@react-native-ohos/toolbar-android Releases](https://gitcode.com/openharmony-sig/rntpc_toolbar-android/releases) | 0.77
-## 1.Installation and Usage
+## 1. Installation & Usage
-Go to the project directory and execute the following instruction:
+Navigate to your project directory and run the following command:
-#### npm
+#### **npm**
```bash
+# 0.72
+npm install @react-native-oh-tpl/toolbar-android
+# 0.77
npm install @react-native-ohos/toolbar-android
```
-#### yarn
+#### **yarn**
```bash
+# 0.72
+yarn add @react-native-oh-tpl/toolbar-android
+# 0.77
yarn add @react-native-ohos/toolbar-android
```
-The following code shows the basic use scenario of the repository:
+The following code demonstrates basic usage scenarios of this library:
-> [!WARNING] The name of the imported repository remains unchanged.
+> [!WARNING] The import library name remains unchanged during use.
```js
import React, { useState } from "react";
@@ -114,41 +120,41 @@ const styles = StyleSheet.create({
export default App;
```
-## 2.Manual Link
+## 2. Manual Link
This step provides guidance for manually configuring native dependencies.
-Open the `harmony` directory of the HarmonyOS project in DevEco Studio.
+First, you need to open the HarmonyOS project `harmony` within your project using DevEco Studio.
-### 2.1.Overrides RN SDK
+### 2.1. Overrides RN SDK
-To ensure the project relies on the same version of the RN SDK, you need to add an `overrides` field in the project's root `oh-package.json5` file, specifying the RN SDK version to be used. The replacement version can be a specific version number, a semver range, or a locally available HAR package or source directory.
+To ensure the project depends on the same version of RN SDK, you need to add the overrides field to the root `oh-package.json5`, pointing to the RN SDK version required by the project. The replaced version can be a specific version number, a fuzzy version, or a locally existing HAR package or source code directory.
-For more information about the purpose of this field, please refer to the [official documentation](https://developer.huawei.com/consumer/en/doc/harmonyos-guides-V5/ide-oh-package-json5-V5#en-us_topic_0000001792256137_overrides).
+For details about this field, please read the [official documentation](https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/ide-oh-package-json5-V5#zh-cn_topic_0000001792256137_overrides)
```json
{
...
"overrides": {
- "@rnoh/react-native-openharmony": "^0.72.38" // ohpm version
- // "@rnoh/react-native-openharmony" : "./react_native_openharmony.har" // a locally available HAR package
- // "@rnoh/react-native-openharmony" : "./react_native_openharmony" // source code directory
+ "@rnoh/react-native-openharmony": "^0.72.38" // ohpm online version
+ // "@rnoh/react-native-openharmony" : "./react_native_openharmony.har" // path to local har package
+ // "@rnoh/react-native-openharmony" : "./react_native_openharmony" // path to source code
}
}
```
-### 2.2.Introducing Native Code
+### 2.2. Import Native Code
-Currently, two methods are available:
+There are currently two methods:
-- Use the HAR file.
-- Directly link to the source code。
+- Import via har package;
+- Link source code directly.
-Method 1 (recommended): Use the HAR file.
+Method 1: Import via har package (Recommended)
-> [!TIP] The HAR file is stored in the `harmony` directory in the installation path of the third-party library.
+> [!TIP] The har package is located in the `harmony` folder of the installed third-party library path.
-Open `entry/oh-package.json5` file and add the following dependencies:
+Open `entry/oh-package.json5` and add the following dependencies:
```json
"dependencies": {
@@ -156,24 +162,24 @@ Open `entry/oh-package.json5` file and add the following dependencies:
}
```
-Click the `sync` button in the upper right corner.
+Click the `sync` button in the top right corner.
-Alternatively, run the following instruction on the terminal:
+Or execute in the terminal:
```bash
cd entry
ohpm install
```
-Method 2: Directly link to the source code.
+Method 2: Link Source Code Directly
-> [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md).
+> [!TIP] If you need to link source code directly, please refer to the [Direct Link Source Code Guide](/zh-cn/link-source-code.md)
-### 2.3.Configuring CMakeLists and Introducing ToolbarAndroidPackage
+### 2.3. Configure CMakeLists and Import ToolbarAndroidPackage
-Open `entry/src/main/cpp/CMakeLists.txt` and add the following code:
+Open `entry/src/main/cpp/CMakeLists.txt` and add:
-```diff
+```cmake
project(rnapp)
cmake_minimum_required(VERSION 3.4.1)
set(CMAKE_SKIP_BUILD_RPATH TRUE)
@@ -205,9 +211,9 @@ target_link_libraries(rnoh_app PUBLIC rnoh_sample_package)
# RNOH_END: link_packages
```
-Open `entry/src/main/cpp/PackageProvider.cpp` and add the following code:
+Open `entry/src/main/cpp/PackageProvider.cpp` and add:
-```diff
+```c++
...
+ #include "ToolbarAndroidPackage.h"
@@ -221,13 +227,13 @@ std::vector> PackageProvider::getPackages(Package::Cont
}
```
-### 2.4.Introducing RNCCheckBoxPackage to ArkTS
+### 2.4. Import RNCCheckBoxPackage on the ArkTS Side
-> [!TIP] Required for version `v0.2.22` and above
+> [!TIP] Required for version v0.2.22 and above
Open `entry/src/main/ets/RNPackagesFactory.ts` and add:
-```diff
+```typescript
...
+ import {ToolbarAndroidPackage} from '@react-native-ohos/toolbar-android/src/main/ets/ToolbarAndroidPackage';
@@ -236,14 +242,13 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
+ return [new ToolbarAndroidPackage(ctx)];
];
}
-
```
-### 2.5.Introducing RNCToolbarAndroid Component to ArkTS
+### 2.5. Import RNCToolbarAndroid Component on the ArkTS Side
-Find `function buildCustomRNComponent()`, which is usually located in `entry/src/main/ets/pages/index.ets` or `entry/src/main/ets/rn/LoadBundle.ets`, and add the following code:
+Find **function buildCustomRNComponent()**, usually located in `entry/src/main/ets/pages/index.ets` or `entry/src/main/ets/rn/LoadBundle.ets`, and add:
-```diff
+```typescript
...
+ import { RNCToolbarAndroid} from '@react-native-ohos/toolbar-android/src/main/ets/RNCToolbarAndroid'
@@ -261,74 +266,77 @@ Find `function buildCustomRNComponent()`, which is usually located in `entry/src
...
```
-> [!TIP] If the repository uses a mixed solution, the component name needs to be added.
+> [!TIP] This library uses a hybrid solution and requires adding the component name.
-Find the constant `arkTsComponentNames` in `entry/src/main/ets/pages/index.ets` or `entry/src/main/ets/rn/LoadBundle.ets` and add the component name to the array.
+Find the constant `arkTsComponentNames` in `entry/src/main/ets/pages/index.ets` or `entry/src/main/ets/rn/LoadBundle.ets` and add the component name to the array:
-```diff
+```typescript
const arkTsComponentNames: Array = [
...
+ RNCToolbarAndroid.NAME
];
```
-### 2.6.Running
+### 2.6. Run
-Click the `sync` button in the upper right corner.
+Click the `sync` button in the top right corner.
-Alternatively, run the following instruction on the terminal:
+Or execute in the terminal:
```bash
cd entry
ohpm install
```
-Then build and run the code.
+Then compile and run.
+
+## 3. Constraints & Limitations
-## 3.Constraints
+### 3.1 Compatibility
-### 3.1Compatibility
+To use this library, you need the correct React-Native and RNOH versions. Additionally, you need to use the matching DevEco Studio and phone ROM.
-To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone.
+Verified in the following versions:
-Check the release version information in the release address of the third-party library: [@react-native-ohos/toolbar-android Releases](https://gitee.com/openharmony-sig/rntpc_toolbar-android/releases)
+1. RNOH: 0.72.38; SDK: HarmonyOS-5.0.0(API12); ROM: 5.0.0.107;
+2. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.868; ROM: 6.0.0.112;
-## 4.Properties
+## 4. Props
-> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library.
+> [!TIP] The "Platform" column indicates the platforms supported by the original third-party library for that property.
-> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android.
+> [!TIP] The "HarmonyOS Support" column: 'Yes' means the property is supported on the HarmonyOS platform; 'No' means it is not supported; 'partially' means partial support. The usage method is consistent across platforms, with effects benchmarked against iOS or Android.
Inherits [View Props](https://reactnative.dev/docs/view#props).
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |-----------| -------- | ----------------- |
-| actions | Sets possible actions on the toolbar as part of the action menu. These are displayed as icons or text on the right side of the widget. If they don't fit they are placed in an 'overflow' menu. | array of object: {title: string,icon: ImageSource,show: enum('always', 'ifRoom', 'never'),showWithText: bool} | No | Android | yes |
-| contentInsetStart | Sets the content inset for the toolbar starting edge. | number | No | Android | yes |
-| contentInsetEnd | Sets the content inset for the toolbar ending edge. | number | No | Android | yes |
-| logo | Sets the toolbar logo. | ImageSource | No | Android | yes |
-| navIcon | Sets the navigation icon. | ImageSource | No | Android | yes |
-| onActionSelected | Callback that is called when an action is selected. The only argument that is passed to the callback is the position of the action in the actions array. | function | No | Android | yes |
-| onIconClicked | Callback called when the icon is selected. | function | No | Android | yes |
-| overflowIcon | Sets the overflow icon. | ImageSource | No | Android | yes |
-| rtl | Used to set the toolbar direction to RTL. | bool | No | Android | yes |
-| subtitle | Sets the toolbar subtitle. | string | No | Android | yes |
-| subtitleColor | Sets the toolbar subtitle color. | string | No | Android | yes |
-| title | Sets the toolbar title. | string | No | Android | yes |
-| titleColor | Sets the toolbar title color. | string | No | Android | yes |
-
-#### 4.1.Props of ImageSource
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ------ | ------------------------------------------------------ | ------ | -------- | -------- | ----------------- |
-| uri | load image from a url, e.g. require('./some_icon.png') | string | Yes | android | yes |
-| width | the width of the image | number | No | android | yes |
-| height | the height of the image | number | No | android | yes |
-
-## 5.Known Issues
-
-## 6.Others
-
-## 7.License
-
-This project is licensed under [The MIT License (MIT)](https://gitee.com/openharmony-sig/rntpc_toolbar-android/blob/master/LICENSE).
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+|-----------------|---------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|-----------|----------|-------------------|
+| actions | Sets possible actions on the toolbar as part of the action menu. These are displayed as icons or text on the right side of the widget. If they don't fit they are placed in an 'overflow' menu. | array of object: {title: string,icon: ImageSource,show: enum('always', 'ifRoom', 'never'),showWithText: bool} | No | Android | Yes |
+| contentInsetStart | Sets the content inset for the toolbar starting edge. | number | No | Android | Yes |
+| contentInsetEnd | Sets the content inset for the toolbar ending edge. | number | No | Android | Yes |
+| logo | Sets the toolbar logo. | ImageSource | No | Android | Yes |
+| navIcon | Sets the navigation icon. | ImageSource | No | Android | Yes |
+| onActionSelected | Callback that is called when an action is selected. The only argument that is passed to the callback is the position of the action in the actions array. | function | No | Android | Yes |
+| onIconClicked | Callback called when the icon is selected. | function | No | Android | Yes |
+| overflowIcon | Sets the overflow icon. | ImageSource | No | Android | Yes |
+| rtl | Used to set the toolbar direction to RTL. | bool | No | Android | Yes |
+| subtitle | Sets the toolbar subtitle. | string | No | Android | Yes |
+| subtitleColor | Sets the toolbar subtitle color. | string | No | Android | Yes |
+| title | Sets the toolbar title. | string | No | Android | Yes |
+| titleColor | Sets the toolbar title color. | string | No | Android | Yes |
+
+#### 4.1. Props of ImageSource
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+|------|---------------------------------------------------------------------------------------------------------------------------------------|--------|----------|----------|-------------------|
+| uri | load image from a url, e.g. require('./some_icon.png') | string | Yes | android | Yes |
+| width | the width of the image | number | No | android | Yes |
+| height | the height of the image | number | No | android | Yes |
+
+## 5. Known Issues
+
+## 6. Others
+
+## 7. License
+
+This project is based on [The MIT License (MIT)](https://gitee.com/openharmony-sig/rntpc_toolbar-android/blob/master/LICENSE). Feel free to enjoy and contribute to open source.
\ No newline at end of file
diff --git a/en/react-native-graph.md b/en/react-native-graph.md
index cd61f5cf..a9a285f1 100644
--- a/en/react-native-graph.md
+++ b/en/react-native-graph.md
@@ -1,5 +1,4 @@
-> Template version: v0.2.2
-
+> Template Version: v0.2.2
react-native-graph
@@ -12,154 +11,164 @@
-> [!TIP] [ GitHub address](https://github.com/margelo/react-native-graph)
+> [!TIP] [Github Address](https://github.com/margelo/react-native-graph)
## Installation and Usage
-Go to the project directory and execute the following instruction:
+Please check the corresponding version information in the third-party library's Releases:
+
+| Third-party Library Version | Release Information | Supported RN Version |
+| --------------------------- | ------------------- | -------------------- |
+| 1.1.0 | [react-native-graph release](https://github.com/margelo/react-native-graph/releases) | 0.72/0.77 |
+
+For older versions not published to npm, please refer to the [Installation Guide](/zh-cn/tgz-usage.md) to install the tgz package.
+
+Navigate to your project directory and enter the following commands:
#### **npm**
```bash
-npm install react-natvie-graph@1.1.0
+npm install react-native-graph@1.1.0
```
#### **yarn**
```bash
-yarn add react-natvie-graph@1.1.0
+yarn add react-native-graph@1.1.0
```
-The following code shows the basic use scenario of the repository:
+The following code demonstrates basic usage scenarios of this library:
```ts
-import React, { useState } from "react";
-import { View, StyleSheet, Text, Button } from "react-native";
-import { LineGraph } from "react-native-graph";
-import { GestureHandlerRootView } from "react-native-gesture-handler";
+import React, { useState } from 'react'
+import { View, StyleSheet, Text, Button } from 'react-native'
+import { LineGraph } from 'react-native-graph'
+import { GestureHandlerRootView } from 'react-native-gesture-handler';
interface GraphPoint {
- value: number;
- date: Date;
-}
+ value: number
+ date: Date
+ }
interface GraphXRange {
- min: Date;
- max: Date;
+ min: Date;
+ max: Date;
}
interface GraphYRange {
- min: number;
- max: number;
+ min: number;
+ max: number;
}
interface GraphPathRange {
- x: GraphXRange;
- y: GraphYRange;
+ x: GraphXRange;
+ y: GraphYRange;
}
type GraphRange = Partial;
type Color = string | Float32Array | number | number[];
-export default function () {
- const generateRandomGraphData = (length: number): GraphPoint[] => {
- return Array(length)
- .fill(0)
- .map((_, index) => ({
- date: new Date(
- new Date(2000, 0, 1).getTime() + 1000 * 60 * 60 * 24 * index
- ),
- value: Math.random() * 10,
- }));
- };
- const POINT_COUNT = 50;
- const POINTS = generateRandomGraphData(POINT_COUNT);
- const [points, setPoints] = useState(POINTS);
- const [isAnimated, setIsAnimated] = useState(true);
- const [enablePanGesture, setEnablePanGesture] = useState(false);
-
- const color = "#dd4400";
-
- return (
-
-
+export default function() {
+ const generateRandomGraphData=(length: number): GraphPoint[]=>{
+ return Array(length)
+ .fill(0)
+ .map((_, index) => ({
+ date: new Date(
+ new Date(2000, 0, 1).getTime() + 1000 * 60 * 60 * 24 * index
+ ),
+ value: Math.random()*10,
+ }))
+ }
+ const POINT_COUNT=50
+ const POINTS = generateRandomGraphData(POINT_COUNT)
+ const [points, setPoints] = useState(POINTS)
+ const [isAnimated, setIsAnimated] = useState(true)
+ const [enablePanGesture, setEnablePanGesture] = useState(false)
+
+ const color='#dd4400'
+
+
+ return (
+
+
{`enablePanGesture value is ${enablePanGesture}`}
-
- setEnablePanGesture(!enablePanGesture)}
- />
-
+ setEnablePanGesture(!enablePanGesture)} />
+
- );
+ )
+
}
const styles = StyleSheet.create({
- graph: {
- alignSelf: "center",
- width: "100%",
- aspectRatio: 1.4,
- marginVertical: 20,
- },
-});
+
+ graph: {
+ alignSelf: 'center',
+ width: '100%',
+ aspectRatio: 1.4,
+ marginVertical: 20,
+ },
+})
```
## Link
-The HarmonyOS implementation of this library depends on the native code from @react-native-oh-tpl/react-native-reanimated , @react-native-oh-tpl/react-native-gesture-handler , @react-native-oh-tpl/react-native-skia. If this library is included into your HarmonyOS application, there is no need to include it again; you can skip the steps in this section and use it directly.
+The HarmonyOS implementation of this library depends on the native code of @react-native-oh-tpl/react-native-reanimated, @react-native-oh-tpl/react-native-gesture-handler, and @react-native-oh-tpl/react-native-skia. If these libraries have already been introduced in your HarmonyOS project, you do not need to introduce them again and can skip this section to start using directly.
-If it is not included, follow the guide provided in[@react-native-oh-tpl/react-native-reanimated docs](/en/react-native-reanimated.md)、[@react-native-oh-tpl/react-native-gesture-handler docs](/en/react-native-gesture-handler.md)、[@react-native-oh-tpl/react-native-skia docs](/en/react-native-skia.md) to add it to your project.
+If not introduced, please refer to:
+- [@react-native-oh-tpl/react-native-reanimated Documentation](/zh-cn/react-native-reanimated.md)
+- [@react-native-oh-tpl/react-native-gesture-handler Documentation](/zh-cn/react-native-gesture-handler.md)
+- [@react-native-oh-tpl/react-native-skia Documentation](/zh-cn/react-native-skia.md)
-## Constraints
+## Constraints and Limitations
### Compatibility
-This document is verified based on the following versions:
-
-1. RNOH:0.72.28; SDK:HarmonyOS NEXT Developer Beta5 5.0.0.60; IDE:DevEco Studio 5.0.3.655; ROM:3.0.0.60
+To use this library, you need to use the correct React-Native and RNOH versions. Additionally, you need to use the matching DevEco Studio and phone ROM.
-2. RNOH:0.72.31; SDK:HarmonyOS NEXT Beta1 SDK 5.0.0.68; IDE:DevEco Studio 5.0.3.810; ROM:5.0.0.60
+Verified in the following versions:
-3. RNOH:0.72.33; SDK:OpenHarmony 5.0.0.71(API Version 12 Release); IDE:DevEco Studio 5.0.3.900; ROM:NEXT.0.0.71;
+1. RNOH: 0.72.38; SDK: HarmonyOS-5.0.0(API12); ROM: 5.0.0.107;
+2. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.868; ROM: 6.0.0.112;
## Properties
-> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library.
-
-> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android.
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| -------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- | -------- | ----------- | ----------------- |
-| `animated` | Whether to animate between data changes | Boolean | yes | iOS/Android | yes |
-| `points` | All points to be marked in the graph. Coordinate system will adjust to scale automatically. | GraphPoint[] | yes | iOS/Android | yes |
-| `color` | Color of the graph line (path) | String | yes | iOS/Android | yes |
-| `enableFadeInMask` | Enable the Fade-In Gradient Effect at the beginning of the Graph | Boolean | no | iOS/Android | yes |
-| `lineThickness` | The width of the graph line (path) | Number | no | iOS/Android | yes |
-| `gradientFillColors` | (Optional) Colors for the fill gradient below the graph line | Color[] | no | iOS/Android | yes |
-| `range` | Range of the graph's x and y-axis. The range must be greaterthan the range given by the points | GraphRange | no | iOS/Android | yes |
-| `enablePanGesture` | Whether to enable the pan gesture.(animated Property must be true) | Boolean | no | iOS/Android | yes |
-| `horizontalPadding` | Horizontal padding applied to graph, so the pan gesture dot doesn't get cut off horizontally(animated Property must be true) | Number | no | iOS/Android | yes |
-| `verticalPadding` | Vertical padding applied to graph, so the pan gesture dot doesn't get cut off vertically(animated Property must be true) | Number | no | iOS/Android | yes |
-| `enableIndicator` | Enables an indicator which is displayed at the end of the graph(animated Property must be true) | Boolean | no | iOS/Android | yes |
-| `indicatorPulsating` | Let's the indicator pulsate(animated GraphEnableIndicator Property must be true) | Boolean | no | iOS/Android | yes |
-| `panGestureDelay` | Delay after which the pan gesture starts(animated enablePanGesture Property must be true)`} | Number | no | iOS/Android | yes |
-| `onPointSelected` | Called for each point while the user is scrubbing/panning through the graph(animated enablePanGesture Property must be true) | (point: GraphPoint) => void | no | iOS/Android | yes |
-| `onGestureStart` | Called once the user starts scrubbing/panning through the graph (animated enablePanGesture Property must be true) | () => void | no | iOS/Android | yes |
-| `onGestureEnd` | Called once the user stopped scrubbing/panning through the graph (animated enablePanGesture Property must be true) | () => void | no | iOS/Android | yes |
-| `SelectionDot` | The element that renders the selection dot(animated enablePanGesture Property must be true) | React.ComponentType\ \| null | no | iOS/Android | yes |
-| `TopAxisLabel` | The element that gets rendered above the Graph (usually the "max" point/value of the Graph)(animated Property must be true) | React.ReactElement \| null | no | iOS/Android | yes |
-| `BottomAxisLabel` | The element that gets rendered below the Graph (usually the "min" point/value of the Graph)(animated Property must be true) | React.ReactElement \| null | no | iOS/Android | yes |
+> [!TIP] The "Platform" column indicates the platforms supported by the original third-party library for this property.
+
+> [!TIP] "HarmonyOS Support" being yes means the property is supported on HarmonyOS platform; no means not supported; partially means partially supported. The usage method is consistent across platforms, with effects benchmarked against iOS or Android.
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+|------|-------------|------|----------|----------|-------------------|
+| `animated` | Whether to enable animation effects when data changes | Boolean | yes | iOS/Android | yes |
+| `points` | All points to be marked in the graph. Coordinate system will adjust to scale automatically | GraphPoint[] | yes | iOS/Android | yes |
+| `color` | Color of the graph line (path) | String | yes | iOS/Android | yes |
+| `enableFadeInMask` | Enable the Fade-In Gradient Effect at the beginning of the Graph | Boolean | no | iOS/Android | yes |
+| `lineThickness` | The width of the graph line (path) | Number | no | iOS/Android | yes |
+| `gradientFillColors` | (Optional) Colors for the fill gradient below the graph line | Color[] | no | iOS/Android | yes |
+| `range` | Range of the graph's x and y-axis. The range must be greater than the range given by the points | GraphRange | no | iOS/Android | yes |
+| `enablePanGesture` | Whether to enable the pan gesture (animated Property must be true) | Boolean | no | iOS/Android | yes |
+| `horizontalPadding` | Horizontal padding applied to graph, so the pan gesture dot doesn't get cut off horizontally (animated Property must be true) | Number | no | iOS/Android | yes |
+| `verticalPadding` | Vertical padding applied to graph, so the pan gesture dot doesn't get cut off vertically (animated Property must be true) | Number | no | iOS/Android | yes |
+| `enableIndicator` | Enables an indicator which is displayed at the end of the graph (animated Property must be true) | Boolean | no | iOS/Android | yes |
+| `indicatorPulsating` | Let's the indicator pulsate (animated GraphEnableIndicator Property must be true) | Boolean | no | iOS/Android | yes |
+| `panGestureDelay` | Delay after which the pan gesture starts (animated enablePanGesture Property must be true) | Number | no | iOS/Android | yes |
+| `onPointSelected` | Called for each point while the user is scrubbing/panning through the graph (animated enablePanGesture Property must be true) | (point: GraphPoint) => void | no | iOS/Android | yes |
+| `onGestureStart` | Called once the user starts scrubbing/panning through the graph (animated enablePanGesture Property must be true) | () => void | no | iOS/Android | yes |
+| `onGestureEnd` | Called once the user stopped scrubbing/panning through the graph (animated enablePanGesture Property must be true) | () => void | no | iOS/Android | yes |
+| `SelectionDot` | The element that renders the selection dot (animated enablePanGesture Property must be true) | React.ComponentType\ \| null | no | iOS/Android | yes |
+| `TopAxisLabel` | The element that gets rendered above the Graph (usually the "max" point/value of the Graph) (animated Property must be true) | React.ReactElement \| null | no | iOS/Android | yes |
+| `BottomAxisLabel` | The element that gets rendered below the Graph (usually the "min" point/value of the Graph) (animated Property must be true) | React.ReactElement \| null | no | iOS/Android | yes |
## Known Issues
-- [ ] A third-party library that relies on gesture libraries may encounter bugs in gesture indicator points when clicking on charts, causing the page to freeze and making it impossible to click on the buttons in the component. Clicking again will return to normal, and we need to wait for the gesture library to update before it returns to normal [issues#38](https://github.com/react-native-oh-library/react-native-harmony-gesture-handler/issues/38)
+- [ ] For third-party libraries that depend on the gesture library, after clicking on the graph, there is a BUG where the gesture indicator point appears, causing the page to freeze and unable to click buttons in the component. It returns to normal after clicking again. This needs to be fixed after the gesture library is updated [issues#38](https://github.com/react-native-oh-library/react-native-harmony-gesture-handler/issues/38)
## Others
-- The original library code for the animated attribute of react native graph is currently problematic. Whether it is false or true, data changes are static and do not have animation effects. There are user issues and PRs in the original library, and the animation can only function properly after adding and merging the corresponding PR code [issue#111](https://github.com/margelo/react-native-graph/pull/111)
+- The animated property of react-native-graph currently has issues in the original library code. Whether false or true, data changes are static without animation effects. Users have raised issues and PRs in the original library. Animation will work normally only after the corresponding PR code is merged [issue#111](https://github.com/margelo/react-native-graph/pull/111)
## License
-This project is licensed under [The MIT License (MIT)](https://github.com/margelo/react-native-graph/blob/main/LICENSE).
+This project is based on [The MIT License (MIT)](https://github.com/margelo/react-native-graph/blob/main/LICENSE). Feel free to enjoy and participate in open source.
\ No newline at end of file
diff --git a/en/react-native-keys.md b/en/react-native-keys.md
index 2653c5ab..f52ad560 100644
--- a/en/react-native-keys.md
+++ b/en/react-native-keys.md
@@ -1,4 +1,4 @@
-> Template version: v0.2.2
+> Template Version: v0.2.2
react-native-keys
@@ -12,37 +12,50 @@
-> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-keys)
+> [!TIP] [Github Address](https://github.com/react-native-oh-library/react-native-keys)
-## Installation and Usage
+## Installation & Usage
-Find the matching version information in the release address of a third-party library: [@react-native-oh-library/react-native-keys Releases](https://github.com/react-native-oh-library/react-native-keys/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package.
+Please check the corresponding version information in the third-party library's Releases:
-Go to the project directory and execute the following instruction:
+| Third-party Version | Release Information | Supported RN Version |
+| ------------------- | ------------------- | -------------------- |
+| 0.7.11 | [@react-native-oh-library/react-native-keys Releases](https://github.com/react-native-oh-library/react-native-keys/releases) | 0.72 |
+| 0.8.0 | [@react-native-ohos/react-native-keys Releases](https://github.com/react-native-oh-library/react-native-keys/releases) | 0.77 |
+For older versions not published to npm, please refer to the [Installation Guide](/zh-cn/tgz-usage.md) to install the tgz package.
+Navigate to your project directory and run the following command:
-#### npm
+#### **npm**
```bash
+# 0.72
npm install @react-native-oh-tpl/react-native-keys
+
+# 0.77
+npm install @react-native-ohos/react-native-keys
```
-#### yarn
+#### **yarn**
```bash
+# 0.72
yarn add @react-native-oh-tpl/react-native-keys
+
+# 0.77
+yarn add @react-native-ohos/react-native-keys
```
-The following code shows the basic use scenario of the repository:
+The following code demonstrates basic usage scenarios of this library:
-> [!WARNING] The name of the imported repository remains unchanged.
+> [!WARNING] The import library name remains unchanged during use.
-1. Create a new file keys.development.json in the root of your React Native app and add Envs in secure object for protected envs variables and add Envs in public for public usage this:
+1. Create a new file named `keys.development.json` in the root directory of your React Native app. Add environment variables that need protection in the secure object, and add environment variables for public use in the public object, as shown below:
```json
{
@@ -62,23 +75,23 @@ The following code shows the basic use scenario of the repository:
2. Use Public Keys & Secure Keys
```js
-import Keys from "react-native-keys";
+import Keys from 'react-native-keys';
Keys.API_URL;
Keys.URI_SCHEME;
-Keys.secureFor("API_TOKEN");
-Keys.secureFor("GOOGLE_API_KEY");
-Keys.secureFor("SECRET_KEY");
+Keys.secureFor('API_TOKEN');
+Keys.secureFor('GOOGLE_API_KEY');
+Keys.secureFor('SECRET_KEY');
```
## Link
-Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking.
+Currently, HarmonyOS does not support AutoLink, so the Link step requires manual configuration.
-Open the `harmony` directory of the HarmonyOS project in DevEco Studio.
+First, you need to open the HarmonyOS project `harmony` within your project using DevEco Studio.
-### 1. Adding the overrides Field to oh-package.json5 File in the Root Directory of the Project
+### 1. Add the overrides field to the root `oh-package.json`
```json
{
@@ -89,15 +102,20 @@ Open the `harmony` directory of the HarmonyOS project in DevEco Studio.
}
```
-### 2. Introducing Native Code
+### 2. Import Native Code
+
+There are currently two methods:
-Currently, two methods are available:
+1. Import via har package (Recommended until IDE functionality is improved);
+2. Link source code directly.
-Method 1 (recommended): Use the HAR file. (Recommended)
+Method 1: Import via har package (Recommended)
-> [!TIP] The HAR file is stored in the `harmony` directory in the installation path of the third-party library.
+> [!TIP] The har package is located in the `harmony` folder of the installed third-party library path.
-Open `entry/oh-package.json5` file and add the following dependencies:
+Open `entry/oh-package.json5` and add the following dependencies:
+
+v0.7.11
```json
"dependencies": {
@@ -106,24 +124,33 @@ Open `entry/oh-package.json5` file and add the following dependencies:
}
```
-Click the `sync` button in the upper right corner.
+v0.8.0
+
+```json
+"dependencies": {
+ "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
+ "@react-native-ohos/react-native-keys": "file:../../node_modules/@react-native-ohos/react-native-keys/harmony/rnoh_keys.har"
+ }
+```
+
+Click the `sync` button in the top right corner.
-Alternatively, run the following instruction on the terminal:
+Or execute in the terminal:
```bash
cd entry
ohpm install
```
-Method 2: Directly link to the source code.
+Method 2: Link Source Code Directly
-> [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md).
+> [!TIP] If you need to link source code directly, please refer to the [Direct Link Source Code Guide](/zh-cn/link-source-code.md).
-### 3. Configuring CMakeLists and Introducing RNOHKeysPackage
+### 3. Configure CMakeLists and Import RNOHKeysPackage
-Open `entry/src/main/cpp/CMakeLists.txt` and add the following code:
+Open `entry/src/main/cpp/CMakeLists.txt` and add:
-```diff
+```cmake
project(rnapp)
cmake_minimum_required(VERSION 3.4.1)
set(CMAKE_SKIP_BUILD_RPATH TRUE)
@@ -141,7 +168,10 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn)
# RNOH_BEGIN: manual_package_linking_1
add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package)
+// v0.77.11
+ add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/react-native-keys/src/main/cpp" ./rnohkeys)
+// v0.8.0
++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-keys/src/main/cpp" ./rnohkeys)
# RNOH_END: manual_package_linking_1
file(GLOB GENERATED_CPP_FILES "./generated/*.cpp")
@@ -159,9 +189,9 @@ target_link_libraries(rnoh_app PUBLIC rnoh_sample_package)
# RNOH_END: manual_package_linking_2
```
-Open `entry/src/main/cpp/PackageProvider.cpp` and add the following code:
+Open `entry/src/main/cpp/PackageProvider.cpp` and add:
-```diff
+```c++
#include "RNOH/PackageProvider.h"
#include "generated/RNOHGeneratedPackage.h"
#include "SamplePackage.h"
@@ -178,13 +208,16 @@ std::vector> PackageProvider::getPackages(Package::Cont
}
```
-### 4. Introducing RNKeysPackage to ArkTS
+### 4. Import RNKeysPackage on the ArkTS Side
-Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
+Open `entry/src/main/ets/RNPackagesFactory.ts` and add:
-```diff
+```typescript
...
+ // v0.7.11
+ import { RNKeysPackage } from '@react-native-oh-tpl/react-native-keys';
+ // v0.8.0
++ import { RNKeysPackage } from '@react-native-ohos/react-native-keys';
export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
return [
@@ -194,48 +227,51 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
}
```
-### 5. Creating a Pre-running Script in DevEco (Generating the Encryption/Decryption Code and Compiling Configuration Files)
+### 5. Create Pre-run Script in DevEco (Generate Encryption/Decryption Code and Build Configuration Files)
-> [!TIP] After the configuration is complete, click **Apply** for the configuration to take effect.
+> [!TIP] Remember to click the Apply button to make the configuration take effect after completing the following steps.
-1. Click **Entry** in the upper right corner and choose **Edit Configurations** to open the configuration panel.
-2. Click **+** in the upper left corner of the panel, select **Shell Script**, open the configuration panel of the new script, and configure the script as prompted.
+1. Click entry in the top right corner -> Edit Configurations... to open the configuration panel
+2. Click the + in the top left corner of the panel, select Shell Script, open the new script configuration panel, and configure according to the following image prompts:

-3. Choose **Entry** > **Before Lunch**, click **+**, select **Run Another Configuration**, select the **Shell Script** configured in the previous step, and drag the configuration to the upper part of **Hvigor-Build Make**.
+3. Configure entry -> Before Launch, click the plus sign to select Run Another Configuration, select the Shell Script configured in the previous step, and drag the configuration above Hvigor-Build Make:

-### 6. Running
+### 6. Run
-Click the `sync` button in the upper right corner.
+Click the `sync` button in the top right corner.
-Alternatively, run the following instruction on the terminal:
+Or execute in the terminal:
```bash
cd entry
ohpm install
```
-Then build and run the code.
+Then compile and run.
-## Constraints
+## Constraints & Limitations
### Compatibility
-To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone.
+To use this library, you need the correct React-Native and RNOH versions. Additionally, you need to use the matching DevEco Studio and phone ROM.
+
+Verified in the following versions:
-Check the release version information in the release address of the third-party library: [@react-native-oh-library/react-native-keys Releases](https://github.com/react-native-oh-library/react-native-keys/releases)
+1. RNOH: 0.72.38; SDK: HarmonyOS-5.0.0(API12); ROM: 5.0.0.107;
+2. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.868; ROM: 6.0.0.112;
## API
-> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library.
+> [!TIP] The "Platform" column indicates the platforms supported by the original third-party library for that property.
-> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android.
+> [!TIP] The "HarmonyOS Support" column: 'Yes' means the property is supported on the HarmonyOS platform; 'No' means it is not supported; 'partially' means partial support. The usage method is consistent across platforms, with effects benchmarked against iOS or Android.
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| --------------- | -------------------- | -------- | -------- | ----------- | ----------------- |
-| Keys attributes | Get public value | object | no | iOS/Android | yes |
-| Keys.publicKeys | Get all public value | function | no | iOS/Android | yes |
-| Keys.secureFor | Get secret value | function | no | iOS/Android | yes |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+|-----------------|----------------------|----------|----------|-------------|-------------------|
+| Keys attributes | Get public value | object | No | iOS/Android | Yes |
+| Keys.publicKeys | Get all public values | function | No | iOS/Android | Yes |
+| Keys.secureFor | Get secret value | function | No | iOS/Android | Yes |
## Known Issues
@@ -243,4 +279,4 @@ Check the release version information in the release address of the third-party
## License
-This project is licensed under [The MIT License (MIT)](https://github.com/numandev1/react-native-keys/blob/main/LICENSE).
+This project is based on [The MIT License (MIT)](https://github.com/numandev1/react-native-keys/blob/main/LICENSE). Feel free to enjoy and contribute to open source.
\ No newline at end of file
diff --git a/en/react-native-tcp-socket.md b/en/react-native-tcp-socket.md
index cc0103b9..981b63c5 100644
--- a/en/react-native-tcp-socket.md
+++ b/en/react-native-tcp-socket.md
@@ -1,4 +1,4 @@
-> Template version: v0.2.2
+> Template Version: v0.2.2
react-native-tcp-socket
@@ -7,40 +7,53 @@
-
+
-> [!TIP] [GitHub address](https://github.com/react-native-oh-library/react-native-tcp-socket)
+> [!TIP] [Github Address](https://github.com/react-native-oh-library/react-native-tcp-socket)
-## Installation and Usage
+## Installation & Usage
-Find the matching version information in the release address of a third-party library: [@react-native-oh-tpl/react-native-tcp-socket Releases](https://github.com/react-native-oh-library/react-native-tcp-socket/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package.
+Please check the corresponding version information in the third-party library's Releases:
-Go to the project directory and execute the following instruction:
+| Third-party Version | Release Information | Supported RN Version |
+| ------------------- | ------------------- | -------------------- |
+| 6.2.0 | [@react-native-oh-tpl/react-native-tcp-socket Releases](https://github.com/react-native-oh-library/react-native-tcp-socket/releases) | 0.72 |
+| 6.3.1 | [@react-native-ohos/react-native-tcp-socket Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-tcp-socket/releases) | 0.77 |
+For older versions not published to npm, please refer to the [Installation Guide](/zh-cn/tgz-usage.md) to install the tgz package.
+Navigate to your project directory and run the following command:
#### **npm**
```bash
+# V0.72
npm install @react-native-oh-tpl/react-native-tcp-socket
+
+# V0.77
+npm install @react-native-ohos/react-native-tcp-socket
```
#### **yarn**
```bash
+# V0.72
yarn add @react-native-oh-tpl/react-native-tcp-socket
+
+# V0.77
+yarn add @react-native-ohos/react-native-tcp-socket
```
-The following code shows the basic use scenario of the repository:
+The following code demonstrates basic usage scenarios of this library:
-> [!WARNING] The name of the imported repository remains unchanged.
+> [!WARNING] The import library name remains unchanged during use.
```js
import React, {useState} from 'react';
@@ -509,28 +522,28 @@ export const TcpSocketDemo = () => {
keyExtractor={item => item.id.toString()}
/>
- creating a tcp server
+ Create TCP Server
- creating a tcp client
+ Create TCP Client
- client and server communication
+ Client-Server Communication
- pause and resume of data
+ Data Pause & Resume
- long data transmission
+ Long Data Transfer
- close link
+ Close Connection
- creating a TLS server
+ Create TLS Server
- creating a TLS client
+ Create TLS Client
);
@@ -567,17 +580,19 @@ const styles = StyleSheet.create({
});
```
-## Use Codegen
+## Using Codegen
-If this repository has been adapted to `Codegen`, generate the bridge code of the third-party library by using the `Codegen`. For details, see [Codegen Usage Guide](/en/codegen.md).
+> [!TIP] V6.3.1 does not require executing Codegen
+
+This library has been adapted for `Codegen`. Before use, you need to actively execute the command to generate the third-party library bridging code. Please refer to the [Codegen Usage Documentation](/zh-cn/codegen.md) for details.
## Link
-Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking.
+Currently, HarmonyOS does not support AutoLink, so the Link step requires manual configuration.
-Open the `harmony` directory of the HarmonyOS project in DevEco Studio.
+First, you need to open the HarmonyOS project `harmony` within your project using DevEco Studio.
-### 1. Adding the overrides Field to oh-package.json5 File in the Root Directory of the Project
+### 1. Add the overrides field to the root `oh-package.json5`
```json
{
@@ -588,15 +603,20 @@ Open the `harmony` directory of the HarmonyOS project in DevEco Studio.
}
```
-### 2. Introducing Native Code
+### 2. Import Native Code
+
+There are currently two methods:
-Currently, two methods are available:
+1. Import via har package (Recommended until IDE functionality is improved);
+2. Link source code directly.
-Method 1 (recommended): Use the HAR file.
+Method 1: Import via har package (Recommended)
-> [!TIP] The HAR file is stored in the `harmony` directory in the installation path of the third-party library.
+> [!TIP] The har package is located in the `harmony` folder of the installed third-party library path.
-Open `entry/oh-package.json5` file and add the following dependencies:
+Open `entry/oh-package.json5` and add the following dependencies:
+
+- V6.2.0
```json
"dependencies": {
@@ -605,27 +625,101 @@ Open `entry/oh-package.json5` file and add the following dependencies:
}
```
-Click the `sync` button in the upper right corner.
+- V6.3.1
+
+```JSON
+"dependencies": {
+ "@rnoh/react-native-openharmony" : "file:../react_native_openharmony",
+ "@react-native-ohos/react-native-tcp-socket": "file:../../node_modules/@react-native-ohos/react-native-tcp-socket/harmony/tcp_socket.har"
+ }
+```
+
+Click the `sync` button in the top right corner.
-Alternatively, run the following instruction on the terminal:
+Or execute in the terminal:
```bash
cd entry
ohpm install
```
-Method 2: Directly link to the source code.
+Method 2: Link Source Code Directly
+
+> [!TIP] If you need to link source code directly, please refer to the [Direct Link Source Code Guide](/zh-cn/link-source-code.md).
+
+### 3. Configure CMakeLists and Import TcpSocketPackage
+
+> [!TIP] If using version 6.2.0, skip this chapter.
+
+Open `entry/src/main/cpp/CMakeLists.txt` and add:
+
+```cmake
+project(rnapp)
+cmake_minimum_required(VERSION 3.4.1)
+set(CMAKE_SKIP_BUILD_RPATH TRUE)
+set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
+set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules")
++ set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
+set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp")
+set(LOG_VERBOSITY_LEVEL 1)
+set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments")
+set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie")
+set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use
+add_compile_definitions(WITH_HITRACE_SYSTRACE)
-> [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md).
+add_subdirectory("${RNOH_CPP_DIR}" ./rn)
-### 3. Introducing TcpSocketPackage to ArkTS
+# RNOH_BEGIN: manual_package_linking_1
+add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package)
++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-tcp-socket/src/main/cpp" ./tcp-socket)
+# RNOH_END: manual_package_linking_1
-Open the `entry/src/main/ets/RNPackagesFactory.ts` file and add the following code:
+file(GLOB GENERATED_CPP_FILES "./generated/*.cpp")
+
+add_library(rnoh_app SHARED
+ ${GENERATED_CPP_FILES}
+ "./PackageProvider.cpp"
+ "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp"
+)
+target_link_libraries(rnoh_app PUBLIC rnoh)
+
+# RNOH_BEGIN: manual_package_linking_2
+target_link_libraries(rnoh_app PUBLIC rnoh_sample_package)
++ target_link_libraries(rnoh_app PUBLIC rnoh_tcp_socket)
+# RNOH_END: manual_package_linking_2
+```
+
+Open `entry/src/main/cpp/PackageProvider.cpp` and add:
+
+```c++
+#include "RNOH/PackageProvider.h"
+#include "generated/RNOHGeneratedPackage.h"
+#include "SamplePackage.h"
++ #include "TcpSocketPackage.h"
+
+using namespace rnoh;
+
+std::vector> PackageProvider::getPackages(Package::Context ctx) {
+ return {
+ std::make_shared(ctx),
+ std::make_shared(ctx),
++ std::make_shared(ctx)
+ };
+}
+```
+
+### 4. Import TcpSocketPackage on the ArkTS Side
+
+Open `entry/src/main/ets/RNPackagesFactory.ts` and add:
```diff
...
+// v6.2.0
+ import {TcpSocketPackage} from '@react-native-oh-tpl/react-native-tcp-socket/ts';
+// v6.3.1
++ import {TcpSocketPackage} from '@react-native-ohos/react-native-tcp-socket/ts';
+
export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
return [new SamplePackage(ctx),
+ new TcpSocketPackage(ctx)
@@ -633,32 +727,35 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
}
```
-### 4. Running
+### 5. Run
-Click the `sync` button in the upper right corner.
+Click the `sync` button in the top right corner.
-Alternatively, run the following instruction on the terminal:
+Or execute in the terminal:
```bash
cd entry
ohpm install
```
-Then build and run the code.
+Then compile and run.
-## Constraints
+## Constraints & Limitations
### Compatibility
-To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone.
+To use this library, you need the correct React-Native and RNOH versions. Additionally, you need to use the matching DevEco Studio and phone ROM.
+
+Verified in the following versions:
-Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-tcp-socket Releases](https://github.com/react-native-oh-library/react-native-tcp-socket/releases)
+1. RNOH: 0.72.38; SDK: HarmonyOS-5.0.0(API12); ROM: 5.0.0.107;
+2. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.868; ROM: 6.0.0.112;
### Permission Requirements
-需要获取网络信息权限:"ohos.permission.GET_NETWORK_INFO"和使用网络权限:"ohos.permission.INTERNET",配置方法如下:
+Requires network information permission: "ohos.permission.GET_NETWORK_INFO" and internet usage permission: "ohos.permission.INTERNET". Configure as follows:
-打开`entry/src/main/module.json5`,添加:
+Open `entry/src/main/module.json5` and add:
```json
"requestPermissions": [
@@ -674,100 +771,100 @@ Check the release version information in the release address of the third-party
## API
-> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library.
-
-> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android.
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| -------------------------------------------- | --------------------------------------------------- | -------- | -------- | ----------- | ----------------- |
-| connect(options, callback) | Same as createConnection,Creating a TCP Socket | function | no | Android,iOS | yes |
-| createServer(connectionListener) | Creating a TCP Server | function | no | Android,iOS | yes |
-| createConnection(options, callback) | Creating a TCP Socket | function | no | Android,iOS | yes |
-| createTLSServer(options, connectionListener) | Creating a TLS-based TCP Server | function | no | Android,iOS | yes |
-| connectTLS | Creating a TLS-based encrypted connection | function | no | Android,iOS | yes |
-| isIP | Check whether a character string is an IP address | function | no | Android,iOS | yes |
-| isIPv4 | Check whether a character string is an IPv4 address | function | no | Android,iOS | yes |
-| isIPv6 | Check whether a character string is an IPv6 address | function | no | Android,iOS | yes |
-| Server | TCP Server Object | object | no | Android,iOS | yes |
-| Socket | TCP Socket Object | object | no | Android,iOS | yes |
-| TLSServer | TLS Server Object | object | no | Android,iOS | yes |
-| TLSSocket | TLS Socket Object | object | no | Android,iOS | yes |
+> [!TIP] The "Platform" column indicates the platforms supported by the original third-party library for that property.
+
+> [!TIP] The "HarmonyOS Support" column: 'Yes' means the property is supported on the HarmonyOS platform; 'No' means it is not supported; 'partially' means partial support. The usage method is consistent across platforms, with effects benchmarked against iOS or Android.
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ---------------------------------------------------------- | --------------------------------------------------- | -------- | -------- | ----------- | ----------------- |
+| connect(options, callback) | Same as createConnection, Creating a TCP Socket | function | No | Android,iOS | Yes |
+| createServer(connectionListener) | Creating a TCP Server | function | No | Android,iOS | Yes |
+| createServer(options,connectionListener)6.3.1+ | Creating a TCP Server | function | No | Android,iOS | Yes |
+| createConnection(options, callback) | Creating a TCP Socket | function | No | Android,iOS | Yes |
+| createTLSServer(options, connectionListener) | Creating a TLS-based TCP Server | function | No | Android,iOS | Yes |
+| connectTLS | Creating a TLS-based encrypted connection | function | No | Android,iOS | Yes |
+| isIP | Check whether a character string is an IP address | function | No | Android,iOS | Yes |
+| isIPv4 | Check whether a character string is an IPv4 address | function | No | Android,iOS | Yes |
+| isIPv6 | Check whether a character string is an IPv6 address | function | No | Android,iOS | Yes |
+| Server | TCP Server Object | object | No | Android,iOS | Yes |
+| Socket | TCP Socket Object | object | No | Android,iOS | Yes |
+| TLSServer | TLS Server Object | object | No | Android,iOS | Yes |
+| TLSSocket | TLS Socket Object | object | No | Android,iOS | Yes |
### Server
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | ----------- | ----------------- |
-| address() | Returns the bound `address`, the address `family` name, and `port` of the server as reported by the operating system if listening | function | no | Android,iOS | yes |
-| listen(options, callback) | Start a server listening for connections | function | no | Android,iOS | yes |
-| close(callback) | Stops the server from accepting new connections and keeps existing connections | function | no | Android,iOS | yes |
-| getConnections(callback) | Asynchronously get the number of concurrent connections on the server | function | no | Android,iOS | yes |
-| listening | whether to enable the listening | boolean | no | Android,iOS | yes |
-| on('close') | Triggered when the server is shut down | event | no | Android,iOS | yes |
-| on('connection') | Triggered when the server receives a new connection | event | no | Android,iOS | yes |
-| on('error') | Triggered when an error occurs on the server | event | no | Android,iOS | yes |
-| on('listening') | Triggered when the server starts listening | event | no | Android,iOS | yes |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ---- | ----------- | ---- | -------- | -------- | ----------------- |
+| address() | Returns the bound address, address family name, and port of the server | function | No | Android,iOS | Yes |
+| listen(options, callback) | Start a server listening for connections | function | No | Android,iOS | Yes |
+| close(callback) | Stops the server from accepting new connections and keeps existing connections | function | No | Android,iOS | Yes |
+| getConnections(callback) | Asynchronously get the number of concurrent connections on the server | function | No | Android,iOS | Yes |
+| listening | whether to enable the listening | boolean | No | Android,iOS | Yes |
+| on('close') | Triggered when the server is shut down | event | No | Android,iOS | Yes |
+| on('connection') | Triggered when the server receives a new connection | event | No | Android,iOS | Yes |
+| on('error') | Triggered when an error occurs on the server | event | No | Android,iOS | Yes |
+| on('listening') | Triggered when the server starts listening | event | No | Android,iOS | Yes |
### Socket
-
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| --------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | ----------- | ----------------- |
-| address() | Returns the bound `address`, the address `family` name and `port` of the socket as reported | function | no | Android,iOS | yes |
-| destroy() | Ensures that no more I/O activity happens on this socket. Destroys the stream and closes the connection | function | no | Android,iOS | yes |
-| end() | Half-closes the socket. i.e., it sends a FIN packet. It is possible the server will still send some data | function | no | Android,iOS | yes |
-| setEncoding(encoding) | Set the encoding for the socket as a Readable Stream. By default, no encoding is assigned and stream data will be returned as `Buffer` objects | function | no | Android,iOS | yes |
-| setNoDelay(noDelay) | Set no delay | function | no | Android,iOS | yes |
-| setTimeout() | Sets the socket to timeout after `timeout` milliseconds of inactivity on the socket. By default `TcpSocket` do not have a timeout | function | no | Android,iOS | yes |
-| write(buffer, encoding, cb) | Sends data on the socket. The second parameter specifies the encoding in the case of a string — it defaults to UTF8 encoding | function | no | Android,iOS | yes |
-| pause() | Pauses the reading of data. That is, `'data'` events will not be emitted. Useful to throttle back an upload | function | no | Android,iOS | yes |
-| resume() | Resumes reading after a call to `socket.pause()` | function | no | Android,iOS | yes |
-| writableNeedDrain | whether need to wait for data to be written to the socket | boolean | no | Android,iOS | yes |
-| bytesRead | Indicates the number of bytes of data that have been read from the socket | number | no | Android,iOS | yes |
-| bytesWritten | get the number of bytes last written to the socket | number | no | Android,iOS | yes |
-| connecting | whether the current socket is being connected | boolean | no | Android,iOS | yes |
-| destroyed | Whether the socket has been destroyed | boolean | no | Android,iOS | yes |
-| localAddress | Local ip address | string | no | Android,iOS | yes |
-| localPort | Local port | number | no | Android,iOS | yes |
-| remoteAddress | remote server IP address | string | no | Android,iOS | yes |
-| remoteFamily | remote server IP address type | string | no | Android,iOS | yes |
-| remotePort | remote server port | number | no | Android,iOS | yes |
-| pending | Whether has pending data to be sent to the remote server | boolean | no | Android,iOS | yes |
-| timeout | The timeout period for the socket, in milliseconds. The default timeout period is 30 seconds | number | no | Android,iOS | yes |
-| readyState | the state of socket,`0`: not connected,`1`:connected,2: closing,3:closed | number | no | Android,iOS | yes |
-| on('pause') | Triggered when pauses the reading of data | event | no | Android,iOS | yes |
-| on('resume') | Triggered when Resumes the reading of data | event | no | Android,iOS | yes |
-| on('close') | Triggered when socket is closed | event | no | Android,iOS | yes |
-| on('connect') | Triggered when socket is connected | event | no | Android,iOS | yes |
-| on('data') | Triggered when socket receives data | event | no | Android,iOS | yes |
-| on('drain') | Triggered when the buffer becomes empty, indicating that data can be written to the socke | event | no | Android,iOS | yes |
-| on('error') | Triggered when an error occurs on the socket | event | no | Android,iOS | yes |
-| on('timeout') | Triggered When the connection or data transmission times out | event | no | Android,iOS | yes |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ---- | ---- | ---- | -------- | ---- | -------- |
+| address() | Returns the bound address, address family name and port of the socket | function | No | Android,iOS | Yes |
+| destroy() | Ensures that no more I/O activity happens on this socket. Destroys the stream and closes the connection | function | No | Android,iOS | Yes |
+| end() | Half-closes the socket. i.e., it sends a FIN packet. It is possible the server will still send some data | function | No | Android,iOS | Yes |
+| setEncoding(encoding) | Set the encoding for the socket as a Readable Stream. By default, no encoding is assigned and stream data will be returned as `Buffer` objects | function | No | Android,iOS | Yes |
+| setNoDelay(noDelay) | Set no delay | function | No | Android,iOS | Yes |
+| setTimeout() | Sets the socket to timeout after `timeout` milliseconds of inactivity on the socket. By default `TcpSocket` do not have a timeout | function | No | Android,iOS | Yes |
+| write(buffer, encoding, cb) | Sends data on the socket. The second parameter specifies the encoding in the case of a string — it defaults to UTF8 encoding | function | No | Android,iOS | Yes |
+| pause() | Pauses the reading of data. That is, `'data'` events will not be emitted. Useful to throttle back an upload | function | No | Android,iOS | Yes |
+| resume() | Resumes reading after a call to `socket.pause()` | function | No | Android,iOS | Yes |
+| writableNeedDrain | whether need to wait for data to be written to the socket | boolean | No | Android,iOS | Yes |
+| bytesRead | Indicates the number of bytes of data that have been read from the socket | number | No | Android,iOS | Yes |
+| bytesWritten | get the number of bytes last written to the socket | number | No | Android,iOS | Yes |
+| connecting | whether the current socket is being connected | boolean | No | Android,iOS | Yes |
+| destroyed | Whether the socket has been destroyed | boolean | No | Android,iOS | Yes |
+| localAddress | Local ip address | string | No | Android,iOS | Yes |
+| localPort | Local port | number | No | Android,iOS | Yes |
+| remoteAddress | remote server IP address | string | No | Android,iOS | Yes |
+| remoteFamily | remote server IP address type | string | No | Android,iOS | Yes |
+| remotePort | remote server port | number | No | Android,iOS | Yes |
+| pending | Whether has pending data to be sent to the remote server | boolean | No | Android,iOS | Yes |
+| timeout | The timeout period for the socket, in milliseconds. The default timeout period is 30 seconds | number | No | Android,iOS | Yes |
+| readyState | the state of socket,`0`: not connected,`1`:connected,2: closing,3:closed | number | No | Android,iOS | Yes |
+| on('pause') | Triggered when pauses the reading of data | event | No | Android,iOS | Yes |
+| on('resume') | Triggered when Resumes the reading of data | event | No | Android,iOS | Yes |
+| on('close') | Triggered when socket is closed | event | No | Android,iOS | Yes |
+| on('connect') | Triggered when socket is connected | event | No | Android,iOS | Yes |
+| on('data') | Triggered when socket receives data | event | No | Android,iOS | Yes |
+| on('drain') | Triggered when the buffer becomes empty, indicating that data can be written to the socket | event | No | Android,iOS | Yes |
+| on('error') | Triggered when an error occurs on the socket | event | No | Android,iOS | Yes |
+| on('timeout') | Triggered When the connection or data transmission times out | event | No | Android,iOS | Yes |
### TLSServer
-[!TIP] TLSServer 继承自 Server 对象,拥有 Server 对象的所有 Properties、方法和事件,以下仅列出其独有的 Properties。
+[!TIP] TLSServer inherits from the Server object and has all properties, methods, and events of the Server object. Only its unique properties are listed below.
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ------------------------- | ----------------------------------------------------- | -------- | -------- | ----------- | ----------------- |
-| setSecureContext(options) | Set Security Context | function | no | Android,iOS | yes |
-| on('secureConnection') | Triggered When a secure TLS connection is established | event | no | Android,iOS | yes |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ---- | ---- | ---- | -------- | ---- | -------- |
+| setSecureContext(options) | Set Security Context | function | No | Android,iOS | Yes |
+| on('secureConnection') | Triggered When a secure TLS connection is established | event | No | Android,iOS | Yes |
### TLSSocket
-[!TIP] TLSSocket 继承自 Socket 对象,拥有 Socket 对象的所有 Properties、方法和事件,以下仅列出其独有的 Properties。
+[!TIP] TLSSocket inherits from the Socket object and has all properties, methods, and events of the Socket object. Only its unique properties are listed below.
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| -------------------- | ---------------------------------------------------- | -------- | -------- | ----------- | ----------------- |
-| getCertificate() | Get a Local Certificate Information | function | no | Android | yes |
-| getPeerCertificate() | Get the Certificate Information of the Remote Server | function | no | Android | yes |
-| on('secureConnect') | Triggered When a secure connection is established | event | no | Android,iOS | yes |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ---- | ---- | ---- | -------- | ---- | -------- |
+| getCertificate() | Get Local Certificate Information | function | No | Android | Yes |
+| getPeerCertificate() | Get the Certificate Information of the Remote Server | function | No | Android | Yes |
+| on('secureConnect') | Triggered When a secure connection is established | event | No | Android,iOS | Yes |
## Known Issues
-- [ ] 目前无法实现多线程: [issue#3](https://github.com/react-native-oh-library/react-native-tcp-socket/issues/3)
-- [ ] 获取证书只有异步接口,目前返回值是一个 promise,与安卓上同步接口不一致: [issue#4](https://github.com/react-native-oh-library/react-native-tcp-socket/issues/4)
+- [ ] Currently unable to implement multithreading: [issue#3](https://github.com/react-native-oh-library/react-native-tcp-socket/issues/3)
+- [ ] Certificate retrieval only has an async interface, currently returns a promise, inconsistent with the synchronous interface on Android: [issue#4](https://github.com/react-native-oh-library/react-native-tcp-socket/issues/4)
## Others
## License
-This project is licensed under [The MIT License (MIT)](https://github.com/Rapsssito/react-native-tcp-socket/blob/master/LICENSE).
+This project is based on [The MIT License (MIT)](https://github.com/Rapsssito/react-native-tcp-socket/blob/master/LICENSE). Feel free to enjoy and contribute to open source.
\ No newline at end of file
diff --git a/zh-cn/react-native-aria.md b/zh-cn/react-native-aria.md
index 84140172..d3134d53 100644
--- a/zh-cn/react-native-aria.md
+++ b/zh-cn/react-native-aria.md
@@ -16,8 +16,13 @@
## 安装与使用
-React Native ARIA是可增量采用的。每个组件都作为单独的包发布,因此您可以在单个组件中使用它,并随着时间的推移逐渐添加更多组件。所有这些包都在npm上的@react-native-aria范围内发布。
-> [!TIP] 该库已经不再维护,如果执行总包命令,项目运行缺失模块,就需要卸载旧包,在命令后增加--legacy-peer-deps,然后再次下载包文件
+请到三方库的 Releases 发布地址查看配套的版本信息:
+
+| 三方库版本 | 发布信息 | 支持RN版本 |
+| ---------- | ------------------------------------------------------------ | ---------- |
+| 0.2.4 | [react-native-aria release](https://github.com/gluestack/react-native-aria/releases) | 0.72/0.77 |
+
+对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。
进入到工程目录并输入以下命令:
@@ -515,12 +520,12 @@ export default TriggerWrapper
### 兼容性
-本文档内容基于以下版本验证通过:
+要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。
+
+在以下版本验证通过:
-1. RNOH:0.72.13; SDK:HarmonyOS NEXT Developer Preview1; IDE:DevEco Studio 4.1.3.500; ROM:2.0.0.59;
-2. RNOH:0.72.27; SDK:HarmonyOS-Next-DB1 5.0.0.29(SP1) ; IDE:DevEco Studio 5.0.3.400; ROM:3.0.0.25;
-3. RNOH:0.72.29; SDK:HarmonyOS NEXT Developer Beta6; IDE:DevEco Studio 5.0.3.706; ROM:3.0.0.61;
-4. RNOH:0.72.33; SDK:OpenHarmony 5.0.0.71(API Version 12 Release); IDE:DevEco Studio 5.0.3.900; ROM:NEXT.0.0.71;
+1. RNOH: 0.72.38; SDK: HarmonyOS-5.0.0(API12); ROM: 5.0.0.107;
+2. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.868; ROM: 6.0.0.112;
## Hooks
@@ -528,17 +533,18 @@ export default TriggerWrapper
> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|----------|-------------------|
-| useToggleButton | Provides the behavior and accessibility implementation for a toggle button component. ToggleButtons allow users to toggle a selection on or off, for example switching between two states or modes. | Function | no | iOS,Android | yes |
-| useCheckbox | Provides the behavior and accessibility implementation for a checkbox component. Checkboxes allow users to select multiple items from a list of individual items, or to mark one individual item as selected. | Function | no | iOS,Android | yes |
-| useCheckboxGroup | Provides the behavior and accessibility implementation for a checkbox group component. Checkbox groups allow users to select multiple items from a list of options. | Function | no | iOS,Android | yes |
-| useRadioGroup | Provides the behavior and accessibility implementation for a radio group component. Radio groups allow users to select a single item from a list of mutually exclusive options. | Function | no | iOS,Android | yes |
-| useSwitch | Provides the behavior and accessibility implementation for a switch component. A switch is similar to a checkbox, but represents on/off values as opposed to selection. | Function | no | iOS,Android | yes |
-| OverlayContainer | Provides React Portal like functionality for React Native apps which can be useful for displaying absolutely positioned components like Menu, Tooltip, Popover. | Function | no | iOS,Android | yes |
-| useOverlayPosition | Handles positioning overlays like popovers and menus relative to a trigger element, and updating the position when the window resizes. | Function | no | iOS,Android | yes |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|----------|-------------|-------------------|
+| useToggleButton | 为切换按钮组件提供行为和可访问性实现。切换按钮允许用户打开或关闭选择,例如在两种状态或模式之间切换。 | Function | No | iOS,Android | Yes |
+| useCheckbox | 为复选框组件提供行为和可访问性实现。复选框允许用户从单个项目列表中选择多个项目,或将单个项目标记为已选择。 | Function | No | iOS,Android | Yes |
+| useCheckboxGroup | 为复选框组组件提供行为和可访问性实现。复选框组允许用户从选项列表中选择多个项目。 | Function | No | iOS,Android | Yes |
+| useRadioGroup | 为单选按钮组组件提供行为和可访问性实现。单选按钮组允许用户从互斥选项列表中选择单个项目。 | Function | No | iOS,Android | Yes |
+| useSwitch | 为开关组件提供行为和可访问性实现。开关类似于复选框,但表示开/关值而不是选择。 | Function | No | iOS,Android | Yes |
+| OverlayContainer | 为 React Native 应用提供类似 React Portal 的功能,可用于显示绝对定位的组件,如菜单、工具提示、弹出框。 | Function | No | iOS,Android | Yes |
+| useOverlayPosition | 处理相对于触发元素定位叠加层(如弹出框和菜单),并在窗口调整大小时更新位置。 | Function | No | iOS,Android | Yes |
## 遗留问题
+1. 切换勾选状态后立刻触发朗读暂时不支持。
## 其他
diff --git a/zh-cn/react-native-community-toolbar-android.md b/zh-cn/react-native-community-toolbar-android.md
index 698c930a..a72676e7 100644
--- a/zh-cn/react-native-community-toolbar-android.md
+++ b/zh-cn/react-native-community-toolbar-android.md
@@ -8,10 +8,10 @@
该第三方库的仓库已迁移至 Gitee,且支持直接从 npm 下载,新的包名为:`@react-native-ohos/toolbar-android`,具体版本所属关系如下:
-| Version | Package Name | Repository | Release |
-|-----------------| ------------------------------------------------- | ------------------ | -------------------------- |
-| <= 0.2.1-0.0.4 | @react-native-oh-tpl/toolbar-android | [Github(deprecated)](https://github.com/react-native-oh-library/toolbar-android) | [Github Releases(deprecated)](https://github.com/react-native-oh-library/toolbar-android/releases) |
-| >= 0.2.2 | @react-native-ohos/toolbar-android | [Gitee](https://gitee.com/openharmony-sig/rntpc_toolbar-android) | [Gitee Releases](https://gitee.com/openharmony-sig/rntpc_toolbar-android/releases) |
+| 三方库版本 | 发布信息 | 支持RN版本 |
+|-----------------| ------------------------------------------------- | ------------------ |
+| <= 0.2.1 | [@react-native-oh-tpl/toolbar-android Releases(deprecated)](https://github.com/react-native-oh-library/toolbar-android/releases) | 0.72
+| >= 0.2.2 | [@react-native-ohos/toolbar-android Releases](https://gitcode.com/openharmony-sig/rntpc_toolbar-android/releases) | 0.77
## 1.安装与使用
@@ -149,7 +149,6 @@ export default App;
> [!TIP] har 包位于三方库安装路径的 `harmony` 文件夹下。
打开 `entry/oh-package.json5`,添加以下依赖
-
```json
"dependencies": {
"@react-native-ohos/toolbar-android": "file:../../node_modules/@react-native-ohos/toolbar-android/harmony/toolbar_android.har"
@@ -291,7 +290,10 @@ ohpm install
要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。
-请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-ohos/toolbar-android Releases](https://gitee.com/openharmony-sig/rntpc_toolbar-android/releases)
+在以下版本验证通过:
+
+1. RNOH: 0.72.38; SDK: HarmonyOS-5.0.0(API12); ROM: 5.0.0.107;
+2. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.868; ROM: 6.0.0.112;
## 4.属性
@@ -301,29 +303,29 @@ ohpm install
Inherits [View Props](https://reactnative.dev/docs/view#props).
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |-----------| -------- | ----------------- |
-| actions | Sets possible actions on the toolbar as part of the action menu. These are displayed as icons or text on the right side of the widget. If they don't fit they are placed in an 'overflow' menu. | array of object: {title: string,icon: ImageSource,show: enum('always', 'ifRoom', 'never'),showWithText: bool} | No | Android | yes |
-| contentInsetStart | Sets the content inset for the toolbar starting edge. | number | No | Android | yes |
-| contentInsetEnd | Sets the content inset for the toolbar ending edge. | number | No | Android | yes |
-| logo | Sets the toolbar logo. | ImageSource | No | Android | yes |
-| navIcon | Sets the navigation icon. | ImageSource | No | Android | yes |
-| onActionSelected | Callback that is called when an action is selected. The only argument that is passed to the callback is the position of the action in the actions array. | function | No | Android | yes |
-| onIconClicked | Callback called when the icon is selected. | function | No | Android | yes |
-| overflowIcon | Sets the overflow icon. | ImageSource | No | Android | yes |
-| rtl | Used to set the toolbar direction to RTL. | bool | No | Android | yes |
-| subtitle | Sets the toolbar subtitle. | string | No | Android | yes |
-| subtitleColor | Sets the toolbar subtitle color. | string | No | Android | yes |
-| title | Sets the toolbar title. | string | No | Android | yes |
-| titleColor | Sets the toolbar title color. | string | No | Android | yes |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |-----------| -------- | ----------------- |
+| actions | 在操作菜单中设置工具栏上的可能操作。这些操作以图标或文本形式显示在小部件右侧。如果空间不足,它们会被放入"溢出"菜单中。 | 对象数组: {title: string,icon: ImageSource,show: enum('always', 'ifRoom', 'never'),showWithText: bool} | No | Android | Yes |
+| contentInsetStart | 设置工具栏起始边缘的内容内边距。 | number | No | Android | Yes |
+| contentInsetEnd | 设置工具栏结束边缘的内容内边距。 | number | No | Android | Yes |
+| logo | 设置工具栏徽标。 | ImageSource | No | Android | Yes |
+| navIcon | 设置导航图标。 | ImageSource | No | Android | Yes |
+| onActionSelected | 选择操作时调用的回调函数。传递给回调的唯一参数是操作在操作数组中的位置。 | function | No | Android | Yes |
+| onIconClicked | 点击图标时调用的回调函数。 | function | No | Android | Yes |
+| overflowIcon | 设置溢出图标。 | ImageSource | No | Android | Yes |
+| rtl | 用于将工具栏方向设置为从右到左。 | bool | No | Android | Yes |
+| subtitle | 设置工具栏副标题。 | string | No | Android | Yes |
+| subtitleColor | 设置工具栏副标题颜色。 | string | No | Android | Yes |
+| title | 设置工具栏标题。 | string | No | Android | Yes |
+| titleColor | 设置工具栏标题颜色。 | string | No | Android | Yes |
#### 4.1.Props of ImageSource
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------ | ------------------------------------------------------ | ------ | -------- | -------- | ----------------- |
-| uri | load image from a url, e.g. require('./some_icon.png') | string | Yes | android | yes |
-| width | the width of the image | number | No | android | yes |
-| height | the height of the image | number | No | android | yes |
+| uri | 从URL加载图片,例如 require('./some_icon.png') | string | Yes | android | Yes |
+| width | 图片宽度 | number | No | android | Yes |
+| height | 图片高度 | number | No | android | Yes | | number | No | android | Yes |
## 5.遗留问题
diff --git a/zh-cn/react-native-graph.md b/zh-cn/react-native-graph.md
index f7117fa6..fd344c48 100644
--- a/zh-cn/react-native-graph.md
+++ b/zh-cn/react-native-graph.md
@@ -16,6 +16,14 @@
## 安装与使用
+请到三方库的 Releases 发布地址查看配套的版本信息:
+
+| 三方库版本 | 发布信息 | 支持RN版本 |
+| ---------- | ------------------------------------------------------------ | ---------- |
+| 1.1.0 | [react-native-graph release](https://github.com/margelo/react-native-graph/releases) | 0.72/0.77 |
+
+对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。
+
进入到工程目录并输入以下命令:
@@ -115,13 +123,13 @@ const styles = StyleSheet.create({
### 兼容性
-本文档内容基于以下版本验证通过:
+要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。
-1. RNOH:0.72.28; SDK:HarmonyOS NEXT Developer Beta5 5.0.0.60; IDE:DevEco Studio 5.0.3.655; ROM:3.0.0.60
+在以下版本验证通过:
-2. RNOH:0.72.31; SDK:HarmonyOS NEXT Beta1 SDK 5.0.0.68; IDE:DevEco Studio 5.0.3.810; ROM:5.0.0.60
+1. RNOH: 0.72.38; SDK: HarmonyOS-5.0.0(API12); ROM: 5.0.0.107;
+2. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.868; ROM: 6.0.0.112;
-3. RNOH:0.72.33; SDK:OpenHarmony 5.0.0.71(API Version 12 Release); IDE:DevEco Studio 5.0.3.900; ROM:NEXT.0.0.71;
## 属性
> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
@@ -130,25 +138,25 @@ const styles = StyleSheet.create({
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ----------------------------- | ----------------------------------------------- | -------- | -------- | ----------- | ----------------- |
-| `animated` | Whether to animate between data changes | Boolean | yes | iOS/Android | yes |
-| `points` | All points to be marked in the graph. Coordinate system will adjust to scale automatically. | GraphPoint[] | yes | iOS/Android | yes |
-| `color`| Color of the graph line (path) | String | yes | iOS/Android | yes |
-| `enableFadeInMask` |Enable the Fade-In Gradient Effect at the beginning of the Graph| Boolean| no | iOS/Android | yes |
-| `lineThickness` |The width of the graph line (path)| Number | no | iOS/Android | yes |
-| `gradientFillColors` |(Optional) Colors for the fill gradient below the graph line| Color[] | no | iOS/Android | yes |
-| `range` |Range of the graph's x and y-axis. The range must be greaterthan the range given by the points| GraphRange | no | iOS/Android | yes |
-| `enablePanGesture`| Whether to enable the pan gesture.(animated Property must be true) | Boolean | no | iOS/Android | yes |
-| `horizontalPadding` | Horizontal padding applied to graph, so the pan gesture dot doesn't get cut off horizontally(animated Property must be true) | Number | no | iOS/Android | yes |
-| `verticalPadding`| Vertical padding applied to graph, so the pan gesture dot doesn't get cut off vertically(animated Property must be true) | Number | no | iOS/Android | yes |
-| `enableIndicator`| Enables an indicator which is displayed at the end of the graph(animated Property must be true) | Boolean | no | iOS/Android | yes |
-| `indicatorPulsating` | Let's the indicator pulsate(animated GraphEnableIndicator Property must be true) | Boolean | no | iOS/Android | yes |
-| `panGestureDelay`| Delay after which the pan gesture starts(animated enablePanGesture Property must be true)`}| Number | no | iOS/Android | yes |
-| `onPointSelected` | Called for each point while the user is scrubbing/panning through the graph(animated enablePanGesture Property must be true)| (point: GraphPoint) => void | no | iOS/Android | yes |
-| `onGestureStart` |Called once the user starts scrubbing/panning through the graph (animated enablePanGesture Property must be true)| () => void | no | iOS/Android | yes |
-| `onGestureEnd` |Called once the user stopped scrubbing/panning through the graph (animated enablePanGesture Property must be true)| () => void | no | iOS/Android | yes |
-| `SelectionDot`|The element that renders the selection dot(animated enablePanGesture Property must be true)| React.ComponentType\ \| null | no | iOS/Android | yes |
-| `TopAxisLabel` |The element that gets rendered above the Graph (usually the "max" point/value of the Graph)(animated Property must be true)| React.ReactElement \| null | no | iOS/Android | yes |
-| `BottomAxisLabel` |The element that gets rendered below the Graph (usually the "min" point/value of the Graph)(animated Property must be true)| React.ReactElement \| null | no | iOS/Android | yes |
+| `animated` | 是否在数据变化时启用动画效果 | Boolean | yes | iOS/Android | yes |
+| `points` | 图表中要标记的所有点。坐标系会自动调整以适应缩放 | GraphPoint[] | yes | iOS/Android | yes |
+| `color`| 图表线条(路径)的颜色 | String | yes | iOS/Android | yes |
+| `enableFadeInMask` | 在图表开头启用淡入渐变效果 | Boolean| no | iOS/Android | yes |
+| `lineThickness` | 图表线条(路径)的宽度 | Number | no | iOS/Android | yes |
+| `gradientFillColors` | 图表线条下方填充渐变的颜色(可选) | Color[] | no | iOS/Android | yes |
+| `range` | 图表x轴和y轴的范围。范围必须大于点给定的范围 | GraphRange | no | iOS/Android | yes |
+| `enablePanGesture`| 是否启用手势拖拽(animated属性必须为true) | Boolean | no | iOS/Android | yes |
+| `horizontalPadding` | 应用于图表的水平内边距,防止拖拽点被水平截断(animated属性必须为true) | Number | no | iOS/Android | yes |
+| `verticalPadding`| 应用于图表的垂直内边距,防止拖拽点被垂直截断(animated属性必须为true) | Number | no | iOS/Android | yes |
+| `enableIndicator`| 启用显示在图表末端的指示器(animated属性必须为true) | Boolean | no | iOS/Android | yes |
+| `indicatorPulsating` | 让指示器产生脉动效果(animated GraphEnableIndicator属性必须为true) | Boolean | no | iOS/Android | yes |
+| `panGestureDelay`| 拖拽手势开始前的延迟时间(animated enablePanGesture属性必须为true) | Number | no | iOS/Android | yes |
+| `onPointSelected` | 当用户在图表中滑动/拖拽时,为每个点调用的回调函数(animated enablePanGesture属性必须为true) | (point: GraphPoint) => void | no | iOS/Android | yes |
+| `onGestureStart` | 当用户开始在图表中滑动/拖拽时调用(animated enablePanGesture属性必须为true) | () => void | no | iOS/Android | yes |
+| `onGestureEnd` | 当用户停止在图表中滑动/拖拽时调用(animated enablePanGesture属性必须为true) | () => void | no | iOS/Android | yes |
+| `SelectionDot`| 渲染选择点的元素(animated enablePanGesture属性必须为true) | React.ComponentType\ \| null | no | iOS/Android | yes |
+| `TopAxisLabel` | 渲染在图表上方的元素(通常是图表的"最大"点/值)(animated属性必须为true) | React.ReactElement \| null | no | iOS/Android | yes |
+| `BottomAxisLabel` | 渲染在图表下方的元素(通常是图表的"最小"点/值)(animated属性必须为true) | React.ReactElement \| null | no | iOS/Android | yes |
diff --git a/zh-cn/react-native-keys.md b/zh-cn/react-native-keys.md
index 5acf29e0..eec2ba8d 100644
--- a/zh-cn/react-native-keys.md
+++ b/zh-cn/react-native-keys.md
@@ -17,8 +17,14 @@
> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-keys)
## 安装与使用
+请到三方库的 Releases 发布地址查看配套的版本信息:
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-library/react-native-keys Releases](https://github.com/react-native-oh-library/react-native-keys/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。
+| 三方库版本 | 发布信息 | 支持RN版本 |
+| ---------- | ------------------------------------------------------------ | ---------- |
+| 0.7.11 | [@react-native-oh-library/react-native-keys Releases](https://github.com/react-native-oh-library/react-native-keys/releases) | 0.72 |
+| 0.8.0 | [@react-native-ohos/react-native-keys Releases](https://github.com/react-native-oh-library/react-native-keys/releases) | 0.77 |
+
+对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。
进入到工程目录并输入以下命令:
@@ -29,13 +35,21 @@
#### npm
```bash
+# 0.72
npm install @react-native-oh-tpl/react-native-keys
+
+# 0.77
+npm install @react-native-ohos/react-native-keys
```
#### yarn
```bash
+# 0.72
yarn add @react-native-oh-tpl/react-native-keys
+
+# 0.77
+yarn add @react-native-ohos/react-native-keys
```
@@ -44,7 +58,7 @@ yarn add @react-native-oh-tpl/react-native-keys
>[!WARNING] 使用时 import 的库名不变。
-1. Create a new file keys.development.json in the root of your React Native app and add Envs in secure object for protected envs variables and add Envs in public for public usage this:
+1. 在 React Native 应用的根目录下创建一个名为 `keys.development.json` 的新文件,并在 secure 对象中添加需要保护的环境变量,在 public 对象中添加可供公开使用的环境变量,具体如下:
```json
{
@@ -62,7 +76,7 @@ yarn add @react-native-oh-tpl/react-native-keys
```
-2. Use Public Keys & Secure Keys
+2. 使用公共密钥和安全密钥
``` js
import Keys from 'react-native-keys';
@@ -106,12 +120,22 @@ Keys.secureFor('SECRET_KEY');
打开 `entry/oh-package.json5`,添加以下依赖
+v0.7.11
+
```json
"dependencies": {
"@rnoh/react-native-openharmony": "file:../react_native_openharmony",
"@react-native-oh-tpl/react-native-keys": "file:../../node_modules/@react-native-oh-tpl/react-native-keys/harmony/rnoh_keys.har"
}
```
+v0.8.0
+
+```json
+"dependencies": {
+ "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
+ "@react-native-ohos/react-native-keys": "file:../../node_modules/@react-native-ohos/react-native-keys/harmony/rnoh_keys.har"
+ }
+```
点击右上角的 `sync` 按钮
@@ -148,7 +172,10 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn)
# RNOH_BEGIN: manual_package_linking_1
add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package)
+// v0.77.11
+ add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/react-native-keys/src/main/cpp" ./rnohkeys)
+// v0.8.0
++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-keys/src/main/cpp" ./rnohkeys)
# RNOH_END: manual_package_linking_1
file(GLOB GENERATED_CPP_FILES "./generated/*.cpp")
@@ -191,7 +218,10 @@ std::vector> PackageProvider::getPackages(Package::Cont
```diff
...
+ // v0.7.11
+ import { RNKeysPackage } from '@react-native-oh-tpl/react-native-keys';
+ // v0.7.11
++ import { RNKeysPackage } from '@react-native-ohos/react-native-keys';
export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
return [
@@ -230,7 +260,10 @@ ohpm install
要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。
-请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-library/react-native-keys Releases](https://github.com/react-native-oh-library/react-native-keys/releases)
+在以下版本验证通过:
+
+1. RNOH: 0.72.38; SDK: HarmonyOS-5.0.0(API12); ROM: 5.0.0.107;
+2. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.868; ROM: 6.0.0.112;
## API
@@ -242,9 +275,9 @@ ohpm install
| Name | Description | Type | Required | Platform | HarmonyOS Support |
|-----------------|----------------------|----------|----------|-------------|-------------------|
-| Keys attributes | Get public value | object | no | iOS/Android | yes |
-| Keys.publicKeys | Get all public value | function | no | iOS/Android | yes |
-| Keys.secureFor | Get secret value | function | no | iOS/Android | yes |
+| Keys attributes | 获取公共值 | object | No | iOS/Android | Yes |
+| Keys.publicKeys | 获取所有公共值 | function | No | iOS/Android | Yes |
+| Keys.secureFor | 获取密钥值 | function | No | iOS/Android | Yes |
## 遗留问题
diff --git a/zh-cn/react-native-tcp-socket.md b/zh-cn/react-native-tcp-socket.md
index 0b63625c..dc387fed 100644
--- a/zh-cn/react-native-tcp-socket.md
+++ b/zh-cn/react-native-tcp-socket.md
@@ -16,7 +16,14 @@
## 安装与使用
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-tcp-socket Releases](https://github.com/react-native-oh-library/react-native-tcp-socket/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。
+请到三方库的 Releases 发布地址查看配套的版本信息:
+
+| 三方库版本 | 发布信息 | 支持RN版本 |
+| ---------- | ------------------------------------------------------------ | ---------- |
+| 6.2.0 | [@react-native-oh-tpl/react-native-tcp-socket Releases](https://github.com/react-native-oh-library/react-native-tcp-socket/releases) | 0.72 |
+| 6.3.1 | [@react-native-ohos/react-native-tcp-socket Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-tcp-socket/releases) | 0.77 |
+
+对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。
进入到工程目录并输入以下命令:
@@ -25,13 +32,21 @@
#### **npm**
```bash
+# V0.72
npm install @react-native-oh-tpl/react-native-tcp-socket
+
+# V0.77
+npm install @react-native-ohos/react-native-tcp-socket
```
#### **yarn**
```bash
+# V0.72
yarn add @react-native-oh-tpl/react-native-tcp-socket
+
+# V0.77
+yarn add @react-native-ohos/react-native-tcp-socket
```
@@ -567,6 +582,8 @@ const styles = StyleSheet.create({
## 使用 Codegen
+> [!TIP] V6.3.1 不需要执行Codegen
+
本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。
## Link
@@ -599,6 +616,8 @@ const styles = StyleSheet.create({
打开 `entry/oh-package.json5`,添加以下依赖
+- V6.2.0
+
```json
"dependencies": {
"@rnoh/react-native-openharmony" : "file:../react_native_openharmony",
@@ -606,6 +625,15 @@ const styles = StyleSheet.create({
}
```
+- V6.3.1
+
+```JSON
+"dependencies": {
+ "@rnoh/react-native-openharmony" : "file:../react_native_openharmony",
+ "@react-native-ohos/react-native-tcp-socket": "file:../../node_modules/@react-native-ohos/react-native-tcp-socket/harmony/tcp_socket.har"
+ }
+```
+
点击右上角的 `sync` 按钮
或者在终端执行:
@@ -619,14 +647,80 @@ ohpm install
> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md)
-### 3.在 ArkTs 侧引入 TcpSocketPackage
+
+### 3.配置CMakeLists 和引入 TcpSocketPackage
+
+> [!TIP] 若使用的是 6.2.0 版本,请跳过本章
+
+打开 `entry/src/main/cpp/CMakeLists.txt`,添加:
+
+```cmake
+project(rnapp)
+cmake_minimum_required(VERSION 3.4.1)
+set(CMAKE_SKIP_BUILD_RPATH TRUE)
+set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
+set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules")
++ set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
+set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp")
+set(LOG_VERBOSITY_LEVEL 1)
+set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments")
+set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie")
+set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use
+add_compile_definitions(WITH_HITRACE_SYSTRACE)
+
+add_subdirectory("${RNOH_CPP_DIR}" ./rn)
+
+# RNOH_BEGIN: manual_package_linking_1
+add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package)
++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-tcp-socket/src/main/cpp" ./tcp-socket)
+# RNOH_END: manual_package_linking_1
+
+file(GLOB GENERATED_CPP_FILES "./generated/*.cpp")
+
+add_library(rnoh_app SHARED
+ ${GENERATED_CPP_FILES}
+ "./PackageProvider.cpp"
+ "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp"
+)
+target_link_libraries(rnoh_app PUBLIC rnoh)
+
+# RNOH_BEGIN: manual_package_linking_2
+target_link_libraries(rnoh_app PUBLIC rnoh_sample_package)
++ target_link_libraries(rnoh_app PUBLIC rnoh_tcp_socket)
+# RNOH_END: manual_package_linking_2
+```
+
+打开 `entry/src/main/cpp/PackageProvider.cpp`,添加:
+
+```c++
+#include "RNOH/PackageProvider.h"
+#include "generated/RNOHGeneratedPackage.h"
+#include "SamplePackage.h"
++ #include "TcpSocketPackage.h"
+
+using namespace rnoh;
+
+std::vector> PackageProvider::getPackages(Package::Context ctx) {
+ return {
+ std::make_shared(ctx),
+ std::make_shared(ctx),
++ std::make_shared(ctx)
+ };
+}
+```
+
+### 4.在 ArkTs 侧引入 TcpSocketPackage
打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
```diff
...
+// v6.2.0
+ import {TcpSocketPackage} from '@react-native-oh-tpl/react-native-tcp-socket/ts';
+// v6.3.1
++ import {TcpSocketPackage} from '@react-native-ohos/react-native-tcp-socket/ts';
+
export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
return [new SamplePackage(ctx),
+ new TcpSocketPackage(ctx)
@@ -634,7 +728,7 @@ export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
}
```
-### 4.运行
+### 5.运行
点击右上角的 `sync` 按钮
@@ -653,7 +747,10 @@ ohpm install
要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。
-请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-tcp-socket Releases](https://github.com/react-native-oh-library/react-native-tcp-socket/releases)
+在以下版本验证通过:
+
+1. RNOH: 0.72.38; SDK: HarmonyOS-5.0.0(API12); ROM: 5.0.0.107;
+2. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.868; ROM: 6.0.0.112;
### 权限要求
@@ -679,88 +776,89 @@ ohpm install
> [!TIP] "HarmonyOS Support"列为 yes 表示 HarmonyOS 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| -------------------------------------------- | --------------------------------------------------- | -------- | -------- | ----------- | ----------------- |
-| connect(options, callback) | Same as createConnection,Creating a TCP Socket | function | no | Android,iOS | yes |
-| createServer(connectionListener) | Creating a TCP Server | function | no | Android,iOS | yes |
-| createConnection(options, callback) | Creating a TCP Socket | function | no | Android,iOS | yes |
-| createTLSServer(options, connectionListener) | Creating a TLS-based TCP Server | function | no | Android,iOS | yes |
-| connectTLS | Creating a TLS-based encrypted connection | function | no | Android,iOS | yes |
-| isIP | Check whether a character string is an IP address | function | no | Android,iOS | yes |
-| isIPv4 | Check whether a character string is an IPv4 address | function | no | Android,iOS | yes |
-| isIPv6 | Check whether a character string is an IPv6 address | function | no | Android,iOS | yes |
-| Server | TCP Server Object | object | no | Android,iOS | yes |
-| Socket | TCP Socket Object | object | no | Android,iOS | yes |
-| TLSServer | TLS Server Object | object | no | Android,iOS | yes |
-| TLSSocket | TLS Socket Object | object | no | Android,iOS | yes |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| ---------------------------------------------------------- | --------------------------------------------------- | -------- | -------- | ----------- | ----------------- |
+| connect(options, callback) | 同createConnection,创建TCP套接字 | function | No | Android,iOS | Yes |
+| createServer(connectionListener) | 创建TCP服务器 | function | No | Android,iOS | Yes |
+| createServer(options,connectionListener)6.3.1+ | 创建TCP服务器 | function | No | Android,iOS | Yes |
+| createConnection(options, callback) | 创建TCP套接字 | function | No | Android,iOS | Yes |
+| createTLSServer(options, connectionListener) | 创建基于TLS的TCP服务器 | function | No | Android,iOS | Yes |
+| connectTLS | 创建基于TLS的加密连接 | function | No | Android,iOS | Yes |
+| isIP | 检查字符串是否为IP地址 | function | No | Android,iOS | Yes |
+| isIPv4 | 检查字符串是否为IPv4地址 | function | No | Android,iOS | Yes |
+| isIPv6 | 检查字符串是否为IPv6地址 | function | No | Android,iOS | Yes |
+| Server | TCP服务器对象 | object | No | Android,iOS | Yes |
+| Socket | TCP套接字对象 | object | No | Android,iOS | Yes |
+| TLSServer | TLS服务器对象 | object | No | Android,iOS | Yes |
+| TLSSocket | TLS套接字对象 | object | No | Android,iOS | Yes |
### Server
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| Name | Description | Type | Required | Platform | HarmonyOS |
| ---- | ----------- | ---- | -------- | -------- | ------------------ |
-| address() | Returns the bound `address`, the address `family` name, and `port` of the server as reported by the operating system if listening | function | no | Android,iOS | yes |
-| listen(options, callback) | Start a server listening for connections | function | no | Android,iOS | yes |
-| close(callback) | Stops the server from accepting new connections and keeps existing connections | function |no | Android,iOS | yes |
-| getConnections(callback) | Asynchronously get the number of concurrent connections on the server | function | no | Android,iOS | yes |
-| listening | whether to enable the listening | boolean | no | Android,iOS | yes |
-| on('close') | Triggered when the server is shut down | event | no | Android,iOS | yes |
-| on('connection') | Triggered when the server receives a new connection | event | no | Android,iOS | yes |
-| on('error') | Triggered when an error occurs on the server | event | no | Android,iOS | yes |
-| on('listening') | Triggered when the server starts listening | event | no | Android,iOS | yes |
+| address() | 返回服务器绑定的地址、地址族名称和端口号 | function | No | Android,iOS | Yes |
+| listen(options, callback) | 启动服务器监听连接 | function | No | Android,iOS | Yes |
+| close(callback) | 停止服务器接受新连接,但保持现有连接 | function | No | Android,iOS | Yes |
+| getConnections(callback) | 异步获取服务器上的并发连接数 | function | No | Android,iOS | Yes |
+| listening | 是否启用监听 | boolean | No | Android,iOS | Yes |
+| on('close') | 当服务器关闭时触发 | event | No | Android,iOS | Yes |
+| on('connection') | 当服务器接收到新连接时触发 | event | No | Android,iOS | Yes |
+| on('error') | 当服务器发生错误时触发 | event | No | Android,iOS | Yes |
+| on('listening') | 当服务器开始监听时触发 | event | No | Android,iOS | Yes |
### Socket
| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ---- | ----------- | ---- | -------- | -------- | ------------------ |
-| address() | Returns the bound `address`, the address `family` name and `port` of the socket as reported | function | no | Android,iOS | yes |
-| destroy() | Ensures that no more I/O activity happens on this socket. Destroys the stream and closes the connection | function | no | Android,iOS | yes |
-| end() | Half-closes the socket. i.e., it sends a FIN packet. It is possible the server will still send some data | function | no | Android,iOS | yes |
-| setEncoding(encoding) | Set the encoding for the socket as a Readable Stream. By default, no encoding is assigned and stream data will be returned as `Buffer` objects | function | no | Android,iOS | yes |
-| setNoDelay(noDelay) | Set no delay | function | no | Android,iOS | yes |
-| setTimeout() | Sets the socket to timeout after `timeout` milliseconds of inactivity on the socket. By default `TcpSocket` do not have a timeout | function | no | Android,iOS | yes |
-| write(buffer, encoding, cb) | Sends data on the socket. The second parameter specifies the encoding in the case of a string — it defaults to UTF8 encoding | function | no | Android,iOS | yes |
-| pause() | Pauses the reading of data. That is, `'data'` events will not be emitted. Useful to throttle back an upload | function | no | Android,iOS | yes |
-| resume() | Resumes reading after a call to `socket.pause()` | function | no | Android,iOS | yes |
-| writableNeedDrain | whether need to wait for data to be written to the socket | boolean | no | Android,iOS | yes |
-| bytesRead | Indicates the number of bytes of data that have been read from the socket | number | no | Android,iOS | yes |
-| bytesWritten | get the number of bytes last written to the socket | number | no | Android,iOS | yes |
-| connecting | whether the current socket is being connected | boolean | no | Android,iOS | yes |
-| destroyed | Whether the socket has been destroyed | boolean | no | Android,iOS | yes |
-| localAddress | Local ip address | string | no | Android,iOS | yes |
-| localPort | Local port | number | no | Android,iOS | yes |
-| remoteAddress | remote server IP address | string | no | Android,iOS | yes |
-| remoteFamily | remote server IP address type | string | no | Android,iOS | yes |
-| remotePort | remote server port | number | no | Android,iOS | yes |
-| pending | Whether has pending data to be sent to the remote server | boolean | no | Android,iOS | yes |
-| timeout | The timeout period for the socket, in milliseconds. The default timeout period is 30 seconds | number | no | Android,iOS | yes |
-| readyState | the state of socket,`0`: not connected,`1`:connected,2: closing,3:closed | number | no | Android,iOS | yes |
-| on('pause') | Triggered when pauses the reading of data | event | no | Android,iOS | yes |
-| on('resume') | Triggered when Resumes the reading of data | event | no | Android,iOS | yes |
-| on('close') | Triggered when socket is closed | event | no | Android,iOS | yes |
-| on('connect') | Triggered when socket is connected | event | no | Android,iOS | yes |
-| on('data') | Triggered when socket receives data | event | no | Android,iOS | yes |
-| on('drain') | Triggered when the buffer becomes empty, indicating that data can be written to the socke | event | no | Android,iOS | yes |
-| on('error') | Triggered when an error occurs on the socket | event | no | Android,iOS | yes |
-| on('timeout') | Triggered When the connection or data transmission times out | event | no | Android,iOS | yes |
+| ---- | ---- | ---- | -------- | ---- | -------- |
+| address() | 返回套接字绑定的地址、地址族名称和端口号 | function | No | Android,iOS | Yes |
+| destroy() | 确保该套接字上不再发生I/O活动。销毁流并关闭连接 | function | No | Android,iOS | Yes |
+| end() | 半关闭套接字(发送FIN包),服务器可能仍会发送数据 | function | No | Android,iOS | Yes |
+| setEncoding(encoding) | 设置套接字作为可读流的编码格式,默认为Buffer对象 | function | No | Android,iOS | Yes |
+| setNoDelay(noDelay) | 设置无延迟 | function | No | Android,iOS | Yes |
+| setTimeout() | 设置套接字空闲超时时间,默认无超时 | function | No | Android,iOS | Yes |
+| write(buffer, encoding, cb) | 通过套接字发送数据,字符串编码默认为UTF8 | function | No | Android,iOS | Yes |
+| pause() | 暂停数据读取(停止触发data事件),用于控制上传速率 | function | No | Android,iOS | Yes |
+| resume() | 恢复被pause()暂停的数据读取 | function | No | Android,iOS | Yes |
+| writableNeedDrain | 是否需要等待数据写入套接字 | boolean | No | Android,iOS | Yes |
+| bytesRead | 已从套接字读取的数据字节数 | number | No | Android,iOS | Yes |
+| bytesWritten | 最后写入套接字的字节数 | number | No | Android,iOS | Yes |
+| connecting | 当前套接字是否正在连接中 | boolean | No | Android,iOS | Yes |
+| destroyed | 套接字是否已被销毁 | boolean | No | Android,iOS | Yes |
+| localAddress | 本地IP地址 | string | No | Android,iOS | Yes |
+| localPort | 本地端口号 | number | No | Android,iOS | Yes |
+| remoteAddress | 远程服务器IP地址 | string | No | Android,iOS | Yes |
+| remoteFamily | 远程服务器IP地址类型 | string | No | Android,iOS | Yes |
+| remotePort | 远程服务器端口号 | number | No | Android,iOS | Yes |
+| pending | 是否仍有待发送到远程服务器的数据 | boolean | No | Android,iOS | Yes |
+| timeout | 套接字超时时长(毫秒),默认为30秒 | number | No | Android,iOS | Yes |
+| readyState | 套接字状态:0-未连接,1-已连接,2-关闭中,3-已关闭 | number | No | Android,iOS | Yes |
+| on('pause') | 暂停数据读取时触发 | event | No | Android,iOS | Yes |
+| on('resume') | 恢复数据读取时触发 | event | No | Android,iOS | Yes |
+| on('close') | 套接字关闭时触发 | event | No | Android,iOS | Yes |
+| on('connect') | 套接字连接成功时触发 | event | No | Android,iOS | Yes |
+| on('data') | 套接字接收到数据时触发 | event | No | Android,iOS | Yes |
+| on('drain') | 缓冲区清空可继续写入数据时触发 | event | No | Android,iOS | Yes |
+| on('error') | 套接字发生错误时触发 | event | No | Android,iOS | Yes |
+| on('timeout') | 连接或数据传输超时时触发 | event | No | Android,iOS | Yes |
### TLSServer
-[!TIP] TLSServer继承自Server对象,拥有Server对象的所有属性、方法和事件,以下仅列出其独有的属性。
+[!TIP] TLSServer 继承自 Server 对象,拥有 Server 对象的所有属性、方法和事件,以下仅列出其独有的属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ---- | ----------- | ---- | -------- | -------- | ------------------ |
-| setSecureContext(options) | Set Security Context | function | no | Android,iOS | yes |
-| on('secureConnection') | Triggered When a secure TLS connection is established | event | no | Android,iOS | yes |
+| ---- | ---- | ---- | -------- | ---- | -------- |
+| setSecureContext(options) | 设置安全上下文 | function | No | Android,iOS | Yes |
+| on('secureConnection') | 当建立安全的 TLS 连接时触发 | event | No | Android,iOS | Yes |
### TLSSocket
[!TIP] TLSSocket继承自Socket对象,拥有Socket对象的所有属性、方法和事件,以下仅列出其独有的属性。
| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| ---- | ----------- | ---- | -------- | -------- | ------------------ |
-| getCertificate() | Get a Local Certificate Information | function | no | Android | yes |
-| getPeerCertificate() | Get the Certificate Information of the Remote Server | function | no | Android | yes |
-| on('secureConnect') | Triggered When a secure connection is established | event | no | Android,iOS | yes |
+| ---- | ---- | ---- | -------- | ---- | -------- |
+| getCertificate() | 获取本地证书信息 | function | No | Android | Yes |
+| getPeerCertificate() | 获取远程服务器的证书信息 | function | No | Android | Yes |
+| on('secureConnect') | 当建立安全连接时触发 | event | No | Android,iOS | Yes |
## 遗留问题
--
Gitee
From 821fa3d8633f91c34e1b93c578d26e6c3ff77270 Mon Sep 17 00:00:00 2001
From: dingchenjie
Date: Thu, 27 Nov 2025 17:01:38 +0800
Subject: [PATCH 2/5] docs: update react-native-autocomplete-input
Signed-off-by: dingchenjie
---
en/react-native-autocomplete-input.md | 12 +++++++--
zh-cn/react-native-autocomplete-input.md | 31 +++++++++++++++---------
2 files changed, 29 insertions(+), 14 deletions(-)
diff --git a/en/react-native-autocomplete-input.md b/en/react-native-autocomplete-input.md
index 6336220c..6c156338 100644
--- a/en/react-native-autocomplete-input.md
+++ b/en/react-native-autocomplete-input.md
@@ -16,6 +16,11 @@
> [!TIP] [ GitHub address](https://github.com/byteburgers/react-native-autocomplete-input)
## Installation and Usage
+Please check the corresponding version information in the third-party library's Releases:
+
+| Third-party Library Version | Release Information | Supported RN Version |
+| --------------------------- | ------------------- | -------------------- |
+| 5.5.6 | [react-native-autocomplete-input release](https://github.com/byteburgers/react-native-autocomplete-input/releases) | 0.72/0.77 |
@@ -164,9 +169,12 @@ export default App;
### Compatibility
-This document is verified based on the following versions:
+To use this library, you need to use the correct React-Native and RNOH versions. Additionally, you need to use the matching DevEco Studio and phone ROM.
+
+Verified in the following versions:
-RNOH:0.72.27; SDK:HarmonyOS-Next-DB1 5.0.0.25; IDE:DevEco Studio 5.0.3.400SP7; ROM:3.0.0.25;
+1. RNOH: 0.72.38; SDK: HarmonyOS-5.0.0(API12); ROM: 5.0.0.107;
+2. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.868; ROM: 6.0.0.112;
## Properties
diff --git a/zh-cn/react-native-autocomplete-input.md b/zh-cn/react-native-autocomplete-input.md
index 8142bfa5..0d450288 100644
--- a/zh-cn/react-native-autocomplete-input.md
+++ b/zh-cn/react-native-autocomplete-input.md
@@ -17,6 +17,12 @@
> [!TIP] [Github 地址](https://github.com/byteburgers/react-native-autocomplete-input)
## 安装与使用
+
+请到三方库的 Releases 发布地址查看配套的版本信息:
+| 三方库版本 | 发布信息 | 支持RN版本 |
+| ---------- | ------------------------------------------------------------ | ---------- |
+| 5.5.6 | [react-native-autocomplete-input release](https://github.com/byteburgers/react-native-autocomplete-input/releases) | 0.72/0.77 |
+
进入到工程目录并输入以下命令:
@@ -152,11 +158,12 @@ export default App;
### 兼容性
-本文档内容基于以下版本验证通过:
+要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。
-1. RNOH:0.72.27; SDK:HarmonyOS-Next-DB1 5.0.0.25; IDE:DevEco Studio 5.0.3.400SP7; ROM:3.0.0.25;
+在以下版本验证通过:
-2. RNOH:0.72.33; SDK:OpenHarmony 5.0.0.71(API Version 12 Release); IDE:DevEco Studio 5.0.3.900; ROM:NEXT.0.0.71;
+1. RNOH: 0.72.38; SDK: HarmonyOS-5.0.0(API12); ROM: 5.0.0.107;
+2. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.868; ROM: 6.0.0.112;
## 属性
> [!TIP] "Platform"列表示该属性在原三方库上支持的平台。
@@ -165,15 +172,15 @@ export default App;
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ------------------- | ------------------------------------------------------------ | -------- | -------- | ----------- | ----------------- |
-| containerStyle | These styles will be applied to the container which surrounds the autocomplete component. | style | no | Android/iOS | yes |
-| hideResults | Set to `true` to hide the suggestion list. | bool | no | Android/iOS | yes |
-| data | An array with suggestion items to be rendered in `renderItem({ item, i })`. Any array with length > 0 will open the suggestion list and any array with length < 1 will hide the list. | array | no | Android/iOS | yes |
-| inputContainerStyle | These styles will be applied to the container which surrounds the textInput component. | style | no | Android/iOS | yes |
-| listContainerStyle | These styles will be applied to the container which surrounds the result list. | style | no | Android/iOS | yes |
-| onShowResults | will be called when the autocomplete suggestions appear or disappear. | function | no | Android/iOS | yes |
-| renderTextInput | render custom TextInput. All props passed to this function. | function | no | Android/iOS | yes |
-| flatListProps | custom props to FlatList. | object | no | Android/iOS | yes |
-| renderResultList | render custom result list. Can be used to replace FlatList. All props passed to this function. | function | no | Android/iOS | yes |
+| containerStyle | 这些样式将应用于环绕自动完成组件的容器 | style | no | Android/iOS | yes |
+| hideResults | 设置为 `true` 以隐藏建议列表 | bool | no | Android/iOS | yes |
+| data | 包含要在 `renderItem({ item, i })` 中渲染的建议项的数组。任何长度 > 0 的数组将打开建议列表,任何长度 < 1 的数组将隐藏列表 | array | no | Android/iOS | yes |
+| inputContainerStyle | 这些样式将应用于环绕文本输入组件的容器 | style | no | Android/iOS | yes |
+| listContainerStyle | 这些样式将应用于环绕结果列表的容器 | style | no | Android/iOS | yes |
+| onShowResults | 当自动完成建议出现或消失时将被调用 | function | no | Android/iOS | yes |
+| renderTextInput | 渲染自定义文本输入组件。所有属性都传递给此函数 | function | no | Android/iOS | yes |
+| flatListProps | 传递给 FlatList 的自定义属性 | object | no | Android/iOS | yes |
+| renderResultList | 渲染自定义结果列表。可用于替换 FlatList。所有属性都传递给此函数 | function | no | Android/iOS | yes |
## 遗留问题
--
Gitee
From af1ce981ea79c16966a1b91a49188e9a32d93d10 Mon Sep 17 00:00:00 2001
From: dingchenjie
Date: Fri, 28 Nov 2025 16:20:35 +0800
Subject: [PATCH 3/5] docs: update react-native-pull
Signed-off-by: dingchenjie
---
en/react-native-pull.md | 101 +++++++++++++++++++++----------------
zh-cn/react-native-pull.md | 18 ++++++-
2 files changed, 73 insertions(+), 46 deletions(-)
diff --git a/en/react-native-pull.md b/en/react-native-pull.md
index 3567bf3f..cd7f09c8 100644
--- a/en/react-native-pull.md
+++ b/en/react-native-pull.md
@@ -1,4 +1,4 @@
-> Template version: v0.2.2
+> Template Version: v0.2.2
react-native-pull
@@ -14,38 +14,48 @@
-> [!TIP] [Github address](https://github.com/react-native-oh-library/react-native-pull)
+> [!TIP] [Github Address](https://github.com/react-native-oh-library/react-native-pull)
-## Installation and Usage
+## Installation & Usage
-Find the matching version information in the release address of a third-party library: [@react-native-oh-tpl/react-native-pull/releases](https://github.com/react-native-oh-library/react-native-pull/releases). For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package.
+| Third-party Library Version | Release Information | Supported RN Version |
+|-----------------------------| --------------------------------------------------------------------- | -------------------- |
+| 2.0.4 | [@react-native-oh-tpl/react-native-pull releases](https://github.com/react-native-oh-library/react-native-pull/releases) | 0.72 |
+| 2.1.0 | [@react-native-ohos/react-native-pull Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-pull/releases) | 0.77 |
-Go to the project directory and execute the following instruction:
+For older versions not published to npm, please refer to the [Installation Guide](/zh-cn/tgz-usage.md) to install the tgz package.
+Navigate to your project directory and enter the following commands:
#### **npm**
```bash
+# 0.72
npm install @react-native-oh-tpl/react-native-pull
+# 0.77
+npm install @react-native-ohos/react-native-pull
```
#### **yarn**
```bash
+# 0.72
yarn add @react-native-oh-tpl/react-native-pull
+#0.77
+yarn add @react-native-ohos/react-native-pull
```
-The following code shows the basic use scenario of the repository:
+The following demo code demonstrates basic usage scenarios of this library:
-> [!WARNING] The library name imported during use remains unchanged.
+> [!WARNING] The import library name remains unchanged when using.
**PullViewDemo**
-> code example
+> Code Example
```js
import React, { Component, useState } from 'react';
@@ -102,11 +112,11 @@ const PullViewDemo = () => {
};
const topIndicatorRender = (pulling: any, pullok: any, pullrelease: any) => {
if (pulling) {
- setCount('Pull-to-refresh: pulling...')
+ setCount('Pull to refresh pulling...')
} else if (pullok) {
- setCount('Release-to-refresh: pullok...')
+ setCount('Release to refresh pullok......')
} else if (pullrelease) {
- setCount('Refreshing: pullrelease...')
+ setCount('Refreshing pullrelease......')
}
return (
@@ -156,7 +166,7 @@ const styles = StyleSheet.create({
**PullListDemo**
-> code example
+> Code Example
```jsx
import React, { useState } from 'react';
@@ -315,17 +325,17 @@ const PullListDemo = () => {
const onPushing = (gesturePosition: any) => {
- testObj.pushing = 'x:' + gesturePosition.x + '------' + 'y: ' + gesturePosition.y
+ testObj.pushing= 'x:' + gesturePosition.x + '------' + 'y:' + gesturePosition.y
setData(testObj)
};
const topIndicatorRender = (pulling: any, pullok: any, pullrelease: any) => {
if (pulling) {
- setCount('Current PullList state: pulling...')
+ setCount('Current PullList Status: pulling...')
} else if (pullok) {
- setCount('Current PullList state: pullok...')
+ setCount('Current PullList Status: pullok......')
} else if (pullrelease) {
- setCount('Current PullList state: pullrelease...')
+ setCount('Current PullList Status: pullrelease......')
}
return (
@@ -379,20 +389,20 @@ const PullListDemo = () => {
const [refreshing, setRefreshing] = useState(false)
const onRefresh = () => {
- // Logic for loading data
+ // Data loading logic
setRefreshing(true)
- // After data loading is completed
+ // After data loading is complete
setTimeout(() => {
setRefreshing(false)
- }, 2000); // Assuming that data loading takes 2 seconds
+ }, 2000); // Assuming data loading takes 2 seconds
};
const refreshControl = (
);
@@ -409,7 +419,7 @@ const PullListDemo = () => {
topIndicatorHeight={60}
pageSize={5}
scrollViewProps={{
- scrollEventThrottle: 16, // Reduce the delay of scrolling events and improve the responsiveness of scrolling
+ scrollEventThrottle: 16, // Reduce scroll event delay, improve scroll responsiveness
}}
initialListSize={5}
onEndReached={loadMore}
@@ -449,41 +459,44 @@ export default PullListDemo;
```
-## Constraints
+## Constraints & Limitations
### Compatibility
-To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone.
+To use this library, you need to use the correct React-Native and RNOH versions. Additionally, you need to use the matching DevEco Studio and phone ROM.
-Check the release version information in the release address of the third-party library: [@react-native-oh-tpl/react-native-pull/releases](https://github.com/react-native-oh-library/react-native-pull/releases)
+Verified in the following versions:
+
+1. RNOH: 0.72.38; SDK: HarmonyOS-5.0.0(API12); ROM: 5.0.0.107;
+2. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.868; ROM: 6.0.0.112;
## Properties
-> [!TIP] The **Platform** column indicates the platform where the properties are supported in the original third-party library.
+> [!TIP] The "Platform" column indicates the platforms supported by the original third-party library.
-> [!TIP] If the value of **HarmonyOS Support** is **yes**, it means that the HarmonyOS platform supports this property; **no** means the opposite; **partially** means some capabilities of this property are supported. The usage method is the same on different platforms and the effect is the same as that of iOS or Android.
+> [!TIP] "HarmonyOS Support" column: yes means the property is supported on HarmonyOS platform; no means not supported; partially means partially supported. The usage method is cross-platform consistent, with effects benchmarked against iOS or Android effects.
-**`PullView` & `PullList` Pull down effect attribute**
+**`PullView` & `PullList` Pull-to-refresh Properties**
-| Name | Description | Type | Required | Platform | HarmonyOS Support |
-| -------------------- | ------------------------------------------------------------ | -------- | -------- | ----------- | ----------------- |
-| `style` | Sets the component style, such as width, height, and background color. | Style | no | android,ios | yes |
-| `onPulling` | Called when the component is in the **pulling** state. | function | no | android,ios | yes |
-| `onPullOk` | Called when the component is in the **pullok** state. | function | no | android,ios | yes |
-| `onPullRelease` | Called when the component is in the **pullrelease** state. This function contains the **resolve **parameter. You should call **resolve()** at the end. | function | no | android,ios | yes |
-| `onPushing` | Called when the component is in the **pushing** state. This function contains the **gesturePosition** parameter, which is a **{x, y}** object in JSON format. When the component is pulled from top to bottom, the value of **gesturePosition.y** is greater than 0. When the object is pushed from bottom to top, the value of **gesturePosition.y** is less than 0. | function | no | android,ios | yes |
-| `topIndicatorRender` | Renders the top indicator component. This function contains four parameters: **ispulling**, **ispullok**, **ispullrelease** and **gesturePosition**. You can use **gesturePosition** to define the animation header. | function | no | android,ios | yes |
-| `topIndicatorHeight` | Specifies the height of the top indicator component. This property is necessary when **topIndicatorRender** is defined. | number | no | android,ios | yes |
-| `isPullEnd` | Indicates whether the pull-down ends. If the value is **true**, the top indicator component is hidden. This parameter is optional. | boolean | no | android,ios | no |
-| `onRefresh` | Called when the refresh starts. | function | no | android,ios | yes |
-| `refreshing` | Indicates whether the component is being refreshed. | function | no | android,ios | yes |
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | ----------- | ----------------- |
+| `style` | Set component styles, such as width/height/backgroundColor, etc. | Style | no | android,ios | yes |
+| `onPulling` | Method executed when in `pulling` state | function | no | android,ios | yes |
+| `onPullOk` | Method executed when in `pullok` state | function | no | android,ios | yes |
+| `onPullRelease` | Method executed when in `pullrelease` state, accepts one parameter: `resolve`, should call `resolve()` after completing operations. | function | no | android,ios | yes |
+| `onPushing` | Method executed when pushing from bottom to top, accepts one parameter: `gesturePosition`. gesturePosition is a JSON format {x, y} object, gesturePosition.y > 0 when pulling from top to bottom, gesturePosition.y < 0 when pushing from bottom to top. | function | no | android,ios | yes |
+| `topIndicatorRender` | Rendering method for top refresh indicator component, accepts 4 parameters: `ispulling`, `ispullok`, `ispullrelease`, `gesturePosition`, you can use `gesturePosition` to define animated header. | function | no | android,ios | yes |
+| `topIndicatorHeight` | Height of top refresh indicator component, required if topIndicatorRender is defined | number | no | android,ios | yes |
+| `isPullEnd` | Whether pull has ended, if true then hide top refresh indicator component, not required | boolean | no | android,ios | no |
+| `onRefresh` | Method called when starting refresh | function | no | android,ios | yes |
+| `refreshing` | Indicates whether refreshing is in progress | function | no | android,ios | yes |
## Known Issues
## Others
-- The isPullEnd property does not take effect; [issue#28](https://github.com/greatbsky/react-native-pull/issues/28)
+- isPullEnd property not working; [issue#28](https://github.com/greatbsky/react-native-pull/issues/28)
-## License
+## Open Source License
-This project is licensed under [The MIT License (MIT)](https://github.com/greatbsky/react-native-pull/blob/master/LICENSE).
\ No newline at end of file
+This project is based on [The MIT License (MIT)](https://github.com/greatbsky/react-native-pull/blob/master/LICENSE), feel free to enjoy and participate in open source.
\ No newline at end of file
diff --git a/zh-cn/react-native-pull.md b/zh-cn/react-native-pull.md
index f38bc7b0..b53b4e4a 100644
--- a/zh-cn/react-native-pull.md
+++ b/zh-cn/react-native-pull.md
@@ -18,7 +18,12 @@
## 安装与使用
-请到三方库的地址查看配套的版本信息:[@react-native-oh-tpl/react-native-pull/releases](https://github.com/react-native-oh-library/react-native-pull/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。
+| 三方库版本 | 发布信息 | 支持RN版本 |
+|--------| ------------------------------------------------------------ | ---------- |
+| 2.0.4 | [@react-native-oh-tpl/react-native-pull releases](https://github.com/react-native-oh-library/react-native-pull/releases) | 0.72 |
+| 2.1.0 | [@react-native-ohos/react-native-pull Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-pull/releases) | 0.77 |
+
+对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。
进入到工程目录并输入以下命令:
@@ -27,13 +32,19 @@
#### **npm**
```bash
+# 0.72
npm install @react-native-oh-tpl/react-native-pull
+# 0.77
+npm install @react-native-ohos/react-native-pull
```
#### **yarn**
```bash
+# 0.72
yarn add @react-native-oh-tpl/react-native-pull
+#0.77
+yarn add @react-native-ohos/react-native-pull
```
@@ -454,7 +465,10 @@ export default PullListDemo;
要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。
-请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-pull/releases](https://github.com/react-native-oh-library/react-native-pull/releases)
+在以下版本验证通过:
+
+1. RNOH: 0.72.38; SDK: HarmonyOS-5.0.0(API12); ROM: 5.0.0.107;
+2. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.868; ROM: 6.0.0.112;
## 属性
--
Gitee
From 2b2f9a4b2bff64a74a5b1f9072790f778343c7b3 Mon Sep 17 00:00:00 2001
From: dingchenjie
Date: Sun, 30 Nov 2025 17:45:36 +0800
Subject: [PATCH 4/5] docs: update react-native-ffmpeg-kit docs
Signed-off-by: dingchenjie
---
en/react-native-ffmpeg-kit.md | 505 +++++++++++++++++++++++++++++++
zh-cn/react-native-ffmpeg-kit.md | 86 ++++--
2 files changed, 558 insertions(+), 33 deletions(-)
create mode 100644 en/react-native-ffmpeg-kit.md
diff --git a/en/react-native-ffmpeg-kit.md b/en/react-native-ffmpeg-kit.md
new file mode 100644
index 00000000..a167c690
--- /dev/null
+++ b/en/react-native-ffmpeg-kit.md
@@ -0,0 +1,505 @@
+> Template Version: v0.2.2
+
+
+
react-native-ffmpeg-kit
+
+
+
+
+
+
+
+
+
+
+
+> [!tip] [Github Address](https://github.com/react-native-oh-library/ffmpeg-kit)
+
+## Installation & Usage
+| Third-party Library Version | Release Information | Supported RN Version |
+| ---------- | ------------------------------------------------------------ | ---------- |
+| 6.0.3 | [@react-native-oh-tpl/react-native-ffmpeg-kit release](https://github.com/react-native-oh-library/ffmpeg-kit/releases) | 0.72
+| 6.1.0 | [@react-native-ohos/react-native-ffmpeg-kit release](https://github.com/react-native-oh-library/ffmpeg-kit/releases) | 0.77
+
+Navigate to your project directory and run the following commands:
+
+#### **npm**
+
+```bash
+#0.72
+npm install @react-native-oh-tpl/react-native-ffmpeg-kit
+#0.77
+npm install @react-native-ohos/react-native-ffmpeg-kit
+```
+
+#### **yarn**
+
+```bash
+#0.72
+yarn add @react-native-ohos/react-native-ffmpeg-kit
+#0.77
+yarn add @react-native-ohos/react-native-ffmpeg-kit
+```
+
+The following code demonstrates basic usage scenarios of this library:
+
+> [!WARNING] The import library name remains unchanged when using.
+
+```js
+import React from 'react';
+import {ScrollView, Text, TextInput, TouchableOpacity, View} from 'react-native';
+import {
+ FFmpegKit,
+ FFmpegKitConfig,
+ FFprobeSession,
+ Level,
+ LogRedirectionStrategy,
+ SessionState
+} from "ffmpeg-kit-react-native";
+
+export default class CommandTab extends React.Component {
+ constructor(props) {
+ super(props);
+
+ this.state = {
+ commandText: '', outputText: ''
+ };
+ }
+
+ componentDidMount() {
+ this.props.navigation.addListener('focus', (_) => {
+ this.clearOutput();
+ this.setActive();
+ });
+ }
+
+ setActive() {
+ console.log("Command Tab Activated");
+ FFmpegKitConfig.enableLogCallback(undefined);
+ FFmpegKitConfig.enableStatisticsCallback(undefined);
+ }
+
+ appendOutput(logMessage) {
+ this.setState({outputText: this.state.outputText + logMessage});
+ };
+
+ clearOutput() {
+ this.setState({outputText: ''});
+ }
+
+ runFFmpeg = () => {
+ this.clearOutput();
+
+ let ffmpegCommand = this.state.commandText;
+
+ FFmpegKit.execute(ffmpegCommand).then(async (session) => {
+ const state = FFmpegKitConfig.sessionStateToString(await session.getState());
+ const returnCode = await session.getReturnCode();
+ const failStackTrace = await session.getFailStackTrace();
+ const output = await session.getOutput();
+
+ this.appendOutput(output);
+
+ if (state === SessionState.FAILED || !returnCode.isValueSuccess()) {
+ console.log("Command failed. Please check output for the details.");
+ }
+ });
+ };
+
+ runFFprobe = () => {
+ this.clearOutput();
+
+ let ffprobeCommand = this.state.commandText;-
+ FFprobeSession.create(FFmpegKitConfig.parseArguments(ffprobeCommand), async (session) => {
+ const state = FFmpegKitConfig.sessionStateToString(await session.getState());
+ const returnCode = await session.getReturnCode();
+ const failStackTrace = await session.getFailStackTrace();
+ session.getOutput().then(output => this.appendOutput(output));
+
+
+ if (state === SessionState.FAILED || !returnCode.isValueSuccess()) {
+ console.log("Command failed. Please check output for the details.");
+ }
+
+ }, undefined, LogRedirectionStrategy.NEVER_PRINT_LOGS).then(session => {
+ FFmpegKitConfig.asyncFFprobeExecute(session);
+ });
+ };
+
+ render() {
+ return (
+
+
+ FFmpegKit ReactNative
+
+
+
+ this.setState({commandText})}
+ value={this.state.commandText}
+ />
+
+
+
+ RUN FFMPEG
+
+
+
+
+ RUN FFPROBE
+
+
+
+ {
+ this.scrollViewReference = view;
+ }}
+ onContentSizeChange={(width, height) => this.scrollViewReference.scrollTo({y: height})}
+ style={styles.outputScrollViewStyle}>
+ {this.state.outputText}
+
+
+ );
+ };
+
+}
+
+const styles = StyleSheet.create({
+ screenStyle: {
+ flex: 1,
+ justifyContent: 'flex-start',
+ alignItems: 'stretch',
+ marginTop: Platform.select({ios: 20, android: 0})
+ },
+ headerViewStyle: {
+ paddingTop: 16,
+ paddingBottom: 10,
+ backgroundColor: '#F46842'
+ },
+ headerTextStyle: {
+ alignSelf: 'center',
+ height: 32,
+ fontSize: 18,
+ fontWeight: 'bold',
+ color: '#fff',
+ borderColor: 'lightgray',
+ borderRadius: 5,
+ borderWidth: 0
+ },
+ buttonViewStyle: {
+ alignSelf: 'center',
+ paddingBottom: 20
+ },
+ buttonStyle: {
+ justifyContent: 'center',
+ alignSelf: 'center',
+ width: 120,
+ height: 38,
+ backgroundColor: '#2ecc71',
+ borderColor: '#27AE60',
+ borderRadius: 5,
+ paddingLeft: 10,
+ paddingRight: 10
+ },
+ cancelButtonStyle: {
+ justifyContent: 'center',
+ width: 100,
+ height: 38,
+ backgroundColor: '#c5c5c5',
+ borderRadius: 5
+ },
+ buttonTextStyle: {
+ textAlign: 'center',
+ fontSize: 14,
+ fontWeight: 'bold',
+ color: '#fff'
+ },
+ videoPlayerViewStyle: {
+ backgroundColor: '#ECF0F1',
+ borderColor: '#B9C3C7',
+ borderRadius: 5,
+ borderWidth: 1,
+ height: window.height - 310,
+ width: window.width - 40,
+ marginVertical: 20,
+ marginHorizontal: 20
+ },
+ halfSizeVideoPlayerViewStyle: {
+ backgroundColor: '#ECF0F1',
+ borderColor: '#B9C3C7',
+ borderRadius: 5,
+ borderWidth: 1,
+ height: (window.height - 250) / 2,
+ width: window.width - 40,
+ marginVertical: 20,
+ marginHorizontal: 20
+ },
+ outputViewStyle: {
+ padding: 20,
+ flex: 1,
+ justifyContent: 'flex-start',
+ alignItems: 'stretch'
+ },
+ outputScrollViewStyle: {
+ padding: 4,
+ backgroundColor: '#f1c40f',
+ borderColor: '#f39c12',
+ borderRadius: 5,
+ borderWidth: 1
+ },
+ outputTextStyle: {
+ color: 'black'
+ },
+ textInputViewStyle: {
+ paddingTop: 40,
+ paddingBottom: 40,
+ paddingRight: 20,
+ paddingLeft: 20
+ },
+ textInputStyle: {
+ height: 36,
+ fontSize: 12,
+ borderColor: '#3498db',
+ borderRadius: 5,
+ borderWidth: 1
+ }
+});
+
+```
+
+## Link
+
+Currently, HarmonyOS does not support AutoLink, so the Link step needs to be configured manually.
+
+First, you need to open the HarmonyOS project `harmony` in your project using DevEco Studio.
+
+### 1. Add the overrides field to `oh-package.json5` in the project root directory
+
+```json
+{
+ ...
+ "overrides": {
+ "@rnoh/react-native-openharmony" : "./react_native_openharmony"
+ }
+}
+```
+
+### 2. Import native code
+
+There are currently two methods:
+
+1. Import via har package (this method will be deprecated after IDE improves related functionality, currently this is the preferred method);
+2. Directly link source code.
+
+Method 1: Import via har package (Recommended)
+
+> [!TIP] The har package is located in the `harmony` folder of the third-party library installation path.
+
+Open `entry/oh-package.json5` and add the following dependencies:
+
+```json
+"dependencies": {
+ "@rnoh/react-native-openharmony": "file:../react_native_openharmony",
+
+ //0.72
+ "@react-native-oh-tpl/react-native-ffmpeg-kit": "file:../../node_modules/@react-native-oh-tpl/react-native-ffmpeg-kit/harmony/ffmpeg_kit.har",
+ //0.77
+ "@react-native-ohos/react-native-ffmpeg-kit": "file:../../node_modules/@react-native-ohos/react-native-ffmpeg-kit/harmony/ffmpeg_kit.har",
+ }
+```
+
+Click the `sync` button in the upper right corner.
+
+Or execute in the terminal:
+
+```bash
+cd entry
+ohpm install
+```
+
+Method 2: Directly link source code
+
+> [!TIP] If you need to use direct source code linking, please refer to [Direct Link Source Code Instructions](/en/link-source-code.md)
+
+### 3. Configure CMakeLists and import GestureHandlerPackage
+
+Open `entry/src/main/cpp/CMakeLists.txt` and add:
+
+```diff
+project(rnapp)
+cmake_minimum_required(VERSION 3.4.1)
+set(CMAKE_SKIP_BUILD_RPATH TRUE)
+set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
++ set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules")
++ set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
+set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../../react-native-harmony/harmony/cpp")
+set(LOG_VERBOSITY_LEVEL 1)
+set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments")
+set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie")
+set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use
+add_compile_definitions(WITH_HITRACE_SYSTRACE)
+
+add_subdirectory("${RNOH_CPP_DIR}" ./rn)
+
+# RNOH_BEGIN: manual_package_linking_1
+add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package)
+#0.72
++ add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/react-native-ffmpeg-kit/src/main/cpp" ./ffmpeg-kit)
+#0.77
++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-ffmpeg-kit/src/main/cpp" ./ffmpeg-kit)
+# RNOH_END: manual_package_linking_1
+
+file(GLOB GENERATED_CPP_FILES "./generated/*.cpp")
+
+add_library(rnoh_app SHARED
+ ${GENERATED_CPP_FILES}
+ "./PackageProvider.cpp"
+ "${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp"
+)
+target_link_libraries(rnoh_app PUBLIC rnoh)
+
+# RNOH_BEGIN: manual_package_linking_2
+target_link_libraries(rnoh_app PUBLIC rnoh_sample_package)
++ target_link_libraries(rnoh_app PUBLIC rnoh_ffmpeg_kit)
+# RNOH_END: manual_package_linking_2
+```
+
+Open `entry/src/main/cpp/PackageProvider.cpp` and add:
+
+```diff
+#include "RNOH/PackageProvider.h"
+#include "SamplePackage.h"
++ #include "FFmpegKitPackage.h"
+
+using namespace rnoh;
+
+std::vector> PackageProvider::getPackages(Package::Context ctx) {
+ return {
+ std::make_shared(ctx),
++ std::make_shared(ctx)
+ };
+}
+```
+
+### 4. Import Gesture Handler Package on ArkTs side
+
+Open `entry/src/main/ets/RNPackagesFactory.ts` and add:
+
+```diff
+//0.72
++ import { FFmpegKitPackage } from '@react-native-oh-tpl/react-native-ffmpeg-kit/ts';
+//0.77
++ import { FFmpegKitPackage } from '@react-native-ohos/react-native-ffmpeg-kit/ts';
+
+export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
+ return [
+ new SamplePackage(ctx),
++ new FFmpegKitPackage(ctx),
+ ];
+}
+```
+
+### 5. Run
+
+Click the `sync` button in the upper right corner.
+
+Or execute in the terminal:
+
+```bash
+cd entry
+ohpm install
+```
+
+Then compile and run.
+
+## Constraints & Limitations
+
+### Compatibility
+
+To use this library, you need to use the correct React-Native and RNOH versions. Additionally, you need to use the matching DevEco Studio and phone ROM.
+
+Verified with the following versions:
+
+1. RNOH: 0.72.38; SDK: HarmonyOS-5.0.0(API12); ROM: 5.0.0.107;
+2. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.868; ROM: 6.0.0.112;
+
+## API
+
+> [!tip] The "Platform" column indicates the platforms supported by the original third-party library for this property.
+
+> [!tip] A value of "yes" in the "HarmonyOS Support" column indicates that the property is supported on the HarmonyOS platform; "no" indicates it is not supported; "partially" indicates partial support. The usage method is cross-platform consistent, with effects benchmarked against iOS or Android effects.
+
+#### FFmpegKit
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+|------|-------------|------|----------|----------|-------------------|
+| execute | Synchronously executes FFmpeg command provided. Space character is used to split the command into arguments. You can use single or double quote characters to specify arguments inside your command. | Promise | yes | All | yes |
+| executeAsync | Starts an asynchronous FFmpeg execution for the given command. Space character is used to split the command into arguments. You can use single or double quote characters to specify arguments inside your command. | Promise | yes | All | yes |
+| cancel | Cancels the session specified with `sessionId`. | Promise | yes | All | yes |
+| listSessions | Lists all FFmpeg sessions in the session history. | Promise | yes | All | yes |
+
+#### FFmpegKitConfig
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+|------|-------------|------|----------|----------|-------------------|
+| enableLogCallback | Sets a global callback to redirect FFmpeg/FFprobe logs. | Promise | yes | All | yes |
+| enableStatisticsCallback | Sets a global callback to redirect FFmpeg statistics. | Promise | yes | All | yes |
+| enableLogs | Enables logs. | Promise | yes | All | yes |
+| sessionStateToString | Returns the string representation of the SessionState provided. | void | yes | All | yes |
+| parseArguments | Parses the given command into arguments. Uses space character to split the arguments. Supports single and double quote characters. | void | yes | All | yes |
+| asyncFFprobeExecute | Starts an asynchronous FFprobe execution for the given session. | Promise | yes | All | yes |
+| getLogLevel | Returns the current log level. | void | yes | All | yes |
+| clearSessions | Clears all, including ongoing, sessions in the session history. | Promise | yes | All | yes |
+| setSessionHistorySize | Sets the session history size. | Promise | yes | All | yes |
+| init | Initializes the library asynchronously. | Promise | yes | All | yes |
+| ignoreSignal | Registers a new ignored signal. Ignored signals are not handled by `FFmpegKit` library. | Promise | yes | All | yes |
+| setLogLevel | Sets the log level. | Promise | yes | All | yes |
+| getPlatform | Returns the platform name the library is loaded on. | Promise | yes | All | yes |
+| getFFmpegVersion | Returns the version of FFmpeg bundled within `FFmpegKit` library. | Promise | yes | All | yes |
+| getSessions | Returns all sessions in the session history. | Promise | yes | All | yes |
+| setFontDirectoryList | Registers the fonts inside the given list of font directories, so they become available to use in FFmpeg filters. | Promise | yes | All | yes |
+| setEnvironmentVariable | Sets an environment variable. | Promise | yes | All | yes |
+
+#### FFprobeSession
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+|------|-------------|------|----------|----------|-------------------|
+| create | Creates a new FFprobe session. | Promise | yes | All | yes |
+
+#### ReturnCode
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+|------|-------------|------|----------|----------|-------------------|
+| isSuccess | Success or not. | boolean | yes | All | yes |
+| isCancel | Cancel or not. | boolean | yes | All | yes |
+
+#### FFprobeKit
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+|------|-------------|------|----------|----------|-------------------|
+| getMediaInformation | Extracts media information for the file specified with path. | Promise | yes | All | yes |
+| listFFprobeSessions | Lists all FFprobe sessions in the session history. | Promise | yes | All | yes |
+
+#### Packages
+
+| Name | Description | Type | Required | Platform | HarmonyOS Support |
+|------|-------------|------|----------|----------|-------------------|
+| getPackageName | Returns the FFmpegKit ReactNative binary package name. | | | | | | Promise | yes | All | yes |
+
+## Known Issues
+
+## Others
+
+## Open Source License
+
+This project is based on [The GNU License (GNU)](https://github.com/arthenica/ffmpeg-kit/blob/main/LICENSE), please feel free to enjoy and participate in open source.
\ No newline at end of file
diff --git a/zh-cn/react-native-ffmpeg-kit.md b/zh-cn/react-native-ffmpeg-kit.md
index c354bdd6..ca0c794a 100644
--- a/zh-cn/react-native-ffmpeg-kit.md
+++ b/zh-cn/react-native-ffmpeg-kit.md
@@ -17,23 +17,32 @@
> [!tip] [Github 地址](https://github.com/react-native-oh-library/ffmpeg-kit)
## 安装与使用
+| Third-party Library Version | Release Information | Supported RN Version |
+| ---------- | ------------------------------------------------------------ | ---------- |
+| 6.0.3 | [@react-native-oh-tpl/react-native-ffmpeg-kit release](https://github.com/react-native-oh-library/ffmpeg-kit/releases) | 0.72
+| 6.1.0 | [@react-native-ohos/react-native-ffmpeg-kit release](https://github.com/react-native-oh-library/ffmpeg-kit/releases) | 0.77
-请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/ffmpeg-kit Releases](https://github.com/react-native-oh-library/ffmpeg-kit/releases)。对于未发布到npm的旧版本,请参考[安装指南](https://gitee.com/react-native-oh-library/usage-docs/blob/master/zh-cn/tgz-usage.md)安装tgz包。
-
-进入到工程目录并输入以下命令:
+Navigate to your project directory and run the following commands:
#### **npm**
```bash
+#0.72
npm install @react-native-oh-tpl/react-native-ffmpeg-kit
+#0.77
+npm install @react-native-ohos/react-native-ffmpeg-kit
```
#### **yarn**
```bash
-yarn add @react-native-oh-tpl/react-native-ffmpeg-kit
+#0.72
+yarn add @react-native-ohos/react-native-ffmpeg-kit
+#0.77
+yarn add @react-native-ohos/react-native-ffmpeg-kit
```
+
下面的代码展示了这个库的基本使用场景:
> [!WARNING] 使用时 import 的库名不变。
@@ -303,7 +312,10 @@ const styles = StyleSheet.create({
"dependencies": {
"@rnoh/react-native-openharmony": "file:../react_native_openharmony",
+ //0.72
"@react-native-oh-tpl/react-native-ffmpeg-kit": "file:../../node_modules/@react-native-oh-tpl/react-native-ffmpeg-kit/harmony/ffmpeg_kit.har",
+ //0.77
+ "@react-native-ohos/react-native-ffmpeg-kit": "file:../../node_modules/@react-native-ohos/react-native-ffmpeg-kit/harmony/ffmpeg_kit.har",
}
```
@@ -342,7 +354,10 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn)
# RNOH_BEGIN: manual_package_linking_1
add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package)
+#0.72
+ add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/react-native-ffmpeg-kit/src/main/cpp" ./ffmpeg-kit)
+#0.77
++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-ffmpeg-kit/src/main/cpp" ./ffmpeg-kit)
# RNOH_END: manual_package_linking_1
file(GLOB GENERATED_CPP_FILES "./generated/*.cpp")
@@ -382,8 +397,10 @@ std::vector> PackageProvider::getPackages(Package::Cont
打开 `entry/src/main/ets/RNPackagesFactory.ts`,添加:
```diff
+//0.72
+ import { FFmpegKitPackage } from '@react-native-oh-tpl/react-native-ffmpeg-kit/ts';
-
+//0.77
++ import { FFmpegKitPackage } from '@react-native-ohos/react-native-ffmpeg-kit/ts';
export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
return [
new SamplePackage(ctx),
@@ -411,7 +428,10 @@ ohpm install
要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。
-请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/ffmpeg-kit Releases](https://github.com/react-native-oh-library/ffmpeg-kit/releases)
+在以下版本验证通过:
+
+1. RNOH: 0.72.38; SDK: HarmonyOS-5.0.0(API12); ROM: 5.0.0.107;
+2. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.868; ROM: 6.0.0.112;
## API
@@ -425,58 +445,58 @@ ohpm install
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| ---------- | ------------------------------------------------------------------------------------------------ | ------------------------------------ | -------- | -------- | -------- |
-| execute | Synchronously executes FFmpeg command provided. Space character is used to split the command into arguments. You can use single or double quote characters to specify arguments inside your command. | Promise | yes | All | yes |
-| executeAsync | Starts an asynchronous FFmpeg execution for the given command. Space character is used to split the command into arguments. You can use single or double quote characters to specify arguments inside your command. | Promise | yes | All | yes |
-| cancel | Cancels the session specified with sessionId. | Promise | yes | All | yes |
-| listSessions | Lists all FFmpeg sessions in the session history. | Promise | yes | All | yes |
+| execute | 同步执行提供的 FFmpeg 命令。使用空格字符将命令分割为参数。您可以使用单引号或双引号字符来指定命令中的参数。 | Promise | yes | All | yes |
+| executeAsync | 为给定命令启动异步 FFmpeg 执行。使用空格字符将命令分割为参数。您可以使用单引号或双引号字符来指定命令中的参数。 | Promise | yes | All | yes |
+| cancel | 取消指定 `sessionId` 的会话。 | Promise | yes | All | yes |
+| listSessions | 列出会话历史中的所有 FFmpeg 会话。 | Promise | yes | All | yes |
#### FFmpegKitConfig
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| :--------- | ------------------------------------------------------------------------------------------------ | ------------------------------------ | -------- | -------- | -------- |
-| enableLogCallback | Sets a global callback to redirect FFmpeg/FFprobe logs. | Promise | yes | All | yes |
-| enableStatisticsCallback | Sets a global callback to redirect FFmpeg statistics. | Promise | yes | All | yes |
-| enableLogs | Enables logs. | Promise | yes | All | yes |
-| sessionStateToString | Returns the string representation of the SessionState provided. | void | yes | All | yes |
-| parseArguments | Parses the given command into arguments. Uses space character to split the arguments.Supports single and double quote characters. | void | yes | All | yes |
-| asyncFFprobeExecute | Starts an asynchronous FFprobe execution for the given session. | Promise | yes | All | yes |
-| getLogLevel | Returns the current log level. | void | yes | All | yes |
-| clearSessions | Clears all, including ongoing, sessions in the session history. | Promise | yes | All | yes |
-| setSessionHistorySize | Sets the session history size. | Promise | yes | All | yes |
-| init | Initializes the library asynchronously. | Promise | yes | All | yes |
-| ignoreSignal | Registers a new ignored signal. Ignored signals are not handled by FFmpegKitlibrary | Promise | yes | All |yes|
-| setLogLevel | Sets the log level. | Promise | yes | All | yes |
-| getPlatform | Returns the platform name the library is loaded on. | Promise | yes | All | yes |
-| getFFmpegVersion | Returns the version of FFmpeg bundled within FFmpegKit library. | Promise | yes | All | yes |
-| getSessions | Returns all sessions in the session history. | Promise | yes | All | yes |
-| setFontDirectoryList | Registers the fonts inside the given list of font directories, so they become available to use in FFmpeg filters. | Promise | yes | All | yes |
-| setEnvironmentVariable | Sets an environment variable. | Promise | yes | All | yes |
+| enableLogCallback | 设置全局回调以重定向 FFmpeg/FFprobe 日志。 | Promise | yes | All | yes |
+| enableStatisticsCallback | 设置全局回调以重定向 FFmpeg 统计信息。 | Promise | yes | All | yes |
+| enableLogs | 启用日志。 | Promise | yes | All | yes |
+| sessionStateToString | 返回提供的 SessionState 的字符串表示形式。 | void | yes | All | yes |
+| parseArguments | 将给定命令解析为参数。使用空格字符分割参数。支持单引号和双引号字符。 | void | yes | All | yes |
+| asyncFFprobeExecute | 为给定会话启动异步 FFprobe 执行。 | Promise | yes | All | yes |
+| getLogLevel | 返回当前日志级别。 | void | yes | All | yes |
+| clearSessions | 清除会话历史中的所有会话(包括正在进行的会话)。 | Promise | yes | All | yes |
+| setSessionHistorySize | 设置会话历史大小。 | Promise | yes | All | yes |
+| init | 异步初始化库。 | Promise | yes | All | yes |
+| ignoreSignal | 注册新的忽略信号。被忽略的信号不会被 `FFmpegKit` 库处理。 | Promise | yes | All |yes|
+| setLogLevel | 设置日志级别。 | Promise | yes | All | yes |
+| getPlatform | 返回库加载所在的平台名称。 | Promise | yes | All | yes |
+| getFFmpegVersion | 返回 `FFmpegKit` 库中捆绑的 FFmpeg 版本。 | Promise | yes | All | yes |
+| getSessions | 返回会话历史中的所有会话。 | Promise | yes | All | yes |
+| setFontDirectoryList | 注册给定字体目录列表中的字体,使其可在 FFmpeg 过滤器中使用。 | Promise | yes | All | yes |
+| setEnvironmentVariable | 设置环境变量。 | Promise | yes | All | yes |
#### FFprobeSession
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| :--------- | ------------------------------------------------------------------------------------------------ | ------------------------------------ | -------- | -------- | -------- |
-| create | Creates a new FFprobe session. | Promise | yes | All | yes |
+| create | 创建新的 FFprobe 会话。 | Promise | yes | All | yes |
#### ReturnCode
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| :--------- | ------------------------------------------------------------------------------------------------ | ------------------------------------ | -------- | -------- | -------- |
-| isSuccess | Success or not. | boolean | yes | All | yes |
-| isCancel | Cancel or not. | boolean | yes | All | yes |
+| isSuccess | 是否成功。 | boolean | yes | All | yes |
+| isCancel | 是否取消。 | boolean | yes | All | yes |
#### FFprobeKit
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| :--------- | ------------------------------------------------------------------------------------------------ | ------------------------------------ | -------- | -------- | -------- |
-| getMediaInformation | Extracts media information for the file specified with path. | Promise | yes | All | yes |
-| listFFprobeSessions | Lists all FFprobe sessions in the session history. | Promise | yes | All | yes |
+| getMediaInformation | 提取指定路径文件的媒体信息。 | Promise | yes | All | yes |
+| listFFprobeSessions | 列出会话历史中的所有 FFprobe 会话。 | Promise | yes | All | yes |
#### Packages
| Name | Description | Type | Required | Platform | HarmonyOS Support |
| :--------- | ------------------------------------------------------------------------------------------------ | ------------------------------------ | -------- | -------- | -------- |
-| getPackageName | Returns the FFmpegKit ReactNative binary package name. | Promise | yes | All | yes |
+| getPackageName | 返回 FFmpegKit ReactNative 二进制包名称。 | | | | | | Promise | yes | All | yes |
## 遗留问题
--
Gitee
From 2cb6952fb3fad4ed96d9901c88e31396c2120c31 Mon Sep 17 00:00:00 2001
From: dingchenjie
Date: Tue, 2 Dec 2025 14:34:42 +0800
Subject: [PATCH 5/5] docs: update docs
Signed-off-by: dingchenjie
---
en/react-native-aria.md | 5 +--
en/react-native-community-toolbar-android.md | 14 +++-----
en/react-native-ffmpeg-kit.md | 2 +-
en/react-native-graph.md | 8 ++---
en/react-native-keys.md | 12 +++----
en/react-native-tcp-socket.md | 29 +++--------------
zh-cn/react-native-aria.md | 5 +--
.../react-native-community-toolbar-android.md | 8 ++---
zh-cn/react-native-ffmpeg-kit.md | 2 +-
zh-cn/react-native-graph.md | 4 +--
zh-cn/react-native-keys.md | 8 ++---
zh-cn/react-native-tcp-socket.md | 32 +++----------------
12 files changed, 41 insertions(+), 88 deletions(-)
diff --git a/en/react-native-aria.md b/en/react-native-aria.md
index a0552328..59aa6401 100644
--- a/en/react-native-aria.md
+++ b/en/react-native-aria.md
@@ -15,6 +15,7 @@
> [!TIP] [Github Address](https://github.com/gluestack/react-native-aria/tree/main)
## Installation & Usage
+> [!TIP] This library is no longer maintained. If you encounter missing modules when running the project after executing the general package command, you need to uninstall the old packages and add `--legacy-peer-deps` to the command, then download the package files again.
Please check the corresponding version information in the third-party library's Releases:
@@ -29,13 +30,13 @@ Navigate to your project directory and run the following command:
#### **yarn**
```bash
-yarn add react-native-aria@0.2.3
+yarn add react-native-aria@0.2.4
```
#### **npm**
```bash
-npm install react-native-aria@0.2.3
+npm install react-native-aria@0.2.4
```
In addition to the main package, we also provide some separate packages, such as: @react-native-aria/button
diff --git a/en/react-native-community-toolbar-android.md b/en/react-native-community-toolbar-android.md
index 4838ddb5..23e38707 100644
--- a/en/react-native-community-toolbar-android.md
+++ b/en/react-native-community-toolbar-android.md
@@ -8,10 +8,10 @@ This project is based on [@react-native-toolbar-android/toolbar-android@v0.2.1](
The third-party library repository has been migrated to Gitee and supports direct download from npm. The new package name is: `@react-native-ohos/toolbar-android`. The specific version relationships are as follows:
-| Third-party Version | Release Information | Supported RN Version |
-|-----------------| ------------------------------------------------- | ------------------ |
-| <= 0.2.1 | [@react-native-oh-tpl/toolbar-android Releases(deprecated)](https://github.com/react-native-oh-library/toolbar-android/releases) | 0.72
-| >= 0.2.2 | [@react-native-ohos/toolbar-android Releases](https://gitcode.com/openharmony-sig/rntpc_toolbar-android/releases) | 0.77
+| Version | Package Name | Repository | Release | Supported RN Version |
+|-----------------|-----|--------|----------------------------------- | ------------------ |
+| 0.2.1 | @react-native-oh-tpl/toolbar-android| [Github(deprecated)](https://github.com/react-native-oh-library/toolbar-android)| [@react-native-oh-tpl/toolbar-android Releases(deprecated)](https://github.com/react-native-oh-library/toolbar-android/releases) | 0.72
+| 0.2.2 | @react-native-ohos/toolbar-android | [Gitcode](https://gitcode.com/openharmony-sig/rntpc_toolbar-android/tree/master)| [@react-native-ohos/toolbar-android Releases](https://gitcode.com/openharmony-sig/rntpc_toolbar-android/releases) | 0.72/0.77
## 1. Installation & Usage
@@ -22,18 +22,12 @@ Navigate to your project directory and run the following command:
#### **npm**
```bash
-# 0.72
-npm install @react-native-oh-tpl/toolbar-android
-# 0.77
npm install @react-native-ohos/toolbar-android
```
#### **yarn**
```bash
-# 0.72
-yarn add @react-native-oh-tpl/toolbar-android
-# 0.77
yarn add @react-native-ohos/toolbar-android
```
diff --git a/en/react-native-ffmpeg-kit.md b/en/react-native-ffmpeg-kit.md
index a167c690..d3400b33 100644
--- a/en/react-native-ffmpeg-kit.md
+++ b/en/react-native-ffmpeg-kit.md
@@ -37,7 +37,7 @@ npm install @react-native-ohos/react-native-ffmpeg-kit
```bash
#0.72
-yarn add @react-native-ohos/react-native-ffmpeg-kit
+yarn add @react-native-oh-tpl/react-native-ffmpeg-kit
#0.77
yarn add @react-native-ohos/react-native-ffmpeg-kit
```
diff --git a/en/react-native-graph.md b/en/react-native-graph.md
index a9a285f1..d3a522ea 100644
--- a/en/react-native-graph.md
+++ b/en/react-native-graph.md
@@ -115,12 +115,12 @@ const styles = StyleSheet.create({
## Link
-The HarmonyOS implementation of this library depends on the native code of @react-native-oh-tpl/react-native-reanimated, @react-native-oh-tpl/react-native-gesture-handler, and @react-native-oh-tpl/react-native-skia. If these libraries have already been introduced in your HarmonyOS project, you do not need to introduce them again and can skip this section to start using directly.
+The HarmonyOS implementation of this library depends on the native code of react-native-reanimated, react-native-gesture-handler, and react-native-skia. If these libraries have already been introduced in your HarmonyOS project, you do not need to introduce them again and can skip this section to start using directly.
If not introduced, please refer to:
-- [@react-native-oh-tpl/react-native-reanimated Documentation](/zh-cn/react-native-reanimated.md)
-- [@react-native-oh-tpl/react-native-gesture-handler Documentation](/zh-cn/react-native-gesture-handler.md)
-- [@react-native-oh-tpl/react-native-skia Documentation](/zh-cn/react-native-skia.md)
+- [react-native-reanimated Documentation](/zh-cn/react-native-reanimated.md)
+- [react-native-gesture-handler Documentation](/zh-cn/react-native-gesture-handler.md)
+- [react-native-skia Documentation](/zh-cn/react-native-skia.md)
## Constraints and Limitations
diff --git a/en/react-native-keys.md b/en/react-native-keys.md
index f52ad560..09a251ec 100644
--- a/en/react-native-keys.md
+++ b/en/react-native-keys.md
@@ -115,7 +115,7 @@ Method 1: Import via har package (Recommended)
Open `entry/oh-package.json5` and add the following dependencies:
-v0.7.11
+v0.72
```json
"dependencies": {
@@ -124,7 +124,7 @@ v0.7.11
}
```
-v0.8.0
+v0.77
```json
"dependencies": {
@@ -168,9 +168,9 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn)
# RNOH_BEGIN: manual_package_linking_1
add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package)
-// v0.77.11
+# v0.72
+ add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/react-native-keys/src/main/cpp" ./rnohkeys)
-// v0.8.0
+# v0.77
+ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-keys/src/main/cpp" ./rnohkeys)
# RNOH_END: manual_package_linking_1
@@ -214,9 +214,9 @@ Open `entry/src/main/ets/RNPackagesFactory.ts` and add:
```typescript
...
- // v0.7.11
+ // v0.72
+ import { RNKeysPackage } from '@react-native-oh-tpl/react-native-keys';
- // v0.8.0
+ // v0.77
+ import { RNKeysPackage } from '@react-native-ohos/react-native-keys';
export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
diff --git a/en/react-native-tcp-socket.md b/en/react-native-tcp-socket.md
index 981b63c5..e56dcc84 100644
--- a/en/react-native-tcp-socket.md
+++ b/en/react-native-tcp-socket.md
@@ -20,7 +20,8 @@ Please check the corresponding version information in the third-party library's
| Third-party Version | Release Information | Supported RN Version |
| ------------------- | ------------------- | -------------------- |
-| 6.2.0 | [@react-native-oh-tpl/react-native-tcp-socket Releases](https://github.com/react-native-oh-library/react-native-tcp-socket/releases) | 0.72 |
+| 6.2.0 | [@react-native-oh-tpl/react-native-tcp-socket Releases(deprecated)](https://github.com/react-native-oh-library/react-native-tcp-socket/releases) | 0.72 |
+| 6.2.1 | [@react-native-ohos/react-native-tcp-socket Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-tcp-socket/releases) | 0.72 |
| 6.3.1 | [@react-native-ohos/react-native-tcp-socket Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-tcp-socket/releases) | 0.77 |
For older versions not published to npm, please refer to the [Installation Guide](/zh-cn/tgz-usage.md) to install the tgz package.
@@ -32,9 +33,6 @@ Navigate to your project directory and run the following command:
#### **npm**
```bash
-# V0.72
-npm install @react-native-oh-tpl/react-native-tcp-socket
-
# V0.77
npm install @react-native-ohos/react-native-tcp-socket
```
@@ -42,10 +40,6 @@ npm install @react-native-ohos/react-native-tcp-socket
#### **yarn**
```bash
-# V0.72
-yarn add @react-native-oh-tpl/react-native-tcp-socket
-
-# V0.77
yarn add @react-native-ohos/react-native-tcp-socket
```
@@ -582,13 +576,13 @@ const styles = StyleSheet.create({
## Using Codegen
-> [!TIP] V6.3.1 does not require executing Codegen
+> [!TIP] Version >= @react-native-ohos/react-native-tcp-socket@6.2.1, compatible with codegen-lib for generating bridge code.
This library has been adapted for `Codegen`. Before use, you need to actively execute the command to generate the third-party library bridging code. Please refer to the [Codegen Usage Documentation](/zh-cn/codegen.md) for details.
## Link
-Currently, HarmonyOS does not support AutoLink, so the Link step requires manual configuration.
+This step provides guidance for manually configuring native dependencies.
First, you need to open the HarmonyOS project `harmony` within your project using DevEco Studio.
@@ -616,17 +610,6 @@ Method 1: Import via har package (Recommended)
Open `entry/oh-package.json5` and add the following dependencies:
-- V6.2.0
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony" : "file:../react_native_openharmony",
- "@react-native-oh-tpl/react-native-tcp-socket": "file:../../node_modules/@react-native-oh-tpl/react-native-tcp-socket/harmony/tcp_socket.har"
- }
-```
-
-- V6.3.1
-
```JSON
"dependencies": {
"@rnoh/react-native-openharmony" : "file:../react_native_openharmony",
@@ -714,10 +697,6 @@ Open `entry/src/main/ets/RNPackagesFactory.ts` and add:
```diff
...
-// v6.2.0
-+ import {TcpSocketPackage} from '@react-native-oh-tpl/react-native-tcp-socket/ts';
-
-// v6.3.1
+ import {TcpSocketPackage} from '@react-native-ohos/react-native-tcp-socket/ts';
export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
diff --git a/zh-cn/react-native-aria.md b/zh-cn/react-native-aria.md
index d3134d53..1a308d20 100644
--- a/zh-cn/react-native-aria.md
+++ b/zh-cn/react-native-aria.md
@@ -15,6 +15,7 @@
> [!TIP] [Github 地址](https://github.com/gluestack/react-native-aria/tree/main)
## 安装与使用
+> [!TIP] 该库已经不再维护,如果执行总包命令,项目运行缺失模块,就需要卸载旧包,在命令后增加--legacy-peer-deps,然后再次下载包文件
请到三方库的 Releases 发布地址查看配套的版本信息:
@@ -29,7 +30,7 @@
#### **yarn**
```bash
-yarn add react-native-aria@0.2.3
+yarn add react-native-aria@0.2.4
```
@@ -37,7 +38,7 @@ yarn add react-native-aria@0.2.3
#### **npm**
```bash
-npm install react-native-aria@0.2.3
+npm install react-native-aria@0.2.4
```
diff --git a/zh-cn/react-native-community-toolbar-android.md b/zh-cn/react-native-community-toolbar-android.md
index a72676e7..e094007f 100644
--- a/zh-cn/react-native-community-toolbar-android.md
+++ b/zh-cn/react-native-community-toolbar-android.md
@@ -8,10 +8,10 @@
该第三方库的仓库已迁移至 Gitee,且支持直接从 npm 下载,新的包名为:`@react-native-ohos/toolbar-android`,具体版本所属关系如下:
-| 三方库版本 | 发布信息 | 支持RN版本 |
-|-----------------| ------------------------------------------------- | ------------------ |
-| <= 0.2.1 | [@react-native-oh-tpl/toolbar-android Releases(deprecated)](https://github.com/react-native-oh-library/toolbar-android/releases) | 0.72
-| >= 0.2.2 | [@react-native-ohos/toolbar-android Releases](https://gitcode.com/openharmony-sig/rntpc_toolbar-android/releases) | 0.77
+| Version | Package Name | Repository | Release | Supported RN Version |
+|-----------------|-----|--------|----------------------------------- | ------------------ |
+| 0.2.1 | @react-native-oh-tpl/toolbar-android| [Github(deprecated)](https://github.com/react-native-oh-library/toolbar-android)| [@react-native-oh-tpl/toolbar-android Releases(deprecated)](https://github.com/react-native-oh-library/toolbar-android/releases) | 0.72
+| 0.2.2 | @react-native-ohos/toolbar-android | [Gitcode](https://gitcode.com/openharmony-sig/rntpc_toolbar-android/tree/master)| [@react-native-ohos/toolbar-android Releases](https://gitcode.com/openharmony-sig/rntpc_toolbar-android/releases) | 0.72/0.77
## 1.安装与使用
diff --git a/zh-cn/react-native-ffmpeg-kit.md b/zh-cn/react-native-ffmpeg-kit.md
index ca0c794a..d8426d90 100644
--- a/zh-cn/react-native-ffmpeg-kit.md
+++ b/zh-cn/react-native-ffmpeg-kit.md
@@ -37,7 +37,7 @@ npm install @react-native-ohos/react-native-ffmpeg-kit
```bash
#0.72
-yarn add @react-native-ohos/react-native-ffmpeg-kit
+yarn add @react-native-oh-tpl/react-native-ffmpeg-kit
#0.77
yarn add @react-native-ohos/react-native-ffmpeg-kit
```
diff --git a/zh-cn/react-native-graph.md b/zh-cn/react-native-graph.md
index fd344c48..5ae2c5a8 100644
--- a/zh-cn/react-native-graph.md
+++ b/zh-cn/react-native-graph.md
@@ -116,9 +116,9 @@ const styles = StyleSheet.create({
```
## Link
-本库 HarmonyOS 侧实现依赖@react-native-oh-tpl/react-native-reanimated , @react-native-oh-tpl/react-native-gesture-handler , @react-native-oh-tpl/react-native-skia 的原生端代码,如已在 HarmonyOS 工程中引入过该库,则无需再次引入,可跳过本章节步骤,直接使用。
+本库 HarmonyOS 侧实现依赖react-native-reanimated , react-native-gesture-handler , react-native-skia 的原生端代码,如已在 HarmonyOS 工程中引入过该库,则无需再次引入,可跳过本章节步骤,直接使用。
-如未引入请参照[@react-native-oh-tpl/react-native-reanimated文档](/zh-cn/react-native-reanimated.md)、[@react-native-oh-tpl/react-native-gesture-handler文档](/zh-cn/react-native-gesture-handler.md)、[@react-native-oh-tpl/react-native-skia文档](/zh-cn/react-native-skia.md)、进行引入
+如未引入请参照[react-native-reanimated文档](/zh-cn/react-native-reanimated.md)、[react-native-gesture-handler文档](/zh-cn/react-native-gesture-handler.md)、[react-native-skia文档](/zh-cn/react-native-skia.md)、进行引入
## 约束与限制
### 兼容性
diff --git a/zh-cn/react-native-keys.md b/zh-cn/react-native-keys.md
index eec2ba8d..e3c42f81 100644
--- a/zh-cn/react-native-keys.md
+++ b/zh-cn/react-native-keys.md
@@ -120,7 +120,7 @@ Keys.secureFor('SECRET_KEY');
打开 `entry/oh-package.json5`,添加以下依赖
-v0.7.11
+v0.72
```json
"dependencies": {
@@ -128,7 +128,7 @@ v0.7.11
"@react-native-oh-tpl/react-native-keys": "file:../../node_modules/@react-native-oh-tpl/react-native-keys/harmony/rnoh_keys.har"
}
```
-v0.8.0
+v0.72
```json
"dependencies": {
@@ -218,9 +218,9 @@ std::vector> PackageProvider::getPackages(Package::Cont
```diff
...
- // v0.7.11
+ // v0.72
+ import { RNKeysPackage } from '@react-native-oh-tpl/react-native-keys';
- // v0.7.11
+ // v0.77
+ import { RNKeysPackage } from '@react-native-ohos/react-native-keys';
export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
diff --git a/zh-cn/react-native-tcp-socket.md b/zh-cn/react-native-tcp-socket.md
index f5b335c2..c0861b48 100644
--- a/zh-cn/react-native-tcp-socket.md
+++ b/zh-cn/react-native-tcp-socket.md
@@ -20,8 +20,9 @@
| 三方库版本 | 发布信息 | 支持RN版本 |
| ---------- | ------------------------------------------------------------ | ---------- |
-| 6.2.0 | [@react-native-oh-tpl/react-native-tcp-socket Releases](https://github.com/react-native-oh-library/react-native-tcp-socket/releases) | 0.72 |
-| 6.3.1 | [@react-native-ohos/react-native-tcp-socket Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-tcp-socket/releases) | 0.77 |
+| 6.2.0 | [@react-native-oh-tpl/react-native-tcp-socket Releases(deprecated)](https://github.com/react-native-oh-library/react-native-tcp-socket/releases) | 0.72 |
+| 6.2.1 | [@react-native-ohos/react-native-tcp-socket Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-tcp-socket/releases) | 0.72 |
+| 6.3.1 | [@react-native-ohos/react-native-tcp-socket Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-tcp-socket/releases) | 0.77 |
对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。
@@ -32,20 +33,12 @@
#### **npm**
```bash
-# V0.72
-npm install @react-native-oh-tpl/react-native-tcp-socket
-
-# V0.77
npm install @react-native-ohos/react-native-tcp-socket
```
#### **yarn**
```bash
-# V0.72
-yarn add @react-native-oh-tpl/react-native-tcp-socket
-
-# V0.77
yarn add @react-native-ohos/react-native-tcp-socket
```
@@ -582,13 +575,13 @@ const styles = StyleSheet.create({
## 使用 Codegen
-> [!TIP] V6.3.1 不需要执行Codegen
+> [!TIP] Version >= @react-native-ohos/react-native-tcp-socket@6.2.1,已适配codegen-lib生成桥接代码
本库已经适配了 `Codegen` ,在使用前需要主动执行生成三方库桥接代码,详细请参考[ Codegen 使用文档](/zh-cn/codegen.md)。
## Link
-目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。
+此步骤为手动配置原生依赖项的指导。
首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony`
@@ -616,17 +609,6 @@ const styles = StyleSheet.create({
打开 `entry/oh-package.json5`,添加以下依赖
-- V6.2.0
-
-```json
-"dependencies": {
- "@rnoh/react-native-openharmony" : "file:../react_native_openharmony",
- "@react-native-oh-tpl/react-native-tcp-socket": "file:../../node_modules/@react-native-oh-tpl/react-native-tcp-socket/harmony/tcp_socket.har"
- }
-```
-
-- V6.3.1
-
```JSON
"dependencies": {
"@rnoh/react-native-openharmony" : "file:../react_native_openharmony",
@@ -715,10 +697,6 @@ std::vector> PackageProvider::getPackages(Package::Cont
```diff
...
-// v6.2.0
-+ import {TcpSocketPackage} from '@react-native-oh-tpl/react-native-tcp-socket/ts';
-
-// v6.3.1
+ import {TcpSocketPackage} from '@react-native-ohos/react-native-tcp-socket/ts';
export function createRNPackages(ctx: RNPackageContext): RNPackage[] {
--
Gitee