using System;
using System.Threading.Tasks;
namespace Darnton.Blazor.DeviceInterop.Geolocation
{
///
/// A wrapper around the device's Geolocation API services.
/// .
///
public interface IGeolocationService
{
///
/// A wrapper around the function,
/// used to get the current position of the device.
///
/// used to modify the request.
/// The result of the geolocation request.
Task GetCurrentPosition(PositionOptions options = null);
///
/// A wrapper around the function,
/// used to listen for position changes. If the service is listening, a event is fired
/// each time the device's position changes.
///
/// used to modify the request.
/// A watch ID that refers to the handler. The ID can be used to unregister the handler with .
Task WatchPosition(PositionOptions options = null);
///
/// Handles the receipt of new positions. Fired whenever a handler is registered and the device's position changes.
/// Invoked with the sender and the .
///
event EventHandler WatchPositionReceived;
///
/// A wrapper around the function,
/// used to unregister a handler created with .
///
/// The ID of the registered watch handler.
/// A task that represents the async clear operation.
Task ClearWatch(long watchId);
}
}