/** * Timestamp computation for CTRK record headers. * * Implements GetTimeData and GetTimeDataEx algorithms from the native * library, including incremental timestamp computation and millis wrapping. */ /** * Convert 10-byte timestamp structure to Unix epoch milliseconds. * * Matches the native GetTimeData function behavior. Parses calendar * fields from the timestamp bytes and converts to epoch time. * * @param tsBytes - 10-byte timestamp from record header * Format: [millis(2LE)][sec][min][hour][wday][day][month][year(2LE)] * @returns Unix timestamp in milliseconds (UTC) */ export declare function getTimeData(tsBytes: Uint8Array): number; /** * State for incremental timestamp computation. */ export interface TimestampState { prevTsBytes: Uint8Array | null; prevEpochMs: number; } /** * Create initial timestamp state. * * @returns Empty timestamp state for first record */ export declare function createTimestampState(): TimestampState; /** * Compute timestamp with incremental optimization (GetTimeDataEx algorithm). * * This function implements the native library's GetTimeDataEx optimization: * - For the first record, compute full timestamp * - For identical timestamps (all 10 bytes), reuse previous value * - For same second (bytes 2-9 identical), update only millis incrementally * - For different second, recompute full timestamp * * @param tsBytes - 10-byte timestamp from current record header * @param state - Mutable state object to track previous timestamp * @returns Unix timestamp in milliseconds (UTC) */ export declare function getTimeDataEx(tsBytes: Uint8Array, state: TimestampState): number; /** * Compare two 10-byte timestamp arrays for equality. * * @param a - First timestamp * @param b - Second timestamp * @returns True if all 10 bytes are identical */ export declare function timestampsEqual(a: Uint8Array, b: Uint8Array): boolean; //# sourceMappingURL=timestamp.d.ts.map