@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.
- package/README.md +59 -505
- package/lib/commonjs/index.js +12 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/sdk/types/index.d.js +349 -0
- package/lib/commonjs/sdk/types/index.d.js.map +1 -1
- package/lib/commonjs/utils/requestPermission.js +2 -2
- package/lib/commonjs/utils/requestPermission.js.map +1 -1
- package/lib/commonjs/wayfinding/components/MapView.js +97 -12
- package/lib/commonjs/wayfinding/components/MapView.js.map +1 -1
- package/lib/commonjs/wayfinding/hooks/index.js +40 -80
- package/lib/commonjs/wayfinding/hooks/index.js.map +1 -1
- package/lib/commonjs/wayfinding/store/index.js +8 -28
- package/lib/commonjs/wayfinding/store/index.js.map +1 -1
- package/lib/commonjs/wayfinding/utils/mapper.js +6 -4
- package/lib/commonjs/wayfinding/utils/mapper.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/sdk/types/index.d.js +373 -1
- package/lib/module/sdk/types/index.d.js.map +1 -1
- package/lib/module/utils/requestPermission.js +2 -2
- package/lib/module/utils/requestPermission.js.map +1 -1
- package/lib/module/wayfinding/components/MapView.js +97 -11
- package/lib/module/wayfinding/components/MapView.js.map +1 -1
- package/lib/module/wayfinding/hooks/index.js +8 -49
- package/lib/module/wayfinding/hooks/index.js.map +1 -1
- package/lib/module/wayfinding/store/index.js +3 -24
- package/lib/module/wayfinding/store/index.js.map +1 -1
- package/lib/module/wayfinding/utils/mapper.js +6 -4
- package/lib/module/wayfinding/utils/mapper.js.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/wayfinding/components/MapView.d.ts +5 -2
- package/lib/typescript/src/wayfinding/components/MapView.d.ts.map +1 -1
- package/lib/typescript/src/wayfinding/hooks/index.d.ts +3 -12
- package/lib/typescript/src/wayfinding/hooks/index.d.ts.map +1 -1
- package/lib/typescript/src/wayfinding/store/index.d.ts +3 -62
- package/lib/typescript/src/wayfinding/store/index.d.ts.map +1 -1
- package/lib/typescript/src/wayfinding/utils/mapper.d.ts +3 -2
- package/lib/typescript/src/wayfinding/utils/mapper.d.ts.map +1 -1
- package/package.json +12 -9
- package/src/index.ts +1 -0
- package/src/sdk/types/index.d.ts +80 -0
- package/src/utils/requestPermission.ts +2 -2
- package/src/wayfinding/components/MapView.tsx +329 -217
- package/src/wayfinding/hooks/index.ts +17 -78
- package/src/wayfinding/store/index.tsx +13 -80
- package/src/wayfinding/types/index.d.ts +10 -11
- package/src/wayfinding/utils/mapper.ts +16 -13
- 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/src/sdk/types/index.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
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);
|