/** A parsed Intel HEX record. */ export interface IHexRecord { /** Byte count of the data field. */ byteCount: number; /** 16-bit address from the record. For data records this is the low 16 bits * of the destination address (combined with any active extended-linear-address * or extended-segment-address offset to form the full address). */ address: number; /** Record type. See {@link IHexRecordType}. */ type: number; /** Data bytes. Length === byteCount. */ data: Buffer; } /** Standard Intel HEX record types. */ export declare const IHexRecordType: { readonly Data: 0; readonly EndOfFile: 1; readonly ExtendedSegmentAddress: 2; readonly StartSegmentAddress: 3; readonly ExtendedLinearAddress: 4; readonly StartLinearAddress: 5; }; export type IHexRecordType = (typeof IHexRecordType)[keyof typeof IHexRecordType]; export declare class IHexParseError extends Error { readonly lineNumber: number; readonly line: string; constructor(message: string, lineNumber: number, line: string); } /** Parse an Intel HEX file into an array of records. */ export declare function parseFile(filename: string): Promise; /** Parse Intel HEX content (string or Buffer) into an array of records. * Empty/whitespace-only lines are skipped. */ export declare function parseString(content: string | Buffer): IHexRecord[]; /** Parse a single Intel HEX line. The line must already be trimmed and non-empty. */ export declare function parseLine(line: string, lineNumber?: number): IHexRecord; export interface LoadIntoBufferOptions { /** If true, stop at the End-Of-File record (default true). If false, continue * processing records past EOF (non-standard, but matches some legacy parsers). */ stopAtEOF?: boolean; /** If true (default), throw if a data record's destination address would * fall outside the buffer. If false, those bytes are silently skipped. */ strictBounds?: boolean; } /** Apply parsed Intel HEX records to a Buffer, honoring extended-address records. * Returns the highest byte index actually written (exclusive), or 0 if nothing was written. */ export declare function applyRecordsToBuffer(records: IHexRecord[], buffer: Buffer, opts?: LoadIntoBufferOptions): number; /** Convenience: parse an Intel HEX file and apply it directly to a Buffer. * Returns the highest byte index written. */ export declare function loadFileIntoBuffer(filename: string, buffer: Buffer, opts?: LoadIntoBufferOptions): Promise; //# sourceMappingURL=ihex.d.ts.map