@stimulus-library/mixins
Version:
A library of useful controllers for Stimulus
19 lines (18 loc) • 675 B
TypeScript
import { Controller } from "@hotwired/stimulus";
export interface GeolocationOptions extends Partial<PositionOptions> {
}
export interface GeolocationData {
locatedAt: number | null;
error: GeolocationPositionError | null;
coords: {
accuracy: number;
latitude: number;
longitude: number;
altitude: number | null;
altitudeAccuracy: number | null;
heading: number | null;
speed: number | null;
};
teardown: () => void;
}
export declare function useGeolocation(controller: Controller, options?: GeolocationOptions, update?: (...args: any[]) => void, error?: (...args: any[]) => void): GeolocationData;