chore: rename type

This commit is contained in:
Methapon Metanipat 2024-10-02 17:06:57 +07:00
parent 51993e97f2
commit 6858cf4103

View file

@ -5,10 +5,12 @@ import { parseMRZ } from './mrz';
let worker: Tesseract.Worker;
export function runOcr(image: ImageLike): Promise<void>;
export function runOcr<T extends (result: RecognizeResult) => void>(
export function runOcr<
CallbackFunction extends (result: RecognizeResult) => void,
>(
image: ImageLike,
callback: T,
): Promise<ReturnType<T>>;
callback: CallbackFunction,
): Promise<ReturnType<CallbackFunction>>;
export async function runOcr<T extends (result: RecognizeResult) => void>(
image: ImageLike,
callback?: T,