/** * Schematic sheet safe-region planner. * * EasyEDA Pro schematic coordinates observed in live MSI testing use a * bottom-left-style sheet origin: larger Y values move objects upward on the * page. The default A4 title block occupies the lower/right portion of the * frame, so hard-coded low-Y coordinates easily collide with the title block. * * This module is deliberately pure and conservative. It does not resize the * sheet; it returns a safe bounding box/anchor or a blocked plan with reasons * that callers can surface before applying any writes. */ export type SchematicRegionPreference = 'upper-left' | 'upper-center' | 'upper-right' | 'center-left' | 'center' | 'center-right' | 'lower-left' | 'lower-center' | 'lower-right'; export interface SchematicRect { x: number; y: number; width: number; height: number; } export interface SchematicPoint { x: number; y: number; } export interface SchematicSheetGeometry { width: number; height: number; unit: string; origin: 'bottom-left'; source: 'sheet-info' | 'default-a4-landscape'; } export interface SafeSchematicRegionPlanInput { sheetInfo?: unknown; contentWidth: number; contentHeight: number; preferredRegion?: SchematicRegionPreference; margin?: number; titleBlockKeepout?: SchematicRect; } export interface SafeSchematicRegionPlan { blocked: boolean; preferredRegion: SchematicRegionPreference; sheet: SchematicSheetGeometry; usableBounds: SchematicRect; requestedBounds: SchematicRect; bounds: SchematicRect; anchor: SchematicPoint; keepouts: Array; warnings: string[]; issues: Array<{ code: string; message: string; }>; } export declare function inferSchematicSheetGeometry(sheetInfo: unknown): SchematicSheetGeometry; export declare function defaultTitleBlockKeepout(sheet: SchematicSheetGeometry): SchematicRect; export declare function rectsOverlap(a: SchematicRect, b: SchematicRect): boolean; export declare function planSafeSchematicRegion(input: SafeSchematicRegionPlanInput): SafeSchematicRegionPlan;