tooltip bounds

This commit is contained in:
Boki 2026-02-10 21:21:07 -05:00
parent 930e00c9cc
commit bb2b9cf507
7 changed files with 474 additions and 56 deletions

View file

@ -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;