mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Set "external ambient module declaration" for "location".
This commit is contained in:
@@ -7,8 +7,7 @@
|
|||||||
// </snippet>
|
// </snippet>
|
||||||
|
|
||||||
import TKUnit = require("Tests/TKUnit");
|
import TKUnit = require("Tests/TKUnit");
|
||||||
import locationModule = require("location/location");
|
import locationModule = require("location");
|
||||||
import types = require("location/location-types");
|
|
||||||
|
|
||||||
var LocationManager = locationModule.LocationManager;
|
var LocationManager = locationModule.LocationManager;
|
||||||
var Location = locationModule.Location;
|
var Location = locationModule.Location;
|
||||||
|
|||||||
15
location/location.d.ts
vendored
15
location/location.d.ts
vendored
@@ -1,20 +1,22 @@
|
|||||||
import promises = require("promises");
|
|
||||||
|
declare module "location" {
|
||||||
|
import promises = require("promises");
|
||||||
|
|
||||||
export declare enum Accuracy {
|
enum Accuracy {
|
||||||
// in meters
|
// in meters
|
||||||
ANY,
|
ANY,
|
||||||
HIGH,
|
HIGH,
|
||||||
}
|
}
|
||||||
|
|
||||||
// For future usage
|
// For future usage
|
||||||
//export declare class LocationRegion {
|
//class LocationRegion {
|
||||||
// public latitude: number;
|
// public latitude: number;
|
||||||
// public longitude: number;
|
// public longitude: number;
|
||||||
|
|
||||||
// public raduis: number; // radius in meters
|
// public raduis: number; // radius in meters
|
||||||
//}
|
//}
|
||||||
|
|
||||||
export declare class Location {
|
class Location {
|
||||||
latitude: number;
|
latitude: number;
|
||||||
longitude: number;
|
longitude: number;
|
||||||
|
|
||||||
@@ -60,7 +62,7 @@ export interface Options {
|
|||||||
timeout?: number;
|
timeout?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export declare class LocationManager {
|
class LocationManager {
|
||||||
/**
|
/**
|
||||||
* Report are location services switched ON for this device (on Android) or application (iOS)
|
* Report are location services switched ON for this device (on Android) or application (iOS)
|
||||||
*/
|
*/
|
||||||
@@ -116,4 +118,5 @@ export declare class LocationManager {
|
|||||||
* If you specify timeout = 0 it just requests the last known location. However if you specify maximumAge and the
|
* If you specify timeout = 0 it just requests the last known location. However if you specify maximumAge and the
|
||||||
* location received is older it won't be received
|
* location received is older it won't be received
|
||||||
*/
|
*/
|
||||||
export declare var getLocation: (options?: Options) => promises.Promise<Location>;
|
var getLocation: (options?: Options) => promises.Promise<Location>;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user