/** * DesignIntent → CircuitIR compiler. * * This module provides the compile boundary: a validated DesignIntent is * compiled into a draft CircuitIR. The CircuitIR must then pass a review * gate (human or automated) before it is marked as "validated" and consumed * by downstream EasyEDA tools. * * The compiler: * 1. Validates the input DesignIntent. * 2. Transforms functional block requirements into Blocks. * 3. Creates power Rails from the DesignIntent's rail requirements. * 4. Plans one candidate Device per Block: a deterministic refdes, a * component role, and a package-family hint (see component-planning.ts). * 5. Generates power Nets for each rail plus a synthesized common-ground Net. * 6. Wires device/power-domain load relationships when unambiguous, and * synthesizes candidate connector Interfaces. * 7. Copies manufacturing, mechanical, and safety intent into CircuitIR fields. * 8. Preserves all traceability IDs. * * @module */ import { DesignIntent } from './design-intent.js'; import { CircuitIR } from './circuit-ir.js'; import { ValidationStatus } from './types.js'; export interface CompileOptions { /** If true, skip DesignIntent validation (assumes pre-validated input). */ skipValidation?: boolean; /** Optional override for the CircuitIR validation status after compile. */ initialStatus?: ValidationStatus; } export interface CompileResult { /** The compiled CircuitIR (draft — must pass review gate). */ circuitIR: CircuitIR; /** The original DesignIntent, preserved for traceability. */ designIntent: DesignIntent; /** Compile warnings (non-fatal issues the compiler wants to flag). */ warnings: string[]; } /** * Compile a validated DesignIntent into a draft CircuitIR. * * Throws `CircuitError` if: * - The input fails DesignIntent validation (unless `skipValidation`). * - The board type is not supported by the compiler. */ export declare function compile(input: unknown, options?: CompileOptions): CompileResult; /** * Transition a CircuitIR from "draft" to "validated" or "rejected". * * Downstream EasyEDA tools MUST check that the CircuitIR they consume * is in "validated" status before proceeding with mutations. */ export declare function setValidationStatus(circuitIR: CircuitIR, status: ValidationStatus.Validated | ValidationStatus.Rejected, _reason?: string): CircuitIR; /** * Check whether a CircuitIR is validated and ready for EasyEDA operations. */ export declare function isReadyForEasyEDA(circuitIR: CircuitIR): boolean;