UNPKG

@rflafla/motec-ld-reader

Version:

A Node.js library for reading MoTeC .ld telemetry files

35 lines (34 loc) 1.06 kB
/** * Decode a null-terminated ASCII string from a buffer */ export declare function decodeString(buffer: Buffer): string; /** * Helper class for reading binary data from a buffer with position tracking */ export declare class BinaryReader { private buffer; private position; constructor(buffer: Buffer, initialPosition?: number); seek(position: number): void; tell(): number; readUInt32LE(): number; readUInt16LE(): number; readInt16LE(): number; readInt32LE(): number; readBytes(length: number): Buffer; skip(bytes: number): void; /** * Read an array of numeric data with a specific data type */ readNumericArray(dataPtr: number, count: number, dtype: 'int16' | 'int32' | 'float32' | 'float16' | 'gps' | 'timestamp'): number[]; /** * Read a 16-bit float (half-precision) * Based on IEEE 754 half-precision format */ private readFloat16; getBuffer(): Buffer; } /** * Read entire file into a buffer */ export declare function readFileBuffer(filePath: string): Buffer;