/** * Temporal model (doc 07): state of a moving object at time T, and trails over a window. * Pure functions over Track data — no data access, no rendering. */ import type { Position, Track, TrackPoint, ValidationResult } from '../core/types.js'; export declare const toMs: (iso: string) => number; export declare const toIso: (ms: number) => string; /** Validates untrusted track data; points must have valid timestamps and positions. Never throws. */ export declare function validateTrack(value: unknown): ValidationResult; /** Sorted by time, duplicates (same timestamp) collapsed to the last one. */ export declare function normalizeTrack(track: Track): Track; /** Bearing in degrees clockwise from north, from `a` to `b`. */ export declare function bearing(a: Position, b: Position): number; export interface StateAt { position: Position; heading?: number; /** m/s, from the data or derived from neighbouring points. */ speed?: number; /** True after the last observation: the last known position is held (a parked object stays where it was). */ held?: boolean; } /** * Where the object was at `ms`: linear interpolation between the surrounding points. After the last observation * the last known position is held (`held: true`). Null before the first observation: it was not there yet. */ export declare function stateAt(track: Track, ms: number): StateAt | null; /** * Positions between `fromMs` and `toMs` (inclusive), with interpolated end points so a trail ends exactly * where the object is at `toMs`. Empty when the object has no observations in or around the window. */ export declare function trailBetween(track: Track, fromMs: number, toMsValue: number): Position[]; /** Appends a newer point (live trail growth) and drops points older than `keepFromMs`. Older points are ignored. */ export declare function appendPoint(track: Track, point: TrackPoint, keepFromMs: number): Track;