@gukhanmun/opendict-fst 0.4.0-dev.236 → 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/general.fst CHANGED
Binary file
package/dist/index.d.ts CHANGED
@@ -1,83 +1,12 @@
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 absence of an `entries` property (`"entries" in source` selects a
16
- * {@link MapDictionarySource}).
17
- */
18
- interface FileDictionarySource {
19
- /**
20
- * The binary dictionary data or a reference to where it can be loaded.
21
- *
22
- * Pass a `BufferSource` for data already in memory, a `URL` for a remote
23
- * or local URL (resolved via `fetch` or `readFile`), or a path `string`
24
- * for filesystem paths (Node.js / Deno 2.0+ / Bun only).
25
- */
26
- readonly data: ArrayBuffer | ArrayBufferView | URL | string;
27
- /**
28
- * The on-disk format of the dictionary file.
29
- *
30
- * - `"fst"` — Gukhanmun FST file (`*.gukfst`); preferred for small
31
- * WebAssembly bundles. Supported in all runtimes.
32
- * - `"cdb"` — Gukhanmun CDB-trie file (`*.gukcdb`); preferred when code
33
- * auditability or trivial mmap support matters. Requires a filesystem
34
- * or in-memory bytes; supported in Node-API and (with `from_bytes`) in
35
- * WASM builds that include the `cdb` feature.
36
- *
37
- * The `"tsv"` format is reserved and never accepted. Pass entries in memory
38
- * through {@link MapDictionarySource} instead of compiling a table.
39
- */
40
- readonly format: "fst" | "cdb";
41
- }
42
- /**
43
- * A dictionary built from entries computed at runtime, such as per-document
44
- * reading overrides.
45
- *
46
- * Use this instead of compiling a TSV file with `gukhanmun-mkdict` when the
47
- * entries do not exist on disk, for example in a browser, an edge runtime, or a
48
- * site generator that derives entries per document.
49
- *
50
- * A source is distinguished from a {@link FileDictionarySource} by the presence
51
- * of an `entries` property.
52
- *
53
- * @example
54
- * ```ts
55
- * import { stdictFst } from "@gukhanmun/stdict-fst";
56
- * const g = await load({
57
- * dictionaries: [
58
- * {
59
- * entries: [
60
- * { hanja: "高橋", reading: "다카하시" },
61
- * { hanja: "東京", reading: "도쿄", preference: 10 },
62
- * { hanja: "年代", reading: "연대", suffixReading: "년대" },
63
- * ],
64
- * },
65
- * await stdictFst(),
66
- * ],
67
- * });
68
- * ```
69
- */
70
- //#endregion
71
- //#region index.d.ts
72
-
1
+ import { FileDictionarySource, FileDictionarySource as FileDictionarySource$1 } from "@gukhanmun/types";
73
2
  /** URL of the bundled Open Korean Dictionary 일반어 FST binary. */
74
- declare const opendictGeneralFstUrl: URL;
3
+ export declare const opendictGeneralFstUrl: URL;
75
4
  /** URL of the bundled Open Korean Dictionary 북한어 FST binary. */
76
- declare const opendictNorthKoreanFstUrl: URL;
5
+ export declare const opendictNorthKoreanFstUrl: URL;
77
6
  /** URL of the bundled Open Korean Dictionary 방언 FST binary. */
78
- declare const opendictDialectFstUrl: URL;
7
+ export declare const opendictDialectFstUrl: URL;
79
8
  /** URL of the bundled Open Korean Dictionary 옛말 FST binary. */
80
- declare const opendictArchaicFstUrl: URL;
9
+ export declare const opendictArchaicFstUrl: URL;
81
10
  /**
82
11
  * Loads an Open Korean Dictionary FST binary as raw bytes.
83
12
  *
@@ -88,7 +17,7 @@ declare const opendictArchaicFstUrl: URL;
88
17
  * @param url Location of the FST binary to read.
89
18
  * @returns The FST binary as a `Uint8Array`.
90
19
  */
91
- declare function opendictFstBytes(url: URL): Promise<Uint8Array>;
20
+ export declare function opendictFstBytes(url: URL): Promise<Uint8Array>;
92
21
  /**
93
22
  * Loads the bundled Open Korean Dictionary 일반어 FST binary as raw bytes.
94
23
  *
@@ -96,7 +25,7 @@ declare function opendictFstBytes(url: URL): Promise<Uint8Array>;
96
25
  * {@link opendictGeneralFstUrl}.
97
26
  * @returns The FST binary as a `Uint8Array`.
98
27
  */
99
- declare function opendictGeneralFstBytes(url?: URL): Promise<Uint8Array>;
28
+ export declare function opendictGeneralFstBytes(url?: URL): Promise<Uint8Array>;
100
29
  /**
101
30
  * Loads the bundled Open Korean Dictionary 북한어 FST binary as raw bytes.
102
31
  *
@@ -104,7 +33,7 @@ declare function opendictGeneralFstBytes(url?: URL): Promise<Uint8Array>;
104
33
  * {@link opendictNorthKoreanFstUrl}.
105
34
  * @returns The FST binary as a `Uint8Array`.
106
35
  */
