From d897c3b069f80fd170b7f1d0c0362fec4037d714 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Mon, 27 Nov 2023 16:09:55 -0500 Subject: Update dictionary importer --- types/ext/dictionary-importer.d.ts | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'types/ext') 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 . */ +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; }; + +export type ArchiveFileMap = Map; + +export type CompiledSchemaNameArray = [ + termBank: CompiledSchemaName, + termMetaBank: CompiledSchemaName, + kanjiBank: CompiledSchemaName, + kanjiMetaBank: CompiledSchemaName, + tagBank: CompiledSchemaName, +]; + +export type CompiledSchemaValidators = { + dictionaryIndex: Ajv.ValidateFunction; + dictionaryTermBankV1: Ajv.ValidateFunction; + dictionaryTermBankV3: Ajv.ValidateFunction; + dictionaryTermMetaBankV3: Ajv.ValidateFunction; + dictionaryKanjiBankV1: Ajv.ValidateFunction; + dictionaryKanjiBankV3: Ajv.ValidateFunction; + dictionaryKanjiMetaBankV3: Ajv.ValidateFunction; + dictionaryTagBankV3: Ajv.ValidateFunction; +}; + +export type CompiledSchemaName = keyof CompiledSchemaValidators; -- cgit v1.2.3