/** * Geo-Location Handler * * P1 - Mock geolocation for testing * * Supports: * - Set custom geolocation * - Common city presets * - Geolocation permission handling * - Coordinate precision control * * @see https://playwright.dev/docs/emulation */ export interface GeoCoordinates { /** Latitude (-90 to 90) */ latitude: number; /** Longitude (-180 to 180) */ longitude: number; /** Accuracy in meters (optional) */ accuracy?: number; /** Altitude in meters (optional) */ altitude?: number; /** Altitude accuracy in meters (optional) */ altitudeAccuracy?: number; /** Heading in degrees (0-360, optional) */ heading?: number; /** Speed in m/s (optional) */ speed?: number; } export interface GeoLocationConfig { /** Default coordinates */ coordinates?: GeoCoordinates; /** Auto-grant permissions */ grantPermissions?: boolean; } /** * Common city presets for testing */ export declare const CITIES: Record; /** * Geo-Location Handler class */ export declare class GeoLocationHandler { private currentLocation?; private grantPermissions; constructor(config?: GeoLocationConfig); /** * Set geolocation for a context/browser */ setGeolocation(context: any, coordinates: GeoCoordinates): Promise; /** * Set geolocation by city preset */ setGeolocationByCity(context: any, city: string): Promise; /** * Get current geolocation */ getCurrentLocation(): GeoCoordinates | undefined; /** * Grant geolocation permission for a context */ grantGeolocationPermission(context: any): Promise; /** * Setup geolocation for a page (includes permission grant) */ setup(context: any, coordinates?: GeoCoordinates): Promise; /** * Get geolocation from a page (what the page sees) */ getPageGeolocation(page: any): Promise; /** * Watch geolocation changes on a page */ watchGeolocation(page: any, callback: (pos: GeoCoordinates | null) => void): Promise; /** * Set approximate location (reduced precision for privacy testing) */ setApproximateLocation(context: any, coordinates: GeoCoordinates, precision?: number): Promise; /** * Simulate movement along a path */ simulateMovement(context: any, from: GeoCoordinates, to: GeoCoordinates, steps?: number, intervalMs?: number): Promise; /** * Animate movement through coordinates */ animateMovement(context: any, coordinates: GeoCoordinates[], intervalMs?: number): Promise; /** * Validate coordinates */ private validateCoordinates; /** * Get distance between two coordinates (in meters) */ getDistance(from: GeoCoordinates, to: GeoCoordinates): number; /** * Get list of available cities */ getAvailableCities(): string[]; /** * Get coordinates for a city */ getCityCoordinates(city: string): GeoCoordinates | undefined; } /** * Type alias for geolocation coordinates */ export type GeCoordinates = GeoCoordinates; /** * Factory function to create Geo-Location Handler */ export declare function createGeoLocationHandler(config?: GeoLocationConfig): GeoLocationHandler; export default GeoLocationHandler;