This repository has been archived by the owner on Apr 21, 2022. It is now read-only.
forked from navratill/react-native-tvos-controller
-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.js
executable file
·51 lines (49 loc) · 1.76 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import {
NativeModules,
NativeEventEmitter
} from 'react-native';
const nativeEventEmitter = new NativeEventEmitter(NativeModules.ReactNativeTvosController);
module.exports = {
connect: function(){
NativeModules.ReactNativeTvosController.connect();
},
connectTap: function(){
NativeModules.ReactNativeTvosController.connectTap();
},
connectSwipe: function(){
NativeModules.ReactNativeTvosController.connectSwipe();
},
connectLongPress: function(){
NativeModules.ReactNativeTvosController.connectLongPress();
},
disconnect: function(){
NativeModules.ReactNativeTvosController.disconnect();
},
disconnectTap: function(){
NativeModules.ReactNativeTvosController.disconnectTap();
},
disconnectSwipe: function(){
NativeModules.ReactNativeTvosController.disconnectSwipe();
},
disconnectLongPress: function(){
NativeModules.ReactNativeTvosController.disconnectLongPress();
},
enablePanGesture: function(){
NativeModules.ReactNativeTvosController.enablePanGesture();
},
disablePanGesture: function(){
NativeModules.ReactNativeTvosController.disablePanGesture();
},
enableRecognizeSimultaneously: function(){
NativeModules.ReactNativeTvosController.enableRecognizeSimultaneously();
},
disableRecognizeSimultaneously: function(){
NativeModules.ReactNativeTvosController.disableRecognizeSimultaneously();
},
subscribe: function(event, callback){
nativeEventEmitter.addListener(event, callback);
return function(){
nativeEventEmitter.removeListener(event, callback);
}
}
}