"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.webGeolocation = webGeolocation;
const APINotImplementedError_1 = require("../../../../exception/APINotImplementedError");
function webGeolocation(window, opt) {
    const { navigator } = window;
    const getCurrentPosition = async () => {
        if (!navigator ||
            !navigator.geolocation ||
            !navigator.geolocation.getCurrentPosition) {
            throw new APINotImplementedError_1.APINotSupportedError('Geolocation');
        }
        return new Promise((resolve, reject) => {
            navigator.geolocation.getCurrentPosition((position) => {
                resolve(position.coords);
            });
        });
    };
    const geolocation = {
        getCurrentPosition,
    };
    return geolocation;
}
//# sourceMappingURL=geolocation.js.map