import type { UiNodeSpec, StyleBoxFlatSpec } from './types.js'; import type { Rect } from './anchor-solver.js'; export interface MeasuredNode { path: string; type: string; rect: Rect; anchors?: Record; offsets?: Record; visible?: boolean; text?: string; styles?: StyleReading[]; } export interface DiffEntry { path: string; target: Rect | null; actual: Rect | null; delta: { dx: number; dy: number; dw: number; dh: number; }; ok: boolean; } export declare function flattenTargets(tree: UiNodeSpec, prefix?: string): Array<{ path: string; rect: Rect; }>; export declare function diffLayout(measured: MeasuredNode[], targets: Array<{ path: string; rect: Rect; }>, tolerancePx?: number): DiffEntry[]; export declare function detectOverlaps(measured: MeasuredNode[]): Array<{ a: string; b: string; overlap: Rect; }>; export declare function detectOutOfBounds(measured: MeasuredNode[]): Array<{ path: string; parent: string; overflow: Rect; }>; /** measure 读回的单槽位样式(GD _walk 产出 JSON 形状;flat=false 时仅 type 有值)。 */ export interface StyleReading { path: string; slot: string; flat: boolean; type?: string; bg_color?: [number, number, number, number]; corner_radius?: { tl: number; tr: number; br: number; bl: number; }; border_width?: { left: number; top: number; right: number; bottom: number; }; border_color?: [number, number, number, number]; } /** style_verify 单条:逐槽位逐属性 diff(spec §4.1)。 */ export interface StyleDiffEntry { path: string; slot: string; field: string; target: number | number[] | string | null; actual: number | number[] | string | null; delta: number | number[] | null; ok: boolean; } /** Color float32 存储的序列化精度(实测 Godot 4.7.1:0.2 → 0.2000000029, * 集成用例 5 以 0.002 容差断言——见 test/integration/ui-import-integration.test.ts)。 */ export declare const STYLE_COLOR_TOL = 0.002; export interface StyleTargetEntry { path: string; slot: string; box: StyleBoxFlatSpec; } /** expect 树 → stylebox 期望清单(path 链语义与 flattenTargets 同构,根级无前缀)。 */ export declare function flattenStyleTargets(tree: UiNodeSpec, prefix?: string): StyleTargetEntry[]; /** 期望清单 → measure 脚本的 path→slots 内嵌清单(GD 侧按需读回判定的并集左侧)。 */ export declare function styleExpectList(targets: StyleTargetEntry[]): Array<{ path: string; slots: string[]; }>; /** 目标(StyleBoxFlatSpec)vs 实测读回逐字段 diff。只比 box 中显式设置的字段 * (缺省字段不比对——生成器同规则缺省不写);非 Flat 以单条 type 红条目暴露 * (N-5:Label 未 override 的 normal 槽是 StyleBoxEmpty,读 bg_color 会崩/误判); * corner/border 宽度为整数属性精确匹配,颜色按 STYLE_COLOR_TOL(float32)。 */ export declare function diffStyles(readings: StyleReading[], targets: StyleTargetEntry[], colorTol?: number): StyleDiffEntry[]; /** flow_verify(spec §4.2):flow 直接子层期望(输入视口绝对)vs measure 实测 * (global rect,视口绝对)直接 diff——不做父相对换算(与 diffLayout 的关键差异, * 消解 B-2 盲区)。孙层不进(由 layout_verify 近似覆盖,纳入会产稳定系统性偏差报警=噪声)。 */ export declare function diffFlow(measured: MeasuredNode[], flowExpect: Array<{ path: string; rect: Rect; }>, tolerancePx?: number): DiffEntry[];