@react-native-ohos/react-native-background-timer 2.4.2-rc.2 → 2.5.0-rc.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 (59) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/COMMITTERS.md +0 -4
  3. package/OAT.xml +3 -1
  4. package/README.md +1 -1
  5. package/example/.eslintrc +18 -0
  6. package/example/.node-version +6 -0
  7. package/example/.prettierrc.js +12 -0
  8. package/example/.watchmanconfig +6 -0
  9. package/example/app.json +4 -0
  10. package/example/babel.config.js +10 -0
  11. package/example/contexts.ts +8 -0
  12. package/example/harmony/AppScope/app.json5 +10 -0
  13. package/example/harmony/AppScope/resources/base/element/string.json +8 -0
  14. package/example/harmony/AppScope/resources/base/media/app_icon.png +0 -0
  15. package/example/harmony/build-profile.template.json5 +40 -0
  16. package/example/harmony/codelinter.json +32 -0
  17. package/example/harmony/entry/build-profile.json5 +19 -0
  18. package/example/harmony/entry/hvigorfile.ts +9 -0
  19. package/example/harmony/entry/oh-package.json5 +11 -0
  20. package/example/harmony/entry/src/main/cpp/CMakeLists.txt +34 -0
  21. package/example/harmony/entry/src/main/cpp/PackageProvider.cpp +19 -0
  22. package/example/harmony/entry/src/main/ets/RNPackagesFactory.ets +15 -0
  23. package/example/harmony/entry/src/main/ets/assets/fonts/Pacifico-Regular.ttf +0 -0
  24. package/example/harmony/entry/src/main/ets/assets/fonts/StintUltraCondensed-Regular.ttf +0 -0
  25. package/example/harmony/entry/src/main/ets/entryability/EntryAbility.ets +19 -0
  26. package/example/harmony/entry/src/main/ets/pages/Index.ets +118 -0
  27. package/example/harmony/entry/src/main/ets/pages/SurfaceDeadlockTest.ets +135 -0
  28. package/example/harmony/entry/src/main/ets/pages/TouchDisplayer.ets +43 -0
  29. package/example/harmony/entry/src/main/module.json5 +52 -0
  30. package/example/harmony/entry/src/main/resources/base/element/color.json +8 -0
  31. package/example/harmony/entry/src/main/resources/base/element/string.json +16 -0
  32. package/example/harmony/entry/src/main/resources/base/media/icon.png +0 -0
  33. package/example/harmony/entry/src/main/resources/base/profile/main_pages.json +5 -0
  34. package/example/harmony/entry/src/main/resources/rawfile/1.txt +1 -0
  35. package/example/harmony/hvigor/hvigor-config.json5 +21 -0
  36. package/example/harmony/hvigorfile.ts +8 -0
  37. package/example/harmony/oh-package.json5 +12 -0
  38. package/example/index.js +10 -0
  39. package/example/jest.config.js +10 -0
  40. package/example/metro.config.js +29 -0
  41. package/example/package.json +66 -0
  42. package/example/react-native.config.js +10 -0
  43. package/example/src/BackgroundTimerDemo.tsx +166 -0
  44. package/harmony/background_timer/hvigorfile.ts +6 -6
  45. package/harmony/background_timer/oh-package.json5 +10 -10
  46. package/harmony/background_timer/src/main/cpp/CMakeLists.txt +13 -13
  47. package/harmony/background_timer/src/main/cpp/generated/RNOH/generated/turbo_modules/BackgroundTimerTurboModule.cpp +21 -21
  48. package/harmony/background_timer/src/main/cpp/generated/RNOH/generated/turbo_modules/BackgroundTimerTurboModule.h +16 -16
  49. package/harmony/background_timer/src/main/ets/generated/components/ts.ts +5 -5
  50. package/harmony/background_timer/src/main/ets/generated/index.ets +5 -5
  51. package/harmony/background_timer/src/main/ets/generated/ts.ts +6 -6
  52. package/harmony/background_timer/src/main/ets/generated/turboModules/BackgroundTimerTurboModule.ts +18 -18
  53. package/harmony/background_timer/src/main/ets/generated/turboModules/ts.ts +5 -5
  54. package/harmony/background_timer/src/main/resources/base/element/string.json +8 -8
  55. package/harmony/background_timer/src/main/resources/en_US/element/string.json +8 -8
  56. package/harmony/background_timer/src/main/resources/zh_CN/element/string.json +8 -8
  57. package/harmony/background_timer.har +0 -0
  58. package/index.js +111 -111
  59. package/package.json +62 -62
