/** * Circuit-specific validation and compilation errors. * * These extend the project's existing error pattern (see src/schemas/common.ts) * and provide structured, actionable error messages for DesignIntent and CircuitIR * validation failures. */ import { ZodError } from 'zod'; export declare const CircuitErrorCode: { readonly DESIGN_INTENT_INVALID: "DESIGN_INTENT_INVALID"; readonly DESIGN_INTENT_MISSING_BLOCKS: "DESIGN_INTENT_MISSING_BLOCKS"; readonly DESIGN_INTENT_RAIL_CONFLICT: "DESIGN_INTENT_RAIL_CONFLICT"; readonly CIRCUIT_IR_INVALID: "CIRCUIT_IR_INVALID"; readonly CIRCUIT_IR_BLOCK_DEVICE_MISMATCH: "CIRCUIT_IR_BLOCK_DEVICE_MISMATCH"; readonly CIRCUIT_IR_NET_ORPHAN: "CIRCUIT_IR_NET_ORPHAN"; readonly CIRCUIT_IR_RAIL_VOLTAGE_MISMATCH: "CIRCUIT_IR_RAIL_VOLTAGE_MISMATCH"; readonly CIRCUIT_IR_DUPLICATE_ID: "CIRCUIT_IR_DUPLICATE_ID"; readonly CIRCUIT_IR_REFERENCE_MISSING: "CIRCUIT_IR_REFERENCE_MISSING"; readonly COMPILE_FAILED: "COMPILE_FAILED"; readonly COMPILE_UNSUPPORTED_BOARD_TYPE: "COMPILE_UNSUPPORTED_BOARD_TYPE"; readonly INTERNAL_ERROR: "INTERNAL_ERROR"; }; export type CircuitErrorCode = (typeof CircuitErrorCode)[keyof typeof CircuitErrorCode]; export interface CircuitValidationError { code: CircuitErrorCode; message: string; /** Path to the field that caused the error (dot-notation) */ path?: string; /** Specific details for programmatic handling */ details?: Record; } export declare class CircuitError extends Error { readonly code: CircuitErrorCode; readonly errors: CircuitValidationError[]; readonly retryable: boolean; constructor(opts: { code: CircuitErrorCode; message: string; errors?: CircuitValidationError[]; retryable?: boolean; }); } /** * Wrap a ZodError into a list of CircuitValidationErrors. */ export declare function fromZodError(zodError: ZodError, prefix?: string): CircuitValidationError[]; /** * Create a single validation error. */ export declare function validationError(code: CircuitErrorCode, message: string, details?: Record): CircuitValidationError;