@dderevjanik/termux-api
Version:
This library allows you to interact with your Android device from Node.js using termux-api
66 lines (65 loc) • 1.36 kB
TypeScript
export interface Location {
/**
* Latitude of the location
* @default 37.19334072
*/
latitude: number;
/**
* Longitude of the location
* @default 21.176107897
*/
longitude: number;
/**
* Altitude of the location
* @default 639.22107621775
*/
altitude: number;
/**
* Accuracy of the location
* @default 53.24557489035055
*/
accuracy: number;
/**
* Vertical accuracy of the location
* @default 44.45618533322194
*/
vertical_accuracy: number;
/**
* Bearing of the location
* @default 0.0
*/
bearing: number;
/**
* Speed of the location
* @default 0.0
*/
speed: number;
/**
* Elapsed time in milliseconds
* @default 38
*/
elapsedMs: number;
/**
* Provider of the location
* @default "gps"
*/
provider: "gps" | "network" | "passive";
}
export interface LocationOptions {
/**
* Location provider
* @default "gps"
*/
provider?: "gps" | "network" | "passive";
/**
* Kind of request to make
* @default "once"
*/
request?: "once" | "last" | "updates";
}
/**
* Get the device location
*
* **Requires permission** `ACCESS_FINE_LOCATION`
*/
export declare function location(options?: LocationOptions): Promise<Location>;