/** * Geofence evaluation (doc 15): geometry + rule + object + state transition → generic spatial events. * Pure and stateful per evaluator; no data access, no rendering, no domain events. */ import type { Geofence, GeofenceEvent, Position, SpatialObject, ValidationResult } from '../core/types.js'; export interface Reading { objectId: string; position: Position; /** ISO 8601 observation time. */ timestamp: string; layerId?: string; properties?: Record; } export declare function validateGeofence(value: unknown): ValidationResult; export declare function watches(g: Geofence, r: Reading): boolean; export declare class GeofenceEvaluator { private fences; private readonly state; constructor(geofences?: Geofence[]); /** Replaces the geofences. State is kept for unchanged ones and dropped for removed or changed ones. */ setGeofences(geofences: Geofence[]): void; geofences(): Geofence[]; /** * One reading → zero or more events. The first reading for an object sets its state silently (no "enter" * storm when a map opens). Readings older than the last one for that object are ignored. */ observe(r: Reading): GeofenceEvent[]; /** Objects currently inside each geofence (settled state). */ occupancy(): Record; reset(): void; /** Inside test with hysteresis: once inside, an object leaves only when farther than the margin outside. */ private isInside; } /** Readings from point objects (e.g. a layer's current data). */ export declare function readingsFrom(objects: SpatialObject[], layerId: string, fallbackTimestamp: string): Reading[];