/** * CircuitIR — versioned, validated, machine-readable circuit model. * * CircuitIR is the **source of truth** for downstream EasyEDA operations. * It is produced by compiling a DesignIntent, but can also be authored or * edited directly for advanced use cases. * * Every significant node (Block, Device, Net, Rail) carries a `designIntentRef` * array for traceability back to the originating DesignIntent requirements. * * @schema circuit-ir/v1 */ import { z } from 'zod'; import { ValidationStatus, NetType, ConstraintSeverity, ConstraintType, BoardLayerType, KeepoutRestriction, PlacementSide, PlacementZoneType, MountingHoleType } from './types.js'; export declare const CIRCUIT_IR_SCHEMA_VERSION = "circuit-ir/v1"; export declare const BlockSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; type: z.ZodString; description: z.ZodOptional; designIntentRef: z.ZodDefault; }, z.core.$strip>>>; children: z.ZodDefault>; }, z.core.$strip>; export type Block = z.infer; export declare const DeviceSchema: z.ZodObject<{ id: z.ZodString; ref: z.ZodString; mpn: z.ZodOptional; manufacturer: z.ZodOptional; package: z.ZodOptional; datasheet: z.ZodUnion<[z.ZodOptional, z.ZodLiteral<"">]>; lcsc: z.ZodOptional; blockRef: z.ZodOptional; powerDomainRef: z.ZodOptional; placementZoneRef: z.ZodOptional; estimatedDissipationWatts: z.ZodOptional; designIntentRef: z.ZodDefault; }, z.core.$strip>>>; metadata: z.ZodDefault>>; }, z.core.$strip>; export type Device = z.infer; export declare const NetNodeSchema: z.ZodObject<{ deviceRef: z.ZodString; pin: z.ZodString; }, z.core.$strip>; export declare const NetSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; type: z.ZodDefault>; nodes: z.ZodDefault>>; blockRef: z.ZodOptional; powerDomainRef: z.ZodOptional; signalClassRef: z.ZodOptional; railRef: z.ZodOptional; designIntentRef: z.ZodDefault; }, z.core.$strip>>>; metadata: z.ZodDefault>>; }, z.core.$strip>; export type Net = z.infer; export type NetNode = z.infer; export declare const PowerRailSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; voltage: z.ZodNumber; tolerance: z.ZodDefault; maxCurrentAmps: z.ZodOptional; sourceBlockRef: z.ZodOptional; sinkBlockRefs: z.ZodDefault>; designIntentRef: z.ZodDefault; }, z.core.$strip>>>; metadata: z.ZodDefault>>; }, z.core.$strip>; export type PowerRail = z.infer; export declare const PowerDomainSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; nominalVoltage: z.ZodOptional; tolerancePercent: z.ZodDefault; groundNet: z.ZodOptional; railRefs: z.ZodDefault>; sourceRailRef: z.ZodOptional; loadDeviceRefs: z.ZodDefault>; maxCurrentAmps: z.ZodOptional; isolation: z.ZodDefault>; designIntentRef: z.ZodDefault; }, z.core.$strip>>>; metadata: z.ZodDefault>>; }, z.core.$strip>; export type PowerDomain = z.infer; export declare const SignalClassSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; kind: z.ZodEnum<{ reset: "reset"; power: "power"; ground: "ground"; analog: "analog"; i2c: "i2c"; spi: "spi"; uart: "uart"; usb: "usb"; rf: "rf"; digital: "digital"; clock: "clock"; can: "can"; "high-speed": "high-speed"; differential: "differential"; sensitive: "sensitive"; }>; netNames: z.ZodDefault>; differentialPair: z.ZodOptional; lengthMatchToleranceMm: z.ZodOptional; }, z.core.$strip>>; impedanceOhms: z.ZodOptional; maxFrequencyHz: z.ZodOptional; edgeRateNs: z.ZodOptional; routing: z.ZodDefault; traceWidthMm: z.ZodOptional; clearanceMm: z.ZodOptional; maxLengthMm: z.ZodOptional; shieldNet: z.ZodOptional; returnPathNet: z.ZodOptional; }, z.core.$strip>>; designIntentRef: z.ZodDefault; }, z.core.$strip>>>; metadata: z.ZodDefault>>; }, z.core.$strip>; export type SignalClass = z.infer; export declare const PhysicalConstraintSchema: z.ZodObject<{ id: z.ZodString; type: z.ZodEnum<{ clearance: "clearance"; placement: "placement"; mechanical: "mechanical"; thermal: "thermal"; keepout: "keepout"; height: "height"; creepage: "creepage"; accessibility: "accessibility"; testability: "testability"; }>; severity: z.ZodDefault>; targetType: z.ZodEnum<{ board: "board"; device: "device"; interface: "interface"; net: "net"; block: "block"; zone: "zone"; }>; targetRef: z.ZodOptional; description: z.ZodString; value: z.ZodOptional>; unit: z.ZodOptional; minClearanceMm: z.ZodOptional; preferredSide: z.ZodOptional>; keepoutRef: z.ZodOptional; designIntentRef: z.ZodDefault; }, z.core.$strip>>>; metadata: z.ZodDefault>>; }, z.core.$strip>; export type PhysicalConstraint = z.infer; export declare const InterfacePinSchema: z.ZodObject<{ pin: z.ZodString; signal: z.ZodString; type: z.ZodOptional>; }, z.core.$strip>; export declare const InterfaceSchema: z.ZodObject<{ id: z.ZodString; name: z.ZodString; type: z.ZodString; pinout: z.ZodDefault>; }, z.core.$strip>>>; blockRef: z.ZodOptional; designIntentRef: z.ZodDefault; }, z.core.$strip>>>; }, z.core.$strip>; export type Interface = z.infer; export type InterfacePin = z.infer; export declare const ConstraintSchema: z.ZodObject<{ id: z.ZodString; type: z.ZodEnum; severity: z.ZodDefault>; description: z.ZodString; scope: z.ZodOptional; designIntentRef: z.ZodDefault; }, z.core.$strip>>>; }, z.core.$strip>; export type Constraint = z.infer; export declare const BomIntentSchema: z.ZodObject<{ excludeRefs: z.ZodDefault>; preferredVendors: z.ZodDefault>; costTargetUsd: z.ZodOptional; notes: z.ZodOptional; }, z.core.$strip>; export type BomIntent = z.infer; export declare const PcbIntentSchema: z.ZodObject<{ layerCount: z.ZodOptional; stackup: z.ZodOptional; widthMm: z.ZodOptional; heightMm: z.ZodOptional; material: z.ZodOptional; notes: z.ZodOptional; boardOutline: z.ZodOptional>; cutouts: z.ZodOptional>>>; }, z.core.$strip>>; layerStack: z.ZodOptional; thicknessMm: z.ZodNumber; material: z.ZodString; copperWeightOz: z.ZodOptional; dielectricConstant: z.ZodOptional; order: z.ZodNumber; }, z.core.$strip>>>; netClasses: z.ZodOptional; viaHoleMm: z.ZodOptional; priority: z.ZodOptional; netNames: z.ZodOptional>; }, z.core.$strip>>>; clearanceRules: z.ZodOptional; }, z.core.$strip>>>; keepoutAreas: z.ZodOptional>; layer: z.ZodString; restriction: z.ZodEnum; description: z.ZodOptional; }, z.core.$strip>>>; placementZones: z.ZodOptional>; layer: z.ZodEnum; zoneType: z.ZodEnum; name: z.ZodString; allowedRefs: z.ZodOptional>; description: z.ZodOptional; }, z.core.$strip>>>; mountingHoles: z.ZodOptional>; plated: z.ZodDefault; }, z.core.$strip>>>; fiducials: z.ZodOptional; top: z.ZodBoolean; bottom: z.ZodOptional; }, z.core.$strip>>>; testPads: z.ZodOptional; label: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>; export type PcbIntent = z.infer; export declare const ManufacturingIntentSchema: z.ZodObject<{ quantity: z.ZodOptional; process: z.ZodOptional>; timelineWeeks: z.ZodOptional; notes: z.ZodOptional; }, z.core.$strip>; export type ManufacturingIntent = z.infer; export declare const CircuitIRSchema: z.ZodObject<{ $schema: z.ZodDefault>; metadata: z.ZodObject<{ version: z.ZodDefault>; createdAt: z.ZodOptional; designIntentRef: z.ZodOptional; validationStatus: z.ZodDefault>; }, z.core.$strip>; blocks: z.ZodDefault; designIntentRef: z.ZodDefault; }, z.core.$strip>>>; children: z.ZodDefault>; }, z.core.$strip>>>; devices: z.ZodDefault; manufacturer: z.ZodOptional; package: z.ZodOptional; datasheet: z.ZodUnion<[z.ZodOptional, z.ZodLiteral<"">]>; lcsc: z.ZodOptional; blockRef: z.ZodOptional; powerDomainRef: z.ZodOptional; placementZoneRef: z.ZodOptional; estimatedDissipationWatts: z.ZodOptional; designIntentRef: z.ZodDefault; }, z.core.$strip>>>; metadata: z.ZodDefault>>; }, z.core.$strip>>>; nets: z.ZodDefault>; nodes: z.ZodDefault>>; blockRef: z.ZodOptional; powerDomainRef: z.ZodOptional; signalClassRef: z.ZodOptional; railRef: z.ZodOptional; designIntentRef: z.ZodDefault; }, z.core.$strip>>>; metadata: z.ZodDefault>>; }, z.core.$strip>>>; rails: z.ZodDefault; maxCurrentAmps: z.ZodOptional; sourceBlockRef: z.ZodOptional; sinkBlockRefs: z.ZodDefault>; designIntentRef: z.ZodDefault; }, z.core.$strip>>>; metadata: z.ZodDefault>>; }, z.core.$strip>>>; powerDomains: z.ZodDefault; tolerancePercent: z.ZodDefault; groundNet: z.ZodOptional; railRefs: z.ZodDefault>; sourceRailRef: z.ZodOptional; loadDeviceRefs: z.ZodDefault>; maxCurrentAmps: z.ZodOptional; isolation: z.ZodDefault>; designIntentRef: z.ZodDefault; }, z.core.$strip>>>; metadata: z.ZodDefault>>; }, z.core.$strip>>>; signalClasses: z.ZodDefault; netNames: z.ZodDefault>; differentialPair: z.ZodOptional; lengthMatchToleranceMm: z.ZodOptional; }, z.core.$strip>>; impedanceOhms: z.ZodOptional; maxFrequencyHz: z.ZodOptional; edgeRateNs: z.ZodOptional; routing: z.ZodDefault; traceWidthMm: z.ZodOptional; clearanceMm: z.ZodOptional; maxLengthMm: z.ZodOptional; shieldNet: z.ZodOptional; returnPathNet: z.ZodOptional; }, z.core.$strip>>; designIntentRef: z.ZodDefault; }, z.core.$strip>>>; metadata: z.ZodDefault>>; }, z.core.$strip>>>; physicalConstraints: z.ZodDefault; severity: z.ZodDefault>; targetType: z.ZodEnum<{ board: "board"; device: "device"; interface: "interface"; net: "net"; block: "block"; zone: "zone"; }>; targetRef: z.ZodOptional; description: z.ZodString; value: z.ZodOptional>; unit: z.ZodOptional; minClearanceMm: z.ZodOptional; preferredSide: z.ZodOptional>; keepoutRef: z.ZodOptional; designIntentRef: z.ZodDefault; }, z.core.$strip>>>; metadata: z.ZodDefault>>; }, z.core.$strip>>>; interfaces: z.ZodDefault>; }, z.core.$strip>>>; blockRef: z.ZodOptional; designIntentRef: z.ZodDefault; }, z.core.$strip>>>; }, z.core.$strip>>>; constraints: z.ZodDefault; severity: z.ZodDefault>; description: z.ZodString; scope: z.ZodOptional; designIntentRef: z.ZodDefault; }, z.core.$strip>>>; }, z.core.$strip>>>; bom: z.ZodDefault>; preferredVendors: z.ZodDefault>; costTargetUsd: z.ZodOptional; notes: z.ZodOptional; }, z.core.$strip>>; pcb: z.ZodDefault; stackup: z.ZodOptional; widthMm: z.ZodOptional; heightMm: z.ZodOptional; material: z.ZodOptional; notes: z.ZodOptional; boardOutline: z.ZodOptional>; cutouts: z.ZodOptional>>>; }, z.core.$strip>>; layerStack: z.ZodOptional; thicknessMm: z.ZodNumber; material: z.ZodString; copperWeightOz: z.ZodOptional; dielectricConstant: z.ZodOptional; order: z.ZodNumber; }, z.core.$strip>>>; netClasses: z.ZodOptional; viaHoleMm: z.ZodOptional; priority: z.ZodOptional; netNames: z.ZodOptional>; }, z.core.$strip>>>; clearanceRules: z.ZodOptional; }, z.core.$strip>>>; keepoutAreas: z.ZodOptional>; layer: z.ZodString; restriction: z.ZodEnum; description: z.ZodOptional; }, z.core.$strip>>>; placementZones: z.ZodOptional>; layer: z.ZodEnum; zoneType: z.ZodEnum; name: z.ZodString; allowedRefs: z.ZodOptional>; description: z.ZodOptional; }, z.core.$strip>>>; mountingHoles: z.ZodOptional>; plated: z.ZodDefault; }, z.core.$strip>>>; fiducials: z.ZodOptional; top: z.ZodBoolean; bottom: z.ZodOptional; }, z.core.$strip>>>; testPads: z.ZodOptional; label: z.ZodOptional; }, z.core.$strip>>>; }, z.core.$strip>>; manufacturing: z.ZodDefault; process: z.ZodOptional>; timelineWeeks: z.ZodOptional; notes: z.ZodOptional; }, z.core.$strip>>; referenceDesign: z.ZodOptional; usbRole: z.ZodDefault>; isolation: z.ZodDefault>; inputVoltage: z.ZodDefault; inputCurrentAmps: z.ZodDefault; rs485BusVoltage: z.ZodDefault; terminationOhms: z.ZodDefault; biasResistorOhms: z.ZodDefault; usbDataRateMbps: z.ZodDefault; isolationClearanceMm: z.ZodDefault; notes: z.ZodDefault>; }, z.core.$strip>>; }, z.core.$strict>; export type CircuitIR = z.infer; /** * Parse and validate an unknown input as a CircuitIR. * * Returns the validated CircuitIR on success. * Throws `CircuitError` with structured errors on failure. */ export declare function validateCircuitIR(input: unknown): CircuitIR; /** * Type guard: check whether an unknown value is a valid CircuitIR. */ export declare function isCircuitIR(value: unknown): value is CircuitIR;