> ## Documentation Index
> Fetch the complete documentation index at: https://docs.arkffi.hmbill.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# Library

> The loaded library instance returned by dlopen

The `Library` class represents a loaded shared library.

## Example

```typescript theme={null}
import { dlopen, FFIType } from 'arkffi';

const lib = dlopen('libffi_target.so', {
  add: { args: [FFIType.double, FFIType.double], returns: FFIType.double },
});
lib.symbols.add(2.0, 3.0);
lib.close();
```

## Properties

### `symbols`

```
readonly symbols: ConvertFns<Fns>;
```

An object whose keys match function names from the `defs` argument. Each value is a callable function.

```typescript theme={null}
lib.symbols.add(2.0, 3.0);
lib.symbols.compute(0, 4.0, 'square');
```

## Methods

### `close()`

```typescript theme={null}
close(): void;
```

Calls `dlclose()` on the native library handle.

```typescript theme={null}
lib.close();
lib.close();  // safe to call multiple times
```
