/** * Reactive geolocation. * * Provides a reactive signal tracking the device's geographic position * via the Geolocation API. * * @module bquery/media */ import type { GeolocationOptions, GeolocationSignal } from './types'; /** * Returns a reactive signal tracking the device's geographic position. * * Uses the Geolocation API (`navigator.geolocation`) where available. * Can operate in one-shot mode (default) or continuous watch mode. * * @param options - Configuration for the geolocation request * @returns A readonly reactive signal with position data and loading/error state, * plus a `destroy()` method to stop an active watcher * * @example * ```ts * import { useGeolocation } from '@bquery/bquery/media'; * import { effect } from '@bquery/bquery/reactive'; * * // One-shot position * const geo = useGeolocation(); * effect(() => { * if (geo.value.loading) return console.log('Getting position...'); * if (geo.value.error) return console.error(geo.value.error); * console.log(`Lat: ${geo.value.latitude}, Lng: ${geo.value.longitude}`); * }); * * // Continuous watch with high accuracy * const geoWatch = useGeolocation({ watch: true, enableHighAccuracy: true }); * ``` */ export declare const useGeolocation: (options?: GeolocationOptions) => GeolocationSignal; //# sourceMappingURL=geolocation.d.ts.map