Browse Source

Fix langs TS typing (#570)

master
Réda Housni Alaoui 2 years ago committed by GitHub
parent
commit
80aef15861
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      src/index.d.ts

9
src/index.d.ts vendored

@ -19,8 +19,8 @@ declare namespace Tesseract {
readText(path: string, jobId?: string): Promise<ConfigResult> readText(path: string, jobId?: string): Promise<ConfigResult>
removeText(path: string, jobId?: string): Promise<ConfigResult> removeText(path: string, jobId?: string): Promise<ConfigResult>
FS(method: string, args: any[], jobId?: string): Promise<ConfigResult> FS(method: string, args: any[], jobId?: string): Promise<ConfigResult>
loadLanguage(langs?: string, jobId?: string): Promise<ConfigResult> loadLanguage(langs?: string | Lang[], jobId?: string): Promise<ConfigResult>
initialize(langs?: string, oem?: OEM, jobId?: string): Promise<ConfigResult> initialize(langs?: string | Lang[], oem?: OEM, jobId?: string): Promise<ConfigResult>
setParameters(params: Partial<WorkerParams>, jobId?: string): Promise<ConfigResult> setParameters(params: Partial<WorkerParams>, jobId?: string): Promise<ConfigResult>
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>
@ -28,6 +28,11 @@ declare namespace Tesseract {
getPDF(title?: string, textonly?: boolean, jobId?: string):Promise<GetPDFResult> getPDF(title?: string, textonly?: boolean, jobId?: string):Promise<GetPDFResult>
} }
interface Lang {
code: string;
data: unknown;
}
interface WorkerOptions { interface WorkerOptions {
corePath: string corePath: string
langPath: string langPath: string

Loading…
Cancel
Save