Skip to content

Commit

Permalink
typings
Browse files Browse the repository at this point in the history
  • Loading branch information
tsubik committed May 14, 2016
1 parent cae7ae8 commit 7c86ff8
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
"version": ">=5.0.0"
}
],
"typings": "./typings/cordova-plugin-geofence.d.ts",
"devDependencies": {
"cordova": "^6.1.1",
"cordova-paramedic": "https://github.com/apache/cordova-paramedic"
Expand Down
61 changes: 61 additions & 0 deletions typings/cordova-plugin-geofence.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
interface TransitionType {
ENTER: number;
EXIT: number;
BOTH: number;
}

interface Window {
geofence: GeofencePlugin;
TransitionType: TransitionType;
}

interface GeofencePlugin {
initialize(
successCallback?: (result: any) => void,
errorCallback?: (error: string) => void
): Promise<any>;

addOrUpdate(
geofence: Geofence | Geofence[],
successCallback?: (result: any) => void,
errorCallback?: (error: string) => void
): Promise<any>;

remove(
id: number | number[],
successCallback?: (result: any) => void,
errorCallback?: (error: string) => void
): Promise<any>;

removeAll(
successCallback?: (result: any) => void,
errorCallback?: (error: string) => void
): Promise<any>;

getWatched(
successCallback?: (result: any) => void,
errorCallback?: (error: string) => void
): Promise<string>;

onTransitionReceived: (geofences: Geofence[]) => void;
}

interface Geofence {
id: string;
latitude: number;
longitude: number;
radius: number;
transitionType: number;
notification?: Notification;
}

interface Notification {
id?: number;
title?: string;
text: string;
smallIcon?: string;
icon?: string;
openAppOnClick?: boolean;
vibration?: number[];
data?: Object;
}

0 comments on commit 7c86ff8

Please sign in to comment.