UNPKG

@rflafla/motec-ld-reader

Version:

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

60 lines (59 loc) 1.48 kB
import { LdHead } from './ldHead.js'; import { LdChan } from './ldChan.js'; /** * Container for parsed data of an ld file. * * Allows reading and accessing channel data. */ export declare class LdData { head: LdHead; channels: LdChan[]; constructor(head: LdHead, channels: LdChan[]); /** * Parse data from an ld file */ static fromFile(filePath: string): LdData; /** * Parse data from an ld file */ static fromBuffer(buffer: Buffer): LdData; /** * Get a channel by name or index */ getChannel(nameOrIndex: string | number): LdChan; /** * Get all channel names */ getChannelNames(): string[]; /** * Get number of channels */ get channelCount(): number; /** * Convert to a simple object structure * Useful for JSON serialization or data export */ toObject(): { metadata: { driver: string; vehicleId: string; venue: string; datetime: string; shortComment: string; event?: string; session?: string; }; channels: { name: string; shortName: string; unit: string; freq: number; data: number[] | bigint[]; }[]; }; /** * Get channel data as a map of channel names to data arrays */ toDataMap(): Record<string, number[] | bigint[]>; toString(): string; }