@situm/react-native 3.0.0-beta.0 → 3.0.0-beta.1

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.
Files changed (51) hide show
  1. package/README.md +59 -505
  2. package/lib/commonjs/index.js +12 -0
  3. package/lib/commonjs/index.js.map +1 -1
  4. package/lib/commonjs/sdk/types/index.d.js +349 -0
  5. package/lib/commonjs/sdk/types/index.d.js.map +1 -1
  6. package/lib/commonjs/utils/requestPermission.js +2 -2
  7. package/lib/commonjs/utils/requestPermission.js.map +1 -1
  8. package/lib/commonjs/wayfinding/components/MapView.js +97 -12
  9. package/lib/commonjs/wayfinding/components/MapView.js.map +1 -1
  10. package/lib/commonjs/wayfinding/hooks/index.js +40 -80
  11. package/lib/commonjs/wayfinding/hooks/index.js.map +1 -1
  12. package/lib/commonjs/wayfinding/store/index.js +8 -28
  13. package/lib/commonjs/wayfinding/store/index.js.map +1 -1
  14. package/lib/commonjs/wayfinding/utils/mapper.js +6 -4
  15. package/lib/commonjs/wayfinding/utils/mapper.js.map +1 -1
  16. package/lib/module/index.js +1 -0
  17. package/lib/module/index.js.map +1 -1
  18. package/lib/module/sdk/types/index.d.js +373 -1
  19. package/lib/module/sdk/types/index.d.js.map +1 -1
  20. package/lib/module/utils/requestPermission.js +2 -2
  21. package/lib/module/utils/requestPermission.js.map +1 -1
  22. package/lib/module/wayfinding/components/MapView.js +97 -11
  23. package/lib/module/wayfinding/components/MapView.js.map +1 -1
  24. package/lib/module/wayfinding/hooks/index.js +8 -49
  25. package/lib/module/wayfinding/hooks/index.js.map +1 -1
  26. package/lib/module/wayfinding/store/index.js +3 -24
  27. package/lib/module/wayfinding/store/index.js.map +1 -1
  28. package/lib/module/wayfinding/utils/mapper.js +6 -4
  29. package/lib/module/wayfinding/utils/mapper.js.map +1 -1
  30. package/lib/typescript/src/index.d.ts +1 -0
  31. package/lib/typescript/src/index.d.ts.map +1 -1
  32. package/lib/typescript/src/wayfinding/components/MapView.d.ts +5 -2
  33. package/lib/typescript/src/wayfinding/components/MapView.d.ts.map +1 -1
  34. package/lib/typescript/src/wayfinding/hooks/index.d.ts +3 -12
  35. package/lib/typescript/src/wayfinding/hooks/index.d.ts.map +1 -1
  36. package/lib/typescript/src/wayfinding/store/index.d.ts +3 -62
  37. package/lib/typescript/src/wayfinding/store/index.d.ts.map +1 -1
  38. package/lib/typescript/src/wayfinding/utils/mapper.d.ts +3 -2
  39. package/lib/typescript/src/wayfinding/utils/mapper.d.ts.map +1 -1
  40. package/package.json +12 -9
  41. package/src/index.ts +1 -0
  42. package/src/sdk/types/index.d.ts +80 -0
  43. package/src/utils/requestPermission.ts +2 -2
  44. package/src/wayfinding/components/MapView.tsx +329 -217
  45. package/src/wayfinding/hooks/index.ts +17 -78
  46. package/src/wayfinding/store/index.tsx +13 -80
  47. package/src/wayfinding/types/index.d.ts +10 -11
  48. package/src/wayfinding/utils/mapper.ts +16 -13
  49. package/android/.gradle/5.6.4/fileChanges/last-build.bin +0 -0
  50. package/android/.gradle/5.6.4/fileHashes/fileHashes.lock +0 -0
  51. package/android/.gradle/5.6.4/gc.properties +0 -0
@@ -216,6 +216,7 @@ export type Point = {
216
216
  isIndoor: boolean;
217
217
  isOutdoor: boolean;
218
218
  };
