Skip to main content
dlopen loads a shared library and returns a Library instance with typed symbols.

Syntax

Example

Parameters

FFIFunction

Struct Type Support

args and returns accept StructSchema instances for small HFA structs passed in registers.
Internally:

Async Calls

Each symbol has an .async method for non-blocking calls on a worker thread:
For basic return types, the Promise resolves with the value directly:

Type Inference

dlopen uses TypeScript generics to infer the shape of symbols, providing IDE autocompletion for all defined function names.

Return Value

Returns a Library instance with typed symbols.