yomitan-core 0.1.0

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.
Files changed (207) hide show
  1. package/README.md +485 -0
  2. package/dist/anki-connect-BQyCGW3O.cjs +513 -0
  3. package/dist/anki-connect-BQyCGW3O.cjs.map +1 -0
  4. package/dist/anki-connect-CPPuhyiQ.js +6 -0
  5. package/dist/anki-connect-DbrQHphS.js +495 -0
  6. package/dist/anki-connect-DbrQHphS.js.map +1 -0
  7. package/dist/anki-connect-DcheJrp-.cjs +6 -0
  8. package/dist/anki.cjs +1758 -0
  9. package/dist/anki.cjs.map +1 -0
  10. package/dist/anki.d.cts +751 -0
  11. package/dist/anki.d.cts.map +1 -0
  12. package/dist/anki.d.ts +751 -0
  13. package/dist/anki.d.ts.map +1 -0
  14. package/dist/anki.js +1751 -0
  15. package/dist/anki.js.map +1 -0
  16. package/dist/audio-D9DvYyB7.d.cts +48 -0
  17. package/dist/audio-D9DvYyB7.d.cts.map +1 -0
  18. package/dist/audio-DQulUkDM.d.ts +48 -0
  19. package/dist/audio-DQulUkDM.d.ts.map +1 -0
  20. package/dist/audio-url-generator-BXvQaqUi.cjs +4 -0
  21. package/dist/audio-url-generator-Dy2hb2Mm.cjs +414 -0
  22. package/dist/audio-url-generator-Dy2hb2Mm.cjs.map +1 -0
  23. package/dist/audio-url-generator-Qi0rfzHz.js +4 -0
  24. package/dist/audio-url-generator-pFQAB5Nb.js +390 -0
  25. package/dist/audio-url-generator-pFQAB5Nb.js.map +1 -0
  26. package/dist/audio.cjs +7 -0
  27. package/dist/audio.d.cts +86 -0
  28. package/dist/audio.d.cts.map +1 -0
  29. package/dist/audio.d.ts +86 -0
  30. package/dist/audio.d.ts.map +1 -0
  31. package/dist/audio.js +4 -0
  32. package/dist/batch-processor-BR-gB3H3.js +84 -0
  33. package/dist/batch-processor-BR-gB3H3.js.map +1 -0
  34. package/dist/batch-processor-CSF1acTw.cjs +3 -0
  35. package/dist/batch-processor-DFqM_L-_.cjs +91 -0
  36. package/dist/batch-processor-DFqM_L-_.cjs.map +1 -0
  37. package/dist/batch-processor-Quo9jUyf.js +3 -0
  38. package/dist/chunk-BCwAaXi7.cjs +31 -0
  39. package/dist/cjk-util-Dp0ZU0sh.cjs +167 -0
  40. package/dist/cjk-util-Dp0ZU0sh.cjs.map +1 -0
  41. package/dist/cjk-util-DubXBGDG.js +94 -0
  42. package/dist/cjk-util-DubXBGDG.js.map +1 -0
  43. package/dist/core-BUpclilG.d.cts +102 -0
  44. package/dist/core-BUpclilG.d.cts.map +1 -0
  45. package/dist/core-DFUj5GtA.d.ts +102 -0
  46. package/dist/core-DFUj5GtA.d.ts.map +1 -0
  47. package/dist/database.cjs +7 -0
  48. package/dist/database.d.cts +4 -0
  49. package/dist/database.d.ts +4 -0
  50. package/dist/database.js +5 -0
  51. package/dist/dictionary-D7l-qFt1.d.cts +316 -0
  52. package/dist/dictionary-D7l-qFt1.d.cts.map +1 -0
  53. package/dist/dictionary-_vzfBLWi.d.ts +316 -0
  54. package/dist/dictionary-_vzfBLWi.d.ts.map +1 -0
  55. package/dist/dictionary-data-util-CHnRdYZ9.cjs +378 -0
  56. package/dist/dictionary-data-util-CHnRdYZ9.cjs.map +1 -0
  57. package/dist/dictionary-data-util-CfOLfEDE.js +323 -0
  58. package/dist/dictionary-data-util-CfOLfEDE.js.map +1 -0
  59. package/dist/dictionary-database-BDC2f9zc.d.ts +58 -0
  60. package/dist/dictionary-database-BDC2f9zc.d.ts.map +1 -0
  61. package/dist/dictionary-database-CU4TsvCC.js +393 -0
  62. package/dist/dictionary-database-CU4TsvCC.js.map +1 -0
  63. package/dist/dictionary-database-DsOi04Sg.d.cts +58 -0
  64. package/dist/dictionary-database-DsOi04Sg.d.cts.map +1 -0
  65. package/dist/dictionary-database-lvFvftnO.cjs +412 -0
  66. package/dist/dictionary-database-lvFvftnO.cjs.map +1 -0
  67. package/dist/dictionary-importer-BkQQSBhm.d.ts +237 -0
  68. package/dist/dictionary-importer-BkQQSBhm.d.ts.map +1 -0
  69. package/dist/dictionary-importer-Cen1z6co.js +1821 -0
  70. package/dist/dictionary-importer-Cen1z6co.js.map +1 -0
  71. package/dist/dictionary-importer-DYmmWmcX.cjs +8 -0
  72. package/dist/dictionary-importer-Da3AuTZw.d.cts +237 -0
  73. package/dist/dictionary-importer-Da3AuTZw.d.cts.map +1 -0
  74. package/dist/dictionary-importer-Dhn75iZ4.cjs +1834 -0
  75. package/dist/dictionary-importer-Dhn75iZ4.cjs.map +1 -0
  76. package/dist/dictionary-importer-xWkel0h-.js +8 -0
  77. package/dist/dictionary-update-checker-BNE4pGTx.js +4 -0
  78. package/dist/dictionary-update-checker-Byjvifd2.cjs +75 -0
  79. package/dist/dictionary-update-checker-Byjvifd2.cjs.map +1 -0
  80. package/dist/dictionary-update-checker-YdpalZ41.cjs +4 -0
  81. package/dist/dictionary-update-checker-kKukiovj.js +69 -0
  82. package/dist/dictionary-update-checker-kKukiovj.js.map +1 -0
  83. package/dist/display-generator-BGVWiI0t.js +746 -0
  84. package/dist/display-generator-BGVWiI0t.js.map +1 -0
  85. package/dist/display-generator-BMQmG5Ov.cjs +9 -0
  86. package/dist/display-generator-BxZ7mBjP.js +9 -0
  87. package/dist/display-generator-DyP-HNzP.cjs +758 -0
  88. package/dist/display-generator-DyP-HNzP.cjs.map +1 -0
  89. package/dist/errors-BSezaJwm.cjs +35 -0
  90. package/dist/errors-BSezaJwm.cjs.map +1 -0
  91. package/dist/errors-DuuDSO5N.js +22 -0
  92. package/dist/errors-DuuDSO5N.js.map +1 -0
  93. package/dist/frequency-ranking-BXjfhhUQ.js +3 -0
  94. package/dist/frequency-ranking-Cx1kkIrw.cjs +3 -0
  95. package/dist/frequency-ranking-DEJMTMdg.js +159 -0
  96. package/dist/frequency-ranking-DEJMTMdg.js.map +1 -0
  97. package/dist/frequency-ranking-DVYxTXN-.cjs +166 -0
  98. package/dist/frequency-ranking-DVYxTXN-.cjs.map +1 -0
  99. package/dist/furigana-5HK97CY8.js +4 -0
  100. package/dist/furigana-9bBI9-qe.d.ts +47 -0
  101. package/dist/furigana-9bBI9-qe.d.ts.map +1 -0
  102. package/dist/furigana-B3-0y231.js +471 -0
  103. package/dist/furigana-B3-0y231.js.map +1 -0
  104. package/dist/furigana-CjOhzvZt.d.cts +47 -0
  105. package/dist/furigana-CjOhzvZt.d.cts.map +1 -0
  106. package/dist/furigana-DpZLcues.cjs +609 -0
  107. package/dist/furigana-DpZLcues.cjs.map +1 -0
  108. package/dist/furigana-h3v2ub4-.cjs +4 -0
  109. package/dist/import.cjs +12 -0
  110. package/dist/import.d.cts +107 -0
  111. package/dist/import.d.cts.map +1 -0
  112. package/dist/import.d.ts +107 -0
  113. package/dist/import.d.ts.map +1 -0
  114. package/dist/import.js +9 -0
  115. package/dist/index.cjs +275 -0
  116. package/dist/index.cjs.map +1 -0
  117. package/dist/index.d.cts +211 -0
  118. package/dist/index.d.cts.map +1 -0
  119. package/dist/index.d.ts +211 -0
  120. package/dist/index.d.ts.map +1 -0
  121. package/dist/index.js +238 -0
  122. package/dist/index.js.map +1 -0
  123. package/dist/json-DGd-cunA.js +17 -0
  124. package/dist/json-DGd-cunA.js.map +1 -0
  125. package/dist/json-DKWp-B7Y.cjs +30 -0
  126. package/dist/json-DKWp-B7Y.cjs.map +1 -0
  127. package/dist/language-KN_u-nTR.d.ts +104 -0
  128. package/dist/language-KN_u-nTR.d.ts.map +1 -0
  129. package/dist/language-xAbQxgXc.d.cts +104 -0
  130. package/dist/language-xAbQxgXc.d.cts.map +1 -0
  131. package/dist/language.cjs +15626 -0
  132. package/dist/language.cjs.map +1 -0
  133. package/dist/language.d.cts +959 -0
  134. package/dist/language.d.cts.map +1 -0
  135. package/dist/language.d.ts +959 -0
  136. package/dist/language.d.ts.map +1 -0
  137. package/dist/language.js +15522 -0
  138. package/dist/language.js.map +1 -0
  139. package/dist/log-D8KtR3aP.cjs +67 -0
  140. package/dist/log-D8KtR3aP.cjs.map +1 -0
  141. package/dist/log-hgSll-dS.js +60 -0
  142. package/dist/log-hgSll-dS.js.map +1 -0
  143. package/dist/lookup.cjs +13 -0
  144. package/dist/lookup.d.cts +161 -0
  145. package/dist/lookup.d.cts.map +1 -0
  146. package/dist/lookup.d.ts +161 -0
  147. package/dist/lookup.d.ts.map +1 -0
  148. package/dist/lookup.js +10 -0
  149. package/dist/media-loader-BABA_E4W.js +3 -0
  150. package/dist/media-loader-Ce9cuANS.cjs +21 -0
  151. package/dist/media-loader-Ce9cuANS.cjs.map +1 -0
  152. package/dist/media-loader-qRti-Q6h.js +14 -0
  153. package/dist/media-loader-qRti-Q6h.js.map +1 -0
  154. package/dist/media-loader-xlUGaJrx.cjs +3 -0
  155. package/dist/multi-language-transformer-AlxOM6b3.js +637 -0
  156. package/dist/multi-language-transformer-AlxOM6b3.js.map +1 -0
  157. package/dist/multi-language-transformer-MdbQBBOt.cjs +685 -0
  158. package/dist/multi-language-transformer-MdbQBBOt.cjs.map +1 -0
  159. package/dist/multi-language-transformer-SEhcJXEB.d.ts +63 -0
  160. package/dist/multi-language-transformer-SEhcJXEB.d.ts.map +1 -0
  161. package/dist/multi-language-transformer-Ul9mbRce.d.cts +63 -0
  162. package/dist/multi-language-transformer-Ul9mbRce.d.cts.map +1 -0
  163. package/dist/pronunciation-generator-BtBc4q_V.js +397 -0
  164. package/dist/pronunciation-generator-BtBc4q_V.js.map +1 -0
  165. package/dist/pronunciation-generator-CBYdXYou.js +4 -0
  166. package/dist/pronunciation-generator-CFbZlf5J.cjs +445 -0
  167. package/dist/pronunciation-generator-CFbZlf5J.cjs.map +1 -0
  168. package/dist/pronunciation-generator-DOz9hEuk.cjs +4 -0
  169. package/dist/render.cjs +2796 -0
  170. package/dist/render.cjs.map +1 -0
  171. package/dist/render.d.cts +424 -0
  172. package/dist/render.d.cts.map +1 -0
  173. package/dist/render.d.ts +424 -0
  174. package/dist/render.d.ts.map +1 -0
  175. package/dist/render.js +2777 -0
  176. package/dist/render.js.map +1 -0
  177. package/dist/sentence-parser-BPAJNzqW.js +126 -0
  178. package/dist/sentence-parser-BPAJNzqW.js.map +1 -0
  179. package/dist/sentence-parser-BVIOI64h.cjs +132 -0
  180. package/dist/sentence-parser-BVIOI64h.cjs.map +1 -0
  181. package/dist/sentence-parser-BoHO3cHn.js +5 -0
  182. package/dist/sentence-parser-DQVLSW0z.cjs +5 -0
  183. package/dist/structured-content-generator-BtOApkTW.cjs +4 -0
  184. package/dist/structured-content-generator-Bx62RYa8.js +4 -0
  185. package/dist/structured-content-generator-CLnybumI.js +276 -0
  186. package/dist/structured-content-generator-CLnybumI.js.map +1 -0
  187. package/dist/structured-content-generator-DrwkB0-k.cjs +282 -0
  188. package/dist/structured-content-generator-DrwkB0-k.cjs.map +1 -0
  189. package/dist/text-utilities-B7PIythe.js +8 -0
  190. package/dist/text-utilities-B7PIythe.js.map +1 -0
  191. package/dist/text-utilities-Del2Ivkg.cjs +15 -0
  192. package/dist/text-utilities-Del2Ivkg.cjs.map +1 -0
  193. package/dist/translator-CRPlPzqi.cjs +1545 -0
  194. package/dist/translator-CRPlPzqi.cjs.map +1 -0
  195. package/dist/translator-CWgG5drA.js +1539 -0
  196. package/dist/translator-CWgG5drA.js.map +1 -0
  197. package/dist/translator-CaGtJvnQ.cjs +6 -0
  198. package/dist/translator-Cc6OGxrW.d.ts +180 -0
  199. package/dist/translator-Cc6OGxrW.d.ts.map +1 -0
  200. package/dist/translator-CcA-s-W4.d.cts +180 -0
  201. package/dist/translator-CcA-s-W4.d.cts.map +1 -0
  202. package/dist/translator-CuJOTK6l.js +6 -0
  203. package/dist/utilities-C-lbZaJE.cjs +52 -0
  204. package/dist/utilities-C-lbZaJE.cjs.map +1 -0
  205. package/dist/utilities-bi3EF-q5.js +33 -0
  206. package/dist/utilities-bi3EF-q5.js.map +1 -0
  207. package/package.json +102 -0
