refactor(ocr): 将 Tesseract 相关类型移动到文件底部以改善代码组织

This commit is contained in:
icarus 2025-08-23 19:34:50 +08:00
parent 45d3550492
commit 428de0836d

View File

@ -72,10 +72,6 @@ export type OcrProviderConfig = {
enabled?: boolean
}
export type OcrTesseractConfig = OcrProviderConfig & {
langs: Record<Tesseract.LanguageCode, boolean>
}
export type OcrProvider = {
id: string
name: string
@ -129,3 +125,12 @@ export type OcrResult = {
export type OcrHandler = (file: SupportedOcrFile) => Promise<OcrResult>
export type OcrImageHandler = (file: ImageFileMetadata) => Promise<OcrResult>
// Tesseract Types
export type OcrTesseractConfig = OcrProviderConfig & {
langs: Record<Tesseract.LanguageCode, boolean>
}
export type OcrTesseractProvider = BuiltinOcrProvider & {
config: OcrTesseractConfig
}