UNPKG

fleeta-api-lib

Version:

A comprehensive library for fleet management applications - API, Auth, Device management

64 lines 2.38 kB
/** * GPS Data Optimization Utilities * Provides functions for optimizing GPS data updates and reducing unnecessary processing */ import type { DeviceGpsInfo } from '../../gps-websocket/types'; import type { DataProcessingResult } from '../types'; /** * Check if device has significant changes that warrant an update * @param previous - Previous device state * @param current - Current device state * @param thresholds - Change detection thresholds * @returns True if changes are significant enough to update */ export declare function hasSignificantChange(previous: DeviceGpsInfo, current: DeviceGpsInfo, thresholds: { position: number; speed: number; }): boolean; /** * Process GPS data updates and determine what needs to be updated * @param previousDevices - Previous device data * @param currentDevices - Current device data * @param thresholds - Update thresholds * @returns Processing result with categorized changes */ export declare function processGpsDataUpdates(previousDevices: DeviceGpsInfo[], currentDevices: DeviceGpsInfo[], thresholds: { position: number; speed: number; }): DataProcessingResult; /** * Optimize device data for map rendering * Reduces data density while preserving important information * @param devices - Device data to optimize * @param config - Optimization configuration * @returns Optimized device data */ export declare function optimizeForMapRendering(devices: DeviceGpsInfo[], config?: { maxDevices?: number; prioritizeActive?: boolean; prioritizeVideo?: boolean; spatialClustering?: boolean; clusterDistance?: number; }): DeviceGpsInfo[]; /** * Calculate data processing performance metrics * @param startTime - Processing start time * @param result - Processing result * @returns Performance metrics */ export declare function calculateProcessingMetrics(startTime: number, result: DataProcessingResult): { processingTime: number; optimizationRatio: number; throughput: number; }; /** * Batch process multiple device updates * @param updates - Array of device update batches * @param thresholds - Processing thresholds * @returns Consolidated processing result */ export declare function batchProcessUpdates(updates: DeviceGpsInfo[][], thresholds: { position: number; speed: number; }): DataProcessingResult; //# sourceMappingURL=dataOptimization.d.ts.map