219
+
219
220
  export type DirectionPoint = {
220
221
  floorIdentifier: Floor["floorIdentifier"];
221
222
  buildingIdentifier: Building["buildingIdentifier"];
@@ -598,6 +599,85 @@ export type RealTimeData = {
598
599
  locations: Location[];
599
600
  };
600
601
 
602
+ export interface Location {
603
+ position?: Position;
604
+ accuracy?: number;
605
+ bearing?: {
606
+ degrees: number;
607
+ degreesClockwise: number;
608
+ };
609
+ hasBearing?: boolean;
610
+ status: LocationStatusName;
611
+ }
612
+
613
+ export interface Position {
614
+ coordinate: {
615
+ latitude: number;
616
+ longitude: number;
617
+ };
618
+ cartesianCoordinate: {
619
+ x: number;
620
+ y: number;
621
+ };
622
+ isIndoor?: boolean;
623
+ isOutdoor?: boolean;
624
+ buildingIdentifier?: string;
625
+ floorIdentifier?: string;
626
+ }
627
+ export interface LocationStatus {
628
+ statusName: LocationStatusName;
629
+ statusCode: number;
630
+ }
631
+
632
+ export enum LocationStatusName {
633
+ STARTING = "STARTING",
634
+ CALCULATING = "CALCULATING",
635
+ // This status will always be sent to mapviewer-web, in case we recieve
636
+ // a location from SDK.
637
+ POSITIONING = "POSITIONING",
638
+ USER_NOT_IN_BUILDING = "USER_NOT_IN_BUILDING",
639
+ STOPPED = "STOPPED",
640
+ }
641
+
642
+ export interface SDKError {
643
+ code?: number;
644
+ message: string;
645
+ }
646
+
647
+ export interface SDKNavigation {
648
+ //closestPositionInRoute: any;
649
+ currentIndication?: any;
650
+ //currentStepIndex:number;
651
+ //distanceToEndStep: number;
652
+ distanceToGoal?: number;
653
+ //nextIndication: any;
654
+ points?: any;
655
+ routeStep?: any;
656
+ segments?: any;
657
+ route?: Directions;
658
+ //timeToEndStep: number;
659
+ //timeToGoal: number;
660
+ type?: NavigationUpdateType;
661
+ status: NavigationStatus;
662
+ }
663
+
664
+ export enum NavigationStatus {
665
+ START = "start",
666
+ STOP = "stop",
667
+ UPDATE = "update",
668
+ }
669
+
670
+ export enum NavigationUpdateType {
671
+ progress = "PROGRESS",
672
+ userOutsideRoute = "OUT_OF_ROUTE",
673
+ destinationReached = "DESTINATION_REACHED",
674
+ }
675
+
676
+ export type NavigateToPoiType = {
677
+ navigationTo: number;
678
+ type?: string;
679
+ };
680
+
601
681
  export interface SitumPluginStatic {
602
682
  initSitumSDK(): void;
603
683
 
@@ -49,12 +49,12 @@ const checkAndroidPermissions = async () => {
49
49
  granted["android.permission.BLUETOOTH_SCAN"] === RESULTS.GRANTED
50
50
  ) {
51
51
  console.info(
52
- "ACCESS_FINE_LOCATION, BLUETOOTH_CONNECT and ACCESS_FINE_LOCATION permissions granted"
52
+ "ACCESS_FINE_LOCATION, BLUETOOTH_CONNECT and BLUETOOTH_SCAN permissions granted"
53
53
  );
54
54
  return true;
55
55
  }
56
56
 
57
- throw "ACCESS_FINE_LOCATION, BLUETOOTH_CONNECT and ACCESS_FINE_LOCATION permissions not granted";
57
+ throw "ACCESS_FINE_LOCATION, BLUETOOTH_CONNECT and BLUETOOTH_SCAN permissions not granted";
58
58
  } else {
59
59
  console.info("ANDROID VERSION < 30");
60
60
  granted = await request(PERMISSIONS.ANDROID.ACCESS_FINE_LOCATION);