.so libraries directly from ArkTS — no NAPI bindings required.
Getting Started
Install, configure, and call your first C function in minutes.
API Reference
Complete reference for dlopen, FFIType, CString, CFunction, and JSCallback.
Guides
Deep dives into mixed types, function pointers, callbacks, and external libraries.
Overview
arkffi provides three layers of abstraction:Features
- Call any exported C function from a
.solibrary - Supports
int32,int64,double,float,bool,pointer,cstring,callback - Mixed parameter types (
int+double+stringin one call) - Function pointer support via
CFunction - JavaScript callbacks via
JSCallbackwith optionalthreadsafemode - C string reading via
CString - TypeScript generics for IDE code completion