/**
 * Location Service Module
 *
 * Provides geographic location context and utilities.
 */
import { EventEmitter } from 'events';
export interface GeoCoordinates {
    /** Latitude in degrees */
    latitude: number;
    /** Longitude in degrees */
    longitude: number;
    /** Altitude in meters (if available) */
    altitude?: number;
    /** Accuracy in meters */
    accuracy?: number;
    /** Altitude accuracy in meters */
    altitudeAccuracy?: number;
    /** Heading in degrees (0-360) */
    heading?: number;
    /** Speed in m/s */
    speed?: number;
}
export interface GeoLocation extends GeoCoordinates {
    /** Timestamp of the location */
    timestamp: Date;
    /** Source of the location data */
    source: LocationSource;
    /** Location name (if resolved) */
    name?: string;
    /** Address components */
    address?: AddressComponents;
    /** Timezone */
    timezone?: TimezoneInfo;
}
export type LocationSource = 'gps' | 'network' | 'ip' | 'manual' | 'cached' | 'mock';
export interface AddressComponents {
    /** Street number */
    streetNumber?: string;
    /** Street name */
    street?: string;
    /** City */
    city?: string;
    /** State/Province */
    state?: string;
    /** Country */
    country?: string;
    /** Country code (ISO 3166-1) */
    countryCode?: string;
    /** Postal/ZIP code */
    postalCode?: string;
    /** Formatted address */
    formatted?: string;
}
export interface TimezoneInfo {
    /** Timezone ID (e.g., 'America/New_York') */
    id: string;
    /** Timezone abbreviation (e.g., 'EST') */
    abbreviation: string;
    /** UTC offset in minutes */
    offsetMinutes: number;
    /** Current DST status */
    isDST: boolean;
}
export interface LocationConfig {
    /** Enable location services */
    enabled: boolean;
    /** Default source preference */
    preferredSource: LocationSource;
    /** Enable caching */
    cacheEnabled: boolean;
    /** Cache TTL in milliseconds */
    cacheTTLMs: number;
    /** Auto-update interval (ms), 0 to disable */
    autoUpdateIntervalMs: number;
    /** Enable reverse geocoding */
    reverseGeocode: boolean;
    /** IP geolocation API URL */
    ipGeoApiUrl?: string;
    /** Default location (fallback) */
    defaultLocation?: GeoCoordinates;
}
export declare const DEFAULT_LOCATION_CONFIG: LocationConfig;
export interface LocationEvents {
    'location-update': (location: GeoLocation) => void;
    'location-error': (error: Error) => void;
    'source-change': (source: LocationSource) => void;
}
/**
 * Calculate distance between two points (Haversine formula)
 * @returns Distance in meters
 */
export declare function calculateDistance(point1: GeoCoordinates, point2: GeoCoordinates): number;
/**
 * Calculate bearing between two points
 * @returns Bearing in degrees (0-360)
 */
export declare function calculateBearing(from: GeoCoordinates, to: GeoCoordinates): number;
/**
 * Get cardinal direction from bearing
 */
export declare function bearingToCardinal(bearing: number): string;
/**
 * Check if a point is within a radius of another point
 */
export declare function isWithinRadius(point: GeoCoordinates, center: GeoCoordinates, radiusMeters: number): boolean;
/**
 * Format coordinates as string
 */
export declare function formatCoordinates(coords: GeoCoordinates, format?: 'decimal' | 'dms'): string;
export declare class LocationService extends EventEmitter {
    private config;
    private cachedLocation;
    private cacheTimestamp;
    private autoUpdateInterval;
    private currentSource;
    private mockLocation;
    constructor(config?: Partial<LocationConfig>);
    /**
     * Get current configuration
     */
    getConfig(): LocationConfig;
    /**
     * Update configuration
     */
    updateConfig(config: Partial<LocationConfig>): void;
    /**
     * Get current location
     */
    getCurrentLocation(options?: {
        forceRefresh?: boolean;
        source?: LocationSource;
    }): Promise<GeoLocation>;
    /**
     * Get location by IP (mock implementation)
     */
    private getLocationByIP;
    /**
     * Create a GeoLocation object
     */
    private createLocation;
    /**
     * Reverse geocode coordinates to address
     */
    private reverseGeocode;
    /**
     * Get timezone for location
     */
    private getTimezone;
    /**
     * Start auto-updating location
     */
    startAutoUpdate(): void;
    /**
     * Stop auto-updating location
     */
    stopAutoUpdate(): void;
    /**
     * Get current location source
     */
    getSource(): LocationSource;
    /**
     * Set location source
     */
    setSource(source: LocationSource): void;
    /**
     * Set mock location (for testing)
     */
    setMockLocation(location: GeoLocation | null): void;
    /**
     * Create mock location from coordinates
     */
    createMockLocation(latitude: number, longitude: number, options?: Partial<GeoLocation>): GeoLocation;
    /**
     * Clear location cache
     */
    clearCache(): void;
    /**
     * Get cached location
     */
    getCachedLocation(): GeoLocation | null;
    /**
     * Get distance to a point from current location
     */
    getDistanceTo(point: GeoCoordinates): Promise<number>;
    /**
     * Get bearing to a point from current location
     */
    getBearingTo(point: GeoCoordinates): Promise<number>;
    /**
     * Check if within radius of a point
     */
    isWithinRadius(center: GeoCoordinates, radiusMeters: number): Promise<boolean>;
    /**
     * Shutdown the service
     */
    shutdown(): void;
    /**
     * Get service stats
     */
    getStats(): {
        enabled: boolean;
        source: LocationSource;
        hasCachedLocation: boolean;
        cacheAge: number;
        isAutoUpdating: boolean;
    };
}
export declare function getLocationService(config?: Partial<LocationConfig>): LocationService;
export declare function resetLocationService(): void;
