/** * Auto-sized section box layout for a cluster of already-placed schematic * components — the "cosmetic auto-layout" gap identified from real usage: a * hand-drawn section rectangle sized before all components were placed ends * up too small (components spill outside it) or misaligned (an empty-looking * box next to the part it's supposed to enclose). * * Scope, deliberately bounded: this computes a box from each component's * real pin extents (the only per-component geometry this bridge can query — * there is no symbol/body bounding-box API) plus a fixed padding allowance, * and unions the whole cluster. It does NOT attempt symbol-level * de-collision or net-label decluttering — those remain a manual review * item. It also does NOT attempt to resize the sheet/page frame (EasyEDA's * Width/Height title-block fields are documented read-only through this * bridge — see skills/easyeda-workflow/SKILL.md's set_title_block caveat); * page overflow is reported as an advisory warning only. * * @module */ import { type ToolContext } from '../tools/types.js'; export interface SectionBounds { x: number; y: number; width: number; height: number; } interface RectangleSummary { primitiveId: string; x?: number; y?: number; width?: number; height?: number; } /** Union of every candidate's pin coordinates, padded per-component to * approximate body extent beyond the pins themselves, then padded again by * `margin` for breathing room around the whole cluster. */ export declare function computeSectionBounds(ctx: ToolContext, primitiveIds: string[], componentPadding: number, margin: number): Promise; /** * Best-effort: list every rectangle currently on the sheet (via the bridge's * `schematic.listRectangles`, added alongside this feature) and report which * ones the proposed section bounds would overlap. Advisory only — two * sections sharing an edge is often intentional, so this never blocks a * layout call, it only surfaces the overlap for the caller to judge. * * Caveat (live-verified 2026-07-09, see memory/easyeda_hotswap_getall_staleness.md): * the underlying getAll()-style bridge enumeration can miss primitives created * earlier in the same live session (confirmed for wires; unconfirmed but * plausible for rectangles too, since listRectangles uses the same pattern). * Treat an empty overlap list as advisory, not proof there's no overlap with * a rectangle created moments earlier in the same session. */ export declare function findOverlappingRectangles(ctx: ToolContext, bounds: SectionBounds, excludePrimitiveIds: string[]): Promise; /** * Best-effort: compare the proposed bounds against the sheet's reported page * size. Returns a warning string if the section would extend past the page, * or null if it fits (or the page size couldn't be determined). Purely * advisory — see module doc for why this never attempts to resize the page. */ export declare function checkAgainstPageFrame(ctx: ToolContext, projectId: string, bounds: SectionBounds): Promise; export {};