@typecad/jlcpcb-parts
Version:
Intelligent fuzzy search for JLCPCB electrical components with CLI interface
37 lines • 1.22 kB
TypeScript
import { ComponentRecord } from '../types/index.js';
/**
* Handles parsing CSV files into ComponentRecord objects
*/
export declare class CsvParser {
/**
* Parses a CSV file into an array of ComponentRecord objects
* @param filePath Path to the CSV file
* @returns Promise that resolves to an array of ComponentRecord objects
* @throws ParsingError if parsing fails
*/
parseFile(filePath: string): Promise<ComponentRecord[]>;
/**
* Parses a single CSV line into an array of values
* @param line CSV line to parse
* @returns Array of values
* @private
*/
private parseCsvLine;
/**
* Validates that the CSV headers contain the required fields
* @param headers Array of header names
* @throws Error if required headers are missing
* @private
*/
private validateHeaders;
/**
* Creates a ComponentRecord from headers and values
* @param headers Array of header names
* @param values Array of values
* @returns ComponentRecord object
* @throws Error if values array doesn't match headers array
* @private
*/
private createComponentRecord;
}
//# sourceMappingURL=CsvParser.d.ts.map