-
Notifications
You must be signed in to change notification settings - Fork 9
/
nativescript-ibeacon.common.d.ts
49 lines (49 loc) · 1.72 KB
/
nativescript-ibeacon.common.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { Observable } from 'data/observable';
export interface BeaconCallback {
onBeaconManagerReady(): void;
didRangeBeaconsInRegion(region: BeaconRegion, beacons: Beacon[]): void;
didFailRangingBeaconsInRegion(region: BeaconRegion, errorCode: number, errorDescription: string): void;
didEnterRegion?(region: BeaconRegion): void;
didExitRegion?(region: BeaconRegion): void;
}
export declare enum BeaconLocationOptionsIOSAuthType {
Always = 0,
WhenInUse = 1,
}
export declare enum BeaconLocationOptionsAndroidAuthType {
Coarse = 0,
Fine = 1,
}
export interface BeaconLocationOptions {
iOSAuthorisationType: BeaconLocationOptionsIOSAuthType;
androidAuthorisationType: BeaconLocationOptionsAndroidAuthType;
androidAuthorisationDescription: string;
}
export declare class Common extends Observable {
protected options: BeaconLocationOptions;
constructor(beaconCallback: BeaconCallback, options?: BeaconLocationOptions);
requestAuthorization(): Promise<any>;
isAuthorised(): boolean;
bind(): void;
unbind(): void;
startRanging(beaconRegion: BeaconRegion): void;
stopRanging(beaconRegion: BeaconRegion): void;
startMonitoring(beaconRegion: BeaconRegion): void;
stopMonitoring(beaconRegion: BeaconRegion): void;
}
export declare class BeaconRegion {
identifier: string;
proximityUUID: string;
major?: number;
minor?: number;
constructor(identifier: string, proximityUUID: string, major?: number, minor?: number);
}
export declare class Beacon {
proximityUUID: string;
major: number;
minor: number;
distance_proximity: number;
rssi: number;
txPower_accuracy: number;
constructor(proximityUUID: string, major: number, minor: number);
}