import { PCB } from './pcb/pcb.js'; /** A single pin mapping entry: IC pin → MCU name → board framework name. * Only needed for legacy usage when the component has no typehal property. */ export interface McuPinMapping { icPin: number; mcuName: string; boardName: string; category: 'gpio' | 'power' | 'gnd' | 'clock' | 'reset'; } /** An external component connected on the same net as an MCU pin */ export interface ContractComponent { reference: string; symbol: string; value: string; footprint: string; mpn: string; datasheet: string; description: string; voltage: string; wattage: string; dnp: boolean; } /** Info about a single connected MCU pin */ export interface ContractPin { pinName: string; /** Pin electrical type from KiCAD symbol (e.g. "bidirectional", "power_in", "passive", "input", "output") */ pinType: string; /** Board framework pin name (e.g. "D13") — populated when typehal.pinLookup is provided */ boardName?: string; net: string; externalComponents: ContractComponent[]; } /** The top-level contract object written to disk */ export interface HwContract { version: 1; mcu: { symbol: string; reference: string; value: string; footprint: string; mpn: string; datasheet: string; description: string; }; connectedPins: Record; availablePeripherals: { i2c: boolean; spi: boolean; uart: boolean; }; } /** Options passed to pcb.contract() */ export interface ContractOptions { /** * Substring to match against Component.symbol to find the MCU. * Ignored when the MCU component has a typehal.boardPackage property. */ mcuSymbolPattern?: string; /** * Exact reference designator of the target MCU (e.g. 'U1'). * Takes priority over mcuSymbolPattern when both are provided. */ mcuReference?: string; /** * Pin mapping table for the MCU (legacy — only needed when the component * has no typehal property and you need board names in the output). */ pinMapping?: McuPinMapping[]; /** Peripheral pin requirements (board pin names) */ peripheralPins?: { i2c?: string[]; spi?: string[]; uart?: string[]; }; /** Output file path (default: "./build/.contract.json") */ outputPath?: string; } /** * Exports a hardware contract JSON file describing which MCU pins are wired * in the circuit. The firmware toolchain (TypeHAL) consumes this contract to * generate a board wrapper that only exposes connected pins and peripherals. * * When a component has a `typehal.boardPackage` property, it is auto-detected * as the MCU and pin names are read directly from the KiCAD symbol file. * * @param pcb - The PCB instance to analyze. * @param options - Contract generation options (all optional when typehal is set on the MCU). */ export declare function exportContract(pcb: PCB, options?: ContractOptions): void; //# sourceMappingURL=contract.d.ts.map