/** * Net validation — error codes, structured issues, and factories. * * Follows the same pattern as `CircuitError` / `CatalogError`: * a const-object error code enum, a structured issue interface, and * factory helpers. * * @module */ export declare const NetValidationCode: { /** Net has zero node connections (floating). */ readonly NetFloating: "NET_FLOATING"; /** Two or more nets share the same name. */ readonly NetDuplicateName: "NET_DUPLICATE_NAME"; /** Two different nets connect to the same device pin. */ readonly NetAccidentalShort: "NET_ACCIDENTAL_SHORT"; /** No net with type=Power exists. */ readonly NetMissingPower: "NET_MISSING_POWER"; /** No net with type=Ground exists. */ readonly NetMissingGround: "NET_MISSING_GROUND"; /** A hierarchical port (Interface) has no matching net. */ readonly NetMissingHierarchicalPort: "NET_MISSING_HIERARCHICAL_PORT"; /** A required device pin has no net connection. */ readonly NetUnconnectedRequiredPin: "NET_UNCONNECTED_REQUIRED_PIN"; /** Cross-sheet interface pin references don't match. */ readonly NetInconsistentCrossSheet: "NET_INCONSISTENT_CROSS_SHEET"; /** Net name violates analog/digital rail naming conventions. */ readonly NetNamingConvention: "NET_NAMING_CONVENTION"; /** Net associated with AC/high-voltage lacks protective naming. */ readonly NetProtectedDomain: "NET_PROTECTED_DOMAIN"; /** Multiple actively-driven outputs or power sources are tied together. */ readonly NetOutputContention: "NET_OUTPUT_CONTENTION"; /** A signal net has inputs but no driver, pull, or passive source. */ readonly NetFloatingInput: "NET_FLOATING_INPUT"; /** A power rail has conflicting power sources/regulators. */ readonly NetPowerConflict: "NET_POWER_CONFLICT"; /** A signal net only connects passive pins and cannot be driven. */ readonly NetPassiveOnly: "NET_PASSIVE_ONLY"; /** A required power/ground pin is missing or connected to the wrong class of net. */ readonly NetUnpoweredDevice: "NET_UNPOWERED_DEVICE"; /** A device marked as requiring decoupling has no local capacitor across rail and ground. */ readonly NetMissingDecoupling: "NET_MISSING_DECOUPLING"; /** A pin expected voltage is incompatible with the connected net voltage. */ readonly NetVoltageMismatch: "NET_VOLTAGE_MISMATCH"; /** Validation could not be completed due to an internal error. */ readonly NetValidationInternal: "NET_VALIDATION_INTERNAL"; }; export type NetValidationCode = (typeof NetValidationCode)[keyof typeof NetValidationCode]; /** * A single net validation issue (error or warning). * * Mirrors `CircuitValidationError`'s shape but adds fields specific * to net/wire semantics: component ref, pin, net name, severity, and * a human-readable remediation hint. */ export interface NetValidationIssue { /** Machine-readable error code (e.g. "NET_FLOATING"). */ code: NetValidationCode; /** Human-readable description of what is wrong. */ message: string; /** Dot-notation path to the offending field (e.g. "nets[2]"). */ path?: string; /** Whether this issue blocks validation (error) or is advisory (warning). */ severity: 'error' | 'warning'; /** Name of the offending net, if applicable. */ netName?: string; /** Reference designator of the offending component, if applicable. */ componentRef?: string; /** Pin number or name on the component, if applicable. */ pin?: string; /** Actionable hint for the user on how to fix this issue. */ remediationHint: string; /** Additional machine-readable context. */ details?: Record; } export interface NetValidationResult { /** True when there are zero errors (warnings are allowed). */ valid: boolean; /** Issues that block validation (catalog / circuit is invalid). */ errors: NetValidationIssue[]; /** Issues that are advisory (catalog / circuit is valid but should be reviewed). */ warnings: NetValidationIssue[]; } /** * Create a single net validation issue. */ export declare function netValidationIssue(code: NetValidationCode, message: string, opts?: { severity?: 'error' | 'warning'; path?: string; netName?: string; componentRef?: string; pin?: string; remediationHint?: string; details?: Record; }): NetValidationIssue; /** * Convenience: create an error-severity issue. */ export declare function netError(code: NetValidationCode, message: string, opts?: Omit[2], 'severity'>): NetValidationIssue; /** * Convenience: create a warning-severity issue. */ export declare function netWarning(code: NetValidationCode, message: string, opts?: Omit[2], 'severity'>): NetValidationIssue;