@gacua/backend
Version:
GACUA Backend
48 lines (47 loc) • 1.39 kB
TypeScript
/**
* @license
* Copyright 2025 MuleRun
* SPDX-License-Identifier: Apache-2.0
*/
import type { Part, PartListUnion } from '@google/genai';
type Resolution = {
width: number;
height: number;
};
export type Coordinate = {
x: number;
y: number;
};
export type Box = {
ymin: number;
xmin: number;
ymax: number;
xmax: number;
};
export type IndexAndBox = {
index: number;
box: Box;
};
export type Image = {
buffer: Buffer;
resolution: Resolution;
mimeType: string;
};
export declare function takeScreenshot(screenshotToolResult: PartListUnion): Promise<Image>;
export declare function cropScreenshot(screenshot: Image): Promise<{
image: Image;
description: string;
nameSuffix: string;
}[]>;
export declare function imageToPart(image: Image): Part;
export declare function toScreenCoords(args: {
index: number;
boxOrCoordinate: Box | Coordinate;
}): Coordinate;
export declare function highlightBox(image: Image, indexAndBox: IndexAndBox, color?: string, width?: number): Promise<Image>;
export declare function highlightConnectedBoxes(image: Image, startingIndexAndBox: IndexAndBox, endingIndexAndBox: IndexAndBox, borderColor?: string, borderWidth?: number, arrowColor?: string, arrowWidth?: number): Promise<{
buffer: Buffer<ArrayBufferLike>;
resolution: Resolution;
mimeType: string;
}>;
export {};