/** * Canonical lap point extraction — produces the per-sample telemetry series * (byDist / byTime) that the UI charts and the backend lap_bundles store. * * Output shape matches the deployed IbtLapPoint contract exactly * (UI/src/lib/ibt-extract.ts and BACKEND process-job convertToIbtLapData): * - Speed m/s → km/h, Throttle/Brake 0–1 → 0–100 %, SteeringWheelAngle rad → deg * - distanceKm normalized per lap: (LapDist − min LapDist) / 1000 * - timeSec normalized per lap: SessionTime − min SessionTime * - tire temps LFtempM.. with LFtempCM.. carcass fallback (process-job behavior) * * CANONICAL DECISION — tire wear is percent 0–100 (×100 from the raw 0–1 * channel), matching process-job and therefore every stored lap bundle. The * UI's ibt-extract.ts left wear at raw 0–1; that was the divergent one. * * RFC-0001 C8: extraction runs at FULL resolution; downsampling to maxPoints * happens last and is presentation-only — never an input to metrics. * * RUNTIME NEUTRALITY: this module must not import Bun/Deno/Node APIs. */ import type { IbtSource, NormalizedLap } from './normalize'; /** Matches the UI/backend IbtLapPoint contract field-for-field. */ export interface LapPoint { distanceKm: number; timeSec: number; speedKmh: number | null; throttlePct: number | null; brakePct: number | null; brakeABSactive: boolean | null; gear: number | null; rpm: number | null; steeringDeg: number | null; lat: number | null; lon: number | null; altitudeM: number | null; /** Lateral acceleration in m/s² (iRacing LatAccel). Added in 1.4.0. */ latAccelMs2: number | null; /** Longitudinal acceleration in m/s² (iRacing LongAccel). Added in 1.4.0. */ longAccelMs2: number | null; /** Yaw rate in deg/s (iRacing YawRate rad/s → deg/s). Added in 1.4.0. */ yawRateDegS: number | null; tireTempLF: number | null; tireTempRF: number | null; tireTempLR: number | null; tireTempRR: number | null; tirePressureLF: number | null; tirePressureRF: number | null; tirePressureLR: number | null; tirePressureRR: number | null; tireWearLF: number | null; tireWearRF: number | null; tireWearLR: number | null; tireWearRR: number | null; } export interface ExtractLapPointsResult { /** Points sorted ascending by distanceKm (downsampled). */ byDist: LapPoint[]; /** Points sorted ascending by timeSec (downsampled). */ byTime: LapPoint[]; /** Number of valid full-resolution points before downsampling. */ downsampledFrom: number; } export interface ExtractLapPointsOptions { /** Maximum points per series after downsampling. Default 500. */ maxPoints?: number; } /** * Extract the telemetry point series for one normalized lap. * * Iterates lap.firstSampleIndex..lastSampleIndex; when the Lap / SessionNum * channels are available, only indices whose Lap equals lap.lapNumber (and * whose SessionNum matches the lap's own session, read at firstSampleIndex) * are honored. Without those channels the whole contiguous range is accepted. */ export declare function extractLapPoints(source: IbtSource, lap: NormalizedLap, opts?: ExtractLapPointsOptions): ExtractLapPointsResult; //# sourceMappingURL=lap-points.d.ts.map