@mt-kit/utils
Version:
12 lines (11 loc) • 372 B
TypeScript
import { ILocation } from "./types";
/**
* 📍 位置信息 (Geolocation)
*
* @returns 返回一个 Promise 对象,resolve 后的值是 ILocation
*
* 如果浏览器不支持 geolocation,则返回 { latitude: 0, longitude: 0 }
*
* 如果获取失败,则返回 { latitude: -1, longitude: -1 }
*/
export default function deviceLocation(): Promise<ILocation>;