import { HttpClient } from './client'; import { ElementInfo, Rect, AutoWaitConfig } from './types'; import { OperationLogger } from './logger'; /** * ElementCore - Element 核心类 * * 包含:构造函数、查询方法、属性方法 */ export declare class ElementCore { readonly windowSelector: string; readonly findSelector: string; _client: HttpClient; _info: ElementInfo; _autoWaitConfig: AutoWaitConfig; _logger: OperationLogger; _cacheTime: any; readonly selector: string; readonly foundElementCount: number; constructor(client: HttpClient, xpathStr: string, windowSelector: string, findSelector: string, info: ElementInfo, autoWaitConfig: AutoWaitConfig, logger: OperationLogger, foundElementCount?: number, cacheTime?: any); /** * 获取元素名称(对应 UIA Name 属性) */ name(): Promise; /** * 获取元素文本内容(name 的 Playwright 兼容别名) */ text(): Promise; /** * 检查元素是否可用(使用本地缓存属性,如需最新状态请先 refresh) */ isEnabled(): Promise; /** * 检查元素是否可见(使用本地缓存属性,如需最新状态请先 refresh) */ isVisible(): Promise; /** * 检查元素是否在屏幕外(使用本地缓存属性,如需最新状态请先 refresh) */ isOffscreen(): Promise; /** * 获取元素所有属性 */ get attrs(): ElementInfo; /** * 获取元素属性 */ attr(name: string): Promise; /** * 获取元素位置和尺寸(使用本地缓存属性,如需最新状态请先 refresh) */ bounds(): Promise; /** * 获取元素位置和尺寸(bounds 的别名,与 Playwright/CDP 一致) */ boundingBox(): Promise; /** * 元素是否支持 Toggle */ isCheckable(): Promise; /** * 元素是否处于勾选状态 */ isChecked(): Promise; /** * 元素是否可点击 */ isClickable(): Promise; /** * 元素是否可滚动 */ isScrollable(): Promise; /** * 元素是否处于选中状态 */ isSelected(): Promise; /** * 自动等待 */ _maybeAutoWait(phase: string): Promise; /** * 自定义 JSON 序列化 */ toJSON(): { selector: string; window: string; findSelector: string; info: ElementInfo; }; }