feat(ocr): 添加OCR服务基础功能

实现OCR服务的基础功能,通过调用window.api.ocr接口处理支持的文件类型
This commit is contained in:
icarus 2025-08-22 15:33:04 +08:00
parent 01ad89eb54
commit 01360e3a4b

View File

@ -0,0 +1,14 @@
import { OcrProvider, OcrResult, SupportedOcrFile } from '@renderer/types/ocr'
// const logger = loggerService.withContext('main:OcrService')
/**
* ocr a file
* @param file any supported file
* @param provider ocr provider
* @returns ocr result
* @throws {Error}
*/
export const ocr = async (file: SupportedOcrFile, provider: OcrProvider): Promise<OcrResult> => {
return window.api.ocr.ocr(file, provider)
}