@@ -0,0 +1,393 @@
1
+ import { log } from "./log-hgSll-dS.js";
2
+ import { stringReverse } from "./utilities-bi3EF-q5.js";
3
+ import Dexie from "dexie";
4
+
5
+ //#region src/database/schema.ts
6
+ var YomitanDatabase = class extends Dexie {
7
+ terms;
8
+ termMeta;
9
+ kanji;
10
+ kanjiMeta;
11
+ tagMeta;
12
+ dictionaries;
13
+ media;
14
+ constructor(name = "dict") {
15
+ super(name);
16
+ this.version(20).stores({
17
+ terms: "++id, dictionary, expression, reading",
18
+ kanji: "++, dictionary, character",
19
+ tagMeta: "++, dictionary",
20
+ dictionaries: "++, title, version"
21
+ });
22
+ this.version(30).stores({
23
+ terms: "++id, dictionary, expression, reading",
24
+ kanji: "++, dictionary, character",
25
+ tagMeta: "++, dictionary, name",
26
+ dictionaries: "++, title, version",
27
+ termMeta: "++, dictionary, expression",
28
+ kanjiMeta: "++, dictionary, character"
29
+ });
30
+ this.version(40).stores({
31
+ terms: "++id, dictionary, expression, reading, sequence",
32
+ kanji: "++, dictionary, character",
33
+ tagMeta: "++, dictionary, name",
34
+ dictionaries: "++, title, version",
35
+ termMeta: "++, dictionary, expression",
36
+ kanjiMeta: "++, dictionary, character"
37
+ });
38
+ this.version(50).stores({
39
+ terms: "++id, dictionary, expression, reading, sequence, expressionReverse, readingReverse",
40
+ kanji: "++, dictionary, character",
41
+ tagMeta: "++, dictionary, name",
42
+ dictionaries: "++, title, version",
43
+ termMeta: "++, dictionary, expression",
44
+ kanjiMeta: "++, dictionary, character"
45
+ });
46
+ this.version(60).stores({
47
+ terms: "++id, dictionary, expression, reading, sequence, expressionReverse, readingReverse",
48
+ kanji: "++, dictionary, character",
49
+ tagMeta: "++, dictionary, name",
50
+ dictionaries: "++, title, version",
51
+ termMeta: "++, dictionary, expression",
52
+ kanjiMeta: "++, dictionary, character",
53
+ media: "++id, dictionary, path"
54
+ });
55
+ }
56
+ };
57
+ const OBJECT_STORE_NAMES = [
58
+ "dictionaries",
59
+ "terms",
60
+ "termMeta",
61
+ "kanji",
62
+ "kanjiMeta",
63
+ "tagMeta",
64
+ "media"
65
+ ];
66
+
67
+ //#endregion
68
+ //#region src/database/dictionary-database.ts
69
+ var DictionaryDB = class {
70
+ _db;
71
+ _isOpen;
72
+ constructor(dbName = "dict") {
73
+ this._db = new YomitanDatabase(dbName);
74
+ this._isOpen = false;
75
+ }
76
+ async open() {
77
+ await this._db.open();
78
+ this._isOpen = true;
79
+ }
80
+ close() {
81
+ this._db.close();
82
+ this._isOpen = false;
83
+ }
84
+ get isOpen() {
85
+ return this._isOpen;
86
+ }
87
+ get dexie() {
88
+ return this._db;
89
+ }
90
+ async purge() {
91
+ if (this._isOpen) this.close();
92
+ try {
93
+ await this._db.delete();
94
+ } catch (e) {
95
+ log.error(e);
96
+ return false;
97
+ }
98
+ this._db = new YomitanDatabase(this._db.name);
99
+ await this.open();
100
+ return true;
101
+ }
102
+ async deleteDictionary(dictionaryName, onProgress) {
103
+ const targets = [
104
+ ["kanji", "dictionary"],
105
+ ["kanjiMeta", "dictionary"],
106
+ ["terms", "dictionary"],
107
+ ["termMeta", "dictionary"],
108
+ ["tagMeta", "dictionary"],
109
+ ["media", "dictionary"]
110
+ ];
111
+ const progressData = {
112
+ count: 0,
113
+ processed: 0,
114
+ storeCount: targets.length + 1,
115
+ storesProcesed: 0
116
+ };
117
+ for (const [storeName] of targets) {
118
+ const table = this._db.table(storeName);
119
+ const keys = await table.where("dictionary").equals(dictionaryName).primaryKeys();
120
+ progressData.storesProcesed++;
121
+ progressData.count += keys.length;
122
+ onProgress?.(progressData);
123
+ const batchSize = 1e3;
124
+ for (let i = 0; i < keys.length; i += batchSize) {
125
+ const batch = keys.slice(i, i + batchSize);
126
+ await table.bulkDelete(batch);
127
+ progressData.processed += batch.length;
128
+ onProgress?.(progressData);
129
+ }
130
+ }
131
+ await this._db.dictionaries.where("title").equals(dictionaryName).delete();
132
+ progressData.storesProcesed++;
133
+ onProgress?.(progressData);
134
+ }
135
+ async findTermsBulk(termList, dictionaries, matchType) {
136
+ if (termList.length === 0) return [];
137
+ const visited = new Set();
138
+ const results = [];
139
+ const indexNames = matchType === "suffix" ? ["expressionReverse", "readingReverse"] : ["expression", "reading"];
140
+ for (let itemIndex = 0; itemIndex < termList.length; itemIndex++) {
141
+ const item = termList[itemIndex];
142
+ for (let indexIndex = 0; indexIndex < indexNames.length; indexIndex++) {
143
+ const indexName = indexNames[indexIndex];
144
+ let query;
145
+ switch (matchType) {
146
+ case "prefix":
147
+ query = this._db.terms.where(indexName).startsWith(item);
148
+ break;
149
+ case "suffix": {
150
+ const reversed = stringReverse(item);
151
+ query = this._db.terms.where(indexName).startsWith(reversed);
152
+ break;
153
+ }
154
+ default:
155
+ query = this._db.terms.where(indexName).equals(item);
156
+ break;
157
+ }
158
+ const rows = await query.toArray();
159
+ for (const row of rows) {
160
+ if (!dictionaries.has(row.dictionary)) continue;
161
+ const { id } = row;
162
+ if (visited.has(id)) continue;
163
+ visited.add(id);
164
+ const matchSourceIsTerm = indexIndex === 0;
165
+ const matchSource = matchSourceIsTerm ? "term" : "reading";
166
+ const actualMatchType = (matchSourceIsTerm ? row.expression : row.reading) === item ? "exact" : matchType;
167
+ results.push(this._createTerm(matchSource, actualMatchType, row, itemIndex));
168
+ }
169
+ }
170
+ }
171
+ return results;
172
+ }
173
+ async findTermsExactBulk(termList, dictionaries) {
174
+ if (termList.length === 0) return [];
175
+ const results = [];
176
+ for (let itemIndex = 0; itemIndex < termList.length; itemIndex++) {
177
+ const item = termList[itemIndex];
178
+ const rows = await this._db.terms.where("expression").equals(item.term).toArray();
179
+ for (const row of rows) {
180
+ if (row.reading !== item.reading || !dictionaries.has(row.dictionary)) continue;
181
+ results.push(this._createTerm("term", "exact", row, itemIndex));
182
+ }
183
+ }
184
+ return results;
185
+ }
186
+ async findTermsBySequenceBulk(items) {
187
+ if (items.length === 0) return [];
188
+ const results = [];
189
+ for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
190
+ const item = items[itemIndex];
191
+ const rows = await this._db.terms.where("sequence").equals(item.query).toArray();
192
+ for (const row of rows) {
193
+ if (row.dictionary !== item.dictionary) continue;
194
+ results.push(this._createTerm("sequence", "exact", row, itemIndex));
195
+ }
196
+ }
197
+ return results;
198
+ }
199
+ async findTermMetaBulk(termList, dictionaries) {
200
+ if (termList.length === 0) return [];
201
+ const results = [];
202
+ for (let itemIndex = 0; itemIndex < termList.length; itemIndex++) {
203
+ const term = termList[itemIndex];
204
+ const rows = await this._db.termMeta.where("expression").equals(term).toArray();
205
+ for (const row of rows) {
206
+ if (!dictionaries.has(row.dictionary)) continue;
207
+ results.push(this._createTermMeta(row, itemIndex));
208
+ }
209
+ }
210
+ return results;
211
+ }
212
+ async findKanjiBulk(kanjiList, dictionaries) {
213
+ if (kanjiList.length === 0) return [];
214
+ const results = [];
215
+ for (let itemIndex = 0; itemIndex < kanjiList.length; itemIndex++) {
216
+ const character = kanjiList[itemIndex];
217
+ const rows = await this._db.kanji.where("character").equals(character).toArray();
218
+ for (const row of rows) {
219
+ if (!dictionaries.has(row.dictionary)) continue;
220
+ results.push(this._createKanji(row, itemIndex));
221
+ }
222
+ }
223
+ return results;
224
+ }
225
+ async findKanjiMetaBulk(kanjiList, dictionaries) {
226
+ if (kanjiList.length === 0) return [];
227
+ const results = [];
228
+ for (let itemIndex = 0; itemIndex < kanjiList.length; itemIndex++) {
229
+ const character = kanjiList[itemIndex];
230
+ const rows = await this._db.kanjiMeta.where("character").equals(character).toArray();
231
+ for (const row of rows) {
232
+ if (!dictionaries.has(row.dictionary)) continue;
233
+ results.push({
234
+ index: itemIndex,
235
+ character: row.character,
236
+ mode: row.mode,
237
+ data: row.data,
238
+ dictionary: row.dictionary
239
+ });
240
+ }
241
+ }
242
+ return results;
243
+ }
244
+ async findTagMetaBulk(items) {
245
+ const results = new Array(items.length);
246
+ for (let i = 0; i < items.length; i++) {
247
+ const item = items[i];
248
+ const row = await this._db.tagMeta.where("name").equals(item.query).and((r) => r.dictionary === item.dictionary).first();
249
+ results[i] = row;
250
+ }
251
+ return results;
252
+ }
253
+ async findTagForTitle(name, dictionary) {
254
+ return await this._db.tagMeta.where("name").equals(name).and((row) => row.dictionary === dictionary).first();
255
+ }
256
+ async getMedia(items) {
257
+ if (items.length === 0) return [];
258
+ const results = [];
259
+ for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {
260
+ const item = items[itemIndex];
261
+ const rows = await this._db.media.where("path").equals(item.path).toArray();
262
+ for (const row of rows) {
263
+ if (row.dictionary !== item.dictionary) continue;
264
+ results.push({
265
+ index: itemIndex,
266
+ dictionary: row.dictionary,
267
+ path: row.path,
268
+ mediaType: row.mediaType,
269
+ width: row.width,
270
+ height: row.height,
271
+ content: row.content
272
+ });
273
+ }
274
+ }
275
+ return results;
276
+ }
277
+ async getDictionaryInfo() {
278
+ return await this._db.dictionaries.toArray();
279
+ }
280
+ async getDictionaryCounts(dictionaryNames, getTotal) {
281
+ const storeNames = [
282
+ ["kanji", "dictionary"],
283
+ ["kanjiMeta", "dictionary"],
284
+ ["terms", "dictionary"],
285
+ ["termMeta", "dictionary"],
286
+ ["tagMeta", "dictionary"],
287
+ ["media", "dictionary"]
288
+ ];
289
+ const counts = [];
290
+ let total = null;
291
+ if (getTotal) {
292
+ const totalGroup = {};
293
+ for (const [storeName] of storeNames) totalGroup[storeName] = await this._db.table(storeName).count();
294
+ total = totalGroup;
295
+ }
296
+ for (const dictionaryName of dictionaryNames) {
297
+ const countGroup = {};
298
+ for (const [storeName] of storeNames) countGroup[storeName] = await this._db.table(storeName).where("dictionary").equals(dictionaryName).count();
299
+ counts.push(countGroup);
300
+ }
301
+ return {
302
+ total,
303
+ counts
304
+ };
305
+ }
306
+ async dictionaryExists(title) {
307
+ const result = await this._db.dictionaries.where("title").equals(title).first();
308
+ return result !== void 0;
309
+ }
310
+ async bulkAdd(objectStoreName, items, start, count) {
311
+ if (start + count > items.length) count = items.length - start;
312
+ if (count <= 0) return;
313
+ const table = this._db.table(objectStoreName);
314
+ const batch = items.slice(start, start + count);
315
+ await table.bulkAdd(batch);
316
+ }
317
+ async addWithResult(objectStoreName, item) {
318
+ const table = this._db.table(objectStoreName);
319
+ return await table.add(item);
320
+ }
321
+ async bulkUpdate(objectStoreName, items, start, count) {
322
+ if (start + count > items.length) count = items.length - start;
323
+ if (count <= 0) return;
324
+ const table = this._db.table(objectStoreName);
325
+ const batch = items.slice(start, start + count);
326
+ await table.bulkPut(batch.map((item) => item.data), batch.map((item) => item.primaryKey));
327
+ }
328
+ _createTerm(matchSource, matchType, row, index) {
329
+ const { sequence } = row;
330
+ return {
331
+ index,
332
+ matchType,
333
+ matchSource,
334
+ term: row.expression,
335
+ reading: row.reading,
336
+ definitionTags: this._splitField(row.definitionTags || row.tags),
337
+ termTags: this._splitField(row.termTags),
338
+ rules: this._splitField(row.rules),
339
+ definitions: row.glossary,
340
+ score: row.score,
341
+ dictionary: row.dictionary,
342
+ id: row.id,
343
+ sequence: typeof sequence === "number" ? sequence : -1
344
+ };
345
+ }
346
+ _createTermMeta(row, index) {
347
+ const { expression: term, mode, data, dictionary } = row;
348
+ switch (mode) {
349
+ case "freq": return {
350
+ index,
351
+ term,
352
+ mode,
353
+ data,
354
+ dictionary
355
+ };
356
+ case "pitch": return {
357
+ index,
358
+ term,
359
+ mode,
360
+ data,
361
+ dictionary
362
+ };
363
+ case "ipa": return {
364
+ index,
365
+ term,
366
+ mode,
367
+ data,
368
+ dictionary
369
+ };
370
+ default: throw new Error(`Unknown mode: ${mode}`);
371
+ }
372
+ }
373
+ _createKanji(row, index) {
374
+ const { stats } = row;
375
+ return {
376
+ index,
377
+ character: row.character,
378
+ onyomi: this._splitField(row.onyomi),
379
+ kunyomi: this._splitField(row.kunyomi),
380
+ tags: this._splitField(row.tags),
381
+ definitions: row.meanings,
382
+ stats: typeof stats === "object" && stats !== null ? stats : {},
383
+ dictionary: row.dictionary
384
+ };
385
+ }
386
+ _splitField(field) {
387
+ return typeof field === "string" && field.length > 0 ? field.split(" ") : [];
388
+ }
389
+ };
390
+
391
+ //#endregion
392
+ export { DictionaryDB, OBJECT_STORE_NAMES, YomitanDatabase };
393
+ //# sourceMappingURL=dictionary-database-CU4TsvCC.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dictionary-database-CU4TsvCC.js","names":["OBJECT_STORE_NAMES: ObjectStoreName[]","dictionaryName: string","onProgress?: DictionaryDatabase.DeleteDictionaryProgressCallback","targets: [string, string][]","progressData: DictionaryDatabase.DeleteDictionaryProgressData","termList: string[]","dictionaries: DictionaryDatabase.DictionarySet","matchType: DictionaryDatabase.MatchType","results: DictionaryDatabase.TermEntry[]","matchSource: DictionaryDatabase.MatchSource","actualMatchType: DictionaryDatabase.MatchType","termList: DictionaryDatabase.TermExactRequest[]","items: DictionaryDatabase.DictionaryAndQueryRequest[]","results: DictionaryDatabase.TermMeta[]","kanjiList: string[]","results: DictionaryDatabase.KanjiEntry[]","results: DictionaryDatabase.KanjiMeta[]","results: (DictionaryDatabase.Tag | undefined)[]","r: DictionaryDatabase.Tag","name: string","dictionary: string","row: DictionaryDatabase.Tag","items: DictionaryDatabase.MediaRequest[]","results: DictionaryDatabase.Media[]","dictionaryNames: string[]","getTotal: boolean","storeNames: [string, string][]","counts: DictionaryDatabase.DictionaryCountGroup[]","total: DictionaryDatabase.DictionaryCountGroup | null","totalGroup: DictionaryDatabase.DictionaryCountGroup","countGroup: DictionaryDatabase.DictionaryCountGroup","title: string","objectStoreName: DictionaryDatabase.ObjectStoreName","items: unknown[]","start: number","count: number","item: unknown","items: { primaryKey: number; data: unknown }[]","row: DictionaryDatabase.DatabaseTermEntryWithId","index: number","row: DictionaryDatabase.DatabaseTermMeta","row: DictionaryDatabase.DatabaseKanjiEntry","field: unknown"],"sources":["../src/database/schema.ts","../src/database/dictionary-database.ts"],"sourcesContent":["import Dexie from 'dexie';\nimport type { ObjectStoreName } from '../types/dictionary-database';\n\nexport class YomitanDatabase extends Dexie {\n terms!: Dexie.Table;\n termMeta!: Dexie.Table;\n kanji!: Dexie.Table;\n kanjiMeta!: Dexie.Table;\n tagMeta!: Dexie.Table;\n dictionaries!: Dexie.Table;\n media!: Dexie.Table;\n\n constructor(name = 'dict') {\n super(name);\n\n this.version(20).stores({\n terms: '++id, dictionary, expression, reading',\n kanji: '++, dictionary, character',\n tagMeta: '++, dictionary',\n dictionaries: '++, title, version',\n });\n\n this.version(30).stores({\n terms: '++id, dictionary, expression, reading',\n kanji: '++, dictionary, character',\n tagMeta: '++, dictionary, name',\n dictionaries: '++, title, version',\n termMeta: '++, dictionary, expression',\n kanjiMeta: '++, dictionary, character',\n });\n\n this.version(40).stores({\n terms: '++id, dictionary, expression, reading, sequence',\n kanji: '++, dictionary, character',\n tagMeta: '++, dictionary, name',\n dictionaries: '++, title, version',\n termMeta: '++, dictionary, expression',\n kanjiMeta: '++, dictionary, character',\n });\n\n this.version(50).stores({\n terms: '++id, dictionary, expression, reading, sequence, expressionReverse, readingReverse',\n kanji: '++, dictionary, character',\n tagMeta: '++, dictionary, name',\n dictionaries: '++, title, version',\n termMeta: '++, dictionary, expression',\n kanjiMeta: '++, dictionary, character',\n });\n\n this.version(60).stores({\n terms: '++id, dictionary, expression, reading, sequence, expressionReverse, readingReverse',\n kanji: '++, dictionary, character',\n tagMeta: '++, dictionary, name',\n dictionaries: '++, title, version',\n termMeta: '++, dictionary, expression',\n kanjiMeta: '++, dictionary, character',\n media: '++id, dictionary, path',\n });\n }\n}\n\nexport const OBJECT_STORE_NAMES: ObjectStoreName[] = [\n 'dictionaries',\n 'terms',\n 'termMeta',\n 'kanji',\n 'kanjiMeta',\n 'tagMeta',\n 'media',\n];\n","import type * as DictionaryDatabase from '../types/dictionary-database';\nimport type * as DictionaryImporter from '../types/dictionary-importer';\nimport { log } from '../util/log';\nimport { stringReverse } from '../util/utilities';\nimport { OBJECT_STORE_NAMES, YomitanDatabase } from './schema';\n\nexport class DictionaryDB {\n private _db: YomitanDatabase;\n private _isOpen: boolean;\n\n constructor(dbName = 'dict') {\n this._db = new YomitanDatabase(dbName);\n this._isOpen = false;\n }\n\n async open(): Promise<void> {\n await this._db.open();\n this._isOpen = true;\n }\n\n close(): void {\n this._db.close();\n this._isOpen = false;\n }\n\n get isOpen(): boolean {\n return this._isOpen;\n }\n\n get dexie(): YomitanDatabase {\n return this._db;\n }\n\n async purge(): Promise<boolean> {\n if (this._isOpen) {\n this.close();\n }\n try {\n await this._db.delete();\n } catch (e) {\n log.error(e);\n return false;\n }\n this._db = new YomitanDatabase(this._db.name);\n await this.open();\n return true;\n }\n\n async deleteDictionary(\n dictionaryName: string,\n onProgress?: DictionaryDatabase.DeleteDictionaryProgressCallback,\n ): Promise<void> {\n const targets: [string, string][] = [\n ['kanji', 'dictionary'],\n ['kanjiMeta', 'dictionary'],\n ['terms', 'dictionary'],\n ['termMeta', 'dictionary'],\n ['tagMeta', 'dictionary'],\n ['media', 'dictionary'],\n ];\n\n const progressData: DictionaryDatabase.DeleteDictionaryProgressData = {\n count: 0,\n processed: 0,\n storeCount: targets.length + 1,\n storesProcesed: 0,\n };\n\n for (const [storeName] of targets) {\n const table = this._db.table(storeName);\n const keys = await table.where('dictionary').equals(dictionaryName).primaryKeys();\n progressData.storesProcesed++;\n progressData.count += keys.length;\n onProgress?.(progressData);\n\n const batchSize = 1000;\n for (let i = 0; i < keys.length; i += batchSize) {\n const batch = keys.slice(i, i + batchSize);\n await table.bulkDelete(batch);\n progressData.processed += batch.length;\n onProgress?.(progressData);\n }\n }\n\n // Delete from dictionaries store\n await this._db.dictionaries.where('title').equals(dictionaryName).delete();\n progressData.storesProcesed++;\n onProgress?.(progressData);\n }\n\n async findTermsBulk(\n termList: string[],\n dictionaries: DictionaryDatabase.DictionarySet,\n matchType: DictionaryDatabase.MatchType,\n ): Promise<DictionaryDatabase.TermEntry[]> {\n if (termList.length === 0) {\n return [];\n }\n\n const visited = new Set<number>();\n const results: DictionaryDatabase.TermEntry[] = [];\n\n const indexNames = matchType === 'suffix' ? ['expressionReverse', 'readingReverse'] : ['expression', 'reading'];\n\n for (let itemIndex = 0; itemIndex < termList.length; itemIndex++) {\n const item = termList[itemIndex];\n\n for (let indexIndex = 0; indexIndex < indexNames.length; indexIndex++) {\n const indexName = indexNames[indexIndex];\n\n let query;\n switch (matchType) {\n case 'prefix':\n query = this._db.terms.where(indexName).startsWith(item);\n break;\n case 'suffix': {\n const reversed = stringReverse(item);\n query = this._db.terms.where(indexName).startsWith(reversed);\n break;\n }\n default:\n query = this._db.terms.where(indexName).equals(item);\n break;\n }\n\n const rows = await query.toArray();\n\n for (const row of rows) {\n if (!dictionaries.has(row.dictionary)) {\n continue;\n }\n const { id } = row;\n if (visited.has(id)) {\n continue;\n }\n visited.add(id);\n\n const matchSourceIsTerm = indexIndex === 0;\n const matchSource: DictionaryDatabase.MatchSource = matchSourceIsTerm ? 'term' : 'reading';\n const actualMatchType: DictionaryDatabase.MatchType =\n (matchSourceIsTerm ? row.expression : row.reading) === item ? 'exact' : matchType;\n\n results.push(this._createTerm(matchSource, actualMatchType, row, itemIndex));\n }\n }\n }\n\n return results;\n }\n\n async findTermsExactBulk(\n termList: DictionaryDatabase.TermExactRequest[],\n dictionaries: DictionaryDatabase.DictionarySet,\n ): Promise<DictionaryDatabase.TermEntry[]> {\n if (termList.length === 0) {\n return [];\n }\n\n const results: DictionaryDatabase.TermEntry[] = [];\n\n for (let itemIndex = 0; itemIndex < termList.length; itemIndex++) {\n const item = termList[itemIndex];\n const rows = await this._db.terms.where('expression').equals(item.term).toArray();\n\n for (const row of rows) {\n if (row.reading !== item.reading || !dictionaries.has(row.dictionary)) {\n continue;\n }\n results.push(this._createTerm('term', 'exact', row, itemIndex));\n }\n }\n\n return results;\n }\n\n async findTermsBySequenceBulk(\n items: DictionaryDatabase.DictionaryAndQueryRequest[],\n ): Promise<DictionaryDatabase.TermEntry[]> {\n if (items.length === 0) {\n return [];\n }\n\n const results: DictionaryDatabase.TermEntry[] = [];\n\n for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {\n const item = items[itemIndex];\n const rows = await this._db.terms.where('sequence').equals(item.query).toArray();\n\n for (const row of rows) {\n if (row.dictionary !== item.dictionary) {\n continue;\n }\n results.push(this._createTerm('sequence', 'exact', row, itemIndex));\n }\n }\n\n return results;\n }\n\n async findTermMetaBulk(\n termList: string[],\n dictionaries: DictionaryDatabase.DictionarySet,\n ): Promise<DictionaryDatabase.TermMeta[]> {\n if (termList.length === 0) {\n return [];\n }\n\n const results: DictionaryDatabase.TermMeta[] = [];\n\n for (let itemIndex = 0; itemIndex < termList.length; itemIndex++) {\n const term = termList[itemIndex];\n const rows = await this._db.termMeta.where('expression').equals(term).toArray();\n\n for (const row of rows) {\n if (!dictionaries.has(row.dictionary)) {\n continue;\n }\n results.push(this._createTermMeta(row, itemIndex));\n }\n }\n\n return results;\n }\n\n async findKanjiBulk(\n kanjiList: string[],\n dictionaries: DictionaryDatabase.DictionarySet,\n ): Promise<DictionaryDatabase.KanjiEntry[]> {\n if (kanjiList.length === 0) {\n return [];\n }\n\n const results: DictionaryDatabase.KanjiEntry[] = [];\n\n for (let itemIndex = 0; itemIndex < kanjiList.length; itemIndex++) {\n const character = kanjiList[itemIndex];\n const rows = await this._db.kanji.where('character').equals(character).toArray();\n\n for (const row of rows) {\n if (!dictionaries.has(row.dictionary)) {\n continue;\n }\n results.push(this._createKanji(row, itemIndex));\n }\n }\n\n return results;\n }\n\n async findKanjiMetaBulk(\n kanjiList: string[],\n dictionaries: DictionaryDatabase.DictionarySet,\n ): Promise<DictionaryDatabase.KanjiMeta[]> {\n if (kanjiList.length === 0) {\n return [];\n }\n\n const results: DictionaryDatabase.KanjiMeta[] = [];\n\n for (let itemIndex = 0; itemIndex < kanjiList.length; itemIndex++) {\n const character = kanjiList[itemIndex];\n const rows = await this._db.kanjiMeta.where('character').equals(character).toArray();\n\n for (const row of rows) {\n if (!dictionaries.has(row.dictionary)) {\n continue;\n }\n results.push({\n index: itemIndex,\n character: row.character,\n mode: row.mode,\n data: row.data,\n dictionary: row.dictionary,\n });\n }\n }\n\n return results;\n }\n\n async findTagMetaBulk(\n items: DictionaryDatabase.DictionaryAndQueryRequest[],\n ): Promise<(DictionaryDatabase.Tag | undefined)[]> {\n const results: (DictionaryDatabase.Tag | undefined)[] = new Array(items.length);\n\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n const row = await this._db.tagMeta\n .where('name')\n .equals(item.query)\n .and((r: DictionaryDatabase.Tag) => r.dictionary === item.dictionary)\n .first();\n results[i] = row;\n }\n\n return results;\n }\n\n async findTagForTitle(name: string, dictionary: string): Promise<DictionaryDatabase.Tag | undefined> {\n return await this._db.tagMeta\n .where('name')\n .equals(name)\n .and((row: DictionaryDatabase.Tag) => row.dictionary === dictionary)\n .first();\n }\n\n async getMedia(items: DictionaryDatabase.MediaRequest[]): Promise<DictionaryDatabase.Media[]> {\n if (items.length === 0) {\n return [];\n }\n\n const results: DictionaryDatabase.Media[] = [];\n\n for (let itemIndex = 0; itemIndex < items.length; itemIndex++) {\n const item = items[itemIndex];\n const rows = await this._db.media.where('path').equals(item.path).toArray();\n\n for (const row of rows) {\n if (row.dictionary !== item.dictionary) {\n continue;\n }\n results.push({\n index: itemIndex,\n dictionary: row.dictionary,\n path: row.path,\n mediaType: row.mediaType,\n width: row.width,\n height: row.height,\n content: row.content,\n });\n }\n }\n\n return results;\n }\n\n async getDictionaryInfo(): Promise<DictionaryImporter.Summary[]> {\n return await this._db.dictionaries.toArray();\n }\n\n async getDictionaryCounts(\n dictionaryNames: string[],\n getTotal: boolean,\n ): Promise<DictionaryDatabase.DictionaryCounts> {\n const storeNames: [string, string][] = [\n ['kanji', 'dictionary'],\n ['kanjiMeta', 'dictionary'],\n ['terms', 'dictionary'],\n ['termMeta', 'dictionary'],\n ['tagMeta', 'dictionary'],\n ['media', 'dictionary'],\n ];\n\n const counts: DictionaryDatabase.DictionaryCountGroup[] = [];\n\n let total: DictionaryDatabase.DictionaryCountGroup | null = null;\n if (getTotal) {\n const totalGroup: DictionaryDatabase.DictionaryCountGroup = {};\n for (const [storeName] of storeNames) {\n totalGroup[storeName] = await this._db.table(storeName).count();\n }\n total = totalGroup;\n }\n\n for (const dictionaryName of dictionaryNames) {\n const countGroup: DictionaryDatabase.DictionaryCountGroup = {};\n for (const [storeName] of storeNames) {\n countGroup[storeName] = await this._db\n .table(storeName)\n .where('dictionary')\n .equals(dictionaryName)\n .count();\n }\n counts.push(countGroup);\n }\n\n return { total, counts };\n }\n\n async dictionaryExists(title: string): Promise<boolean> {\n const result = await this._db.dictionaries.where('title').equals(title).first();\n return result !== undefined;\n }\n\n async bulkAdd(\n objectStoreName: DictionaryDatabase.ObjectStoreName,\n items: unknown[],\n start: number,\n count: number,\n ): Promise<void> {\n if (start + count > items.length) {\n count = items.length - start;\n }\n if (count <= 0) {\n return;\n }\n\n const table = this._db.table(objectStoreName);\n const batch = items.slice(start, start + count);\n await table.bulkAdd(batch);\n }\n\n async addWithResult(objectStoreName: DictionaryDatabase.ObjectStoreName, item: unknown): Promise<number> {\n const table = this._db.table(objectStoreName);\n return (await table.add(item)) as number;\n }\n\n async bulkUpdate(\n objectStoreName: DictionaryDatabase.ObjectStoreName,\n items: { primaryKey: number; data: unknown }[],\n start: number,\n count: number,\n ): Promise<void> {\n if (start + count > items.length) {\n count = items.length - start;\n }\n if (count <= 0) {\n return;\n }\n\n const table = this._db.table(objectStoreName);\n const batch = items.slice(start, start + count);\n await table.bulkPut(batch.map((item) => item.data), batch.map((item) => item.primaryKey));\n }\n\n // Private result creators\n\n private _createTerm(\n matchSource: DictionaryDatabase.MatchSource,\n matchType: DictionaryDatabase.MatchType,\n row: DictionaryDatabase.DatabaseTermEntryWithId,\n index: number,\n ): DictionaryDatabase.TermEntry {\n const { sequence } = row;\n return {\n index,\n matchType,\n matchSource,\n term: row.expression,\n reading: row.reading,\n definitionTags: this._splitField(row.definitionTags || row.tags),\n termTags: this._splitField(row.termTags),\n rules: this._splitField(row.rules),\n definitions: row.glossary,\n score: row.score,\n dictionary: row.dictionary,\n id: row.id,\n sequence: typeof sequence === 'number' ? sequence : -1,\n };\n }\n\n private _createTermMeta(row: DictionaryDatabase.DatabaseTermMeta, index: number): DictionaryDatabase.TermMeta {\n const { expression: term, mode, data, dictionary } = row;\n switch (mode) {\n case 'freq':\n return { index, term, mode, data, dictionary };\n case 'pitch':\n return { index, term, mode, data, dictionary };\n case 'ipa':\n return { index, term, mode, data, dictionary };\n default:\n throw new Error(`Unknown mode: ${mode}`);\n }\n }\n\n private _createKanji(row: DictionaryDatabase.DatabaseKanjiEntry, index: number): DictionaryDatabase.KanjiEntry {\n const { stats } = row;\n return {\n index,\n character: row.character,\n onyomi: this._splitField(row.onyomi),\n kunyomi: this._splitField(row.kunyomi),\n tags: this._splitField(row.tags),\n definitions: row.meanings,\n stats: typeof stats === 'object' && stats !== null ? stats : {},\n dictionary: row.dictionary,\n };\n }\n\n private _splitField(field: unknown): string[] {\n return typeof field === 'string' && field.length > 0 ? field.split(' ') : [];\n }\n}\n"],"mappings":";;;;;AAGA,IAAa,kBAAb,cAAqC,MAAM;CACvC;CACA;CACA;CACA;CACA;CACA;CACA;CAEA,YAAY,OAAO,QAAQ;AACvB,QAAM,KAAK;AAEX,OAAK,QAAQ,GAAG,CAAC,OAAO;GACpB,OAAO;GACP,OAAO;GACP,SAAS;GACT,cAAc;EACjB,EAAC;AAEF,OAAK,QAAQ,GAAG,CAAC,OAAO;GACpB,OAAO;GACP,OAAO;GACP,SAAS;GACT,cAAc;GACd,UAAU;GACV,WAAW;EACd,EAAC;AAEF,OAAK,QAAQ,GAAG,CAAC,OAAO;GACpB,OAAO;GACP,OAAO;GACP,SAAS;GACT,cAAc;GACd,UAAU;GACV,WAAW;EACd,EAAC;AAEF,OAAK,QAAQ,GAAG,CAAC,OAAO;GACpB,OAAO;GACP,OAAO;GACP,SAAS;GACT,cAAc;GACd,UAAU;GACV,WAAW;EACd,EAAC;AAEF,OAAK,QAAQ,GAAG,CAAC,OAAO;GACpB,OAAO;GACP,OAAO;GACP,SAAS;GACT,cAAc;GACd,UAAU;GACV,WAAW;GACX,OAAO;EACV,EAAC;CACL;AACJ;AAED,MAAaA,qBAAwC;CACjD;CACA;CACA;CACA;CACA;CACA;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,UAAU,GAAG;AACrB,SAAO;GACH;GACA;GACA;GACA,MAAM,IAAI;GACV,SAAS,IAAI;GACb,gBAAgB,KAAK,YAAY,IAAI,kBAAkB,IAAI,KAAK;GAChE,UAAU,KAAK,YAAY,IAAI,SAAS;GACxC,OAAO,KAAK,YAAY,IAAI,MAAM;GAClC,aAAa,IAAI;GACjB,OAAO,IAAI;GACX,YAAY,IAAI;GAChB,IAAI,IAAI;GACR,iBAAiB,aAAa,WAAW,WAAW;EACvD;CACJ;CAED,AAAQ,gBAAgBC,KAA0CD,OAA4C;EAC1G,MAAM,EAAE,YAAY,MAAM,MAAM,MAAM,YAAY,GAAG;AACrD,UAAQ,MAAR;GACI,KAAK,OACD,QAAO;IAAE;IAAO;IAAM;IAAM;IAAM;GAAY;GAClD,KAAK,QACD,QAAO;IAAE;IAAO;IAAM;IAAM;IAAM;GAAY;GAClD,KAAK,MACD,QAAO;IAAE;IAAO;IAAM;IAAM;IAAM;GAAY;GAClD,QACI,OAAM,IAAI,OAAO,gBAAgB,KAAK;EAC7C;CACJ;CAED,AAAQ,aAAaE,KAA4CF,OAA8C;EAC3G,MAAM,EAAE,OAAO,GAAG;AAClB,SAAO;GACH;GACA,WAAW,IAAI;GACf,QAAQ,KAAK,YAAY,IAAI,OAAO;GACpC,SAAS,KAAK,YAAY,IAAI,QAAQ;GACtC,MAAM,KAAK,YAAY,IAAI,KAAK;GAChC,aAAa,IAAI;GACjB,cAAc,UAAU,YAAY,UAAU,OAAO,QAAQ,CAAE;GAC/D,YAAY,IAAI;EACnB;CACJ;CAED,AAAQ,YAAYG,OAA0B;AAC1C,gBAAc,UAAU,YAAY,MAAM,SAAS,IAAI,MAAM,MAAM,IAAI,GAAG,CAAE;CAC/E;AACJ"}
@@ -0,0 +1,58 @@
1
+ import { DeleteDictionaryProgressCallback, DictionaryAndQueryRequest, DictionaryCounts, DictionarySet, KanjiEntry, KanjiMeta, MatchType, Media, MediaRequest, ObjectStoreName, Summary, Tag, TermEntry, TermExactRequest, TermMeta } from "./dictionary-importer-Da3AuTZw.cjs";
2
+ import Dexie from "dexie";
3
+
4
+ //#region src/database/schema.d.ts
5
+ declare class YomitanDatabase extends Dexie {
6
+ terms: Dexie.Table;
7
+ termMeta: Dexie.Table;
8
+ kanji: Dexie.Table;
9
+ kanjiMeta: Dexie.Table;
10
+ tagMeta: Dexie.Table;
11
+ dictionaries: Dexie.Table;
12
+ media: Dexie.Table;
13
+ constructor(name?: string);
14
+ }
15
+ declare const OBJECT_STORE_NAMES: ObjectStoreName[];
16
+
17
+ //#endregion
18
+ //#region src/database/dictionary-database.d.ts
19
+ //# sourceMappingURL=schema.d.ts.map
20
+ declare class DictionaryDB {
21
+ private _db;
22
+ private _isOpen;
23
+ constructor(dbName?: string);
24
+ open(): Promise<void>;
25
+ close(): void;
26
+ get isOpen(): boolean;
27
+ get dexie(): YomitanDatabase;
28
+ purge(): Promise<boolean>;
29
+ deleteDictionary(dictionaryName: string, onProgress?: DeleteDictionaryProgressCallback): Promise<void>;
30
+ findTermsBulk(termList: string[], dictionaries: DictionarySet, matchType: MatchType): Promise<TermEntry[]>;
31
+ findTermsExactBulk(termList: TermExactRequest[], dictionaries: DictionarySet): Promise<TermEntry[]>;
32
+ findTermsBySequenceBulk(items: DictionaryAndQueryRequest[]): Promise<TermEntry[]>;
33
+ findTermMetaBulk(termList: string[], dictionaries: DictionarySet): Promise<TermMeta[]>;
34
+ findKanjiBulk(kanjiList: string[], dictionaries: DictionarySet): Promise<KanjiEntry[]>;
35
+ findKanjiMetaBulk(kanjiList: string[], dictionaries: DictionarySet): Promise<KanjiMeta[]>;
36
+ findTagMetaBulk(items: DictionaryAndQueryRequest[]): Promise<(Tag | undefined)[]>;
37
+ findTagForTitle(name: string, dictionary: string): Promise<Tag | undefined>;
38
+ getMedia(items: MediaRequest[]): Promise<Media[]>;
39
+ getDictionaryInfo(): Promise<Summary[]>;
40
+ getDictionaryCounts(dictionaryNames: string[], getTotal: boolean): Promise<DictionaryCounts>;
41
+ dictionaryExists(title: string): Promise<boolean>;
42
+ bulkAdd(objectStoreName: ObjectStoreName, items: unknown[], start: number, count: number): Promise<void>;
43
+ addWithResult(objectStoreName: ObjectStoreName, item: unknown): Promise<number>;
44
+ bulkUpdate(objectStoreName: ObjectStoreName, items: {
45
+ primaryKey: number;
46
+ data: unknown;
47
+ }[], start: number, count: number): Promise<void>;
48
+ private _createTerm;
49
+ private _createTermMeta;
50
+ private _createKanji;
51
+ private _splitField;
52
+ }
53
+
54
+ //#endregion
55
+ //# sourceMappingURL=dictionary-database.d.ts.map
56
+
57
+ export { DictionaryDB, OBJECT_STORE_NAMES, YomitanDatabase };
58
+ //# sourceMappingURL=dictionary-database-DsOi04Sg.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dictionary-database-DsOi04Sg.d.cts","names":[],"sources":["../src/database/schema.ts","../src/database/dictionary-database.ts"],"sourcesContent":null,"mappings":";;;;cAGa,eAAA,SAAwB,KAAA;SACzB,KAAA,CAAM;EADL,QAAA,EAEE,KAAA,CAAM,KAFQ;EAAA,KAAA,EAGjB,KAAA,CAAM,KAHW;EAAA,SACX,EAGF,KAAA,CAAM,KAHJ;EAAK,OACR,EAGD,KAAA,CAAM,KAHC;EAAK,YACR,EAGC,KAAA,CAAM,KAHP;EAAK,KACP,EAGJ,KAAA,CAAM,KAHI;EAAK,WACP,CAAA,IAAA,CAAA,EAAA,MAAA;;AAER,cAmDC,kBAnDK,EAmDe,eAnDf,EAAA;;;;;cCJL,YAAA;EDHA,QAAA,GAAA;EAAgB,QAAA,OAAA;EAAA,WACX,CAAA,MAAA,CAAA,EAAA,MAAA;EAAK,IACR,CAAA,CAAA,ECUG,ODVG,CAAA,IAAA,CAAA;EAAK,KACd,CAAA,CAAA,EAAM,IAAA;EAAK,IACP,MAAM,CAAA,CAAA,EAAA,OAAA;EAAK,IACb,KAAM,CAAA,CAAA,ECqBH,eDrBG;EAAK,KACN,CAAA,CAAA,ECwBA,ODxBM,CAAA,OAAA,C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