@woosmap/react-native-plugin-geofencing 1.0.0-beta.1 → 1.0.0-beta.2
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/CHANGELOG.md +1 -2
- package/package.json +2 -1
- package/src/NativeWoosmapGeofencingTurbo.ts +56 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
## 1.0.0
|
|
2
|
-
- Enhancement: Introduced the `WoosmapGeofencingTurbo` TurboModule (New Architecture).
|
|
3
|
-
— The region-CRUD and key/radius methods `addRegion`, `removeRegions`, `getRegions`, `setPoiRadius`, `setWoosmapApiKey` now dispatch through the generated codegen path. All other methods continue to flow through the legacy `PluginGeofencing` module. Public JS API is unchanged.
|
|
2
|
+
- Enhancement: Introduced the `WoosmapGeofencingTurbo` TurboModule (New Architecture). The region-CRUD and key/radius methods — `addRegion`, `removeRegions`, `getRegions`, `setPoiRadius`, and `setWoosmapApiKey` — now dispatch through the generated codegen path. All other methods continue to flow through the legacy `PluginGeofencing` module. The public JS API is unchanged.
|
|
4
3
|
|
|
5
4
|
## 0.14.0
|
|
6
5
|
- Breaking: Raised minimum supported React Native to `0.85.x`; React `19.2.3`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@woosmap/react-native-plugin-geofencing",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.2",
|
|
4
4
|
"description": "This react-native plugin extends the functionality offered by the Woosmap Geofencing Mobile SDKs. Find more about the Woosmap Geofencing SDK",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"source": "src/index",
|
|
9
9
|
"files": [
|
|
10
10
|
"lib",
|
|
11
|
+
"src/NativeWoosmapGeofencingTurbo.ts",
|
|
11
12
|
"android",
|
|
12
13
|
"ios",
|
|
13
14
|
"cpp",
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Geofence region payload accepted by {@link Spec.addRegion}.
|
|
6
|
+
*
|
|
7
|
+
* Codegen supports a narrower subset of TypeScript than the public
|
|
8
|
+
* `GeofenceRegion` interface in `internal/types`. String-literal unions
|
|
9
|
+
* (`'circle' | 'isochrone'`) are not expressible in a spec, so `type` is
|
|
10
|
+
* widened to `string` here. The JS facade keeps the strict union for
|
|
11
|
+
* consumers — the widening is internal to the native boundary only.
|
|
12
|
+
*/
|
|
13
|
+
export type GeofenceRegionInput = {
|
|
14
|
+
regionId: string;
|
|
15
|
+
lat: number;
|
|
16
|
+
lng: number;
|
|
17
|
+
radius: number;
|
|
18
|
+
type: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Region record returned by {@link Spec.getRegions}. Mirrors the native
|
|
23
|
+
* payload shape (lower-cased keys) before the facade maps it onto the
|
|
24
|
+
* `Region` class via `Region.jsonToObj`.
|
|
25
|
+
*/
|
|
26
|
+
export type RegionRecord = {
|
|
27
|
+
date: number;
|
|
28
|
+
didenter: boolean;
|
|
29
|
+
identifier: string;
|
|
30
|
+
latitude: number;
|
|
31
|
+
longitude: number;
|
|
32
|
+
radius: number;
|
|
33
|
+
frompositiondetection: boolean;
|
|
34
|
+
eventname: string;
|
|
35
|
+
spenttime: number;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* TurboModule spec for the region-CRUD + key/radius slice migrated in
|
|
40
|
+
* Event emitters, background lifecycle and the
|
|
41
|
+
* remaining ~27 methods stay on the legacy `PluginGeofencing` module.
|
|
42
|
+
*
|
|
43
|
+
* The codegen module name is `WoosmapGeofencingTurbo`; the generated spec
|
|
44
|
+
* artifacts are named `WoosmapGeofencingTurboSpec` (see `codegenConfig` in
|
|
45
|
+
* package.json).
|
|
46
|
+
*/
|
|
47
|
+
export interface Spec extends TurboModule {
|
|
48
|
+
addRegion(region: GeofenceRegionInput): Promise<string>;
|
|
49
|
+
removeRegion(regionId: string): Promise<string>;
|
|
50
|
+
removeAllRegions(): Promise<string>;
|
|
51
|
+
getRegions(regionId?: string): Promise<RegionRecord[]>;
|
|
52
|
+
setPoiRadius(radius: string): Promise<string>;
|
|
53
|
+
setWoosmapApiKey(apiKey: string): Promise<string>;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('WoosmapGeofencingTurbo');
|