22 lines
874 B
JavaScript
22 lines
874 B
JavaScript
import { registerPlugin } from '@capacitor/core';
|
|
const DumonGeolocationPlugin = registerPlugin('DumonGeolocation', {
|
|
web: () => import('./web').then((m) => new m.DumonGeolocationWeb()),
|
|
});
|
|
const isEmptyObject = (value) => {
|
|
if (!value || typeof value !== 'object' || Array.isArray(value))
|
|
return false;
|
|
return Object.keys(value).length === 0;
|
|
};
|
|
const DumonGeolocation = Object.assign(DumonGeolocationPlugin, {
|
|
async getGnssStatus() {
|
|
const result = await DumonGeolocationPlugin.getGnssStatus();
|
|
return isEmptyObject(result) ? null : result;
|
|
},
|
|
async getBackgroundLatestPosition() {
|
|
const result = await DumonGeolocationPlugin.getBackgroundLatestPosition();
|
|
return isEmptyObject(result) ? null : result;
|
|
},
|
|
});
|
|
export * from './definitions';
|
|
export { DumonGeolocation };
|
|
//# sourceMappingURL=index.js.map
|