import type { ResolvedAnnotation } from "./model.js"; import type { PlacedAnnotation, Rect } from "./svg.js"; export { computeScale, toCanvasRect, positionTargetRect, appCriteriaError, allTargetError, appWindowOrigin, criteriaFromTarget, resolveAnnotationRects, APP_UNSUPPORTED_CRITERIA, APP_SUPPORTED_CRITERIA, }; type Point = { x: number; y: number; }; declare const APP_UNSUPPORTED_CRITERIA: string[]; declare const APP_SUPPORTED_CRITERIA: string[]; declare function computeScale(imageWidth: number, logicalWidth: unknown): number; declare function toCanvasRect(logical: Rect, scale: number, cropOrigin?: Point): Rect; declare function positionTargetRect(position: any, canvas: { width: number; height: number; }, scale: number): Rect; /** * The origin to rebase native element rects onto, given the captured window. * * The two desktop platforms differ, and the difference is empirical rather * than something to reason out from first principles: * * - **Windows**: the driver session is ROOTED at the app window (that's why * `appWindowScreenshot` can just call `driver.saveScreenshot()` and get * exactly that window), and `getElementRect` reports window-relative * coordinates to match. The capture and the rects already share an origin, * so rebasing would shift every annotation up-left by the window's desktop * position — verified against Character Map, where subtracting a (25, 115) * window origin moved annotations off their targets by exactly (25, 115). * - **macOS**: Mac2 reports SCREEN coordinates — `appWindowRect` reads the * window ELEMENT's rect and hands it to ffmpeg as a display crop, which * only works in screen space. The capture is an element screenshot of the * window, so child rects must be rebased onto the window's origin. * * Anything else (including mobile, which captures in-device and therefore * shares the device origin) needs no rebasing. */ declare function appWindowOrigin(platform: string | undefined, windowRect: { x: number; y: number; } | null | undefined): Point; declare function appCriteriaError(target: any): string | null; declare function allTargetError(target: any, all: boolean, isAppCapture?: boolean): string | null; declare function criteriaFromTarget(target: any): any; /** * Resolve every annotation's target into a rect in the final image. * * Returns the placed annotations plus a list of human-readable failures. A * target that can't be found is reported rather than skipped: an annotation * that silently vanishes is a documentation bug, and for `blur` it's a * disclosure. */ declare function resolveAnnotationRects({ config, annotations, driver, surface, appSession, isAppCapture, appDriver, windowOrigin, canvas, scale, cropOrigin, }: { config: any; annotations: ResolvedAnnotation[]; driver: any; surface?: any; appSession?: any; isAppCapture?: boolean; appDriver?: any; windowOrigin?: Point; canvas: { width: number; height: number; }; scale: number; cropOrigin?: Point; }): Promise<{ placed: PlacedAnnotation[]; errors: string[]; }>; //# sourceMappingURL=geometry.d.ts.map