Browse Source

Updated types per #606 and #580

bug/type-edits
Balearica 2 years ago
parent
commit
ef260a6503
  1. 6
      src/index.d.ts

6
src/index.d.ts vendored

@ -25,6 +25,7 @@ declare namespace Tesseract {
recognize(image: ImageLike, options?: Partial<RecognizeOptions>, jobId?: string): Promise<RecognizeResult> recognize(image: ImageLike, options?: Partial<RecognizeOptions>, jobId?: string): Promise<RecognizeResult>
detect(image: ImageLike, jobId?: string): Promise<DetectResult> detect(image: ImageLike, jobId?: string): Promise<DetectResult>
terminate(jobId?: string): Promise<ConfigResult> terminate(jobId?: string): Promise<ConfigResult>
getPDF(title?: string, textonly?: boolean, jobId?: string):Promise<GetPDFResult>
} }
interface WorkerOptions { interface WorkerOptions {
@ -62,6 +63,10 @@ declare namespace Tesseract {
jobId: string jobId: string
data: Page data: Page
} }
interface GetPDFResult {
jobId: string
data: number[]
}
interface DetectResult { interface DetectResult {
jobId: string jobId: string
data: DetectData data: DetectData
@ -99,6 +104,7 @@ declare namespace Tesseract {
SINGLE_CHAR = '10', SINGLE_CHAR = '10',
SPARSE_TEXT = '11', SPARSE_TEXT = '11',
SPARSE_TEXT_OSD = '12', SPARSE_TEXT_OSD = '12',
RAW_LINE = '13'
} }
type ImageLike = string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement type ImageLike = string | HTMLImageElement | HTMLCanvasElement | HTMLVideoElement
| CanvasRenderingContext2D | File | Blob | ImageData | Buffer; | CanvasRenderingContext2D | File | Blob | ImageData | Buffer;

Loading…
Cancel
Save