@react-native-ohos/react-native-sensors 7.3.7-rc.1 → 7.3.7-rc.4
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 +1 -1
- package/harmony/sensors/BuildProfile.ets +17 -0
- package/harmony/sensors/oh-package.json5 +1 -1
- package/harmony/sensors/src/main/ets/RTNSensorsTurboModule.ts +5 -5
- package/harmony/sensors.har +0 -0
- package/package.json +3 -4
- package/src/sensors.js +3 -1
- package/harmony/sensors/oh-package-lock.json5 +0 -18
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @react-native-ohos/react-native-sensors
|
|
2
2
|
|
|
3
|
-
This project is based on [react-native-sensors](https://github.com/react-native-sensors/react-native-sensors/tree/v7.
|
|
3
|
+
This project is based on [react-native-sensors@7.3.6](https://github.com/react-native-sensors/react-native-sensors/tree/v7.3.6)
|
|
4
4
|
|
|
5
5
|
## Documentation
|
|
6
6
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Use these variables when you tailor your ArkTS code. They must be of the const type.
|
|
3
|
+
*/
|
|
4
|
+
export const HAR_VERSION = '7.3.7-rc.4';
|
|
5
|
+
export const BUILD_MODE_NAME = 'debug';
|
|
6
|
+
export const DEBUG = true;
|
|
7
|
+
export const TARGET_NAME = 'default';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* BuildProfile Class is used only for compatibility purposes.
|
|
11
|
+
*/
|
|
12
|
+
export default class BuildProfile {
|
|
13
|
+
static readonly HAR_VERSION = HAR_VERSION;
|
|
14
|
+
static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
|
|
15
|
+
static readonly DEBUG = DEBUG;
|
|
16
|
+
static readonly TARGET_NAME = TARGET_NAME;
|
|
17
|
+
}
|
|
@@ -66,7 +66,7 @@ export class RTNSensorsTurboModule extends TurboModule implements RTNSensors.Spe
|
|
|
66
66
|
timestamp: data?.timestamp
|
|
67
67
|
})}`)
|
|
68
68
|
}
|
|
69
|
-
this.ctx.rnInstance.emitDeviceEvent('
|
|
69
|
+
this.ctx.rnInstance.emitDeviceEvent('Accelerometer', {
|
|
70
70
|
x: data?.x,
|
|
71
71
|
y: data?.y,
|
|
72
72
|
z: data?.z,
|
|
@@ -95,7 +95,7 @@ export class RTNSensorsTurboModule extends TurboModule implements RTNSensors.Spe
|
|
|
95
95
|
timestamp: data?.timestamp
|
|
96
96
|
})}`)
|
|
97
97
|
}
|
|
98
|
-
this.ctx.rnInstance.emitDeviceEvent('
|
|
98
|
+
this.ctx.rnInstance.emitDeviceEvent('Gyroscope', {
|
|
99
99
|
x: data?.x,
|
|
100
100
|
y: data?.y,
|
|
101
101
|
z: data?.z,
|
|
@@ -124,7 +124,7 @@ export class RTNSensorsTurboModule extends TurboModule implements RTNSensors.Spe
|
|
|
124
124
|
timestamp: data?.timestamp
|
|
125
125
|
})}`)
|
|
126
126
|
}
|
|
127
|
-
this.ctx.rnInstance.emitDeviceEvent('
|
|
127
|
+
this.ctx.rnInstance.emitDeviceEvent('Magnetometer', {
|
|
128
128
|
x: data?.x,
|
|
129
129
|
y: data?.y,
|
|
130
130
|
z: data?.z,
|
|
@@ -150,7 +150,7 @@ export class RTNSensorsTurboModule extends TurboModule implements RTNSensors.Spe
|
|
|
150
150
|
pressure: data?.pressure
|
|
151
151
|
})}`)
|
|
152
152
|
}
|
|
153
|
-
this.ctx.rnInstance.emitDeviceEvent('
|
|
153
|
+
this.ctx.rnInstance.emitDeviceEvent('Barometer', {
|
|
154
154
|
pressure: data?.pressure
|
|
155
155
|
});
|
|
156
156
|
}, { interval: interval });
|
|
@@ -176,7 +176,7 @@ export class RTNSensorsTurboModule extends TurboModule implements RTNSensors.Spe
|
|
|
176
176
|
timestamp: data?.timestamp
|
|
177
177
|
})}`)
|
|
178
178
|
}
|
|
179
|
-
this.ctx.rnInstance.emitDeviceEvent('
|
|
179
|
+
this.ctx.rnInstance.emitDeviceEvent('Orientation', {
|
|
180
180
|
x: data?.beta,
|
|
181
181
|
y: data?.gamma,
|
|
182
182
|
z: data?.alpha,
|
package/harmony/sensors.har
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-ohos/react-native-sensors",
|
|
3
|
-
"version": "7.3.7-rc.
|
|
3
|
+
"version": "7.3.7-rc.4",
|
|
4
4
|
"description": "A developer friendly approach for sensors in react-native",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"contributor:add": "all-contributors add",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"main": "index.js",
|
|
17
17
|
"types": "index.d.ts",
|
|
18
18
|
"repository": "https://gitcode.com/openharmony-sig/rntpc_react-native-sensors.git",
|
|
19
|
-
"homepage": "https://gitcode.com/openharmony-sig/rntpc_react-native-sensors.
|
|
19
|
+
"homepage": "https://gitcode.com/openharmony-sig/rntpc_react-native-sensors/tree/br_rnoh0.77#readme",
|
|
20
20
|
"keywords": [
|
|
21
21
|
"react-native",
|
|
22
22
|
"harmony"
|
|
@@ -64,8 +64,7 @@
|
|
|
64
64
|
"react": "18.3.1",
|
|
65
65
|
"react-native": "0.77.1",
|
|
66
66
|
"regenerator-runtime": "0.13.1",
|
|
67
|
-
"rxjs-marbles": "5.0.0"
|
|
68
|
-
"react-native-harmony-cli": "file:./packages/rnoh-react-native-harmony-cli-0.77.10.tgz"
|
|
67
|
+
"rxjs-marbles": "5.0.0"
|
|
69
68
|
},
|
|
70
69
|
"harmony": {
|
|
71
70
|
"alias": "react-native-sensors"
|
package/src/sensors.js
CHANGED
|
@@ -35,7 +35,9 @@ function createSensorObservable(sensorType) {
|
|
|
35
35
|
RNSensors.isAvailable(sensorType).then((res) => {
|
|
36
36
|
this.isSensorAvailable = true;
|
|
37
37
|
if (!res) {
|
|
38
|
-
observer.
|
|
38
|
+
observer.next(null);
|
|
39
|
+
observer.complete();
|
|
40
|
+
RNSensors.stop(sensorType);
|
|
39
41
|
return;
|
|
40
42
|
} else {
|
|
41
43
|
RNSensors.start(sensorType);
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"meta": {
|
|
3
|
-
"stableOrder": true
|
|
4
|
-
},
|
|
5
|
-
"lockfileVersion": 3,
|
|
6
|
-
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
|
|
7
|
-
"specifiers": {
|
|
8
|
-
"@rnoh/react-native-openharmony@../../example/node_modules/react-native-harmony/harmony/react_native_openharmony.har": "@rnoh/react-native-openharmony@../../example/node_modules/react-native-harmony/harmony/react_native_openharmony.har"
|
|
9
|
-
},
|
|
10
|
-
"packages": {
|
|
11
|
-
"@rnoh/react-native-openharmony@../../example/node_modules/react-native-harmony/harmony/react_native_openharmony.har": {
|
|
12
|
-
"name": "@rnoh/react-native-openharmony",
|
|
13
|
-
"version": "0.77.10",
|
|
14
|
-
"resolved": "../../example/node_modules/react-native-harmony/harmony/react_native_openharmony.har",
|
|
15
|
-
"registryType": "local"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|