import { HttpClient } from './client'; import { ElementInfo, Rect, ClickOptions, TypeOptions, AutoWaitConfig, ElementList, FlashOptions, ScrollToVisibleResult, InspectResponse, InspectOptions, ElementVisibilityResult, ScrollOptions } from './types'; import { OperationLogger } from './logger'; import { ElementCore } from './element-core'; declare const Element_base: { new (...args: any[]): { click(options?: ClickOptions, ...propNames: string[]): Promise; dblclick(): Promise; rightClick(...propNames: string[]): Promise; type(text: string, options?: TypeOptions): Promise; clear(): Promise; fill(text: string, options?: TypeOptions): Promise; focus(): Promise; flash(options?: FlashOptions, ...propNames: string[]): Promise; hover(options?: { duration?: number; humanize?: boolean; } | undefined, ...propNames: string[]): Promise; readonly windowSelector: string; readonly findSelector: string; _client: HttpClient; _info: ElementInfo; _autoWaitConfig: AutoWaitConfig; _logger: OperationLogger; _cacheTime: any; readonly selector: string; readonly foundElementCount: number; name(): Promise; text(): Promise; isEnabled(): Promise; isVisible(): Promise; isOffscreen(): Promise; get attrs(): ElementInfo; attr(name: string): Promise; bounds(): Promise; boundingBox(): Promise; isCheckable(): Promise; isChecked(): Promise; isClickable(): Promise; isScrollable(): Promise; isSelected(): Promise; _maybeAutoWait(phase: string): Promise; toJSON(): { selector: string; window: string; findSelector: string; info: ElementInfo; }; }; } & typeof ElementCore; export declare class Element extends Element_base { constructor(client: HttpClient, xpathStr: string, windowSelector: string, findSelector: string, info: ElementInfo, autoWaitConfig: AutoWaitConfig, logger: OperationLogger, foundElementCount?: number, cacheTime?: any); protected get runtimeId(): string; /** * 刷新元素最新状态(xpath 重新查找 / runtimeId 刷新) */ refresh(...propNames: string[]): Promise; assertExists(...propNames: string[]): Promise; assertEnabled(): Promise; assertVisible(): Promise; assertText(expected: string): Promise; /** * 实时检查元素在可视区域的位置信息(查询后端,非缓存) */ checkVisibility(containerXPath?: string, ...propNames: string[]): Promise; protected resolveDistance(distance: number | string, dimension: number): number; clickAbove(distance?: number | string, options?: ClickOptions): Promise; clickBelow(distance?: number | string, options?: ClickOptions): Promise; clickLeft(distance?: number | string, options?: ClickOptions): Promise; clickRight(distance?: number | string, options?: ClickOptions): Promise; } declare const UiaElementMixin_base: { new (...args: any[]): { compass(path: string, ...propNames: string[]): Promise; _parseCompassPath(path: string): import("./element-navigation").CompassToken[]; _readOptionalNumber(path: string, pos: number): number | null; _readSignedNumber(path: string, pos: number): number | null; _buildCompassXpath(baseXpath: string, tokens: any[]): string; readonly windowSelector: string; readonly findSelector: string; _client: HttpClient; _info: ElementInfo; _autoWaitConfig: AutoWaitConfig; _logger: OperationLogger; _cacheTime: any; readonly selector: string; readonly foundElementCount: number; name(): Promise; text(): Promise; isEnabled(): Promise; isVisible(): Promise; isOffscreen(): Promise; get attrs(): ElementInfo; attr(name: string): Promise; bounds(): Promise; boundingBox(): Promise; isCheckable(): Promise; isChecked(): Promise; isClickable(): Promise; isScrollable(): Promise; isSelected(): Promise; _maybeAutoWait(phase: string): Promise; toJSON(): { selector: string; window: string; findSelector: string; info: ElementInfo; }; }; } & { new (...args: any[]): { findOne(xpath: string, options?: import("./types").FindOptions, ...propNames: string[]): Promise; findFirst(xpath: string, options?: import("./types").FindOptions, ...propNames: string[]): Promise; find(xpath: string, options?: import("./types").FindOptions, ...propNames: string[]): Promise; findAll(xpath: string, options?: import("./types").FindOptions, ...propNames: string[]): Promise; nth(xpath: string, n: number, ...propNames: string[]): Promise; locator(xpath: string, ...propNames: string[]): Promise; children(xpath?: string, ...propNames: string[]): Promise; childCount(...propNames: string[]): Promise; child(index: number, ...propNames: string[]): Promise; parent(levelOrPropNames?: number | string, ...restPropNames: string[]): Promise; next(...propNames: string[]): Promise; prev(...propNames: string[]): Promise; readonly windowSelector: string; readonly findSelector: string; _client: HttpClient; _info: ElementInfo; _autoWaitConfig: AutoWaitConfig; _logger: OperationLogger; _cacheTime: any; readonly selector: string; readonly foundElementCount: number; name(): Promise; text(): Promise; isEnabled(): Promise; isVisible(): Promise; isOffscreen(): Promise; get attrs(): ElementInfo; attr(name: string): Promise; bounds(): Promise; boundingBox(): Promise; isCheckable(): Promise; isChecked(): Promise; isClickable(): Promise; isScrollable(): Promise; isSelected(): Promise; _maybeAutoWait(phase: string): Promise; toJSON(): { selector: string; window: string; findSelector: string; info: ElementInfo; }; }; } & { new (...args: any[]): { dragTo(target: any, options?: { duration?: number; propNames?: string[]; targetPropNames?: string[]; } | undefined): Promise; scroll(options: ScrollOptions): Promise<{ scrolled: number; }>; readonly windowSelector: string; readonly findSelector: string; _client: HttpClient; _info: ElementInfo; _autoWaitConfig: AutoWaitConfig; _logger: OperationLogger; _cacheTime: any; readonly selector: string; readonly foundElementCount: number; name(): Promise; text(): Promise; isEnabled(): Promise; isVisible(): Promise; isOffscreen(): Promise; get attrs(): ElementInfo; attr(name: string): Promise; bounds(): Promise; boundingBox(): Promise; isCheckable(): Promise; isChecked(): Promise; isClickable(): Promise; isScrollable(): Promise; isSelected(): Promise; _maybeAutoWait(phase: string): Promise; toJSON(): { selector: string; window: string; findSelector: string; info: ElementInfo; }; }; } & typeof Element; declare class UiaElementMixin extends UiaElementMixin_base { } export declare class UiaElement extends UiaElementMixin { constructor(client: HttpClient, xpathStr: string, windowSelector: string, findSelector: string, info: ElementInfo, autoWaitConfig: AutoWaitConfig, logger: OperationLogger, foundElementCount?: number, cacheTime?: any); /** * 获取能唯一定位此元素的 XPath 字符串 */ toXpath(...propNames: string[]): string; /** * 获取元素的选择器信息 */ getSelector(): { windowSelector: string; elementSelector: string; }; /** * 通过 XPath 重新查找来刷新元素 */ refreshByXpath(findFn: () => Promise): Promise; private getParentXpath; private appendPredicates; private buildXpathFromProps; resolveXpath(propNames: string[]): string; private resolveRelativeXpath; private parseExistingAttrs; private selectAutoProps; private mapPropToAttr; private getPropValue; private escapeXpath; private buildRelativeXpath; private buildChildXpath; private buildChildIndexPredicate; private findElement; private findElementByXPath; private findAllByXPath; private emptyElementList; waitUntilGone(options?: any, ...propNames: string[]): Promise; waitFor(options?: any, ...propNames: string[]): Promise; scrollToVisible(containerSelector: string, options: any): Promise; /** * 获取当前元素在父控件中的 0-based 索引位置。 */ indexInParent(...propNames: string[]): Promise; inspect(options?: InspectOptions, ...propNames: string[]): Promise; private computeRegionRect; private rectsIntersect; } import { Template } from './image-template'; export declare class ImageElement extends Element { readonly confidence: number; readonly template: Template; readonly matchRect: Rect; constructor(client: HttpClient, windowSelector: string, info: ElementInfo, autoWaitConfig: AutoWaitConfig, logger: OperationLogger, template: Template, confidence: number, matchRect: Rect); private get centerPoint(); /** * 根据 clickArea / offset 计算最终点击点(屏幕绝对坐标)。 * offset 优先级高于 clickArea(与后端 calculate_offset_click_point 一致)。 */ private resolveClickPoint; click(options?: ClickOptions, ..._propNames: string[]): Promise; refresh(..._propNames: string[]): Promise; /** * 右键点击图像元素(走坐标版 API) */ rightClick(..._propNames: string[]): Promise; /** * 鼠标悬停在图像元素上(走坐标版 API) */ hover(options?: { duration?: number; humanize?: boolean; }, ..._propNames: string[]): Promise; /** * 高亮闪烁图像匹配矩形(走 /api/highlight/rect) */ flash(options?: FlashOptions, ..._propNames: string[]): Promise; /** * 输入文本(仅支持 key 模式:click 聚焦 + 全局键盘输入) * set / paste 模式需要后端 xpath 定位,不支持 */ type(text: string, options?: TypeOptions): Promise; /** * 断言元素存在:图像元素构造时已匹配,直接视为存在。 * 如需检查图像是否仍在屏幕上,请使用 flow.findImage 重新匹配。 */ assertExists(..._propNames: string[]): Promise; /** * 实时检查可视区域位置:使用本地缓存 rect 判断(不查后端)。 * 注意:返回的是构造时的快照状态,如需实时状态请先 refresh。 */ checkVisibility(_containerXPath?: string, ..._propNames: string[]): Promise; toJSON(): { type: string; selector: string; window: string; findSelector: string; template: string; confidence: number; matchRect: Rect; info: ElementInfo; }; } export {};