@@ -0,0 +1,52 @@
1
+ {
2
+ "module": {
3
+ "name": "entry",
4
+ "type": "entry",
5
+ "description": "$string:module_desc",
6
+ "mainElement": "EntryAbility",
7
+ "deviceTypes": [
8
+ "default"
9
+ ],
10
+ "querySchemes": [
11
+ "weixin",
12
+ ],
13
+ "deliveryWithInstall": true,
14
+ "installationFree": false,
15
+ "pages": "$profile:main_pages",
16
+ // below property is supported from 5.0.0 - it is needed by bundleManager.canOpenLink to check if the app can open some url
17
+ // "querySchemes": ["maps", "http", "https", "customDomain"],
18
+ "requestPermissions": [
19
+ {
20
+ "name": "ohos.permission.INTERNET"
21
+ },
22
+ ],
23
+ "metadata": [
24
+ {
25
+ "name": "OPTLazyForEach",
26
+ "value": "true",
27
+ }
28
+ ],
29
+ "abilities": [
30
+ {
31
+ "name": "EntryAbility",
32
+ "srcEntry": "./ets/entryability/EntryAbility.ets",
33
+ "description": "$string:EntryAbility_desc",
34
+ "icon": "$media:icon",
35
+ "label": "$string:EntryAbility_label",
36
+ "startWindowIcon": "$media:icon",
37
+ "startWindowBackground": "$color:start_window_background",
38
+ "visible": true,
39
+ "skills": [
40
+ {
41
+ "entities": [
42
+ "entity.system.home"
43
+ ],
44
+ "actions": [
45
+ "action.system.home"
46
+ ]
47
+ }
48
+ ]
49
+ }
50
+ ]
51
+ }
52
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "color": [
3
+ {
4
+ "name": "start_window_background",
5
+ "value": "#FFFFFF"
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "string": [
3
+ {
4
+ "name": "module_desc",
5
+ "value": "module description"
6
+ },
7
+ {
8
+ "name": "EntryAbility_desc",
9
+ "value": "description"
10
+ },
11
+ {
12
+ "name": "EntryAbility_label",
13
+ "value": "RN Tester"
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "src": [
3
+ "pages/Index"
4
+ ]
5
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "modelVersion": "5.0.0",
3
+ "dependencies": {
4
+ },
5
+ "execution": {
6
+ // "analyze": "default", /* Define the build analyze mode. Value: [ "default" | "verbose" | false ]. Default: "default" */
7
+ // "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */
8
+ // "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */
9
+ // "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */
10
+ // "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */
11
+ },
12
+ "logging": {
13
+ // "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */
14
+ },
15
+ "debugging": {
16
+ "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */
17
+ },
18
+ "nodeOptions": {
19
+ // "maxOldSpaceSize": 4096 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process */
20
+ }
21
+ }
@@ -0,0 +1,8 @@
1
+ /*
2
+ * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
3
+ * Use of this source code is governed by a MIT license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+
7
+ // Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
8
+ export { appTasks } from '@ohos/hvigor-ohos-plugin';
@@ -0,0 +1,12 @@
1
+ {
2
+ "modelVersion": "5.0.0",
3
+ "license": "ISC",
4
+ "name": "rnoh",
5
+ "description": "example description",
6
+ "repository": {},
7
+ "version": "1.0.0",
8
+ "overrides": {
9
+ "@rnoh/react-native-openharmony": "0.72.38"
10
+ },
11
+ "dynamicDependencies": {}
12
+ }
@@ -0,0 +1,10 @@
1
+ /*
2
+ * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
3
+ * Use of this source code is governed by a MIT license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+ import {AppRegistry, View, Text} from 'react-native';
7
+ import {name as appName} from './app.json';
8
+ import App from './src/BackgroundTimerDemo';
9
+
10
+ AppRegistry.registerComponent(appName, () => App);
@@ -0,0 +1,10 @@
1
+ /*
2
+ * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
3
+ * Use of this source code is governed by a MIT license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+ /** @type {import('ts-jest').JestConfigWithTsJest} */
7
+ module.exports = {
8
+ preset: 'ts-jest',
9
+ testEnvironment: 'node',
10
+ };
@@ -0,0 +1,29 @@
1
+ /*
2
+ * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
3
+ * Use of this source code is governed by a MIT license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+ const {mergeConfig, getDefaultConfig} = require('@react-native/metro-config');
7
+ const {createHarmonyMetroConfig} = require('react-native-harmony/metro.config');
8
+
9
+ /**
10
+ * @type {import("metro-config").ConfigT}
11
+ */
12
+ const config = {
13
+ transformer: {
14
+ getTransformOptions: async () => ({
15
+ transform: {
16
+ experimentalImportSupport: false,
17
+ inlineRequires: true,
18
+ },
19
+ }),
20
+ },
21
+ };
22
+
23
+ module.exports = mergeConfig(
24
+ getDefaultConfig(__dirname),
25
+ createHarmonyMetroConfig({
26
+ reactNativeHarmonyPackageName: 'react-native-harmony',
27
+ }),
28
+ config,
29
+ );
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "react-native-harmony-tester",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "scripts": {
6
+ "i": "cd ../ && npm i && npm run pack && cd ./example && npm i",
7
+ "reStart": "npm run install:pkg && npm run codegen && hdc rport tcp:8081 tcp:8081 && react-native start",
8
+ "start": "hdc rport tcp:8081 tcp:8081 && react-native start",
9
+ "codegen": "react-native codegen-harmony --rnoh-module-path ./harmony/entry/oh_modules/@rnoh/react-native-openharmony",
10
+ "pack:pkg": "cd ../ && npm pack && cd ./example",
11
+ "install:pkg": "npm uninstall @react-native-ohos/react-native-background-timer && npm run pack:pkg && npm i @react-native-ohos/react-native-background-timer@file:../react-native-ohos-react-native-background-timer-2.4.2-rc.3.tgz",
12
+ "dev": "npm run codegen && react-native bundle-harmony --dev --minify=false",
13
+ "prod": "npm run codegen && react-native bundle-harmony --dev=false --minify=true",
14
+ "postinstall": "node ./scripts/create-build-profile",
15
+ "fast:pkg": "cd ../ && npm i --legacy-peer-deps && npm pack && cd ./example && npm i && npm run dev"
16
+ },
17
+ "dependencies": {
18
+ "@gorhom/portal": "^1.0.14",
19
+ "@react-native-ohos/react-native-background-timer": "file:../react-native-ohos-react-native-background-timer-2.4.2-rc.3.tgz",
20
+ "react": "18.2.0",
21
+ "react-native": "0.72.5",
22
+ "react-native-harmony": "npm:@react-native-oh/react-native-harmony@^0.77.17"
23
+ },
24
+ "devDependencies": {
25
+ "@babel/core": "^7.20.0",
26
+ "@babel/preset-env": "^7.20.0",
27
+ "@babel/runtime": "^7.20.0",
28
+ "@react-native-community/eslint-config": "^3.2.0",
29
+ "@react-native/eslint-config": "^0.74.0",
30
+ "@react-native/metro-config": "^0.72.6",
31
+ "@tsconfig/react-native": "^2.0.2",
32
+ "@types/chai": "^4.3.4",
33
+ "@types/d3-scale-chromatic": "^3.0.0",
34
+ "@types/fs-extra": "^11.0.1",
35
+ "@types/jest": "^29.5.5",
36
+ "@types/metro-config": "^0.76.2",
37
+ "@types/react": "17.0.14",
38
+ "@types/react-dom": "17.0.14",
39
+ "@types/react-test-renderer": "^18.0.0",
40
+ "babel-jest": "^29.2.1",
41
+ "csv-parser": "^3.0.0",
42
+ "eslint": "^8.19.0",
43
+ "eslint-plugin-prettier": "^5.0.1",
44
+ "fs-extra": "^11.1.1",
45
+ "husky": "^8.0.3",
46
+ "jest": "^29.7.0",
47
+ "json5": "^2.2.3",
48
+ "metro": "^0.76.3",
49
+ "metro-config": "^0.76.3",
50
+ "metro-react-native-babel-preset": "0.73.9",
51
+ "prettier": "3.2.4",
52
+ "react-test-renderer": "18.2.0",
53
+ "simple-statistics": "^7.8.3",
54
+ "ts-jest": "^29.1.1",
55
+ "typescript": "^5.3.2",
56
+ "yargs": "^17.7.2"
57
+ },
58
+ "overrides": {
59
+ "@rnoh/react-native-harmony-cli": "npm:@react-native-oh/react-native-harmony-cli@^0.0.27",
60
+ "@react-native-community/cli": "11.3.6",
61
+ "@react-native/codegen": "0.74.0"
62
+ },
63
+ "resolutions": {
64
+ "@react-native-community/cli": "11.3.6"
65
+ }
66
+ }
@@ -0,0 +1,10 @@
1
+ /*
2
+ * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
3
+ * Use of this source code is governed by a MIT license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+ module.exports = {
7
+ project: {
8
+ },
9
+ assets: ['./assets/fonts/'],
10
+ };
@@ -0,0 +1,166 @@
1
+ /*
2
+ * Copyright (c) 2024 Huawei Device Co., Ltd. All rights reserved
3
+ * Use of this source code is governed by a MIT license that can be
4
+ * found in the LICENSE file.
5
+ */
6
+
7
+ import {View, Button, StyleSheet, Text,TextInput} from 'react-native';
8
+ import React, {useState} from 'react';
9
+ import BackgroundTimer from "react-native-background-timer";
10
+
11
+ export default function BackgroundTimerDemo() {
12
+ let [count, setCount] = useState(0);
13
+ let [text, setText] = useState("");
14
+ // BackgroundTimer延时
15
+ let [delay, setDelay] = useState("1000");
16
+ // setTimeout延时
17
+ let [timeoutDelay, setTimeoutDelay] = useState("1000");
18
+ // setInterval延时
19
+ let [intervalDelay, setIntervalDelay] = useState("1000");
20
+ let timeoutList:number[] = []
21
+ let [intervalList, setIntervalList] = useState<number[]>([]);
22
+
23
+ // runBackgroundTimer
24
+ function onPressStart(){
25
+ setText("开启定时器...")
26
+ BackgroundTimer.runBackgroundTimer(()=>{
27
+ setCount(count+=1)
28
+ },parseInt(delay))
29
+ }
30
+ function onPressStop(){
31
+ setText("结束定时器")
32
+ BackgroundTimer.stopBackgroundTimer()
33
+ }
34
+
35
+ // setTimeout
36
+ function setTimeoutStart(){
37
+ setText("开启定时器...")
38
+ let timeoutId = BackgroundTimer.setTimeout(()=>{
39
+ setCount(count+=1)
40
+ },parseInt(timeoutDelay))
41
+ timeoutList.push(timeoutId)
42
+ }
43
+ function setTimeoutStop(){
44
+ setText("结束定时器")
45
+ if(timeoutList.length>0){
46
+ BackgroundTimer.clearTimeout(timeoutList[0])
47
+ timeoutList.shift()
48
+ }
49
+ }
50
+
51
+ // setInterval
52
+ function setIntervalStart(){
53
+ setText("开启定时器...")
54
+ let intervalId = BackgroundTimer.setInterval(()=>{
55
+ setCount(count+=1)
56
+ },parseInt(intervalDelay))
57
+ setIntervalList([...intervalList,intervalId])
58
+ }
59
+ function setIntervalStop(){
60
+ setText("结束定时器")
61
+ if(intervalList.length>0){
62
+ BackgroundTimer.clearInterval(intervalList[0])
63
+ intervalList.shift()
64
+ }
65
+ }
66
+ function resetNumber(){
67
+ setCount(0)
68
+ setText("")
69
+ }
70
+ return (
71
+ <View style={{flexDirection: 'column', flex: 1,backgroundColor:'white'}}>
72
+ <View style={styles.container}>
73
+ <View style={styles.viewStyle}>
74
+ <Button
75
+ onPress={onPressStart}
76
+ title="runBackgroundTimer"
77
+ />
78
+ <TextInput
79
+ style={{ height: 40, borderColor: 'gray', borderWidth: 1 }}
80
+ placeholder="BackgroundTimer延时"
81
+ onChangeText={(value)=>{setDelay(value)}}
82
+ value={delay}
83
+ />
84
+ </View>
85
+ <View style={[styles.viewStyle]}>
86
+ <Button
87
+ onPress={onPressStop}
88
+ title="stopBackgroundTimer"
89
+ />
90
+ </View>
91
+ </View>
92
+
93
+ <View style={styles.container}>
94
+ <View style={styles.viewStyle}>
95
+ <Button
96
+ onPress={setTimeoutStart}
97
+ title="setTimeout"
98
+ />
99
+ <TextInput
100
+ style={{ height: 40, borderColor: 'gray', borderWidth: 1 }}
101
+ placeholder="setTimeout延时"
102
+ onChangeText={(value)=>{setTimeoutDelay(value)}}
103
+ value={timeoutDelay}
104
+ />
105
+ </View>
106
+ <View style={[styles.viewStyle]}>
107
+ <Button
108
+ onPress={setTimeoutStop}
109
+ title="clearTimeout"
110
+ />
111
+ </View>
112
+ </View>
113
+
114
+ <View style={styles.container}>
115
+ <View style={styles.viewStyle}>
116
+ <Button
117
+ onPress={setIntervalStart}
118
+ title="setInterval"
119
+ />
120
+ <TextInput
121
+ style={{ height: 40, borderColor: 'gray', borderWidth: 1 }}
122
+ placeholder="setInterval延时"
123
+ onChangeText={(value)=>{setIntervalDelay(value)}}
124
+ value={intervalDelay}
125
+ />
126
+ </View>
127
+ <View style={[styles.viewStyle]}>
128
+ <Button
129
+ onPress={setIntervalStop}
130
+ title="clearInterval"
131
+ />
132
+ </View>
133
+ </View>
134
+
135
+ <View style={[styles.viewStyle,styles.resetStyle]}>
136
+ <Button
137
+ onPress={resetNumber}
138
+ title="Reset"
139
+ />
140
+ </View>
141
+ <Text style={styles.textStyle}>{count}</Text>
142
+ <Text style={styles.textStyle}>{text}</Text>
143
+ </View>
144
+ );
145
+ }
146
+
147
+ const styles = StyleSheet.create({
148
+ container: {
149
+ borderColor: 'black',
150
+ borderTopWidth: 0,
151
+ borderBottomWidth: 5,
152
+ borderLeftWidth: 0,
153
+ borderRightWidth: 0,
154
+ padding: 10,
155
+ },
156
+ resetStyle: {
157
+ paddingTop: 10,
158
+ },
159
+ viewStyle:{
160
+ marginBottom: 10,
161
+ },
162
+ textStyle: {
163
+ fontSize: 30,
164
+ },
165
+ });
166
+
@@ -1,6 +1,6 @@
1
- import { harTasks } from '@ohos/hvigor-ohos-plugin';
2
-
3
- export default {
4
- system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
5
- plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
6
- }
1
+ import { harTasks } from '@ohos/hvigor-ohos-plugin';
2
+
3
+ export default {
4
+ system: harTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
5
+ plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
6
+ }
@@ -1,11 +1,11 @@
1
- {
2
- name: '@react-native-ohos/react-native-background-timer',
3
- version: '2.4.2-rc.2',
4
- description: 'Please describe the basic information.',
5
- main: 'Index.ets',
6
- author: '',
7
- license: 'MIT',
8
- dependencies: {
9
- '@rnoh/react-native-openharmony': '^0.72.38',
10
- },
1
+ {
2
+ name: '@react-native-ohos/react-native-background-timer',
3
+ version: '2.5.0-rc.1',
4
+ description: 'Please describe the basic information.',
5
+ main: 'Index.ets',
6
+ author: '',
7
+ license: 'MIT',
8
+ dependencies: {
9
+ "@rnoh/react-native-openharmony": "file:../react_native_openharmony"
10
+ },
11
11
  }
@@ -1,13 +1,13 @@
1
- cmake_minimum_required(VERSION 3.13)
2
- set(CMAKE_VERBOSE_MAKEFILE on)
3
-
4
- set(rnoh_background_timer_generated_dir "${CMAKE_CURRENT_SOURCE_DIR}/generated")
5
-
6
- file(GLOB_RECURSE rnoh_background_timer_generated_SRC "${rnoh_background_timer_generated_dir}/**/*.cpp")
7
- file(GLOB rnoh_background_timer_SRC CONFIGURE_DEPENDS *.cpp)
8
-
9
- add_library(rnoh_background_timer SHARED ${rnoh_background_timer_SRC} ${rnoh_background_timer_generated_SRC})
10
-
11
- target_include_directories(rnoh_background_timer PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${rnoh_background_timer_generated_dir})
12
-
13
- target_link_libraries(rnoh_background_timer PUBLIC rnoh)
1
+ cmake_minimum_required(VERSION 3.13)
2
+ set(CMAKE_VERBOSE_MAKEFILE on)
3
+
4
+ set(rnoh_background_timer_generated_dir "${CMAKE_CURRENT_SOURCE_DIR}/generated")
5
+
6
+ file(GLOB_RECURSE rnoh_background_timer_generated_SRC "${rnoh_background_timer_generated_dir}/**/*.cpp")
7
+ file(GLOB rnoh_background_timer_SRC CONFIGURE_DEPENDS *.cpp)
8
+
9
+ add_library(rnoh_background_timer SHARED ${rnoh_background_timer_SRC} ${rnoh_background_timer_generated_SRC})
10
+
11
+ target_include_directories(rnoh_background_timer PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${rnoh_background_timer_generated_dir})
12
+
13
+ target_link_libraries(rnoh_background_timer PUBLIC rnoh)
@@ -1,21 +1,21 @@
1
- /**
2
- * This code was generated by "react-native codegen-lib-harmony"
3
- */
4
-
5
- #include "BackgroundTimerTurboModule.h"
6
-
7
- namespace rnoh {
8
- using namespace facebook;
9
-
10
- BackgroundTimerTurboModule::BackgroundTimerTurboModule(
11
- const ArkTSTurboModule::Context ctx, const std::string name
12
- ) : ArkTSTurboModule(ctx, name)
13
- {
14
- methodMap_ = {
15
- ARK_METHOD_METADATA(start, 1),
16
- ARK_METHOD_METADATA(stop, 0),
17
- ARK_METHOD_METADATA(setTimeout, 2),
18
- };
19
- }
20
-
21
- } // namespace rnoh
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ #include "BackgroundTimerTurboModule.h"
6
+
7
+ namespace rnoh {
8
+ using namespace facebook;
9
+
10
+ BackgroundTimerTurboModule::BackgroundTimerTurboModule(
11
+ const ArkTSTurboModule::Context ctx, const std::string name
12
+ ) : ArkTSTurboModule(ctx, name)
13
+ {
14
+ methodMap_ = {
15
+ ARK_METHOD_METADATA(start, 1),
16
+ ARK_METHOD_METADATA(stop, 0),
17
+ ARK_METHOD_METADATA(setTimeout, 2),
18
+ };
19
+ }
20
+
21
+ } // namespace rnoh
@@ -1,16 +1,16 @@
1
- /**
2
- * This code was generated by "react-native codegen-lib-harmony"
3
- */
4
-
5
- #pragma once
6
-
7
- #include "RNOH/ArkTSTurboModule.h"
8
-
9
- namespace rnoh {
10
-
11
- class JSI_EXPORT BackgroundTimerTurboModule : public ArkTSTurboModule {
12
- public:
13
- BackgroundTimerTurboModule(const ArkTSTurboModule::Context ctx, const std::string name);
14
- };
15
-
16
- } // namespace rnoh
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ #pragma once
6
+
7
+ #include "RNOH/ArkTSTurboModule.h"
8
+
9
+ namespace rnoh {
10
+
11
+ class JSI_EXPORT BackgroundTimerTurboModule : public ArkTSTurboModule {
12
+ public:
13
+ BackgroundTimerTurboModule(const ArkTSTurboModule::Context ctx, const std::string name);
14
+ };
15
+
16
+ } // namespace rnoh
@@ -1,5 +1,5 @@
1
-
2
- /**
3
- */
4
-
5
- export {}
1
+
2
+ /**
3
+ */
4
+
5
+ export {}
@@ -1,5 +1,5 @@
1
- /**
2
- * This code was generated by "react-native codegen-lib-harmony"
3
- */
4
-
5
- export * from "./ts"
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ export * from "./ts"
@@ -1,6 +1,6 @@
1
- /**
2
- * This code was generated by "react-native codegen-lib-harmony"
3
- */
4
-
5
- export * as RNC from "./components/ts"
6
- export * as TM from "./turboModules/ts"
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ export * as RNC from "./components/ts"
6
+ export * as TM from "./turboModules/ts"
@@ -1,18 +1,18 @@
1
- /**
2
- * This code was generated by "react-native codegen-lib-harmony"
3
- */
4
-
5
- import { Tag } from "@rnoh/react-native-openharmony/ts"
6
-
7
- export namespace BackgroundTimerTurboModule {
8
- export const NAME = 'BackgroundTimerTurboModule' as const
9
-
10
- export interface Spec {
11
- start(delay: number): void;
12
-
13
- stop(): void;
14
-
15
- setTimeout(timeoutId: number, timeout: number): void;
16
-
17
- }
18
- }
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ import { Tag } from "@rnoh/react-native-openharmony/ts"
6
+
7
+ export namespace BackgroundTimerTurboModule {
8
+ export const NAME = 'BackgroundTimerTurboModule' as const
9
+
10
+ export interface Spec {
11
+ start(delay: number): void;
12
+
13
+ stop(): void;
14
+
15
+ setTimeout(timeoutId: number, timeout: number): void;
16
+
17
+ }
18
+ }
@@ -1,5 +1,5 @@
1
- /**
2
- * This code was generated by "react-native codegen-lib-harmony"
3
- */
4
-
5
- export * from "./BackgroundTimerTurboModule"
1
+ /**
2
+ * This code was generated by "react-native codegen-lib-harmony"
3
+ */
4
+
5
+ export * from "./BackgroundTimerTurboModule"