> For AI agents: the complete documentation index is available at https://canary.gukhanmun.org/llms.txt, the full documentation bundle is available at https://canary.gukhanmun.org/llms-full.txt.

# Interface: GukhanmunFactory

Factory interface satisfied by both `@gukhanmun/wasm` and
`@gukhanmun/napi`.

## Example

```ts
import { load } from "@gukhanmun/wasm";
import { stdictFst } from "@gukhanmun/stdict-fst";

const g = await load({
  preset: "ko-kr",
  dictionaries: [await stdictFst()],
});
console.log(g.convert("漢字를 한글로"));
```

## Methods

### load()

> **load**(`options?`): `Promise`\<[`Gukhanmun`](https://canary.gukhanmun.org/api/js/interfaces/_gukhanmun_types.Gukhanmun.md)>

Loads and initialises a [Gukhanmun](https://canary.gukhanmun.org/api/js/interfaces/_gukhanmun_types.Gukhanmun.md) converter with the given
options.

In the WASM implementation this involves asynchronous `.wasm` binary
initialisation; in the Node-API implementation the native addon is
synchronously ready but still returns a `Promise` for API uniformity.
Dictionary sources with `URL` or string `data` are fetched / read during
this call.

#### Parameters

##### options?

[`GukhanmunOptions`](https://canary.gukhanmun.org/api/js/interfaces/_gukhanmun_types.GukhanmunOptions.md)

Conversion options.  All fields are optional; unset
fields inherit defaults from the selected `preset` (or `"ko-kr"` when
no preset is given).

#### Returns

`Promise`\<[`Gukhanmun`](https://canary.gukhanmun.org/api/js/interfaces/_gukhanmun_types.Gukhanmun.md)>

A ready-to-use [Gukhanmun](https://canary.gukhanmun.org/api/js/interfaces/_gukhanmun_types.Gukhanmun.md) instance.

#### Throws

[GukhanmunError](https://canary.gukhanmun.org/api/js/classes/_gukhanmun_types.GukhanmunError.md) when an option value is unrecognised
(`code: "invalid-input"`) or a dictionary fails to load
(`code: "dictionary-load"`).
