Skip to content

Commit

Permalink
Fix langs TS typing (#570)
Browse files Browse the repository at this point in the history
  • Loading branch information
reda-alaoui authored Sep 25, 2022
1 parent 263dbb8 commit 80aef15
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,20 @@ declare namespace Tesseract {
readText(path: string, jobId?: string): Promise<ConfigResult>
removeText(path: string, jobId?: string): Promise<ConfigResult>
FS(method: string, args: any[], jobId?: string): Promise<ConfigResult>
loadLanguage(langs?: string, jobId?: string): Promise<ConfigResult>
initialize(langs?: string, oem?: OEM, jobId?: string): Promise<ConfigResult>
loadLanguage(langs?: string | Lang[], jobId?: string): Promise<ConfigResult>
initialize(langs?: string | Lang[], oem?: OEM, jobId?: string): Promise<ConfigResult>
setParameters(params: Partial<WorkerParams>, jobId?: string): Promise<ConfigResult>
recognize(image: ImageLike, options?: Partial<RecognizeOptions>, jobId?: string): Promise<RecognizeResult>
detect(image: ImageLike, jobId?: string): Promise<DetectResult>
terminate(jobId?: string): Promise<ConfigResult>
getPDF(title?: string, textonly?: boolean, jobId?: string):Promise<GetPDFResult>
}

interface Lang {
code: string;
data: unknown;
}

interface WorkerOptions {
corePath: string
langPath: string
Expand Down

0 comments on commit 80aef15

Please sign in to comment.