ArkTS bindings for Loro generated from loro-dev/loro-ffi with uniffi-bindgen-arkts.
This project follows the same shape as aholstenson/loro-go: a thin Rust crate pins the loro-ffi version and re-exports its UniFFI scaffolding, then a script builds the native library with ohrs and generates the language package.
./scripts/generate.shThe generated ArkTS package is written to generated/example/packages/loro.
The script keeps the uniffi-bindgen-arkts package layout intact and only adds
the built N-API adapter library. Keeping the package inside the example project
avoids ArkTS rejecting relative imports inside symlinked dependencies that
resolve outside the project root.
Defaults can be overridden:
OUT_DIR=/path/to/output ./scripts/generate.shThe default native target is OHOS_ARCH=arm64 / OHOS_ABI=arm64-v8a.
The generated package contains a Rust N-API adapter under
generated/example/packages/loro/native.
cd generated/example/packages/loro/native
ohrs build --release --arch arm64The adapter output is
generated/example/packages/loro/native/dist/arm64-v8a/libloro.so.
cd generated/example
ohpm install --all
hvigorw assembleHap --mode module -p module=entry@defaultThe example consumes @ohos-rs/loro through local package dependencies:
file:../packages/loro and file:../packages/loro/types/libloro.
Keep useNormalizedOHMUrl enabled for this symlinked package workflow.