mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-07 05:39:05 +08:00
refactor(ocr): 将 Tesseract 相关类型移动到文件底部以改善代码组织
This commit is contained in:
parent
45d3550492
commit
428de0836d
@ -72,10 +72,6 @@ export type OcrProviderConfig = {
|
|||||||
enabled?: boolean
|
enabled?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type OcrTesseractConfig = OcrProviderConfig & {
|
|
||||||
langs: Record<Tesseract.LanguageCode, boolean>
|
|
||||||
}
|
|
||||||
|
|
||||||
export type OcrProvider = {
|
export type OcrProvider = {
|
||||||
id: string
|
id: string
|
||||||
name: string
|
name: string
|
||||||
@ -129,3 +125,12 @@ export type OcrResult = {
|
|||||||
export type OcrHandler = (file: SupportedOcrFile) => Promise<OcrResult>
|
export type OcrHandler = (file: SupportedOcrFile) => Promise<OcrResult>
|
||||||
|
|
||||||
export type OcrImageHandler = (file: ImageFileMetadata) => 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
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user