@situm/react-native 3.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +656 -0
- package/ReactNativeSitumPlugin.podspec +22 -0
- package/SECURITY-POLICY.md +9 -0
- package/android/.gradle/5.6.4/fileChanges/last-build.bin +0 -0
- package/android/.gradle/5.6.4/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/5.6.4/gc.properties +0 -0
- package/android/.idea/.name +1 -0
- package/android/.idea/codeStyles/Project.xml +116 -0
- package/android/.idea/encodings.xml +6 -0
- package/android/.idea/misc.xml +31 -0
- package/android/.idea/sonarlint/issuestore/index.pb +15 -0
- package/android/.project +34 -0
- package/android/build.gradle +45 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/android/gradlew +172 -0
- package/android/gradlew.bat +84 -0
- package/android/src/main/AndroidManifest.xml +6 -0
- package/android/src/main/java/com/situm/plugin/PluginHelper.java +989 -0
- package/android/src/main/java/com/situm/plugin/SitumMapper.java +1206 -0
- package/android/src/main/java/com/situm/plugin/SitumPackage.java +29 -0
- package/android/src/main/java/com/situm/plugin/SitumPlugin.java +84 -0
- package/android/src/main/java/com/situm/plugin/SitumPluginImpl.java +344 -0
- package/android/src/main/java/com/situm/plugin/utils/ReactNativeJson.java +122 -0
- package/android/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/android/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/android/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/android/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/android/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/android/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/android/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/android/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/android/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/android/src/main/res/values/strings.xml +3 -0
- package/android/src/main/res/values/styles.xml +9 -0
- package/ios/Constants.h +14 -0
- package/ios/Constants.m +14 -0
- package/ios/RNSitumReactNativePlugin.xcodeproj/project.pbxproj +272 -0
- package/ios/SitumLocationWrapper.h +112 -0
- package/ios/SitumLocationWrapper.m +1132 -0
- package/ios/SitumPlugin.h +15 -0
- package/ios/SitumPlugin.m +911 -0
- package/lib/commonjs/index.js +25 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/sdk/index.js +399 -0
- package/lib/commonjs/sdk/index.js.map +1 -0
- package/lib/commonjs/sdk/nativeInterface.js +20 -0
- package/lib/commonjs/sdk/nativeInterface.js.map +1 -0
- package/lib/commonjs/sdk/types/index.d.js +6 -0
- package/lib/commonjs/sdk/types/index.d.js.map +1 -0
- package/lib/commonjs/sdk/utils.js +22 -0
- package/lib/commonjs/sdk/utils.js.map +1 -0
- package/lib/commonjs/utils/requestPermission.js +73 -0
- package/lib/commonjs/utils/requestPermission.js.map +1 -0
- package/lib/commonjs/wayfinding/components/MapView.js +220 -0
- package/lib/commonjs/wayfinding/components/MapView.js.map +1 -0
- package/lib/commonjs/wayfinding/hooks/index.js +401 -0
- package/lib/commonjs/wayfinding/hooks/index.js.map +1 -0
- package/lib/commonjs/wayfinding/index.js +45 -0
- package/lib/commonjs/wayfinding/index.js.map +1 -0
- package/lib/commonjs/wayfinding/store/index.js +237 -0
- package/lib/commonjs/wayfinding/store/index.js.map +1 -0
- package/lib/commonjs/wayfinding/store/utils.js +44 -0
- package/lib/commonjs/wayfinding/store/utils.js.map +1 -0
- package/lib/commonjs/wayfinding/styles/colors.js +18 -0
- package/lib/commonjs/wayfinding/styles/colors.js.map +1 -0
- package/lib/commonjs/wayfinding/types/index.d.js +6 -0
- package/lib/commonjs/wayfinding/types/index.d.js.map +1 -0
- package/lib/commonjs/wayfinding/utils/index.js +11 -0
- package/lib/commonjs/wayfinding/utils/index.js.map +1 -0
- package/lib/commonjs/wayfinding/utils/mapper.js +106 -0
- package/lib/commonjs/wayfinding/utils/mapper.js.map +1 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/sdk/index.js +390 -0
- package/lib/module/sdk/index.js.map +1 -0
- package/lib/module/sdk/nativeInterface.js +18 -0
- package/lib/module/sdk/nativeInterface.js.map +1 -0
- package/lib/module/sdk/types/index.d.js +2 -0
- package/lib/module/sdk/types/index.d.js.map +1 -0
- package/lib/module/sdk/utils.js +15 -0
- package/lib/module/sdk/utils.js.map +1 -0
- package/lib/module/utils/requestPermission.js +67 -0
- package/lib/module/utils/requestPermission.js.map +1 -0
- package/lib/module/wayfinding/components/MapView.js +207 -0
- package/lib/module/wayfinding/components/MapView.js.map +1 -0
- package/lib/module/wayfinding/hooks/index.js +392 -0
- package/lib/module/wayfinding/hooks/index.js.map +1 -0
- package/lib/module/wayfinding/index.js +12 -0
- package/lib/module/wayfinding/index.js.map +1 -0
- package/lib/module/wayfinding/store/index.js +202 -0
- package/lib/module/wayfinding/store/index.js.map +1 -0
- package/lib/module/wayfinding/store/utils.js +34 -0
- package/lib/module/wayfinding/store/utils.js.map +1 -0
- package/lib/module/wayfinding/styles/colors.js +11 -0
- package/lib/module/wayfinding/styles/colors.js.map +1 -0
- package/lib/module/wayfinding/types/index.d.js +2 -0
- package/lib/module/wayfinding/types/index.d.js.map +1 -0
- package/lib/module/wayfinding/utils/index.js +4 -0
- package/lib/module/wayfinding/utils/index.js.map +1 -0
- package/lib/module/wayfinding/utils/mapper.js +100 -0
- package/lib/module/wayfinding/utils/mapper.js.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/sdk/index.d.ts +269 -0
- package/lib/typescript/src/sdk/index.d.ts.map +1 -0
- package/lib/typescript/src/sdk/nativeInterface.d.ts +2 -0
- package/lib/typescript/src/sdk/nativeInterface.d.ts.map +1 -0
- package/lib/typescript/src/sdk/utils.d.ts +7 -0
- package/lib/typescript/src/sdk/utils.d.ts.map +1 -0
- package/lib/typescript/src/utils/requestPermission.d.ts +3 -0
- package/lib/typescript/src/utils/requestPermission.d.ts.map +1 -0
- package/lib/typescript/src/wayfinding/components/MapView.d.ts +36 -0
- package/lib/typescript/src/wayfinding/components/MapView.d.ts.map +1 -0
- package/lib/typescript/src/wayfinding/hooks/index.d.ts +53 -0
- package/lib/typescript/src/wayfinding/hooks/index.d.ts.map +1 -0
- package/lib/typescript/src/wayfinding/index.d.ts +5 -0
- package/lib/typescript/src/wayfinding/index.d.ts.map +1 -0
- package/lib/typescript/src/wayfinding/store/index.d.ts +103 -0
- package/lib/typescript/src/wayfinding/store/index.d.ts.map +1 -0
- package/lib/typescript/src/wayfinding/store/utils.d.ts +9 -0
- package/lib/typescript/src/wayfinding/store/utils.d.ts.map +1 -0
- package/lib/typescript/src/wayfinding/styles/colors.d.ts +8 -0
- package/lib/typescript/src/wayfinding/styles/colors.d.ts.map +1 -0
- package/lib/typescript/src/wayfinding/utils/index.d.ts +3 -0
- package/lib/typescript/src/wayfinding/utils/index.d.ts.map +1 -0
- package/lib/typescript/src/wayfinding/utils/mapper.d.ts +17 -0
- package/lib/typescript/src/wayfinding/utils/mapper.d.ts.map +1 -0
- package/package.json +130 -0
- package/security.txt +4 -0
- package/src/index.ts +6 -0
- package/src/sdk/index.ts +656 -0
- package/src/sdk/nativeInterface.ts +18 -0
- package/src/sdk/types/index.d.ts +718 -0
- package/src/sdk/utils.ts +16 -0
- package/src/utils/requestPermission.ts +94 -0
- package/src/wayfinding/components/MapView.tsx +312 -0
- package/src/wayfinding/hooks/index.ts +539 -0
- package/src/wayfinding/index.tsx +11 -0
- package/src/wayfinding/store/index.tsx +254 -0
- package/src/wayfinding/store/utils.ts +40 -0
- package/src/wayfinding/styles/colors.tsx +6 -0
- package/src/wayfinding/types/index.d.ts +56 -0
- package/src/wayfinding/utils/index.ts +5 -0
- package/src/wayfinding/utils/mapper.ts +129 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import React, { createContext, useReducer } from "react";
|
|
3
|
+
//@ts-ignore
|
|
4
|
+
|
|
5
|
+
import { createReducer } from "./utils";
|
|
6
|
+
export let PositioningStatus = /*#__PURE__*/function (PositioningStatus) {
|
|
7
|
+
PositioningStatus["STARTING"] = "STARTING";
|
|
8
|
+
PositioningStatus["CALCULATING"] = "CALCULATING";
|
|
9
|
+
PositioningStatus["POSITIONING"] = "POSITIONING";
|
|
10
|
+
PositioningStatus["USER_NOT_IN_BUILDING"] = "USER_NOT_IN_BUILDING";
|
|
11
|
+
PositioningStatus["STOPPED"] = "STOPPED";
|
|
12
|
+
return PositioningStatus;
|
|
13
|
+
}({});
|
|
14
|
+
export let NavigationStatus = /*#__PURE__*/function (NavigationStatus) {
|
|
15
|
+
NavigationStatus["START"] = "start";
|
|
16
|
+
NavigationStatus["STOP"] = "stop";
|
|
17
|
+
NavigationStatus["UPDATE"] = "update";
|
|
18
|
+
return NavigationStatus;
|
|
19
|
+
}({});
|
|
20
|
+
export let NavigationUpdateType = /*#__PURE__*/function (NavigationUpdateType) {
|
|
21
|
+
NavigationUpdateType["progress"] = "PROGRESS";
|
|
22
|
+
NavigationUpdateType["userOutsideRoute"] = "OUT_OF_ROUTE";
|
|
23
|
+
NavigationUpdateType["destinationReached"] = "DESTINATION_REACHED";
|
|
24
|
+
return NavigationUpdateType;
|
|
25
|
+
}({});
|
|
26
|
+
|
|
27
|
+
// TODO: add types
|
|
28
|
+
|
|
29
|
+
export const initialState = {
|
|
30
|
+
webViewRef: undefined,
|
|
31
|
+
sdkInitialized: false,
|
|
32
|
+
user: undefined,
|
|
33
|
+
location: {
|
|
34
|
+
status: PositioningStatus.STOPPED
|
|
35
|
+
},
|
|
36
|
+
buildings: [],
|
|
37
|
+
currentBuilding: undefined,
|
|
38
|
+
pois: [],
|
|
39
|
+
directions: undefined,
|
|
40
|
+
navigation: {
|
|
41
|
+
status: NavigationStatus.STOP
|
|
42
|
+
},
|
|
43
|
+
destinationPoiID: undefined,
|
|
44
|
+
error: undefined
|
|
45
|
+
};
|
|
46
|
+
export const SitumContext = /*#__PURE__*/createContext(undefined);
|
|
47
|
+
const Reducer = createReducer({
|
|
48
|
+
setWebViewRef: (state, payload) => {
|
|
49
|
+
return {
|
|
50
|
+
...state,
|
|
51
|
+
webViewRef: payload
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
setSdkInitialized: (state, payload) => {
|
|
55
|
+
return {
|
|
56
|
+
...state,
|
|
57
|
+
sdkInitialized: payload
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
setAuth: (state, payload) => {
|
|
61
|
+
return {
|
|
62
|
+
...state,
|
|
63
|
+
user: payload
|
|
64
|
+
};
|
|
65
|
+
},
|
|
66
|
+
setLocation: (state, payload) => {
|
|
67
|
+
return {
|
|
68
|
+
...state,
|
|
69
|
+
location: payload
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
setLocationStatus: (state, payload) => {
|
|
73
|
+
return {
|
|
74
|
+
...state,
|
|
75
|
+
location: {
|
|
76
|
+
...state.location,
|
|
77
|
+
status: payload
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
resetLocation: state => {
|
|
82
|
+
return {
|
|
83
|
+
...state,
|
|
84
|
+
location: initialState.location
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
setBuildings: (state, payload) => {
|
|
88
|
+
return {
|
|
89
|
+
...state,
|
|
90
|
+
buildings: payload
|
|
91
|
+
};
|
|
92
|
+
},
|
|
93
|
+
setCurrentBuilding: (state, payload) => {
|
|
94
|
+
return {
|
|
95
|
+
...state,
|
|
96
|
+
currentBuilding: payload
|
|
97
|
+
};
|
|
98
|
+
},
|
|
99
|
+
setPois: (state, payload) => {
|
|
100
|
+
return {
|
|
101
|
+
...state,
|
|
102
|
+
pois: payload
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
setDirections: (state, payload) => {
|
|
106
|
+
return {
|
|
107
|
+
...state,
|
|
108
|
+
directions: payload
|
|
109
|
+
};
|
|
110
|
+
},
|
|
111
|
+
setNavigation: (state, payload) => {
|
|
112
|
+
return {
|
|
113
|
+
...state,
|
|
114
|
+
navigation: payload
|
|
115
|
+
};
|
|
116
|
+
},
|
|
117
|
+
setDestinationPoiID: (state, payload) => {
|
|
118
|
+
return {
|
|
119
|
+
...state,
|
|
120
|
+
destinationPoiID: payload
|
|
121
|
+
};
|
|
122
|
+
},
|
|
123
|
+
setError: (state, payload) => {
|
|
124
|
+
return {
|
|
125
|
+
...state,
|
|
126
|
+
error: payload
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
export const selectWebViewRef = state => {
|
|
131
|
+
return state.webViewRef;
|
|
132
|
+
};
|
|
133
|
+
export const selectIsSDKInitialized = state => {
|
|
134
|
+
return state.sdkInitialized;
|
|
135
|
+
};
|
|
136
|
+
export const selectUser = state => {
|
|
137
|
+
return state.user;
|
|
138
|
+
};
|
|
139
|
+
export const selectLocation = state => {
|
|
140
|
+
return state.location;
|
|
141
|
+
};
|
|
142
|
+
export const selectLocationStatus = state => {
|
|
143
|
+
return state.location.status;
|
|
144
|
+
};
|
|
145
|
+
export const selectBuildings = state => {
|
|
146
|
+
return state.buildings;
|
|
147
|
+
};
|
|
148
|
+
export const selectCurrentBuilding = state => {
|
|
149
|
+
return state.currentBuilding;
|
|
150
|
+
};
|
|
151
|
+
export const selectPois = state => {
|
|
152
|
+
return state.pois;
|
|
153
|
+
};
|
|
154
|
+
export const selectDirections = state => {
|
|
155
|
+
return state.directions;
|
|
156
|
+
};
|
|
157
|
+
export const selectNavigation = state => {
|
|
158
|
+
return state.navigation;
|
|
159
|
+
};
|
|
160
|
+
export const selectDestinationPoiID = state => {
|
|
161
|
+
return state.destinationPoiID;
|
|
162
|
+
};
|
|
163
|
+
export const selectError = state => {
|
|
164
|
+
return state.error;
|
|
165
|
+
};
|
|
166
|
+
export const {
|
|
167
|
+
setWebViewRef,
|
|
168
|
+
setSdkInitialized,
|
|
169
|
+
setAuth,
|
|
170
|
+
setLocation,
|
|
171
|
+
setLocationStatus,
|
|
172
|
+
resetLocation,
|
|
173
|
+
setBuildings,
|
|
174
|
+
setCurrentBuilding,
|
|
175
|
+
setPois,
|
|
176
|
+
setDirections,
|
|
177
|
+
setNavigation,
|
|
178
|
+
setDestinationPoiID,
|
|
179
|
+
setError
|
|
180
|
+
} = Reducer.actions;
|
|
181
|
+
const SitumProvider = _ref => {
|
|
182
|
+
let {
|
|
183
|
+
email,
|
|
184
|
+
apiKey,
|
|
185
|
+
children
|
|
186
|
+
} = _ref;
|
|
187
|
+
const [state, dispatch] = useReducer(Reducer.reducer, {
|
|
188
|
+
...initialState,
|
|
189
|
+
user: {
|
|
190
|
+
email,
|
|
191
|
+
apiKey
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
return /*#__PURE__*/React.createElement(SitumContext.Provider, {
|
|
195
|
+
value: {
|
|
196
|
+
state,
|
|
197
|
+
dispatch
|
|
198
|
+
}
|
|
199
|
+
}, children);
|
|
200
|
+
};
|
|
201
|
+
export default SitumProvider;
|
|
202
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","createContext","useReducer","createReducer","PositioningStatus","NavigationStatus","NavigationUpdateType","initialState","webViewRef","undefined","sdkInitialized","user","location","status","STOPPED","buildings","currentBuilding","pois","directions","navigation","STOP","destinationPoiID","error","SitumContext","Reducer","setWebViewRef","state","payload","setSdkInitialized","setAuth","setLocation","setLocationStatus","resetLocation","setBuildings","setCurrentBuilding","setPois","setDirections","setNavigation","setDestinationPoiID","setError","selectWebViewRef","selectIsSDKInitialized","selectUser","selectLocation","selectLocationStatus","selectBuildings","selectCurrentBuilding","selectPois","selectDirections","selectNavigation","selectDestinationPoiID","selectError","actions","SitumProvider","_ref","email","apiKey","children","dispatch","reducer","createElement","Provider","value"],"sourceRoot":"../../../../src","sources":["wayfinding/store/index.tsx"],"mappings":"AAAA;AACA,OAAOA,KAAK,IAAIC,aAAa,EAAoBC,UAAU,QAAQ,OAAO;AAC1E;;AAGA,SAASC,aAAa,QAAQ,SAAS;AA4BvC,WAAYC,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA;AA2B7B,WAAYC,gBAAgB,0BAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAhBA,gBAAgB;EAAA,OAAhBA,gBAAgB;AAAA;AAM5B,WAAYC,oBAAoB,0BAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAApBA,oBAAoB;EAAA,OAApBA,oBAAoB;AAAA;;AAMhC;;AA+BA,OAAO,MAAMC,YAAmB,GAAG;EACjCC,UAAU,EAAEC,SAAS;EACrBC,cAAc,EAAE,KAAK;EACrBC,IAAI,EAAEF,SAAS;EACfG,QAAQ,EAAE;IAAEC,MAAM,EAAET,iBAAiB,CAACU;EAAQ,CAAC;EAC/CC,SAAS,EAAE,EAAE;EACbC,eAAe,EAAEP,SAAS;EAC1BQ,IAAI,EAAE,EAAE;EACRC,UAAU,EAAET,SAAS;EACrBU,UAAU,EAAE;IAAEN,MAAM,EAAER,gBAAgB,CAACe;EAAK,CAAC;EAC7CC,gBAAgB,EAAEZ,SAAS;EAC3Ba,KAAK,EAAEb;AACT,CAAC;AAED,OAAO,MAAMc,YAAY,gBAAGtB,aAAa,CAEvCQ,SAAS,CAAC;AAEZ,MAAMe,OAAO,GAAGrB,aAAa,CAAQ;EACnCsB,aAAa,EAAEA,CAACC,KAAY,EAAEC,OAA4B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;AAED,OAAO,MAAM+B,gBAAgB,GAAItB,KAAY,IAAK;EAChD,OAAOA,KAAK,CAACR,UAAU;AACzB,CAAC;AAED,OAAO,MAAM+B,gBAAgB,GAAIvB,KAAY,IAAK;EAChD,OAAOA,KAAK,CAACP,UAAU;AACzB,CAAC;AAED,OAAO,MAAM+B,sBAAsB,GAAIxB,KAAY,IAAK;EACtD,OAAOA,KAAK,CAACL,gBAAgB;AAC/B,CAAC;AAED,OAAO,MAAM8B,WAAW,GAAIzB,KAAY,IAAK;EAC3C,OAAOA,KAAK,CAACJ,KAAK;AACpB,CAAC;AAED,OAAO,MAAM;EACXG,aAAa;EACbG,iBAAiB;EACjBC,OAAO;EACPC,WAAW;EACXC,iBAAiB;EACjBC,aAAa;EACbC,YAAY;EACZC,kBAAkB;EAClBC,OAAO;EACPC,aAAa;EACbC,aAAa;EACbC,mBAAmB;EACnBC;AACF,CAAC,GAAGf,OAAO,CAAC4B,OAAO;AAEnB,MAAMC,aAKL,GAAGC,IAAA,IAAiC;EAAA,IAAhC;IAAEC,KAAK;IAAEC,MAAM;IAAEC;EAAS,CAAC,GAAAH,IAAA;EAC9B,MAAM,CAAC5B,KAAK,EAAEgC,QAAQ,CAAC,GAAGxD,UAAU,CAACsB,OAAO,CAACmC,OAAO,EAAE;IACpD,GAAGpD,YAAY;IACfI,IAAI,EAAE;MAAE4C,KAAK;MAAEC;IAAO;EACxB,CAAC,CAAC;EAEF,oBACExD,KAAA,CAAA4D,aAAA,CAACrC,YAAY,CAACsC,QAAQ;IACpBC,KAAK,EAAE;MACLpC,KAAK;MACLgC;IACF;EAAE,GAEDD,QACoB,CAAC;AAE5B,CAAC;AAED,eAAeJ,aAAa"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import { SitumContext } from "./index";
|
|
4
|
+
export const createReducer = reducers => {
|
|
5
|
+
// Actions
|
|
6
|
+
const actions = Object.keys(reducers).reduce((acc, r) => {
|
|
7
|
+
acc[r] = payload => state => reducers[r](state, payload);
|
|
8
|
+
return acc;
|
|
9
|
+
}, {});
|
|
10
|
+
|
|
11
|
+
// Reducer
|
|
12
|
+
const reducer = (state, action) => {
|
|
13
|
+
return action(state);
|
|
14
|
+
};
|
|
15
|
+
return {
|
|
16
|
+
actions,
|
|
17
|
+
reducer
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export const useSelector = selector => {
|
|
21
|
+
const context = useContext(SitumContext);
|
|
22
|
+
if (!context) {
|
|
23
|
+
throw new Error("No SitumProvider found.");
|
|
24
|
+
}
|
|
25
|
+
return selector(context.state);
|
|
26
|
+
};
|
|
27
|
+
export const useDispatch = () => {
|
|
28
|
+
const context = useContext(SitumContext);
|
|
29
|
+
if (!context) {
|
|
30
|
+
throw new Error("No SitumProvider found.");
|
|
31
|
+
}
|
|
32
|
+
return context.dispatch;
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useContext","SitumContext","createReducer","reducers","actions","Object","keys","reduce","acc","r","payload","state","reducer","action","useSelector","selector","context","Error","useDispatch","dispatch"],"sourceRoot":"../../../../src","sources":["wayfinding/store/utils.ts"],"mappings":"AAAA;AACA,SAASA,UAAU,QAAQ,OAAO;AAElC,SAASC,YAAY,QAAe,SAAS;AAE7C,OAAO,MAAMC,aAAa,GACxBC,QAAuD,IACpD;EACH;EACA,MAAMC,OAAO,GAAGC,MAAM,CAACC,IAAI,CAACH,QAAQ,CAAC,CAACI,MAAM,CAAC,CAACC,GAAG,EAAEC,CAAC,KAAK;IACvDD,GAAG,CAACC,CAAC,CAAC,GAAIC,OAAY,IAAMC,KAAQ,IAAKR,QAAQ,CAACM,CAAC,CAAC,CAACE,KAAK,EAAED,OAAO,CAAC;IACpE,OAAOF,GAAG;EACZ,CAAC,EAAE,CAAC,CAAuD,CAAC;;EAE5D;EACA,MAAMI,OAAO,GAAGA,CAACD,KAAQ,EAAEE,MAAuB,KAAQ;IACxD,OAAOA,MAAM,CAACF,KAAK,CAAC;EACtB,CAAC;EACD,OAAO;IAAEP,OAAO;IAAEQ;EAAQ,CAAC;AAC7B,CAAC;AAED,OAAO,MAAME,WAAW,GAAIC,QAA+B,IAAK;EAC9D,MAAMC,OAAO,GAAGhB,UAAU,CAACC,YAAY,CAAC;EAExC,IAAI,CAACe,OAAO,EAAE;IACZ,MAAM,IAAIC,KAAK,CAAC,yBAAyB,CAAC;EAC5C;EAEA,OAAOF,QAAQ,CAACC,OAAO,CAACL,KAAK,CAAC;AAChC,CAAC;AAED,OAAO,MAAMO,WAAW,GAAGA,CAAA,KAAM;EAC/B,MAAMF,OAAO,GAAGhB,UAAU,CAACC,YAAY,CAAC;EAExC,IAAI,CAACe,OAAO,EAAE;IACZ,MAAM,IAAIC,KAAK,CAAC,yBAAyB,CAAC;EAC5C;EAEA,OAAOD,OAAO,CAACG,QAAQ;AACzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["blueSitum","white","black","darkGray"],"sourceRoot":"../../../../src","sources":["wayfinding/styles/colors.tsx"],"mappings":"AAAA,MAAMA,SAAS,GAAG,SAAS;AAC3B,MAAMC,KAAK,GAAG,MAAM;AACpB,MAAMC,KAAK,GAAG,MAAM;AACpB,MAAMC,QAAQ,GAAG,SAAS;AAE1B,eAAe;EAAEH,SAAS;EAAEC,KAAK;EAAEC,KAAK;EAAEC;AAAS,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["wayfinding/types/index.d.ts"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["sendMessageToViewer","viewer","message","injectJavaScript"],"sourceRoot":"../../../../src","sources":["wayfinding/utils/index.ts"],"mappings":"AAEA,OAAO,MAAMA,mBAAmB,GAAGA,CAACC,MAAe,EAAEC,OAAe,KAAK;EACvED,MAAM,CAACE,gBAAgB,CAAE,sBAAqBD,OAAQ,GAAE,CAAC;AAC3D,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
|
|
3
|
+
const mapperWrapper = (type, payload) => JSON.stringify({
|
|
4
|
+
type,
|
|
5
|
+
payload
|
|
6
|
+
});
|
|
7
|
+
const Mapper = {
|
|
8
|
+
location: location => {
|
|
9
|
+
var _location$bearing;
|
|
10
|
+
return mapperWrapper("location.update", {
|
|
11
|
+
...(location.position && {
|
|
12
|
+
latitude: location.position.coordinate.latitude,
|
|
13
|
+
longitude: location.position.coordinate.longitude,
|
|
14
|
+
x: location.position.cartesianCoordinate.x,
|
|
15
|
+
y: location.position.cartesianCoordinate.y,
|
|
16
|
+
buildingId: location.position.buildingIdentifier,
|
|
17
|
+
floorId: location.position.floorIdentifier,
|
|
18
|
+
bearing: (_location$bearing = location.bearing) === null || _location$bearing === void 0 ? void 0 : _location$bearing.degreesClockwise,
|
|
19
|
+
isIndoor: location.position.isIndoor,
|
|
20
|
+
isOutdoor: location.position.isOutdoor,
|
|
21
|
+
accuracy: location.accuracy,
|
|
22
|
+
hasBearing: location.hasBearing
|
|
23
|
+
}),
|
|
24
|
+
status: location.status
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
locationStatus: locationStatus => mapperWrapper("location_status.update", locationStatus),
|
|
28
|
+
route: directions => mapperWrapper("directions.update", directions),
|
|
29
|
+
navigation: navigation => mapperWrapper(`navigation.${navigation.status}`, navigation),
|
|
30
|
+
navigateToPoi: navigate => mapperWrapper(`navigation.start`, {
|
|
31
|
+
navigationTo: navigate === null || navigate === void 0 ? void 0 : navigate.navigationTo
|
|
32
|
+
}),
|
|
33
|
+
cancelNavigation: () => mapperWrapper(`navigation.cancel`, {}),
|
|
34
|
+
selectPoi: poiId => mapperWrapper(`cartography.select_poi`, {
|
|
35
|
+
identifier: poiId
|
|
36
|
+
}),
|
|
37
|
+
followUser: follow => mapperWrapper("camera.follow_user", follow),
|
|
38
|
+
initialConfiguration: (style, enablePoiClustering, showPoiNames, minZoom, maxZoom, initialZoom, useDashboardTheme) => mapperWrapper("ui.initial_configuration", {
|
|
39
|
+
...(style && {
|
|
40
|
+
style: style
|
|
41
|
+
}),
|
|
42
|
+
...(enablePoiClustering && {
|
|
43
|
+
enablePoiClustering: enablePoiClustering
|
|
44
|
+
}),
|
|
45
|
+
...(showPoiNames && {
|
|
46
|
+
showPoiNames: showPoiNames
|
|
47
|
+
}),
|
|
48
|
+
...(minZoom && {
|
|
49
|
+
minZoom: minZoom
|
|
50
|
+
}),
|
|
51
|
+
...(maxZoom && {
|
|
52
|
+
maxZoom: maxZoom
|
|
53
|
+
}),
|
|
54
|
+
...(initialZoom && {
|
|
55
|
+
initialZoom: initialZoom
|
|
56
|
+
}),
|
|
57
|
+
...(useDashboardTheme && {
|
|
58
|
+
useDashboardTheme: useDashboardTheme
|
|
59
|
+
})
|
|
60
|
+
}),
|
|
61
|
+
routeToResult: navigation => {
|
|
62
|
+
//console.log('navigation/route to be mapped:', navigation);
|
|
63
|
+
return {
|
|
64
|
+
status: navigation.status,
|
|
65
|
+
destination: {
|
|
66
|
+
category: navigation !== null && navigation !== void 0 && navigation.destinationId ? "POI" : "COORDINATE",
|
|
67
|
+
identifier: navigation === null || navigation === void 0 ? void 0 : navigation.destinationId,
|
|
68
|
+
//name:, //TODO
|
|
69
|
+
point: {
|
|
70
|
+
buildingId: navigation.to.buildingIdentifier || navigation.TO.buildingIdentifier,
|
|
71
|
+
floorId: navigation.to.floorIdentifier || navigation.TO.floorIdentifier,
|
|
72
|
+
latitude: navigation.to.coordinate.latitude || navigation.TO.coordinate.latitude,
|
|
73
|
+
longitude: navigation.to.coordinate.longitude || navigation.TO.coordinate.longitude
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
},
|
|
78
|
+
navigationToResult: navigation => {
|
|
79
|
+
return {
|
|
80
|
+
status: navigation === null || navigation === void 0 ? void 0 : navigation.type
|
|
81
|
+
};
|
|
82
|
+
// return {
|
|
83
|
+
// status: navigation.status,
|
|
84
|
+
// destination: {
|
|
85
|
+
// category: navigation.routeStep.TO.destinationId ? 'POI' : 'COORDINATE',
|
|
86
|
+
// identifier: navigation.routeStep.TO.destinationId,
|
|
87
|
+
// //name:, //TODO
|
|
88
|
+
// point: {
|
|
89
|
+
// buildingId: navigation.routeStep.TO.buildingIdentifier,
|
|
90
|
+
// floorId: navigation.routeStep.TO.floorIdentifier,
|
|
91
|
+
// latitude: navigation.routeStep.TO.coordinate.latitude,
|
|
92
|
+
// longitude: navigation.routeStep.TO.coordinate.longitude,
|
|
93
|
+
// } as Point,
|
|
94
|
+
// } as Destination,
|
|
95
|
+
// } as Navigation;
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export default Mapper;
|
|
100
|
+
//# sourceMappingURL=mapper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["mapperWrapper","type","payload","JSON","stringify","Mapper","location","_location$bearing","position","latitude","coordinate","longitude","x","cartesianCoordinate","y","buildingId","buildingIdentifier","floorId","floorIdentifier","bearing","degreesClockwise","isIndoor","isOutdoor","accuracy","hasBearing","status","locationStatus","route","directions","navigation","navigateToPoi","navigate","navigationTo","cancelNavigation","selectPoi","poiId","identifier","followUser","follow","initialConfiguration","style","enablePoiClustering","showPoiNames","minZoom","maxZoom","initialZoom","useDashboardTheme","routeToResult","destination","category","destinationId","point","to","TO","navigationToResult"],"sourceRoot":"../../../../src","sources":["wayfinding/utils/mapper.ts"],"mappings":"AAAA;;AASA,MAAMA,aAAa,GAAGA,CAACC,IAAY,EAAEC,OAAgB,KACnDC,IAAI,CAACC,SAAS,CAAC;EAAEH,IAAI;EAAEC;AAAQ,CAAC,CAAC;AAEnC,MAAMG,MAAM,GAAG;EACbC,QAAQ,EAAGA,QAAkB;IAA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ACpC,kBAAkB,IAChCa,UAAU,CAACwB,EAAE,CAACrC,kBAAkB;UAClCC,OAAO,EACLY,UAAU,CAACuB,EAAE,CAAClC,eAAe,IAAIW,UAAU,CAACwB,EAAE,CAACnC,eAAe;UAChET,QAAQ,EACNoB,UAAU,CAACuB,EAAE,CAAC1C,UAAU,CAACD,QAAQ,IACjCoB,UAAU,CAACwB,EAAE,CAAC3C,UAAU,CAACD,QAAQ;UACnCE,SAAS,EACPkB,UAAU,CAACuB,EAAE,CAAC1C,UAAU,CAACC,SAAS,IAClCkB,UAAU,CAACwB,EAAE,CAAC3C,UAAU,CAACC;QAC7B;MACF;IACF,CAAC;EACH,CAAC;EAED2C,kBAAkB,EAAGzB,UAAyB,IAAiB;IAC7D,OAAO;MACLJ,MAAM,EAAEI,UAAU,aAAVA,UAAU,uBAAVA,UAAU,CAAE5B;IACtB,CAAC;IACD;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;EACF;AACF,CAAC;;AAED,eAAeI,MAAM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,MAAM,OAAO,CAAC;AAGhC,cAAc,qBAAqB,CAAC;AAEpC,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
import type { Building, DirectionPoint, DirectionsOptions, Floor, LocationRequestOptions } from "./types/index.d.ts";
|
|
2
|
+
declare const _default: {
|
|
3
|
+
/**
|
|
4
|
+
* Initializes SDK.
|
|
5
|
+
*
|
|
6
|
+
* You have to call this function prior any call to other method.
|
|
7
|
+
* This method can be safely called many times as it will only initialise the SDK
|
|
8
|
+
* if it is not already initialised.
|
|
9
|
+
*/
|
|
10
|
+
initSitumSDK: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* Provides your API key to the Situm SDK.
|
|
13
|
+
*
|
|
14
|
+
* This key is generated for your application in the Dashboard.
|
|
15
|
+
* Old credentials will be removed.
|
|
16
|
+
*
|
|
17
|
+
* @param email user's email.
|
|
18
|
+
* @param apiKey user's apikey.
|
|
19
|
+
* @param onSuccess callback to use when the function returns successfully
|
|
20
|
+
*/
|
|
21
|
+
setApiKey: (email: string, apiKey: string, onSuccess?: Function) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Provides user's email and password. This credentials will be used to obtain a
|
|
24
|
+
* valid user token to authenticate the server request, when necessary. Token
|
|
25
|
+
* obtaining is not necessary done when this method is executed. Old credentials
|
|
26
|
+
* will be removed.
|
|
27
|
+
*
|
|
28
|
+
* @param email user's email.
|
|
29
|
+
* @param password user's password.
|
|
30
|
+
* @param onSuccess callback to use when the function returns successfully
|
|
31
|
+
*/
|
|
32
|
+
setUserPass: (email: string, password: string, onSuccess?: Function) => void;
|
|
33
|
+
setDashboardURL: (url: string, success: Function) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Set to true if you want the SDK to download the configuration from the Situm API
|
|
36
|
+
* and use it by default. Right now it only affects the LocationRequest.
|
|
37
|
+
* Default value is true from SDK version 2.83.5
|
|
38
|
+
*
|
|
39
|
+
* @param useRemoteConfig boolean
|
|
40
|
+
* @param success function called on sucess
|
|
41
|
+
*/
|
|
42
|
+
setUseRemoteConfig(useRemoteConfig: string, onSuccess?: Function): void;
|
|
43
|
+
/**
|
|
44
|
+
* Sets the maximum age of a cached response. If the cache response's age exceeds
|
|
45
|
+
* maxAge, it will not be used and a network request will be made.
|
|
46
|
+
*
|
|
47
|
+
* @param cacheAge a non-negative integer
|
|
48
|
+
* @param success function called on success
|
|
49
|
+
*/
|
|
50
|
+
setCacheMaxAge: (cacheAge: number, success?: Function) => void;
|
|
51
|
+
/**
|
|
52
|
+
* Invalidate all the resources in the cache
|
|
53
|
+
*/
|
|
54
|
+
invalidateCache: () => void;
|
|
55
|
+
/**
|
|
56
|
+
* Gets the list of versions for the current plugin and environment
|
|
57
|
+
*
|
|
58
|
+
* @param callback callback to use on success
|
|
59
|
+
*/
|
|
60
|
+
sdkVersions: (callback: (event: {
|
|
61
|
+
ios?: string;
|
|
62
|
+
android?: string;
|
|
63
|
+
react_native: string;
|
|
64
|
+
}) => void) => void;
|
|
65
|
+
/**
|
|
66
|
+
* Returns the device identifier that has generated the location
|
|
67
|
+
*
|
|
68
|
+
* @param callback function called on sucess, returns the id of the current device
|
|
69
|
+
*/
|
|
70
|
+
getDeviceId: (callback: Function) => void;
|
|
71
|
+
/**
|
|
72
|
+
* Request authorization for the provided authentication
|
|
73
|
+
* and stores it internally for subsequent requests
|
|
74
|
+
*/
|
|
75
|
+
requestAuthorization: () => void;
|
|
76
|
+
/**
|
|
77
|
+
* Download all the buildings for the current user
|
|
78
|
+
*
|
|
79
|
+
* @param success function called on sucess, returns a list of Building objects
|
|
80
|
+
* @param error function called on failure, returns an error string
|
|
81
|
+
*/
|
|
82
|
+
fetchBuildings: (success: Function, error?: Function) => void;
|
|
83
|
+
/**
|
|
84
|
+
* Download all the building data for the selected building. This info includes
|
|
85
|
+
* floors, indoor and outdoor POIs, events and paths. Also it download floor
|
|
86
|
+
* maps and POI category icons to local storage.
|
|
87
|
+
*
|
|
88
|
+
* @param building
|
|
89
|
+
* @param success function called on sucess, returns a list of Building objects
|
|
90
|
+
* @param error function called on failure, returns an error string
|
|
91
|
+
*/
|
|
92
|
+
fetchBuildingInfo: (building: Building, success: Function, error?: Function) => void;
|
|
93
|
+
fetchTilesFromBuilding: (building: Building, success: Function, error?: Function) => void;
|
|
94
|
+
/**
|
|
95
|
+
* Download all the floors of a building
|
|
96
|
+
*
|
|
97
|
+
* @param building
|
|
98
|
+
* @param success function called on sucess, returns a list of Floor objects
|
|
99
|
+
* @param error function called on failure, returns an error string
|
|
100
|
+
*/
|
|
101
|
+
fetchFloorsFromBuilding: (building: Building, success: Function, error?: Function) => void;
|
|
102
|
+
/**
|
|
103
|
+
* Download the map image of a floor
|
|
104
|
+
*
|
|
105
|
+
* @param floor the floor object. Not null.
|
|
106
|
+
* @param success function called on sucess, returns a list of Map url objects
|
|
107
|
+
* @param error function called on failure, returns an error string
|
|
108
|
+
*/
|
|
109
|
+
fetchMapFromFloor: (floor: Floor, success: Function, error?: Function) => void;
|
|
110
|
+
/**
|
|
111
|
+
* Get the geofences of a building
|
|
112
|
+
*
|
|
113
|
+
* @param building
|
|
114
|
+
* @param success function called on sucess, returns a list of Building objects
|
|
115
|
+
* @param error function called on failure, returns an error string
|
|
116
|
+
*/
|
|
117
|
+
fetchGeofencesFromBuilding: (building: Building, success: Function, error?: Function) => void;
|
|
118
|
+
/**
|
|
119
|
+
* Get all POI categories, download and cache their icons asynchronously.
|
|
120
|
+
*
|
|
121
|
+
* @param success function called on sucess, returns a list of POI categories
|
|
122
|
+
* @param error function called on failure, returns an error string
|
|
123
|
+
*/
|
|
124
|
+
fetchPoiCategories: (success: Function, error?: Function) => void;
|
|
125
|
+
/**
|
|
126
|
+
* Get the normal category icon for a category
|
|
127
|
+
*
|
|
128
|
+
* @param category the category. Not null.
|
|
129
|
+
* @param success function called on sucess, returns the icon in normal state.
|
|
130
|
+
* @param error function called on failure, returns an error string
|
|
131
|
+
*/
|
|
132
|
+
fetchPoiCategoryIconNormal: (category: any, success: Function, error?: Function) => void;
|
|
133
|
+
/**
|
|
134
|
+
* Get the selected category icon for a category
|
|
135
|
+
*
|
|
136
|
+
* @param category the category. Not null.
|
|
137
|
+
* @param success function called on sucess, returns the icon in selected state.
|
|
138
|
+
* @param error function called on failure, returns an error string
|
|
139
|
+
*/
|
|
140
|
+
fetchPoiCategoryIconSelected: (category: any, success: Function, error?: Function) => void;
|
|
141
|
+
/**
|
|
142
|
+
* Download the indoor POIs of a building
|
|
143
|
+
*
|
|
144
|
+
* @param building
|
|
145
|
+
* @param success function called on sucess, returns a list of POI objects
|
|
146
|
+
* @param error function called on failure, returns an error string
|
|
147
|
+
*/
|
|
148
|
+
fetchIndoorPOIsFromBuilding: (building: any, success: Function, error?: Function) => void;
|
|
149
|
+
/**
|
|
150
|
+
* Download the outdoor POIs of a building
|
|
151
|
+
*
|
|
152
|
+
* @param building
|
|
153
|
+
* @param success function called on sucess, returns a list of POI objects
|
|
154
|
+
* @param error function called on failure, returns an error string
|
|
155
|
+
*/
|
|
156
|
+
fetchOutdoorPOIsFromBuilding: (building: any, success: Function, error?: Function) => void;
|
|
157
|
+
/**
|
|
158
|
+
* Download the events of a building
|
|
159
|
+
*
|
|
160
|
+
* @param building
|
|
161
|
+
* @param success Callback to asynchronously receive the events of a building. Not null.
|
|
162
|
+
* @param error function called on failure, returns an error string
|
|
163
|
+
*/
|
|
164
|
+
fetchEventsFromBuilding: (building: any, success: Function, error?: Function) => void;
|
|
165
|
+
/**
|
|
166
|
+
* Starts positioning with the configuration specified by the LocationRequest;
|
|
167
|
+
* computed geolocations, status codes and errors will be received through the LocationListener callbacks.
|
|
168
|
+
* You may call this method more than once, with the following effect:
|
|
169
|
+
*
|
|
170
|
+
* - If you provide a new LocationRequest instance, positioning will be re-started
|
|
171
|
+
* with the new positioning options specified by this new instance.
|
|
172
|
+
* - If you provide a new LocationListener, the former LocationListener will be
|
|
173
|
+
* replaced, therefore geolocations will be communicated to the new one.
|
|
174
|
+
* - If neither LocationRequest nor LocationListener change, nothing will happen.
|
|
175
|
+
* You may stop positioning at any time by calling the LocationManager.removeUpdates() method.
|
|
176
|
+
*
|
|
177
|
+
* @param location callback to use when location is udpated
|
|
178
|
+
* @param status callback to use when the positioning status changes
|
|
179
|
+
* @param error callback to use when error is raised
|
|
180
|
+
* @param locationOptions hashmap with options
|
|
181
|
+
*
|
|
182
|
+
* @returns the id of the subscription
|
|
183
|
+
*/
|
|
184
|
+
startPositioning: (location: (event: any) => void, status: Function, error?: Function, options?: LocationRequestOptions) => void;
|
|
185
|
+
startPositioningUpdates: (location: (event: any) => void, status: (event: any) => void, error?: (event: any) => void, options?: LocationRequestOptions) => void;
|
|
186
|
+
/**
|
|
187
|
+
* Stops positioning, removing all location updates
|
|
188
|
+
*
|
|
189
|
+
* @param callback the callback to use when the function successfully ends
|
|
190
|
+
* @returns
|
|
191
|
+
*/
|
|
192
|
+
stopPositioning: (callback?: Function) => void;
|
|
193
|
+
/**
|
|
194
|
+
* Calculates a route between two points. The result is provided
|
|
195
|
+
* asynchronously using the callback.
|
|
196
|
+
*
|
|
197
|
+
* @param directionParams
|
|
198
|
+
* @param success function called on sucess, returns a Route object
|
|
199
|
+
* @param error function called on failure, returns an error string
|
|
200
|
+
*/
|
|
201
|
+
requestDirections: (directionParams: [
|
|
202
|
+
Building,
|
|
203
|
+
DirectionPoint,
|
|
204
|
+
DirectionPoint,
|
|
205
|
+
DirectionsOptions
|
|
206
|
+
], success: Function, error?: Function) => void;
|
|
207
|
+
/**
|
|
208
|
+
* Set the navigation params, and the listener that receives the updated
|
|
209
|
+
* navigation progress.
|
|
210
|
+
*
|
|
211
|
+
* Can only exist one navigation with one listener at a time. If this method was
|
|
212
|
+
* previously invoked, but removeUpdates() wasn't, removeUpdates() is called internally.
|
|
213
|
+
*
|
|
214
|
+
* @param navigationUpdates
|
|
215
|
+
* @param error function called on failure, returns an error string
|
|
216
|
+
* @param options
|
|
217
|
+
*/
|
|
218
|
+
requestNavigationUpdates: (navigationUpdates: (event: any) => void, error?: (event: any) => void, options?: LocationRequestOptions) => void;
|
|
219
|
+
/**
|
|
220
|
+
* Informs NavigationManager object the change of the user's location
|
|
221
|
+
*
|
|
222
|
+
* @param location new Location of the user. If null, nothing is done
|
|
223
|
+
* @param success callback to use when the navigation updates
|
|
224
|
+
* @param error callback to use when an error on navigation udpates raises
|
|
225
|
+
*/
|
|
226
|
+
updateNavigationWithLocation: (location: any, success: Function, error?: Function) => void;
|
|
227
|
+
/**
|
|
228
|
+
* Removes all location updates. This removes the internal state of the manager,
|
|
229
|
+
* including the listener provided in requestNavigationUpdates(NavigationRequest,
|
|
230
|
+
* NavigationListener), so it won't receive more progress updates.
|
|
231
|
+
*
|
|
232
|
+
* @param callback
|
|
233
|
+
*/
|
|
234
|
+
removeNavigationUpdates: (callback?: Function) => void;
|
|
235
|
+
requestRealTimeUpdates: (navigationUpdates: (event: any) => void, error?: (event: any) => void, options?: any) => void;
|
|
236
|
+
/**
|
|
237
|
+
* Requests a real time devices positions
|
|
238
|
+
*
|
|
239
|
+
* @param realtimeUpdates callback to use when new device positions are updated
|
|
240
|
+
* @param error callback to use when an error on navigation udpates raises
|
|
241
|
+
* @param options Represents the configuration for getting realtime devices positions in
|
|
242
|
+
*/
|
|
243
|
+
removeRealTimeUpdates: (_callback?: Function) => void;
|
|
244
|
+
checkIfPointInsideGeofence: (request: any, callback?: Function) => void;
|
|
245
|
+
/**
|
|
246
|
+
* Callback that notifies when the user enters a geofence.
|
|
247
|
+
*
|
|
248
|
+
* In order to use correctly these callbacks you must know the following:
|
|
249
|
+
* - Positioning geofences (with trainer_metadata custom field) won't be notified.
|
|
250
|
+
* - These callbacks only work with indoor locations. Any outdoor location will
|
|
251
|
+
* produce a call to onExitedGeofences with the last positioned geofences as argument.
|
|
252
|
+
*
|
|
253
|
+
* @param callback the function called when the user enters a geofence
|
|
254
|
+
*/
|
|
255
|
+
onEnterGeofences: (callback: (event: any) => void) => void;
|
|
256
|
+
/**
|
|
257
|
+
* Callback that notifies when the user exits a geofence.
|
|
258
|
+
*
|
|
259
|
+
* In order to use correctly these callbacks you must know the following:
|
|
260
|
+
* - Positioning geofences (with trainer_metadata custom field) won't be notified.
|
|
261
|
+
* - These callbacks only work with indoor locations. Any outdoor location will
|
|
262
|
+
* produce a call to onExitedGeofences with the last positioned geofences as argument.
|
|
263
|
+
*
|
|
264
|
+
* @param callback the function called when the user exits a geofence
|
|
265
|
+
*/
|
|
266
|
+
onExitGeofences: (callback: (event: any) => void) => void;
|
|
267
|
+
};
|
|
268
|
+
export default _default;
|
|
269
|
+
//# sourceMappingURL=index.d.ts.map
|