export type GpsPermissionState =
  | 'idle'
  | 'requesting'
  | 'granted'
  | 'denied'
  | 'unsupported'
  | 'error';

export type GpsCoordinates = {
  latitude: number;
  longitude: number;
  accuracy: number | null;
  altitude: number | null;
  heading: number | null;
  speed: number | null;
  timestamp: number;
};

export type GpsAnchor = {
  id: string;
  name: string;
  latitude: number;
  longitude: number;
  createdAt: string;
};

export type GpsConfig = {
  notifyOnEnter: boolean;
  notifyOnExit: boolean;
  radiusMeters: number;
};

export type GpsGeofenceEventType = 'enter' | 'exit';

export type GpsGeofenceEvent = {
  id: string;
  anchorId: string;
  anchorName: string;
  type: GpsGeofenceEventType;
  distanceMeters: number;
  createdAt: string;
};

export type GpsLayerSnapshot = {
  enabled: boolean;
  supported: boolean;
  permissionState: GpsPermissionState;
  currentPosition: GpsCoordinates | null;
  anchors: GpsAnchor[];
  config: GpsConfig;
  selectedAnchorId: string | null;
  anchorPresence: Record<string, boolean>;
  events: GpsGeofenceEvent[];
  errorMessage: string | null;
};
