import { Snapshot, Voyage } from './contract'; import { PortEntry, VoyageOptions } from './config'; export type VoyageRow = Pick; export declare function isMovingState(s: string | null): boolean; export declare function isStationaryState(s: string | null): boolean; export interface VoyageMetrics { distance_nm: number; hours_underway: number; avg_sog_kn: number | null; max_sog_kn: number | null; fuel_used_l: number | null; end_lat: number | null; end_lon: number | null; } export declare function integrateMetrics(snaps: VoyageRow[], fuelRatePaths?: readonly string[]): VoyageMetrics; export declare class VoyageStateMachine { private opts; open: boolean; private movingStreakMs; private stationaryStreakMs; private lastTs; constructor(opts: VoyageOptions, open: boolean); feed(row: VoyageRow): { type: 'open'; startTs: number; } | { type: 'close'; } | null; } export declare function mergeContiguousVoyages(voyages: Voyage[], opts: VoyageOptions, reintegrate: (v: Voyage) => Promise, manual?: ReadonlySet): Promise; export interface ReconcileState { voyages: Voyage[]; nextId: number; } export declare function reconcile(state: ReconcileState, rows: VoyageRow[], opts: VoyageOptions, ports: PortEntry[], readRange: (fromTs: number, toTs: number) => Promise, now?: number, fuelRatePaths?: readonly string[], manual?: ReadonlySet): Promise; export declare function applyMetrics(v: Voyage, readRange: (fromTs: number, toTs: number) => Promise, now?: number, fuelRatePaths?: readonly string[]): Promise; export declare function nearestPort(lat: number | null, lon: number | null, ports: PortEntry[]): string | null;