107
- declare function opendictNorthKoreanFstBytes(url?: URL): Promise<Uint8Array>;
36
+ export declare function opendictNorthKoreanFstBytes(url?: URL): Promise<Uint8Array>;
108
37
  /**
109
38
  * Loads the bundled Open Korean Dictionary 방언 FST binary as raw bytes.
110
39
  *
@@ -112,7 +41,7 @@ declare function opendictNorthKoreanFstBytes(url?: URL): Promise<Uint8Array>;
112
41
  * {@link opendictDialectFstUrl}.
113
42
  * @returns The FST binary as a `Uint8Array`.
114
43
  */
115
- declare function opendictDialectFstBytes(url?: URL): Promise<Uint8Array>;
44
+ export declare function opendictDialectFstBytes(url?: URL): Promise<Uint8Array>;
116
45
  /**
117
46
  * Loads the bundled Open Korean Dictionary 옛말 FST binary as raw bytes.
118
47
  *
@@ -120,30 +49,29 @@ declare function opendictDialectFstBytes(url?: URL): Promise<Uint8Array>;
120
49
  * {@link opendictArchaicFstUrl}.
121
50
  * @returns The FST binary as a `Uint8Array`.
122
51
  */
123
- declare function opendictArchaicFstBytes(url?: URL): Promise<Uint8Array>;
52
+ export declare function opendictArchaicFstBytes(url?: URL): Promise<Uint8Array>;
124
53
  /**
125
54
  * Loads the bundled Open Korean Dictionary 일반어 dictionary.
126
55
  *
127
56
  * @returns A `FileDictionarySource` with `format: "fst"`.
128
57
  */
129
- declare function opendictGeneralFst(): Promise<FileDictionarySource>;
58
+ export declare function opendictGeneralFst(): Promise<FileDictionarySource$1>;
130
59
  /**
131
60
  * Loads the bundled Open Korean Dictionary 북한어 dictionary.
132
61
  *
133
62
  * @returns A `FileDictionarySource` with `format: "fst"`.
134
63
  */
135
- declare function opendictNorthKoreanFst(): Promise<FileDictionarySource>;
64
+ export declare function opendictNorthKoreanFst(): Promise<FileDictionarySource$1>;
136
65
  /**
137
66
  * Loads the bundled Open Korean Dictionary 방언 dictionary.
138
67
  *
139
68
  * @returns A `FileDictionarySource` with `format: "fst"`.
140
69
  */
141
- declare function opendictDialectFst(): Promise<FileDictionarySource>;
70
+ export declare function opendictDialectFst(): Promise<FileDictionarySource$1>;
142
71
  /**
143
72
  * Loads the bundled Open Korean Dictionary 옛말 dictionary.
144
73
  *
145
74
  * @returns A `FileDictionarySource` with `format: "fst"`.
146
75
  */
147
- declare function opendictArchaicFst(): Promise<FileDictionarySource>;
148
- //#endregion
149
- export { type FileDictionarySource, opendictArchaicFst, opendictArchaicFstBytes, opendictArchaicFstUrl, opendictDialectFst, opendictDialectFstBytes, opendictDialectFstUrl, opendictFstBytes, opendictGeneralFst, opendictGeneralFstBytes, opendictGeneralFstUrl, opendictNorthKoreanFst, opendictNorthKoreanFstBytes, opendictNorthKoreanFstUrl };
76
+ export declare function opendictArchaicFst(): Promise<FileDictionarySource$1>;
77
+ 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 Open Korean Dictionary 일반어 FST binary. */
3
3
  const opendictGeneralFstUrl = new URL("./general.fst", import.meta.url);
4
4
  /** URL of the bundled Open Korean Dictionary 북한어 FST binary. */
@@ -117,5 +117,4 @@ async function opendictArchaicFst() {
117
117
  format: "fst"
118
118
  };
119
119
  }
120
- //#endregion
121
120
  export { opendictArchaicFst, opendictArchaicFstBytes, opendictArchaicFstUrl, opendictDialectFst, opendictDialectFstBytes, opendictDialectFstUrl, opendictFstBytes, opendictGeneralFst, opendictGeneralFstBytes, opendictGeneralFstUrl, opendictNorthKoreanFst, opendictNorthKoreanFstBytes, opendictNorthKoreanFstUrl };
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gukhanmun/opendict-fst",
3
- "version": "0.4.0-dev.236",
3
+ "version": "0.4.0-dev.245",
4
4
  "description": "Open Korean Dictionary categories bundled as FST binaries for @gukhanmun/wasm and @gukhanmun/napi.",
5
5
  "type": "module",
6
6
  "exports": {
@@ -61,7 +61,7 @@
61
61
  "@gukhanmun/types": "*"
62
62
  },
63
63
  "devDependencies": {
64
- "@gukhanmun/types": "0.4.0-dev.236+75afc34"
64
+ "@gukhanmun/types": "0.4.0-dev.245+223a736"
65
65
  },
66
66
  "scripts": {
67
67
  "prebuild": "mise run -C ../.. opendict-fst-data",