@react-native-ohos/react-native-sensors 7.2.3-rc.1 → 7.3.7-rc.3
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/LICENSE +1 -1
- package/README.OpenSource +2 -2
- package/README.md +1 -1
- package/harmony/sensors/Index.ets +2 -4
- package/harmony/sensors/oh-package.json5 +2 -2
- package/harmony/sensors/src/main/ets/{SensorsPackage.ets → SensorsPackage.ts} +1 -2
- package/harmony/sensors/{ts.ets → ts.ts} +1 -1
- package/harmony/sensors.har +0 -0
- package/package.json +6 -12
- package/src/sensors.js +3 -1
package/LICENSE
CHANGED
|
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
20
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
21
|
+
SOFTWARE.
|
package/README.OpenSource
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
[
|
|
2
2
|
{
|
|
3
|
-
"Name": "
|
|
3
|
+
"Name": "React Native Sensors",
|
|
4
4
|
"License": "MIT License",
|
|
5
5
|
"License File": "https://github.com/react-native-sensors/react-native-sensors/blob/master/LICENSE",
|
|
6
|
-
"Version Number": "7.
|
|
6
|
+
"Version Number": "7.3.6",
|
|
7
7
|
"Owner" : "xiafeng@huawei.com",
|
|
8
8
|
"Upstream URL": "https://github.com/react-native-sensors/react-native-sensors",
|
|
9
9
|
"Description": "A developer friendly approach for sensors in React Native"
|
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
|
|
|
@@ -12,7 +12,5 @@
|
|
|
12
12
|
* See the License for the specific language governing permissions and
|
|
13
13
|
* limitations under the License.
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export * from './ts.ets'
|
|
18
|
-
export default SensorsPackage;
|
|
15
|
+
|
|
16
|
+
export * from './ts'
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
name: "@react-native-ohos/react-native-sensors",
|
|
3
|
-
version: "7.
|
|
3
|
+
version: "7.3.7-rc.3",
|
|
4
4
|
description: "Please describe the basic information.",
|
|
5
5
|
main: "Index.ets",
|
|
6
6
|
author: "",
|
|
7
7
|
license: "MIT License",
|
|
8
8
|
dependencies: {
|
|
9
|
-
"@rnoh/react-native-openharmony": "
|
|
9
|
+
"@rnoh/react-native-openharmony": "file:../react_native_openharmony"
|
|
10
10
|
},
|
|
11
11
|
}
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
import { RNPackage, TurboModulesFactory } from '@rnoh/react-native-openharmony/ts';
|
|
17
17
|
import type { TurboModule, TurboModuleContext } from '@rnoh/react-native-openharmony/ts';
|
|
18
18
|
import { RTNSensorsTurboModule } from './RTNSensorsTurboModule';
|
|
19
|
-
import { RNOHPackage } from '@rnoh/react-native-openharmony';
|
|
20
19
|
|
|
21
20
|
class SensorsModulesFactory extends TurboModulesFactory {
|
|
22
21
|
createTurboModule(name: string): TurboModule | null {
|
|
@@ -31,7 +30,7 @@ class SensorsModulesFactory extends TurboModulesFactory {
|
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
|
|
34
|
-
export class SensorsPackage extends
|
|
33
|
+
export class SensorsPackage extends RNPackage {
|
|
35
34
|
createTurboModulesFactory(ctx: TurboModuleContext): TurboModulesFactory {
|
|
36
35
|
return new SensorsModulesFactory(ctx);
|
|
37
36
|
}
|
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
|
+
"version": "7.3.7-rc.3",
|
|
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"
|
|
@@ -61,20 +61,14 @@
|
|
|
61
61
|
"metro-config": "^0.67.0",
|
|
62
62
|
"prettier": "2.2.1",
|
|
63
63
|
"pretty-quick": "3.1.0",
|
|
64
|
-
"react": "
|
|
65
|
-
"react-native": "
|
|
64
|
+
"react": "18.3.1",
|
|
65
|
+
"react-native": "0.77.1",
|
|
66
66
|
"regenerator-runtime": "0.13.1",
|
|
67
67
|
"rxjs-marbles": "5.0.0",
|
|
68
|
-
"react-native-harmony-cli": "
|
|
68
|
+
"react-native-harmony-cli": "file:./packages/react-native-oh-react-native-harmony-cli-0.77.18.tgz"
|
|
69
69
|
},
|
|
70
70
|
"harmony": {
|
|
71
|
-
"alias": "react-native-sensors"
|
|
72
|
-
"autolinking": {
|
|
73
|
-
"etsPackageClassName": "SensorsPackage",
|
|
74
|
-
"cppPackageClassName": "SensorsPackage",
|
|
75
|
-
"cmakeLibraryTargetName": "rnoh_sensors",
|
|
76
|
-
"ohPackageName": "@react-native-ohos/react-native-sensors"
|
|
77
|
-
}
|
|
71
|
+
"alias": "react-native-sensors"
|
|
78
72
|
},
|
|
79
73
|
"files": [
|
|
80
74
|
"src",
|
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);
|