@gukhanmun/stdict-fst 0.4.0-dev.235 → 0.4.0-dev.245

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,60 +1,6 @@
1
- //#region ../types/dist/index.d.ts
2
-
3
- /**
4
- * Specifies a dictionary loaded from a binary file or URL.
5
- *
6
- * The `data` field accepts:
7
- * - A `BufferSource` (`ArrayBuffer` or `ArrayBufferView`) — supported in all
8
- * environments.
9
- * - A `URL` — resolved via `fetch` in browsers; via `node:fs/promises`
10
- * in Node.js, Deno 2.0+, and Bun.
11
- * - A `string` — treated as a filesystem path; supported in Node.js,
12
- * Deno 2.0+, and Bun only. Throws in browser environments.
13
- *
14
- * At runtime, a `FileDictionarySource` is distinguished from other values by
15
- * the presence of a `format` property (`"format" in source`).
16
- */
17
- interface FileDictionarySource {
18
- /**
19
- * The binary dictionary data or a reference to where it can be loaded.
20
- *
21
- * Pass a `BufferSource` for data already in memory, a `URL` for a remote
22
- * or local URL (resolved via `fetch` or `readFile`), or a path `string`
23
- * for filesystem paths (Node.js / Deno 2.0+ / Bun only).
24
- */
25
- readonly data: ArrayBuffer | ArrayBufferView | URL | string;
26
- /**
27
- * The on-disk format of the dictionary file.
28
- *
29
- * - `"fst"` — Gukhanmun FST file (`*.gukfst`); preferred for small
30
- * WebAssembly bundles. Supported in all runtimes.
31
- * - `"cdb"` — Gukhanmun CDB-trie file (`*.gukcdb`); preferred when code
32
- * auditability or trivial mmap support matters. Requires a filesystem
33
- * or in-memory bytes; supported in Node-API and (with `from_bytes`) in
34
- * WASM builds that include the `cdb` feature.
35
- *
36
- * The `"tsv"` format is reserved for future use; passing it throws
37
- * `GukhanmunError` with code `"unsupported-content-type"`.
38
- */
39
- readonly format: "fst" | "cdb";
40
- }
41
- /**
42
- * A dictionary source accepted by {@link GukhanmunOptions.dictionaries}.
43
- *
44
- * Currently only {@link FileDictionarySource} (binary file / URL / path) is
45
- * supported. Sources are tried in array order; the first match wins.
46
- *
47
- * @example
48
- * ```ts
49
- * import { stdictFst } from "@gukhanmun/stdict-fst";
50
- * const g = await load({ dictionaries: [await stdictFst()] });
51
- * ```
52
- */
53
- //#endregion
54
- //#region index.d.ts
55
-
1
+ import { FileDictionarySource, FileDictionarySource as FileDictionarySource$1 } from "@gukhanmun/types";
56
2
  /** URL of the bundled Standard Korean Language Dictionary FST binary. */
57
- declare const stdictFstUrl: URL;
3
+ export declare const stdictFstUrl: URL;
58
4
  /**
59
5
  * Loads the bundled Standard Korean Language Dictionary as raw bytes.
60
6
  *
@@ -73,13 +19,12 @@ declare const stdictFstUrl: URL;
73
19
  * {@link stdictFstUrl}; pass another URL to load a relocated copy.
74
20
  * @returns The FST binary as a `Uint8Array`.
75
21
  */
76
- declare function stdictFstBytes(url?: URL): Promise<Uint8Array<ArrayBuffer>>;
22
+ export declare function stdictFstBytes(url?: URL): Promise<Uint8Array<ArrayBuffer>>;
77
23
  /**
78
24
  * Loads the bundled Standard Korean Language Dictionary as a
79
25
  * {@link FileDictionarySource} ready to pass to `load({ dictionaries: [...] })`.
80
26
  *
81
27
  * @returns A `FileDictionarySource` with `format: "fst"`.
82
28
  */
83
- declare function stdictFst(): Promise<FileDictionarySource>;
84
- //#endregion
85
- export { type FileDictionarySource, stdictFst, stdictFstBytes, stdictFstUrl };
29
+ export declare function stdictFst(): Promise<FileDictionarySource$1>;
30
+ export type { FileDictionarySource };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region index.ts
1
+ // index.ts
2
2
  /** URL of the bundled Standard Korean Language Dictionary FST binary. */
3
3
  const stdictFstUrl = new URL("./stdict.fst", import.meta.url);
4
4
  /**
@@ -43,5 +43,4 @@ async function stdictFst() {
43
43
  format: "fst"
44
44
  };
45
45
  }
46
- //#endregion
47
46
  export { stdictFst, stdictFstBytes, stdictFstUrl };
package/dist/stdict.fst CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gukhanmun/stdict-fst",
3
- "version": "0.4.0-dev.235",
3
+ "version": "0.4.0-dev.245",
4
4
  "description": "Standard Korean Language Dictionary bundled as an FST binary for @gukhanmun/wasm and @gukhanmun/napi.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -55,7 +55,7 @@
55
55
  "@gukhanmun/types": "*"
56
56
  },
57
57
  "devDependencies": {
58
- "@gukhanmun/types": "0.4.0-dev.235+2861f4b"
58
+ "@gukhanmun/types": "0.4.0-dev.245+223a736"
59
59
  },
60
60
  "scripts": {
61
61
  "build": "tsdown && node -e \"require('node:fs').copyFileSync('stdict.fst','dist/stdict.fst')\""