import { ISourceInfo } from './pcb_interfaces.js'; import type { CodeMetadata, LegacyCodeMetadata } from '../kicad2typecad/types.js'; /** * Utility functions for PCB operations */ /** * Formats source information for property inclusion in KiCad files. * Uses the new stable base64url-encoded format (typecad:v1:...). * * @param info - Source information object * @param uuid - Component UUID (primary identity for round-trip matching) * @param footprintFingerprint - Footprint identity fingerprint (fallback for anonymous components) * @returns Encoded string safe for KiCad property values */ export declare function formatSourceInfoForProperty(info?: ISourceInfo, uuid?: string, footprintFingerprint?: string): string | undefined; /** * Decodes a Code property value back into structured metadata. * Tries new format first, falls back to legacy format. * @param rawValue - Raw Code property string from a KiCad file * @returns Decoded metadata or null */ export declare function parseSourceInfoFromProperty(rawValue: string | null | undefined): CodeMetadata | LegacyCodeMetadata | null; /** * Generates a unique UUID using crypto module * @returns Random UUID string */ export declare function generateUuid(): string; export declare function normalizeNetName(name?: string): string | undefined; /** * Formats call site information into a human-readable string for error messages. * @param callSite - Call site info from getCallSite(), or undefined * @returns Formatted string like " (called from file.ts:42)" or empty string */ export declare function formatCallSite(callSite: { file: string; line: number; column: number; function?: string; } | undefined | null): string; /** * Safely extracts an error message from an unknown caught value. * @param error - The caught value * @returns Error message string */ export declare function getErrorMessage(error: unknown): string; //# sourceMappingURL=pcb_utils.d.ts.map