mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-09 06:49:02 +08:00
Merge branch 'feat/ocr' into feat/ocr-translate
This commit is contained in:
commit
2dbd487a90
@ -1,4 +1,4 @@
|
|||||||
import { FileMetadata, FileTypes, Model } from '.'
|
import { FileMetadata, ImageFileMetadata, isImageFile, Model } from '.'
|
||||||
|
|
||||||
export const BuiltinOcrProviderIds = {
|
export const BuiltinOcrProviderIds = {
|
||||||
tesseract: 'tesseract'
|
tesseract: 'tesseract'
|
||||||
@ -62,18 +62,10 @@ export const isImageOcrProvider = (p: OcrProvider): p is ImageOcrProvider => {
|
|||||||
return p.capabilities.image
|
return p.capabilities.image
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SupportedOcrFileType = FileTypes.IMAGE
|
export type SupportedOcrFile = ImageFileMetadata
|
||||||
|
|
||||||
export const isSupportedOcrFileType = (type: FileTypes): type is SupportedOcrFileType => {
|
|
||||||
return type === FileTypes.IMAGE
|
|
||||||
}
|
|
||||||
|
|
||||||
export type SupportedOcrFile = FileMetadata & {
|
|
||||||
type: FileTypes.IMAGE
|
|
||||||
}
|
|
||||||
|
|
||||||
export const isSupportedOcrFile = (file: FileMetadata): file is SupportedOcrFile => {
|
export const isSupportedOcrFile = (file: FileMetadata): file is SupportedOcrFile => {
|
||||||
return isSupportedOcrFileType(file.type)
|
return isImageFile(file)
|
||||||
}
|
}
|
||||||
|
|
||||||
export type OcrResult = {
|
export type OcrResult = {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user