tooltip bounds
This commit is contained in:
parent
930e00c9cc
commit
bb2b9cf507
7 changed files with 474 additions and 56 deletions
|
|
@ -43,6 +43,12 @@ export interface GridScanResult {
|
|||
matches?: GridMatch[];
|
||||
}
|
||||
|
||||
export interface DiffOcrResponse {
|
||||
text: string;
|
||||
lines: OcrLine[];
|
||||
region?: Region;
|
||||
}
|
||||
|
||||
export interface DetectGridResult {
|
||||
detected: boolean;
|
||||
region?: Region;
|
||||
|
|
@ -151,6 +157,22 @@ export class OcrDaemon {
|
|||
};
|
||||
}
|
||||
|
||||
async snapshot(): Promise<void> {
|
||||
await this.sendWithRetry({ cmd: 'snapshot' }, REQUEST_TIMEOUT);
|
||||
}
|
||||
|
||||
async diffOcr(savePath?: string, region?: Region): Promise<DiffOcrResponse> {
|
||||
const req: DaemonRequest = { cmd: 'diff-ocr' };
|
||||
if (savePath) req.path = savePath;
|
||||
if (region) req.region = region;
|
||||
const resp = await this.sendWithRetry(req, REQUEST_TIMEOUT);
|
||||
return {
|
||||
text: resp.text ?? '',
|
||||
lines: resp.lines ?? [],
|
||||
region: resp.region,
|
||||
};
|
||||
}
|
||||
|
||||
async saveScreenshot(path: string, region?: Region): Promise<void> {
|
||||
const req: DaemonRequest = { cmd: 'screenshot', path };
|
||||
if (region) req.region = region;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue