aboutsummaryrefslogtreecommitdiff
path: root/types/ext
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-11-27 16:09:55 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-11-27 16:09:55 -0500
commitd897c3b069f80fd170b7f1d0c0362fec4037d714 (patch)
tree76448c197b510c394463d3ba6b0eb31b01bcd7f0 /types/ext
parentac562ca36417f2d9fdb860d1f8a879fdccde438d (diff)
Update dictionary importer
Diffstat (limited to 'types/ext')
-rw-r--r--types/ext/dictionary-importer.d.ts27
1 files changed, 26 insertions, 1 deletions
diff --git a/types/ext/dictionary-importer.d.ts b/types/ext/dictionary-importer.d.ts
index 16ce66ce..de85d04a 100644
--- a/types/ext/dictionary-importer.d.ts
+++ b/types/ext/dictionary-importer.d.ts
@@ -15,6 +15,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+import type * as Ajv from 'ajv';
+import type * as ZipJS from '@zip.js/zip.js';
import type * as DictionaryData from './dictionary-data';
import type * as DictionaryDatabase from './dictionary-database';
import type * as StructuredContent from './structured-content';
@@ -90,6 +92,29 @@ export type StructuredContentImageImportRequirement = {
};
export type ImportRequirementContext = {
- archive: import('jszip');
+ fileMap: ArchiveFileMap;
media: Map<string, DictionaryDatabase.MediaDataArrayBufferContent>;
};
+
+export type ArchiveFileMap = Map<string, ZipJS.Entry>;
+
+export type CompiledSchemaNameArray = [
+ termBank: CompiledSchemaName,
+ termMetaBank: CompiledSchemaName,
+ kanjiBank: CompiledSchemaName,
+ kanjiMetaBank: CompiledSchemaName,
+ tagBank: CompiledSchemaName,
+];
+
+export type CompiledSchemaValidators = {
+ dictionaryIndex: Ajv.ValidateFunction<unknown>;
+ dictionaryTermBankV1: Ajv.ValidateFunction<unknown>;
+ dictionaryTermBankV3: Ajv.ValidateFunction<unknown>;
+ dictionaryTermMetaBankV3: Ajv.ValidateFunction<unknown>;
+ dictionaryKanjiBankV1: Ajv.ValidateFunction<unknown>;
+ dictionaryKanjiBankV3: Ajv.ValidateFunction<unknown>;
+ dictionaryKanjiMetaBankV3: Ajv.ValidateFunction<unknown>;
+ dictionaryTagBankV3: Ajv.ValidateFunction<unknown>;
+};
+
+export type CompiledSchemaName = keyof CompiledSchemaValidators;