├── .gitignore ├── .haxerc ├── .travis.yml ├── README.md ├── haxe_libraries ├── react-native.hxml ├── react-next.hxml └── travix.hxml ├── haxelib.json ├── src ├── Nothing.hx └── react │ └── native │ ├── NativeEvent.hx │ ├── ReactNative.hx │ ├── ReactNativeComponent.hx │ ├── Statics.hx │ ├── api │ ├── ActionSheetIOS.hx │ ├── Alert.hx │ ├── AlertIOS.hx │ ├── Animated.hx │ ├── AppRegistry.hx │ ├── AppState.hx │ ├── AsyncStorage.hx │ ├── BackAndroid.hx │ ├── BackHandler.hx │ ├── CameraRoll.hx │ ├── Clipboard.hx │ ├── DatePickerAndroid.hx │ ├── DeviceEventEmitter.hx │ ├── Dimensions.hx │ ├── Easing.hx │ ├── EmitterSubscription.hx │ ├── Geolocation.hx │ ├── ImageEditor.hx │ ├── InteractionManager.hx │ ├── Keyboard.hx │ ├── LayoutAnimation.hx │ ├── Linking.hx │ ├── NativeEventEmitter.hx │ ├── NetInfo.hx │ ├── PanResponder.hx │ ├── PermissionsAndroid.hx │ ├── PixelRatio.hx │ ├── Platform.hx │ ├── PushNotificationIOS.hx │ ├── Share.hx │ ├── StatusBarIOS.hx │ ├── StyleSheet.hx │ ├── ToastAndroid.hx │ ├── UIManager.hx │ └── Vibration.hx │ └── component │ ├── ActivityIndicator.hx │ ├── Button.hx │ ├── CheckBox.hx │ ├── DatePickerIOS.hx │ ├── DrawerLayoutAndroid.hx │ ├── FlatList.hx │ ├── Image.hx │ ├── ImageBackground.hx │ ├── KeyboardAvoidingView.hx │ ├── ListView.hx │ ├── Modal.hx │ ├── NavigatorIOS.hx │ ├── Picker.hx │ ├── PickerIOS.hx │ ├── ProgressBarAndroid.hx │ ├── ProgressViewIOS.hx │ ├── RefreshControl.hx │ ├── SafeAreaView.hx │ ├── ScrollView.hx │ ├── SectionList.hx │ ├── SegmentedControlIOS.hx │ ├── Slider.hx │ ├── SnapshotViewIOS.hx │ ├── StatusBar.hx │ ├── Switch.hx │ ├── TabBarIOS.hx │ ├── Text.hx │ ├── TextInput.hx │ ├── ToolbarAndroid.hx │ ├── TouchableHighlight.hx │ ├── TouchableNativeFeedback.hx │ ├── TouchableOpacity.hx │ ├── TouchableWithoutFeedback.hx │ ├── View.hx │ ├── ViewPagerAndroid.hx │ ├── VirtualizedList.hx │ ├── WebView.hx │ ├── props │ ├── ActivityIndicatorProps.hx │ ├── AnimatedViewProps.hx │ ├── AnimatedViewStyle.hx │ ├── AnimatedViewStyleProps.hx │ ├── ButtonProps.hx │ ├── CheckBoxProps.hx │ ├── Color.hx │ ├── DatePickerIOSProps.hx │ ├── DrawerLayoutAndroidProps.hx │ ├── FlatListProps.hx │ ├── ImageProps.hx │ ├── ImageSource.hx │ ├── ImageStyle.hx │ ├── KeyboardAvoidingViewProps.hx │ ├── LayoutProps.hx │ ├── ListViewProps.hx │ ├── ModalProps.hx │ ├── NavigatorIOSProps.hx │ ├── Node.hx │ ├── PickerIOSProps.hx │ ├── PickerProps.hx │ ├── ProgressBarAndroidProps.hx │ ├── ProgressViewIOSProps.hx │ ├── Props_.hx │ ├── RefreshControlProps.hx │ ├── ScrollViewProps.hx │ ├── ScrollViewStyle.hx │ ├── SectionListProps.hx │ ├── SegmentedControlIOSProps.hx │ ├── ShadowProps.hx │ ├── SliderProps.hx │ ├── SnapshotViewIOSProps.hx │ ├── StatusBarProps.hx │ ├── Style.hx │ ├── SwitchProps.hx │ ├── TextInputProps.hx │ ├── TextProps.hx │ ├── TextStyle.hx │ ├── ToolbarAndroidProps.hx │ ├── TouchableHighlightProps.hx │ ├── TouchableNativeFeedbackProps.hx │ ├── TouchableOpacityProps.hx │ ├── TouchableProps.hx │ ├── TouchableWithoutFeedbackProps.hx │ ├── Transforms.hx │ ├── ViewPagerAndroidProps.hx │ ├── ViewProps.hx │ ├── ViewStyle.hx │ ├── ViewStyleProps.hx │ ├── VirtualizedListProps.hx │ └── WebViewProps.hx │ └── types │ ├── AccessibilityTypes.hx │ ├── AnimationTypes.hx │ ├── EventTypes.hx │ ├── ImagePropsTypes.hx │ ├── TextPropsTypes.hx │ └── ViewPropTypes.hx ├── submit.sh ├── tests.hxml └── tests └── RunTests.hx /.gitignore: -------------------------------------------------------------------------------- 1 | bin -------------------------------------------------------------------------------- /.haxerc: -------------------------------------------------------------------------------- 1 | {"version":"3.4.7","resolveLibs":"scoped"} -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: required 2 | dist: trusty 3 | 4 | language: haxe 5 | 6 | os: 7 | - linux 8 | - osx 9 | 10 | haxe: 11 | - "3.2.1" 12 | - development 13 | 14 | matrix: 15 | allow_failures: 16 | - haxe: development 17 | 18 | install: 19 | - haxelib install travix 20 | - haxelib run travix install 21 | 22 | script: 23 | - haxelib run travix js 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # haxe-react-native 2 | 3 | ## Quick Start 4 | 5 | Follow the steps [here](https://github.com/haxe-react/haxe-react-native-sample) to start writing an app in less than a minute! 6 | 7 | ## Manual Setup 8 | 9 | ##### Install Haxelibs 10 | 11 | 1. `haxelib install react-next` 12 | 1. `haxelib install react-native` 13 | 14 | ##### Setup React Native 15 | 16 | Follow the steps [here](http://facebook.github.io/react-native/docs/getting-started.html#content) 17 | 18 | ##### Write some Haxe 19 | 20 | Main.hx 21 | 22 | ``` haxe 23 | package; 24 | 25 | import react.ReactComponent; 26 | import react.ReactMacro.jsx; 27 | import react.native.api.*; 28 | import react.native.component.*; 29 | 30 | class Main 31 | { 32 | public static function main() 33 | { 34 | var projectName = 'AwesomeProject'; 35 | AppRegistry.registerComponent(projectName, function() return App); 36 | } 37 | } 38 | 39 | class App extends ReactComponent 40 | { 41 | override function render() 42 | { 43 | return jsx(' 44 | 45 | 46 | Test 47 | 48 | 49 | '); 50 | } 51 | } 52 | ``` 53 | 54 | ##### Build 55 | 56 | build.hxml 57 | 58 | ``` 59 | -lib react-native 60 | 61 | -cp src 62 | -main Main 63 | -js index.ios.js 64 | ``` 65 | 66 | Then the generated `index.ios.js` can be used in the usual react-native workflow 67 | -------------------------------------------------------------------------------- /haxe_libraries/react-native.hxml: -------------------------------------------------------------------------------- 1 | -cp src 2 | -D react_native 3 | -lib react-next -------------------------------------------------------------------------------- /haxe_libraries/react-next.hxml: -------------------------------------------------------------------------------- 1 | -D react-next=1.121.0 2 | # @install: lix --silent download "haxelib:/react-next#1.121.0" into react-next/1.121.0/haxelib 3 | -lib tink_hxx 4 | -lib js-object 5 | -cp ${HAXE_LIBCACHE}/react-next/1.121.0/haxelib/src/lib 6 | --macro react.jsx.JsxStaticMacro.addHook() 7 | --macro addGlobalMetadata('', '@:build(react.jsx.JsxStaticMacro.build())') 8 | 9 | -D react=1.121.0 10 | -------------------------------------------------------------------------------- /haxe_libraries/travix.hxml: -------------------------------------------------------------------------------- 1 | # @run: haxelib run-dir travix ${HAXESHIM_LIBCACHE}/travix/0.10.5/haxelib 2 | # @install: lix --silent download "haxelib:travix#0.10.5" into travix/0.10.5/haxelib 3 | -D travix=0.10.5 4 | -cp ${HAXESHIM_LIBCACHE}/travix/0.10.5/haxelib/src 5 | -------------------------------------------------------------------------------- /haxelib.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native", 3 | "classPath": "src", 4 | "dependencies": { 5 | "react-next": "" 6 | }, 7 | "url": "https://github.com/haxe-react/haxe-react-native", 8 | "contributors": [ 9 | "kevinresol", 10 | "zabojad" 11 | ], 12 | "version": "0.2.1", 13 | "releasenote": "Various updates", 14 | "tags": [ 15 | "react", 16 | "native" 17 | ], 18 | "license": "MIT" 19 | } -------------------------------------------------------------------------------- /src/Nothing.hx: -------------------------------------------------------------------------------- 1 | package; 2 | 3 | // TODO: this is so useful with js.Promise and should go into the std lib 4 | @:enum 5 | abstract Nothing(Dynamic) { 6 | var Nil = null; 7 | } -------------------------------------------------------------------------------- /src/react/native/NativeEvent.hx: -------------------------------------------------------------------------------- 1 | package react.native; 2 | 3 | typedef NativeEvent = { 4 | changedTouches:Array, // Array of all touch events that have changed since the last event 5 | identifier:String, // The ID of the touch 6 | locationX:Float, // The X position of the touch, relative to the element 7 | locationY:Float, // The Y position of the touch, relative to the element 8 | pageX:Float, // The X position of the touch, relative to the root element 9 | pageY:Float, // The Y position of the touch, relative to the root element 10 | target:String, // The node id of the element receiving the touch event 11 | timestamp:Int, // A time identifier for the touch, useful for velocity calculation 12 | touches:Array, // Array of all current touches on the screen 13 | } -------------------------------------------------------------------------------- /src/react/native/ReactNative.hx: -------------------------------------------------------------------------------- 1 | package react.native; 2 | 3 | 4 | @:jsRequire('react-native') 5 | extern class ReactNative { 6 | static function findNodeHandle(node:Any):Float; 7 | } -------------------------------------------------------------------------------- /src/react/native/ReactNativeComponent.hx: -------------------------------------------------------------------------------- 1 | package react.native; 2 | 3 | typedef MeasureData = { 4 | x:Float, 5 | y:Float, 6 | width:Float, 7 | height:Float, 8 | pageX:Float, 9 | pageY:Float, 10 | } 11 | 12 | typedef MeasureWindowData = { 13 | x:Float, 14 | y:Float, 15 | width:Float, 16 | height:Float, 17 | } 18 | 19 | typedef MeasureLayoutData = { 20 | left:Float, 21 | top:Float, 22 | width:Float, 23 | height:Float, 24 | } 25 | 26 | @:jsRequire('react-native') 27 | extern class ReactNativeComponent extends react.ReactComponent { 28 | function blur():Void; 29 | 30 | function focus():Void; 31 | 32 | function measure(cb:MeasureData->Void):Void; 33 | 34 | function measureInWindow(cb:MeasureWindowData->Void):Void; 35 | 36 | function measureLayout(relativeRef:Float, onSuccess:MeasureLayoutData->Void, ?onFail:Void->Void):Void; 37 | 38 | function setNativeProps(nativeProps: Dynamic): Void; 39 | } -------------------------------------------------------------------------------- /src/react/native/Statics.hx: -------------------------------------------------------------------------------- 1 | package react.native; 2 | 3 | import react.ReactComponent; 4 | 5 | @:jsRequire('react-native') 6 | extern class Statics { 7 | static function findNodeHandle(component:ReactComponent):Int; 8 | } -------------------------------------------------------------------------------- /src/react/native/api/ActionSheetIOS.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | @:jsRequire('react-native', 'ActionSheetIOS') 4 | extern class ActionSheetIOS { 5 | static function showActionSheetWithOptions(options:ShowActionSheetOptions, callback:Int->Void):Void; 6 | static function showShareActionSheetWithOptions(options:ShowShareActionSheetOptions, failureCallback:js.Error->Void, successCallback:Bool->String->Void):Void; 7 | } 8 | 9 | typedef ShowActionSheetOptions = { 10 | options:Array, 11 | ?cancelButtonIndex:Int, 12 | ?destructiveButtonIndex:Int, 13 | ?title:String, 14 | ?message:String, 15 | ?tintColor:String, 16 | } 17 | 18 | typedef ShowShareActionSheetOptions = { 19 | url:String, 20 | message:String, 21 | subject:String, 22 | excludedActivityTypes:Array, 23 | } -------------------------------------------------------------------------------- /src/react/native/api/Alert.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | @:jsRequire('react-native', 'Alert') 4 | extern class Alert { 5 | static function alert( 6 | title:Null, //Passing null or empty string will hide the title. 7 | ?message:String, 8 | ?buttons:Array<{text:String, ?onPress:Void->Void, ?style:AlertButtonStyle}>, 9 | ?options:Dynamic 10 | ):Void; 11 | 12 | //TODO better typing for keyboardType and callbackOrButtons 13 | static function prompt( 14 | title:String, 15 | ?message:String, 16 | ?callbackOrButtons:Dynamic, //If passed a function, it will be called with the prompt's value (text: string) => void, when the user taps 'OK'. 17 | //If passed an array, buttons will be configured based on the array content. 18 | ?type:AlertType, 19 | ?defaultValue:String, 20 | ?keyboardType:String //The keyboard type of first text field (if exists). One of TextInput keyboardTypes. 21 | ):Void; 22 | } 23 | 24 | //iOS only 25 | enum abstract AlertButtonStyle(String) to String { 26 | var Cancel = 'cancel'; 27 | var Destructive = 'destructive'; 28 | var Default = 'default'; 29 | } 30 | 31 | //iOS only 32 | enum abstract AlertType(String) to String { 33 | var Default = 'default'; //Default alert with no inputs 34 | var Plain = 'plain-text'; //Plain text input alert 35 | var Secure = 'secure-text;'; //Secure text input alert 36 | var Login = 'login-password'; //Login and password alert 37 | } 38 | -------------------------------------------------------------------------------- /src/react/native/api/AlertIOS.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | import haxe.extern.EitherType; 4 | import haxe.Constraints; 5 | 6 | @:jsRequire('react-native', 'AlertIOS') 7 | extern class AlertIOS { 8 | static function alert(title:String, ?message:String, ?buttons:EitherTypeVoid, Array<{text:String, ?onPress:Void->Void, ?style:String}>>):Void; 9 | static function prompt(title:String, ?message:String, ?buttons:EitherTypeVoid, Array<{text:String, ?onPress:String->Void, ?style:String}>>, type:String, defaultValue:String, keyboardType:String):Void; 10 | } 11 | -------------------------------------------------------------------------------- /src/react/native/api/Animated.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | import react.ReactComponent; 4 | import react.native.component.*; 5 | import react.native.component.props.*; 6 | import haxe.extern.EitherType; 7 | import haxe.Constraints; 8 | 9 | @:jsRequire('react-native', 'Animated') 10 | extern class Animated { 11 | static inline var View = AnimatedView; 12 | static inline var ScrollView = AnimatedScrollView; 13 | static inline var Image = AnimatedImage; 14 | static inline var Text = AnimatedText; 15 | static inline var FlatList = AnimatedFlatList; 16 | 17 | static function decay(value:EitherType, config:DecayAnimationConfig):CompositeAnimation; 18 | static function timing(value:EitherType, config:TimingAnimationConfig):CompositeAnimation; 19 | static function spring(value:EitherType, config:SpringAnimationConfig):CompositeAnimation; 20 | static function add(a:EitherType, b:EitherType):Animated; 21 | static function divide(a:EitherType, b:EitherType):Animated; 22 | static function multiply(a:EitherType, b:EitherType):Animated; 23 | static function modulo(a:EitherType, modulus:Float):Animated; 24 | static function diffClamp(a:Animated, min:Float, max:Float):Animated; 25 | static function delay(time:Float):CompositeAnimation; 26 | static function loop(anim:CompositeAnimation,cfg:{?iterations:Int}):CompositeAnimation; 27 | static function sequence(animations:Array):CompositeAnimation; 28 | static function parallel(animations:Array, ?config:ParallelConfig):CompositeAnimation; 29 | static function stagger(time:Float, animations:Array):CompositeAnimation; 30 | static function event(argMapping:Array, ?config:EventConfig):Dynamic; 31 | static function createAnimatedComponent(component:Dynamic):Dynamic; 32 | 33 | function interpolate(config:InterpolationConfigType):AnimatedValue; 34 | } 35 | 36 | 37 | @:forward 38 | abstract AnimatedValue(AnimatedValueImpl) from AnimatedValueImpl to AnimatedValueImpl { 39 | public inline function new(v) this = new AnimatedValueImpl(v); 40 | @:from static function fromFloat(f:Float) return cast new AnimatedValueImpl(f); 41 | @:to function toFloat():Float return (this :AnimatedValueImpl).getValue(); 42 | } 43 | 44 | @:jsRequire('react-native', 'Animated.Value') 45 | extern class AnimatedValueImpl extends Animated { 46 | function new(v:Float); 47 | @:native('__getValue') 48 | function getValue():Float; 49 | function setValue(v:Float):Void; 50 | function setOffset(v:Float):Void; 51 | function flattenOffset():Void; 52 | function extractOffset():Void; 53 | function addListener(callback:ValueListenerCallback):String; 54 | function removeListener(id:String):Void; 55 | function removeAllListeners():Void; 56 | function stopAnimation(?callback:Float->Void):Void; 57 | } 58 | 59 | @:jsRequire('react-native', 'Animated.ValueXY') 60 | extern class AnimatedValueXY extends Animated { 61 | function new(?value:{x:EitherType, y:EitherType}); 62 | @:native('__getValue') 63 | function getValue():{x:Float, y:Float}; 64 | function setValue(v:{x:Float, y:Float}):Void; 65 | function setOffset(v:{x:Float, y:Float}):Void; 66 | function flattenOffset():Void; 67 | function stopAnimation(?callback:{x:Float, y:Float}->Void):Void; 68 | function addListener(callback:ValueXYListenerCallback):String; 69 | function removeListener(id:String):Void; 70 | function removeAllListeners():Void; 71 | function getLayout():{left:AnimatedValue, top:AnimatedValue}; 72 | function getTranslateTransform():Array>; 73 | var x:AnimatedValue; 74 | var y:AnimatedValue; 75 | } 76 | 77 | @:jsRequire('react-native', 'Animated.View') 78 | extern class AnimatedView extends ReactComponentOfProps<{>AnimatedViewProps,}> {} 79 | 80 | @:jsRequire('react-native', 'Animated.ScrollView') 81 | extern class AnimatedScrollView extends ReactComponentOfProps<{>ScrollViewProps,}> { 82 | var _component:ScrollView; 83 | } 84 | 85 | @:jsRequire('react-native', 'Animated.FlatList') 86 | extern class AnimatedFlatList extends ReactComponentOfProps<{>FlatListProps,}> { 87 | var _component:FlatList; 88 | } 89 | 90 | @:jsRequire('react-native', 'Animated.Text') 91 | extern class AnimatedText extends ReactComponentOfProps<{>TextProps,}> {} 92 | 93 | @:jsRequire('react-native', 'Animated.Image') 94 | extern class AnimatedImage extends ReactComponentOfProps<{>ImageProps,}> {} 95 | 96 | typedef ValueListenerCallback = {value:Float}->Void; 97 | typedef ValueXYListenerCallback = {x:Float, y:Float}->Void; 98 | 99 | typedef AnimationConfig = { 100 | ?isInteraction:Bool, 101 | ?useNativeDriver:Bool, 102 | ?onComplete:EndCallback, 103 | } 104 | 105 | typedef DecayAnimationConfig = { 106 | > AnimationConfig, 107 | velocity:EitherType, 108 | ?deceleration:Float, 109 | } 110 | 111 | typedef TimingAnimationConfig = { 112 | > AnimationConfig, 113 | toValue:EitherType>>, 114 | ?easing:Float->Float, 115 | ?duration:Float, 116 | ?delay:Float, 117 | } 118 | 119 | typedef SpringAnimationConfig = { 120 | > AnimationConfig, 121 | toValue:EitherType>>, 122 | ?overshootClamping:Bool, 123 | ?restDisplacementThreshold:Float, 124 | ?restSpeedThreshold:Float, 125 | ?velocity:EitherType, 126 | ?bounciness:Float, 127 | ?speed:Float, 128 | ?tension:Float, 129 | ?friction:Float, 130 | } 131 | 132 | typedef ParallelConfig = { 133 | ?stopTogether:Bool, 134 | } 135 | 136 | typedef Mapping = EitherType, AnimatedValue>; 137 | typedef EventConfig = { 138 | ?listener:Function, 139 | ?useNativeDriver:Bool, 140 | } 141 | 142 | typedef CompositeAnimation = { 143 | start:?EndCallback->Void, 144 | stop:Void->Void, 145 | } 146 | 147 | typedef EndResult = {finished:Bool}; 148 | typedef EndCallback = EndResult->Void; 149 | 150 | typedef InterpolationConfigType = { 151 | inputRange:Array, 152 | outputRange:EitherType, Array>, 153 | ?easing:Float->Float, 154 | ?extrapolate:ExtrapolateType, 155 | ?extrapolateLeft:ExtrapolateType, 156 | ?extrapolateRight:ExtrapolateType, 157 | } 158 | 159 | @:enum 160 | abstract ExtrapolateType(String) { 161 | var Extend = 'extend'; 162 | var Identity = 'identity'; 163 | var Clamp = 'clamp'; 164 | } 165 | -------------------------------------------------------------------------------- /src/react/native/api/AppRegistry.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | @:jsRequire("react-native", "AppRegistry") 4 | extern class AppRegistry { 5 | static function registerConfig(config:Array):Dynamic; 6 | static function registerComponent(appKey:String, getComponentFunc:Void->ReactType, ?section:Bool):String; 7 | static function registerRunnable(appKey:String, func:Dynamic):Dynamic; 8 | static function getAppKeys():Dynamic; 9 | static function runApplication(appKey:String, appParameters:Dynamic):Dynamic; 10 | static function unmountApplicationComponentAtRootTag(rootTag:Float):Dynamic; 11 | } 12 | -------------------------------------------------------------------------------- /src/react/native/api/AppState.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | @:jsRequire('react-native', 'AppState') 4 | extern class AppState { 5 | static var currentState:AppStateValue; 6 | static function addEventListener(event:AppStateEventName, listener:AppStateValue->Void):Void; 7 | static function removeEventListener(event:AppStateEventName, listener:AppStateValue->Void):Void; 8 | } 9 | 10 | @:enum 11 | abstract AppStateValue(String) { 12 | var Active = 'active'; 13 | var Background = 'background'; 14 | var Inactive = 'inactive'; 15 | } 16 | @:enum 17 | abstract AppStateEventName(String) { 18 | var Change = 'change'; 19 | } -------------------------------------------------------------------------------- /src/react/native/api/AsyncStorage.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | import js.Error; 4 | import js.Promise; 5 | 6 | @:jsRequire('react-native', 'AsyncStorage') 7 | extern class AsyncStorage { 8 | static function getItem(key:String, ?callback:Error->String->Void):Promise; 9 | static function setItem(key:String, value:String, ?callback:Error->Void):Promise; 10 | static function removeItem(key:String, ?callback:Error->Void):Promise; 11 | static function mergeItem(key:String, value:String, ?callback:Error->Void):Promise; 12 | static function clear(?callback:Error->Array->Void):Promise>; 13 | static function flushGetRequests():Void; 14 | static function getAllKeys(?callback:Error->Array->Void):Promise>; 15 | static function multiGet(keys:Array, ?callback:Array->Array>->Void):Promise>>; 16 | static function multiSet(keyValuePairs:Array>, ?callback:Array->Void):Promise; 17 | static function multiRemove(keys:Array, ?callback:Array->Void):Promise>>; 18 | static function multiMerge(keyValuePairs:Array>, ?callback:Array->Void):Promise; 19 | } 20 | -------------------------------------------------------------------------------- /src/react/native/api/BackAndroid.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | @:jsRequire('react-native', 'BackAndroid') 4 | extern class BackAndroid { 5 | static function exitApp():Void; 6 | static function addEventListener(event:BackAndroidEventName, listener:Void->Bool):Void; 7 | static function removeEventListener(event:BackAndroidEventName, listener:Void->Bool):Void; 8 | } 9 | 10 | @:enum 11 | abstract BackAndroidEventName(String) { 12 | var HardwareBackPress = 'hardwareBackPress'; 13 | } -------------------------------------------------------------------------------- /src/react/native/api/BackHandler.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | @:jsRequire('react-native', 'BackHandler') 4 | extern class BackHandler { 5 | static function exitApp():Void; 6 | static function addEventListener(event:BackHandlerEventName, listener:Void->Bool):Void; 7 | static function removeEventListener(event:BackHandlerEventName, listener:Void->Bool):Void; 8 | } 9 | 10 | @:enum 11 | abstract BackHandlerEventName(String) { 12 | var HardwareBackPress = 'hardwareBackPress'; 13 | } -------------------------------------------------------------------------------- /src/react/native/api/CameraRoll.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | import js.Promise; 4 | using StringTools; 5 | 6 | @:jsRequire('react-native', 'CameraRoll') 7 | extern class CameraRoll { 8 | static function saveImageWithTag(tag:String):Promise; 9 | static function saveToCameraRoll(tag:String, ?type:SaveType):Promise; 10 | static function getPhotos(params:GetPhotoParams):Promise; 11 | } 12 | 13 | @:enum 14 | abstract GroupTypes(String) { 15 | var Album = 'Album'; 16 | var All = 'All'; 17 | var Event = 'Event'; 18 | var Faces = 'Faces'; 19 | var Library = 'Library'; 20 | var PhotoStream = 'PhotoStream'; 21 | var SavedPhotos = 'SavedPhotos'; 22 | } 23 | 24 | @:enum 25 | abstract AssetType(String) { 26 | var All = 'All'; 27 | var Videos = 'Videos'; 28 | var Photos = 'Photos'; 29 | } 30 | 31 | @:enum 32 | abstract SaveType(String) { 33 | var Video = 'video'; 34 | var Photo = 'photo'; 35 | } 36 | 37 | typedef GetPhotoParams = { 38 | first:Int, 39 | ?after:String, 40 | ?groupTypes:GroupTypes, 41 | ?groupName:String, 42 | ?assetType:AssetType, 43 | ?mimeTypes:Array, 44 | } 45 | 46 | typedef GetPhotoResult = { 47 | edges:Array, 48 | page_info:PageInfo, 49 | } 50 | 51 | typedef PageInfo = { 52 | has_next_page:Bool, 53 | start_cursor:String, 54 | end_cursor:String, 55 | } 56 | 57 | abstract NodeType(String) to String { 58 | public function asMimeType():String { 59 | return switch this { 60 | #if ios 61 | case 'ALAssetTypeVideo': 'video/mp4'; // TODO: how to determine? 62 | case 'ALAssetTypePhoto': 'image/jpeg'; // TODO: how to determine? 63 | #end 64 | default: this; 65 | } 66 | } 67 | 68 | @:to public function asEnum():SaveType { 69 | return switch this { 70 | #if ios 71 | case 'ALAssetTypeVideo': Video; 72 | case 'ALAssetTypePhoto': Photo; 73 | #elseif android 74 | case v if(v.startsWith('video/')): Video; 75 | case v if(v.startsWith('image/')): Photo; 76 | #end 77 | default: cast this; // TODO: 78 | } 79 | } 80 | } 81 | 82 | typedef Edge = { 83 | node: { 84 | type:NodeType, 85 | group_name:String, 86 | image: { 87 | uri:String, 88 | height:Int, 89 | width:Int, 90 | isStored:Bool, 91 | #if ios filename:String, #end 92 | }, 93 | timestamp:Float, 94 | location: { 95 | latitude:Float, 96 | longitude:Float, 97 | altitude:Float, 98 | heading:Float, 99 | speed:Float, 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /src/react/native/api/Clipboard.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | @:jsRequire('react-native', 'Clipboard') 4 | extern class Clipboard { 5 | static function getString():js.Promise; 6 | static function setString(content:String):Void; 7 | } 8 | -------------------------------------------------------------------------------- /src/react/native/api/DatePickerAndroid.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | @:enum 4 | abstract DatePickerAndroidMode(String) 5 | from String to String 6 | { 7 | var Calendar = 'calendar'; 8 | var Spinner = 'spinner'; 9 | var Default = 'default'; 10 | } 11 | 12 | typedef DatePickerAndroidOptions = { 13 | ? date : haxe.extern.EitherType, 14 | ? minDate : haxe.extern.EitherType, 15 | ? maxDate : haxe.extern.EitherType, 16 | ? mode : DatePickerAndroidMode, 17 | } 18 | 19 | typedef DatePickerAndroidResult = { 20 | action : String, 21 | ? year : Int, 22 | ? month : Int, 23 | ? day : Int, 24 | } 25 | 26 | @:jsRequire('react-native', 'DatePickerAndroid') 27 | extern class DatePickerAndroid { 28 | static public function open(options : DatePickerAndroidOptions) : js.Promise; 29 | static public var dateSetAction : String; 30 | static public var dismissedAction : String; 31 | } 32 | -------------------------------------------------------------------------------- /src/react/native/api/DeviceEventEmitter.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | import haxe.Constraints; 4 | 5 | @:jsRequire('react-native', 'DeviceEventEmitter') 6 | extern class DeviceEventEmitter { 7 | static public function addListener(event:String, cb:Function, ?context:Dynamic):EmitterSubscription; 8 | static public function removeAllListeners(eventType:String):Void; 9 | static public function removeSubscription(sub:EmitterSubscription):Void; 10 | } 11 | -------------------------------------------------------------------------------- /src/react/native/api/Dimensions.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | typedef ItemDimensionsData = { 4 | width:Float, 5 | height:Float, 6 | scale:Float, 7 | fontScale:Float 8 | } 9 | typedef DimensionsData = { 10 | window:ItemDimensionsData, 11 | screen:ItemDimensionsData 12 | } 13 | 14 | @:jsRequire('react-native', 'Dimensions') 15 | extern class Dimensions { 16 | static function get(dim:String):{width:Int, height:Int}; 17 | static function set(dim:{width:Int, height:Int}):Void; 18 | static function addEventListener(type:String,handler:DimensionsData->Void):Void; 19 | static function removeEventListener(type:String,handler:DimensionsData->Void):Void; 20 | } 21 | 22 | 23 | @:enum abstract DimensionTarget(String) from String { 24 | var Window = 'window'; 25 | var Screen = 'screen'; 26 | } -------------------------------------------------------------------------------- /src/react/native/api/Easing.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | @:jsRequire("react-native", "Easing") 4 | extern class Easing { 5 | static function step0(n:Float):Float; 6 | static function step1(n:Float):Float; 7 | static function linear(t:Float):Float; 8 | static function ease(t:Float):Float; 9 | static function quad(t:Float):Float; 10 | static function cubic(t:Float):Float; 11 | static function poly(n:Int):Float->Float; 12 | static function sin(t:Float):Float; 13 | static function circle(t:Float):Float; 14 | static function exp(t:Float):Float; 15 | static function elastic(bounciness:Float):Float->Float; 16 | static function back(s:Float):Float->Float; 17 | static function bounce(t:Float):Float; 18 | static function bezier(x1:Float, y1:Float, x2:Float, y2:Float):Float->Float; 19 | @:native('in') static function in_(easing:Float->Float):Float->Float; 20 | static function out(easing:Float->Float):Float->Float; 21 | static function inOut(easing:Float->Float):Float->Float; 22 | } 23 | -------------------------------------------------------------------------------- /src/react/native/api/EmitterSubscription.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | extern class EmitterSubscription { 4 | public function remove():Void; 5 | } -------------------------------------------------------------------------------- /src/react/native/api/Geolocation.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | import haxe.Constraints; 4 | 5 | @:jsRequire('react-native', 'Geolocation') 6 | extern class Geolocation { 7 | static function getCurrentPosition(geo_success:Function, ?geo_error:Function, ?geo_options:GeoOptions):Void; 8 | static function watchPosition(success:Function, ?error:Function, ?options:GeoOptions):Int; 9 | static function clearWatch(watchID:Int):Void; 10 | static function stopObserving():Void; 11 | } 12 | 13 | typedef GeoOptions = { 14 | timeout:Float, 15 | maximumAge:Float, 16 | enableHighAccuracy:Bool, 17 | distanceFilter:Float, 18 | } -------------------------------------------------------------------------------- /src/react/native/api/ImageEditor.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | import haxe.Constraints; 4 | 5 | @:jsRequire('react-native', 'ImageEditor') 6 | extern class ImageEditor { 7 | static function cropImage(uri:String, cropData:ImageCropData, success:String->Void, failure:Dynamic->Void):Void; 8 | } 9 | 10 | typedef ImageCropData = { 11 | offset:{ 12 | x:Int, 13 | y:Int, 14 | }, 15 | size:{ 16 | width:Int, 17 | height:Int, 18 | }, 19 | ?displaySize:{ 20 | width:Int, 21 | height:Int, 22 | }, 23 | ?resizeMode:ResizeMode, 24 | } 25 | 26 | @:enum 27 | abstract ResizeMode(String) { 28 | var Contain = 'contain'; 29 | var Cover = 'cover'; 30 | var Stretch = 'stretch'; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/react/native/api/InteractionManager.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | import haxe.extern.EitherType; 4 | 5 | @:jsRequire('react-native', 'InteractionManager') 6 | extern class InteractionManager { 7 | public static function runAfterInteractions(task:Task):CancellablePromise; 8 | public static function createInteractionHandle():Handle; 9 | public static function clearInteractionHandle(handle:Handle):Void; 10 | public static function setDeadline(deadline:Int):Void; 11 | } 12 | 13 | private typedef Handle = Int; 14 | 15 | private extern class CancellablePromise { 16 | function then(cb:Void->Void):Void; 17 | function done():Void; 18 | function cancel():Void; 19 | } 20 | 21 | private typedef Task = EitherType< 22 | Void->Void, 23 | EitherType< 24 | {name:String, run:Void->Void}, 25 | {name:String, gen:Void->js.Promise} 26 | > 27 | > -------------------------------------------------------------------------------- /src/react/native/api/Keyboard.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | @:jsRequire('react-native', 'Keyboard') 4 | extern class Keyboard { 5 | static function addListener(event:KeyboardEventName, listener:Dynamic->Void):Keyboard; 6 | static function removeListener(event:KeyboardEventName, listener:Dynamic->Void):Keyboard; 7 | static function removeAllListener(event:KeyboardEventName):Void; 8 | static function dismiss():Void; 9 | function remove():Void; 10 | } 11 | 12 | @:enum 13 | abstract KeyboardEventName(String) { 14 | var KeyboardWillShow = "keyboardWillShow"; 15 | var KeyboardDidShow = "keyboardDidShow"; 16 | var KeyboardWillHide = "keyboardWillHide"; 17 | var KeyboardDidHide = "keyboardDidHide"; 18 | var KeyboardWillChangeFrame = "keyboardWillChangeFrame"; 19 | var KeyboardDidChangeFrame = "keyboardDidChangeFrame"; 20 | } -------------------------------------------------------------------------------- /src/react/native/api/LayoutAnimation.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | import haxe.Constraints; 4 | 5 | @:jsRequire('react-native', 'LayoutAnimation') 6 | extern class LayoutAnimation { 7 | static function configureNext(config:LayoutAnimationConfig, ?onAnimationDidEnd:Function):Void; 8 | static function create(duration:Int, type:Anim, creationProp:CreationProps):LayoutAnimationConfig; 9 | static function easeInEaseOut():Void; 10 | static function linear():Void; 11 | static function spring():Void; 12 | } 13 | 14 | 15 | extern class LayoutAnimationConfig {} 16 | private typedef Anim = Dynamic; 17 | private typedef CreationProps = Dynamic; -------------------------------------------------------------------------------- /src/react/native/api/Linking.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | import js.Promise; 4 | 5 | @:jsRequire('react-native', 'Linking') 6 | extern class Linking { 7 | static function addEventListener(name:LinkingEventName, listener:LinkingEvent->Void):Void; 8 | static function removeEventListener(name:LinkingEventName, listener:LinkingEvent->Void):Void; 9 | static function openURL(url:String):Promise; 10 | static function canOpenURL(url:String):Promise; 11 | static function getInitialURL():Promise; 12 | } 13 | 14 | @:enum 15 | abstract LinkingEventName(String) { 16 | var Url = 'url'; 17 | } 18 | 19 | typedef LinkingEvent = { 20 | url:String, 21 | } -------------------------------------------------------------------------------- /src/react/native/api/NativeEventEmitter.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | import haxe.Constraints; 4 | 5 | @:jsRequire('react-native', 'NativeEventEmitter') 6 | extern class NativeEventEmitter { 7 | public function new(m:Dynamic); 8 | public function addListener(event:String, cb:Function, ?context:Dynamic):EmitterSubscription; 9 | public function removeAllListeners(event:String):Void; 10 | public function removeSubscription(sub:EmitterSubscription):Void; 11 | } -------------------------------------------------------------------------------- /src/react/native/api/NetInfo.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | import js.Promise; 4 | import haxe.Constraints; 5 | 6 | @:jsRequire('react-native', 'NetInfo') 7 | extern class NetInfo { 8 | static function addEventListener(event:NetInfoEventName, handler:Info->Void):Void; 9 | static function removeEventListener(event:NetInfoEventName, handler:Info->Void):Void; 10 | static function getConnectionInfo():Promise; 11 | static function isConnectionExpensive():Promise; 12 | 13 | static var isConnected:{ 14 | function addEventListener(event:NetInfoEventName, handler:Bool->Void):Void; 15 | function removeEventListener(event:NetInfoEventName, handler:Bool->Void):Void; 16 | function fetch():Promise; 17 | } 18 | } 19 | 20 | typedef Info = { 21 | type:ConnectionType, 22 | effectiveType:EffectiveConnectionType, 23 | } 24 | 25 | @:enum 26 | abstract NetInfoEventName(String) to String { 27 | var ConnectionChange = 'connectionChange'; 28 | } 29 | 30 | @:enum 31 | abstract ConnectionType(String) to String { 32 | var None = 'none'; 33 | var Wifi = 'wifi'; 34 | var Cellular = 'cellular'; 35 | var Unknown = 'unknown'; 36 | #if android 37 | var Bluetooth = 'bluetooth'; 38 | var Ethernet = 'ethernet'; 39 | var Wimax = 'wimax'; 40 | #end 41 | } 42 | 43 | @:enum 44 | abstract EffectiveConnectionType(String) to String { 45 | var _2g = '2g'; 46 | var _3g = '3g'; 47 | var _4g = '4g'; 48 | var Unknown = 'unknown'; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /src/react/native/api/PanResponder.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | import react.native.NativeEvent; 3 | 4 | @:jsRequire('react-native', 'PanResponder') 5 | extern class PanResponder { 6 | public static function create(config:PanResponderConfig):PanResponder; 7 | var panHandlers:PanHandlers; 8 | } 9 | 10 | extern class PressEvent {} 11 | typedef PanHandlers = { 12 | onStartShouldSetResponder:PressEvent->Bool, 13 | onMoveShouldSetResponder:PressEvent->Bool, 14 | onStartShouldSetResponderCapture:PressEvent->Bool, 15 | onMoveShouldSetResponderCapture:PressEvent->Bool, 16 | onResponderGrant:PressEvent->Bool, 17 | onResponderReject:PressEvent->Bool, 18 | onResponderRelease:PressEvent->Bool, 19 | onResponderStart:PressEvent->Bool, 20 | onResponderMove:PressEvent->Bool, 21 | onResponderEnd:PressEvent->Bool, 22 | onResponderTerminate:PressEvent->Bool, 23 | onResponderTerminationRequest:PressEvent->Bool, 24 | } 25 | 26 | typedef PanResponderConfig = { 27 | ?onMoveShouldSetPanResponder:ResponderSyntheticEvent->GestureState->Bool, 28 | ?onMoveShouldSetPanResponderCapture:ResponderSyntheticEvent->GestureState->Bool, 29 | ?onStartShouldSetPanResponder:ResponderSyntheticEvent->GestureState->Bool, 30 | ?onStartShouldSetPanResponderCapture:ResponderSyntheticEvent->GestureState->Bool, 31 | ?onPanResponderReject:ResponderSyntheticEvent->GestureState->Void, 32 | ?onPanResponderGrant:ResponderSyntheticEvent->GestureState->Void, 33 | ?onPanResponderStart:ResponderSyntheticEvent->GestureState->Void, 34 | ?onPanResponderEnd:ResponderSyntheticEvent->GestureState->Void, 35 | ?onPanResponderRelease:ResponderSyntheticEvent->GestureState->Void, 36 | ?onPanResponderMove:ResponderSyntheticEvent->GestureState->Void, 37 | ?onPanResponderTerminate:ResponderSyntheticEvent->GestureState->Void, 38 | ?onPanResponderTerminationRequest:ResponderSyntheticEvent->GestureState->Bool, 39 | ?onShouldBlockNativeResponder:ResponderSyntheticEvent->GestureState->Void, 40 | } 41 | 42 | extern class ResponderSyntheticEvent { 43 | var nativeEvent(default, never):NativeEvent; 44 | } 45 | 46 | typedef GestureState = { 47 | stateID:Dynamic, 48 | moveX:Float, 49 | moveY:Float, 50 | x0:Float, 51 | y0:Float, 52 | dx:Float, 53 | dy:Float, 54 | vx:Float, 55 | vy:Float, 56 | numberActiveTouches:Int, 57 | } 58 | -------------------------------------------------------------------------------- /src/react/native/api/PermissionsAndroid.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | import js.Promise; 4 | 5 | typedef AndroidPermissionRationale = { 6 | title : String, 7 | message : String, 8 | } 9 | 10 | typedef AndroidPermissionResults = { 11 | GRANTED : String, 12 | DENIED : String, 13 | NEVER_ASK_AGAIN : String, 14 | } 15 | 16 | typedef AndroidPermissions = { 17 | READ_CALENDAR : String, 18 | WRITE_CALENDAR : String, 19 | CAMERA : String, 20 | READ_CONTACTS : String, 21 | WRITE_CONTACTS : String, 22 | GET_ACCOUNTS : String, 23 | ACCESS_FINE_LOCATION : String, 24 | ACCESS_COARSE_LOCATION : String, 25 | RECORD_AUDIO : String, 26 | READ_PHONE_STATE : String, 27 | CALL_PHONE : String, 28 | READ_CALL_LOG : String, 29 | WRITE_CALL_LOG : String, 30 | ADD_VOICEMAIL : String, 31 | USE_SIP : String, 32 | PROCESS_OUTGOING_CALLS : String, 33 | BODY_SENSORS : String, 34 | SEND_SMS : String, 35 | RECEIVE_SMS : String, 36 | READ_SMS : String, 37 | RECEIVE_WAP_PUSH : String, 38 | RECEIVE_MMS : String, 39 | READ_EXTERNAL_STORAGE : String, 40 | WRITE_EXTERNAL_STORAGE : String, 41 | } 42 | 43 | @:jsRequire('react-native', 'PermissionsAndroid') 44 | extern class PermissionsAndroid { 45 | static function check(permission:String):Promise; 46 | static function request(permission:String, ?rationale:AndroidPermissionRationale):Promise; 47 | static function requestMultiple(permissions:Array):Promise>; 48 | static var PERMISSIONS : AndroidPermissions; 49 | static var RESULTS : AndroidPermissionResults; 50 | } 51 | -------------------------------------------------------------------------------- /src/react/native/api/PixelRatio.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | @:jsRequire("react-native", "PixelRatio") 4 | extern class PixelRatio { 5 | static function get():Float; 6 | static function getFontScale():Float; 7 | static function getPixelSizeForLayoutSize(layoutSize:Float):Int; 8 | static function roundToNearestPixel(layoutSize:Float):Float; 9 | } 10 | -------------------------------------------------------------------------------- /src/react/native/api/Platform.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | @:jsRequire('react-native', 'Platform') 4 | extern class Platform { 5 | static var OS:Os; 6 | static var Version:Int; 7 | static function select(obj:Dynamic):A; 8 | static function isTVOS():Bool; // ios only 9 | } 10 | 11 | @:enum 12 | abstract Os(String) to String { 13 | var IOS = 'ios'; 14 | var Android = 'android'; 15 | } 16 | -------------------------------------------------------------------------------- /src/react/native/api/PushNotificationIOS.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | @:enum 4 | abstract NotificationPermission(String){ 5 | var Alert = "alert"; 6 | var Badge = "badge"; 7 | var Sound = "sound"; 8 | } 9 | 10 | typedef NotificationPermissions = { 11 | alert:Bool, 12 | badge:Bool, 13 | sound:Bool, 14 | } 15 | 16 | @:enum 17 | abstract RepeatInterval(String){ 18 | var Minute = "minute"; 19 | var Hour = "hour"; 20 | var Day = "day"; 21 | var Week = "week"; 22 | var Month = "month"; 23 | var Year = "year"; 24 | } 25 | 26 | typedef UserInfo = Dynamic; 27 | 28 | typedef DeliveredNotification = { 29 | identifier:String, 30 | title:String, 31 | body:String, 32 | ?category:String, 33 | userInfo:UserInfo, 34 | // 'thread-id':String, 35 | } 36 | 37 | typedef PushNotificationIOSDetails= { 38 | alertBody:String, 39 | alertAction:String, 40 | soundName:String, 41 | isSilent:Bool, 42 | category:String, 43 | userInfo:UserInfo, 44 | applicationIconBadgeNumber:Int, 45 | } 46 | typedef ScheduledPushNotificationIOSDetails= { 47 | > PushNotificationIOSDetails, 48 | fireDate:Date, 49 | alertTitle:String, 50 | repeatInterval:RepeatInterval, 51 | } 52 | 53 | typedef FetchResultValues={ 54 | NoData:String, 55 | NewData:String, 56 | Failed:String, 57 | } 58 | 59 | @:jsRequire('react-native', 'PushNotificationIOS') 60 | extern class PushNotificationIOS { 61 | static public var FetchResult:FetchResultValues; 62 | static public function presentLocalNotification(d:react.Partial):Void; 63 | static public function scheduleLocalNotification(d:react.Partial):Void; 64 | static public function cancelAllLocalNotifications():Void; 65 | static public function removeAllDeliveredNotifications():Void; 66 | static public function getDeliveredNotifications(cb:Array->Void):Void; 67 | static public function removeDeliveredNotifications(id:Array):Void; 68 | static public function setApplicationIconBadgeNumber(v:Int):Void; 69 | static public function getApplicationIconBadgeNumber(cb:Int->Void):Void; 70 | static public function cancelLocalNotifications(v:UserInfo):Void; 71 | static public function getScheduledLocalNotifications(cb:Array->Void):Void; 72 | static public function addEventListener(type:String,handler:Void->Void):Void; 73 | static public function removeEventListener(type:String,handler:Void->Void):Void; 74 | static public function requestPermissions(v:Array):Void; 75 | static public function abandonPermissions():Void; 76 | static public function checkPermissions(cb:NotificationPermissions->Void):Void; 77 | static public function getInitialNotification(cb:DeliveredNotification->Void):Void; 78 | public function constructor():Void; 79 | public function finish(v:FetchResultValues):Void; 80 | public function getMessage():String; 81 | public function getSound():String; 82 | public function getCategory():String; 83 | public function getAlert():String; 84 | public function getContentAvailable():Int; 85 | public function getBadgeCount():Int; 86 | public function getData():Dynamic; 87 | } 88 | -------------------------------------------------------------------------------- /src/react/native/api/Share.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | import haxe.extern.EitherType; 4 | import js.Promise; 5 | 6 | @:jsRequire("react-native", "Share") 7 | extern class Share { 8 | static var sharedAction:String; 9 | static var dismissedAction:String; 10 | static function share(content:Content, ?options:Options):Promise; 11 | } 12 | 13 | private typedef Result = { 14 | action:String, 15 | ?activityType:String, 16 | } 17 | 18 | private typedef Content = { 19 | ?title:String, 20 | ?message:String, 21 | #if ios 22 | ?url:String 23 | #end 24 | } 25 | 26 | private typedef Options = { 27 | #if android 28 | ?dialogTitle:String, 29 | #elseif ios 30 | ?excludeActivityTypes:Array, 31 | ?tintColor:String, 32 | ?subject:String,//subject to share via email 33 | #end 34 | } -------------------------------------------------------------------------------- /src/react/native/api/StatusBarIOS.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | @:jsRequire('react-native', 'StatusBarIOS') 4 | extern class StatusBarIOS { 5 | static function setStyle(style:StatusBarStyle, ?animated:Bool):Void; 6 | static function setHidden(hidden:Bool, ?animation:String):Void; 7 | static function setNetworkActivityIndicatorVisible(visible:Bool):Void; 8 | } 9 | 10 | /** 11 | https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIApplication_Class/#//apple_ref/c/tdef/UIStatusBarStyle 12 | **/ 13 | @:enum 14 | abstract StatusBarStyle(String) { 15 | var Default = 'default'; 16 | var LightContent = 'light-content'; 17 | // var BlackOpaque = 'black-opaque'; 18 | } 19 | -------------------------------------------------------------------------------- /src/react/native/api/StyleSheet.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | import haxe.extern.Rest; 4 | import haxe.macro.Context; 5 | import haxe.macro.Expr; 6 | import react.native.component.props.*; 7 | using haxe.macro.Tools; 8 | 9 | @:jsRequire("react-native", "StyleSheet") 10 | extern class StyleSheet { 11 | 12 | static var hairlineWidth:Dynamic; 13 | static var absoluteFill:Dynamic; 14 | static var absoluteFillObject:Dynamic; 15 | 16 | @:native('create') @:noCompletion static function _create(obj:T):T; 17 | @:native('flatten') @:noCompletion static function _flatten(a:Array):T; 18 | static function compose(args:Rest):T; 19 | 20 | static inline macro function create(e:Expr):ExprOf> { 21 | var p = new haxe.macro.Printer(); 22 | var exprs = new Map(); 23 | switch e.expr { 24 | case EObjectDecl(fields): 25 | for(field in fields) { 26 | var ct = switch field.expr { 27 | case {expr: EMeta({name: ':type', params:[{expr: EConst(CIdent(name))}]}, e)}: 28 | field.expr = e; 29 | TPath({name: name, pack: 'react.native.component.props'.split('.')}); 30 | case {expr: EMeta({pos: pos}, _)}: 31 | Context.error('Only supports @:type(StyleType)', pos); 32 | case {expr: EParenthesis({expr: ECheckType({expr: EObjectDecl(_)}, ct)})}: 33 | ct; 34 | case {expr: EObjectDecl(_) | EBlock([])}: 35 | macro : react.native.component.props.Style; 36 | case e: 37 | Context.error('Expected object literal', e.pos); 38 | } 39 | var expr = macro @:pos(field.expr.pos) (${field.expr}:$ct); 40 | exprs[field.field] = field.expr = expr; 41 | } 42 | case EBlock([]): 43 | 44 | case _: 45 | var error = p.printExpr(e); 46 | Context.error('Expected object literal $error', e.pos); 47 | return macro throw 'Error ${error}'; 48 | } 49 | return macro react.native.api.StyleSheet._create($e); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/react/native/api/ToastAndroid.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | @:jsRequire('react-native', 'ToastAndroid') 4 | extern class ToastAndroid { 5 | static var SHORT:Duration; 6 | static var LONG:Duration; 7 | static var TOP:Gravity; 8 | static var CENTER:Gravity; 9 | static var BOTTOM:Gravity; 10 | static function show(message:String, duration:Duration):Void; 11 | static function showWithGravity(message:String, duration:Duration, gravity:Gravity):Void; 12 | } 13 | 14 | abstract Duration(Dynamic) {} 15 | abstract Gravity(Dynamic) {} 16 | -------------------------------------------------------------------------------- /src/react/native/api/UIManager.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | import haxe.Constraints; 4 | 5 | @:jsRequire('react-native', 'UIManager') 6 | extern class UIManager { 7 | static function setLayoutAnimationEnabledExperimental(v:Bool):Void; 8 | } -------------------------------------------------------------------------------- /src/react/native/api/Vibration.hx: -------------------------------------------------------------------------------- 1 | package react.native.api; 2 | 3 | import haxe.extern.EitherType; 4 | 5 | @:jsRequire('react-native', 'Vibration') 6 | extern class Vibration { 7 | static function vibrate(pattern:EitherType>, ?repeat:Bool):Void; 8 | static function cancel():Void; 9 | } -------------------------------------------------------------------------------- /src/react/native/component/ActivityIndicator.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'ActivityIndicator') 7 | extern class ActivityIndicator extends ReactComponentOfProps {} 8 | -------------------------------------------------------------------------------- /src/react/native/component/Button.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.ButtonProps; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'Button') 7 | extern class Button extends ReactComponentOfProps {} 8 | -------------------------------------------------------------------------------- /src/react/native/component/CheckBox.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'CheckBox') 7 | extern class CheckBox extends ReactComponentOfProps {} 8 | -------------------------------------------------------------------------------- /src/react/native/component/DatePickerIOS.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'DatePickerIOS') 7 | extern class DatePickerIOS extends ReactComponentOfProps {} 8 | -------------------------------------------------------------------------------- /src/react/native/component/DrawerLayoutAndroid.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.DrawerLayoutAndroidProps; 4 | import react.ReactComponent; 5 | 6 | 7 | @:jsRequire('react-native', 'DrawerLayoutAndroid') 8 | extern class DrawerLayoutAndroid extends ReactComponentOfProps { 9 | static var positions:{Left:DrawerPosition, Right:DrawerPosition}; 10 | function openDrawer():Void; 11 | function closeDrawer():Void; 12 | } 13 | -------------------------------------------------------------------------------- /src/react/native/component/FlatList.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'FlatList') 7 | extern class FlatList extends ReactComponentOfProps> { 8 | function scrollToEnd(?params:{}):Void; 9 | function scrollToIndex(params:{}):Void; 10 | function scrollToItem(params:{}):Void; 11 | function scrollToOffset(params:{}):Void; 12 | function recordInteraction():Void; 13 | } -------------------------------------------------------------------------------- /src/react/native/component/Image.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'Image') 7 | extern class Image extends ReactComponentOfProps { 8 | static function getSize(uri:String, success:Int->Int->Void , ?failure:Dynamic->Void):Void; 9 | } 10 | -------------------------------------------------------------------------------- /src/react/native/component/ImageBackground.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | //ImageBackground uses both style for self and imageStyle for underlaying Image component 7 | @:jsRequire('react-native', 'ImageBackground') 8 | extern class ImageBackground extends ReactComponentOfProps<{ 9 | >ImageProps, 10 | ?imageStyle:haxe.extern.EitherType> 11 | }> {} 12 | -------------------------------------------------------------------------------- /src/react/native/component/KeyboardAvoidingView.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'KeyboardAvoidingView') 7 | extern class KeyboardAvoidingView extends ReactComponentOfProps {} 8 | -------------------------------------------------------------------------------- /src/react/native/component/ListView.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'ListView') 7 | extern class ListView extends ReactComponentOfProps { 8 | static inline var DataSource = ListViewDataSource; 9 | } 10 | 11 | typedef ListViewDataSourceOfRow = ListViewDataSource; 12 | 13 | @:jsRequire('react-native', 'ListView.DataSource') 14 | extern class ListViewDataSource { 15 | function new(options:ListViewDataSourceOptions); 16 | function cloneWithRows(arr:Array):ListViewDataSource; 17 | function cloneWithRowsAndSections(data:TData, sectionIds:Array, rowIds:Array):ListViewDataSource; 18 | function getRowCount():Int; 19 | } 20 | 21 | typedef ListViewDataSourceOptions = { 22 | ?rowHasChanged:TRow->TRow->Bool, 23 | ?getRowData:TData->TSectionId->String->TRow, 24 | ?getSectionData:Dynamic->String->String->TSection, 25 | ?sectionHeaderHasChanged:TSectionId->TSectionId->Bool, 26 | } 27 | -------------------------------------------------------------------------------- /src/react/native/component/Modal.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'Modal') 7 | extern class Modal extends ReactComponentOfProps {} -------------------------------------------------------------------------------- /src/react/native/component/NavigatorIOS.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'NavigatorIOS') 7 | extern class NavigatorIOS extends ReactComponentOfProps {} 8 | -------------------------------------------------------------------------------- /src/react/native/component/Picker.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | import haxe.extern.EitherType; 6 | 7 | @:jsRequire('react-native', 'Picker') 8 | extern class Picker extends ReactComponentOfProps {} 9 | 10 | @:jsRequire('react-native', 'Picker.Item') 11 | extern class PickerItem extends ReactComponentOfProps<{label:String, value:EitherType}> {} -------------------------------------------------------------------------------- /src/react/native/component/PickerIOS.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'PickerIOS') 7 | extern class PickerIOS extends ReactComponentOfProps {} 8 | -------------------------------------------------------------------------------- /src/react/native/component/ProgressBarAndroid.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'ProgressBarAndroid') 7 | extern class ProgressBarAndroid extends ReactComponentOfProps {} 8 | -------------------------------------------------------------------------------- /src/react/native/component/ProgressViewIOS.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'ProgressViewIOS') 7 | extern class ProgressViewIOS extends ReactComponentOfProps {} -------------------------------------------------------------------------------- /src/react/native/component/RefreshControl.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.RefreshControlProps; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'RefreshControl') 7 | extern class RefreshControl extends ReactComponentOfProps { 8 | static var SIZE:{DEFAULT:RefreshControlSize, LARGE:RefreshControlSize}; 9 | } 10 | -------------------------------------------------------------------------------- /src/react/native/component/SafeAreaView.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.ViewProps; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'SafeAreaView') 7 | extern class SafeAreaView extends ReactComponentOfProps {} 8 | -------------------------------------------------------------------------------- /src/react/native/component/ScrollView.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'ScrollView') 7 | extern class ScrollView extends ReactComponentOfProps { 8 | function scrollTo(options:{?x:Float, ?y:Float, ?animated:Bool}):Void; 9 | function scrollToEnd(options:{?animated:Bool}):Void; 10 | function getScrollResponder():ScrollResponder; 11 | function flashScrollIndicators():Void; 12 | } 13 | 14 | extern class ScrollResponder { 15 | function scrollResponderScrollNativeHandleToKeyboard(nodeHandle:Dynamic, ?additionalOffset:Float, ?preventNegativeScrollOffset:Bool):Void; 16 | } 17 | -------------------------------------------------------------------------------- /src/react/native/component/SectionList.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'SectionList') 7 | extern class SectionList}> extends ReactComponentOfProps> { 8 | function scrollToEnd(?params:{}):Void; 9 | function scrollToIndex(params:{}):Void; 10 | function scrollToItem(params:{}):Void; 11 | function scrollToOffset(params:{}):Void; 12 | function scrollToLocation(params:{}):Void; 13 | function recordInteraction():Void; 14 | } -------------------------------------------------------------------------------- /src/react/native/component/SegmentedControlIOS.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'SegmentedControlIOS') 7 | extern class SegmentedControlIOS extends ReactComponentOfProps {} 8 | -------------------------------------------------------------------------------- /src/react/native/component/Slider.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'Slider') 7 | extern class Slider extends ReactComponentOfProps {} 8 | -------------------------------------------------------------------------------- /src/react/native/component/SnapshotViewIOS.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'SnapshotViewIOS') 7 | extern class SnapshotViewIOS extends ReactComponentOfProps {} 8 | -------------------------------------------------------------------------------- /src/react/native/component/StatusBar.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'StatusBar') 7 | extern class StatusBar extends ReactComponentOfProps { 8 | static var currentHeight:Float; 9 | } 10 | -------------------------------------------------------------------------------- /src/react/native/component/Switch.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'Switch') 7 | extern class Switch extends ReactComponentOfProps {} 8 | -------------------------------------------------------------------------------- /src/react/native/component/TabBarIOS.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | @:jsRequire('react-native', 'TabBarIOS') 4 | extern class TabBarIOS extends react.ReactComponent { 5 | static inline var Item = TabBarIOSItem; 6 | } 7 | 8 | @:jsRequire('react-native', 'TabBarIOS.Item') 9 | extern class TabBarIOSItem extends react.ReactComponent {} 10 | -------------------------------------------------------------------------------- /src/react/native/component/Text.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | //not very elegant, but some components requires some 'extra' props (see swiper example) 7 | //to remove later 8 | //@:acceptsMoreProps 9 | @:jsRequire('react-native', 'Text') 10 | extern class Text extends ReactComponentOfProps {} 11 | -------------------------------------------------------------------------------- /src/react/native/component/TextInput.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'TextInput') 7 | extern class TextInput extends ReactComponentOfProps { 8 | function isFocused():Bool; 9 | function clear():Void; 10 | function focus():Void; 11 | function blur():Void; 12 | } -------------------------------------------------------------------------------- /src/react/native/component/ToolbarAndroid.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'ToolbarAndroid') 7 | extern class ToolbarAndroid extends ReactComponentOfProps {} 8 | -------------------------------------------------------------------------------- /src/react/native/component/TouchableHighlight.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'TouchableHighlight') 7 | extern class TouchableHighlight extends ReactComponentOfProps {} -------------------------------------------------------------------------------- /src/react/native/component/TouchableNativeFeedback.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.TouchableNativeFeedbackProps; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'TouchableNativeFeedback') 7 | extern class TouchableNativeFeedback extends ReactComponentOfProps { 8 | static function SelectableBackground():TouchableNativeFeedbackBackground; 9 | static function SelectableBackgroundBorderless():TouchableNativeFeedbackBackground; 10 | static function Ripple(color:String, borderless:Bool):TouchableNativeFeedbackBackground; 11 | } -------------------------------------------------------------------------------- /src/react/native/component/TouchableOpacity.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'TouchableOpacity') 7 | extern class TouchableOpacity extends ReactComponentOfProps {} 8 | -------------------------------------------------------------------------------- /src/react/native/component/TouchableWithoutFeedback.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'TouchableWithoutFeedback') 7 | extern class TouchableWithoutFeedback extends ReactComponentOfProps {} 8 | -------------------------------------------------------------------------------- /src/react/native/component/View.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.ViewProps; 4 | import react.ReactComponent; 5 | 6 | //not very elegant, but some components requires some 'extra' props (see swiper example) 7 | //to remove later 8 | //@:acceptsMoreProps 9 | @:jsRequire('react-native', 'View') 10 | extern class View extends ReactComponentOfProps {} 11 | -------------------------------------------------------------------------------- /src/react/native/component/ViewPagerAndroid.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'ViewPagerAndroid') 7 | extern class ViewPagerAndroid extends ReactComponentOfProps {} 8 | -------------------------------------------------------------------------------- /src/react/native/component/VirtualizedList.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'VirtualizedList') 7 | extern class VirtualizedList extends ReactComponentOfProps> { 8 | function scrollToEnd(?params:{}):Void; 9 | function scrollToIndex(params:{}):Void; 10 | function scrollToItem(params:{}):Void; 11 | function scrollToOffset(params:{}):Void; 12 | function recordInteraction():Void; 13 | } -------------------------------------------------------------------------------- /src/react/native/component/WebView.hx: -------------------------------------------------------------------------------- 1 | package react.native.component; 2 | 3 | import react.native.component.props.*; 4 | import react.ReactComponent; 5 | 6 | @:jsRequire('react-native', 'WebView') 7 | extern class WebView extends ReactComponentOfProps {} 8 | -------------------------------------------------------------------------------- /src/react/native/component/props/ActivityIndicatorProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.extern.EitherType; 4 | 5 | @:enum 6 | abstract ActivityIndicatorSizeType(String) to String { 7 | var Small = "small"; 8 | var Large = "large"; 9 | 10 | @:from public static inline function fromFloat(f:Float):ActivityIndicatorSizeType return cast f; 11 | } 12 | 13 | typedef ActivityIndicatorProps = { 14 | > ViewProps, 15 | ?animating:Bool, 16 | ?color:Color, 17 | ?size:ActivityIndicatorSizeType, 18 | ?hidesWhenStopped:Bool, 19 | } -------------------------------------------------------------------------------- /src/react/native/component/props/AnimatedViewProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | import react.BaseProps; 5 | import react.native.component.types.AccessibilityTypes; 6 | import react.native.component.types.EventTypes; 7 | import react.native.component.props.ViewProps.ViewPropsWithoutStyle; 8 | import react.native.component.props.AnimatedViewStyle; 9 | 10 | import haxe.extern.EitherType; 11 | 12 | typedef AnimatedViewProps = { 13 | > ViewPropsWithoutStyle, 14 | ?style:haxe.extern.EitherType, 15 | Array>>,//after 16 | } -------------------------------------------------------------------------------- /src/react/native/component/props/AnimatedViewStyle.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | typedef AnimatedViewStyle = { 4 | > LayoutProps, 5 | > Transforms, 6 | > ShadowProps, 7 | > AnimatedViewStyleProps, 8 | ?color:String, 9 | } -------------------------------------------------------------------------------- /src/react/native/component/props/AnimatedViewStyleProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import react.native.api.Animated.AnimatedValue; 4 | 5 | typedef AnimatedViewStyleProps = { 6 | ?backfaceVisibility:String, 7 | ?backgroundColor:Color, 8 | ?borderBottomColor:Color, 9 | ?borderBottomLeftRadius:AnimatedValue, 10 | ?borderBottomRightRadius:AnimatedValue, 11 | ?borderBottomWidth:AnimatedValue, 12 | ?borderColor:Color, 13 | ?borderLeftColor:Color, 14 | ?borderLeftWidth:AnimatedValue, 15 | ?borderRadius:AnimatedValue, 16 | ?borderRightColor:Color, 17 | ?borderRightWidth:AnimatedValue, 18 | ?borderStyle:String, 19 | ?borderTopColor:Color, 20 | ?borderTopLeftRadius:AnimatedValue, 21 | ?borderTopRightRadius:AnimatedValue, 22 | ?borderTopWidth:Float, 23 | ?borderWidth:AnimatedValue, 24 | ?opacity:AnimatedValue, 25 | ?androidelevation:Float, 26 | } -------------------------------------------------------------------------------- /src/react/native/component/props/ButtonProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | import haxe.extern.EitherType; 5 | import react.ReactType; 6 | import react.BaseProps; 7 | 8 | typedef ButtonProps = { 9 | > BasePropsWithoutChildren, 10 | ?accessibilityLabel:ReactType, 11 | ?color:String, 12 | ?disabled:Bool, 13 | onPress:EitherTypeVoid, Void->Dynamic>, 14 | ?testID:String, 15 | title:String, 16 | } -------------------------------------------------------------------------------- /src/react/native/component/props/CheckBoxProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | 5 | typedef CheckBoxProps = { 6 | > ViewProps.ViewPropsWithoutStyle, 7 | ?disabled:Bool, 8 | ?onChange:Function, 9 | ?onValueChange:Function, 10 | ?testID:String, 11 | ?value:Bool, 12 | } 13 | -------------------------------------------------------------------------------- /src/react/native/component/props/Color.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | typedef Color = String; -------------------------------------------------------------------------------- /src/react/native/component/props/DatePickerIOSProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | 5 | typedef DatePickerIOSProps = { 6 | > ViewProps, 7 | ?locale:String, 8 | date:Date, 9 | ?maximumDate:Date, 10 | ?minimumDate:Date, 11 | ?minuteInterval:Int, 12 | ?mode:DatePickerIOSMode, 13 | onDateChange:Function, 14 | ?timeZoneOffsetInMinutes:Int, 15 | } 16 | 17 | 18 | @:enum 19 | abstract DatePickerIOSMode(String) to String { 20 | var Date = 'date'; 21 | var Time = 'time'; 22 | var DateTime = 'datetime'; 23 | } -------------------------------------------------------------------------------- /src/react/native/component/props/DrawerLayoutAndroidProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | 5 | typedef DrawerLayoutAndroidProps = { 6 | > ViewProps, 7 | ?drawerBackgroundColor:Color, 8 | ?drawerLockMode:DrawerLayoutAndroidDrawerLockMode, 9 | ?drawerPosition:DrawerPosition, 10 | ?drawerWidth:Float, 11 | ?keyboardDismissMode:DrawerLayoutAndroidKeyboardDismissMode, 12 | ?onDrawerClose:Function, 13 | ?onDrawerOpen:Function, 14 | ?onDrawerSlide:Function, 15 | ?onDrawerStateChanged:Function, 16 | renderNavigationView:Function, 17 | ?statusBarBackgroundColor:Color, 18 | } 19 | 20 | abstract DrawerPosition(Dynamic) {} 21 | 22 | 23 | @:enum 24 | abstract DrawerLayoutAndroidDrawerLockMode(String) to String { 25 | var Unlocked = 'unlocked'; 26 | var LockedClosed = 'locked-closed'; 27 | var LockedOpen = 'locked-open'; 28 | } 29 | 30 | @:enum 31 | abstract DrawerLayoutAndroidKeyboardDismissMode(String) to String { 32 | var None = 'none'; 33 | var OnDrag = 'on-drag'; 34 | } -------------------------------------------------------------------------------- /src/react/native/component/props/FlatListProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import react.ReactType; 4 | import react.ReactComponent; 5 | import haxe.Constraints; 6 | 7 | 8 | typedef FlatListProps = { 9 | > ScrollViewProps, 10 | // > VirtualizedListProps, can't do that? 11 | ?initialScrollIndex:Int, 12 | ?ItemSeparatorComponent:ReactType, 13 | ?ListEmptyComponent:ReactType, 14 | ?ListFooterComponent:ReactType, 15 | ?ListHeaderComponent:ReactType, 16 | ?columnWrapperStyle:Dynamic, 17 | ?data:Array, 18 | ?debug:Bool, 19 | ?extraData:Dynamic, 20 | ?inverted:Bool, 21 | ?getItem:Function, 22 | ?getItemCount:Function, 23 | ?getItemLayout:Array->Int->{length:Int, offset:Int, index:Int}, 24 | ?horizontal:Bool, 25 | ?initialNumToRender:Int, 26 | ?keyExtractor:T->Int->String, 27 | ?maxToRenderPerBatch:Int, 28 | ?legacyImplementation:Bool, 29 | ?numColumns:Int, 30 | ?progressViewOffset:Float, 31 | ?onEndReached:{distanceFromEnd:Float}->Void, 32 | ?onEndReachedThreshold:Float, 33 | ?onLayout:Function, 34 | ?onRefresh:Void->Void, 35 | ?onViewableItemsChanged:{viewableItems:Array, changed:Array}->Void, 36 | ?viewableItems:Array, 37 | ?changed:Array, 38 | ?refreshing:Bool, 39 | ?removeClippedSubviews:Bool, 40 | ?renderItem:{item:T, index:Int}->ReactFragment, 41 | ?renderScrollComponent:haxe.DynamicAccess->ReactFragment, 42 | ?updateCellsBatchingPeriod:Float, 43 | ?viewabilityConfig:ViewabilityConfig, 44 | ?windowSize:Float, 45 | } 46 | 47 | private typedef ViewToken = Dynamic; 48 | private typedef ViewabilityConfig = Dynamic; -------------------------------------------------------------------------------- /src/react/native/component/props/ImageProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | import haxe.extern.EitherType; 5 | import react.native.component.types.ImagePropsTypes; 6 | import react.native.component.types.EventTypes; 7 | import react.ReactComponent.ReactFragment; 8 | import react.BaseProps; 9 | 10 | typedef ImageProps = { 11 | > BasePropsWithOptChildren, 12 | ?onError:Function, 13 | ?onLayout:Function, 14 | ?onLoad:Function, 15 | ?onLoadEnd:Function, 16 | ?onLoadStart:Function, 17 | ?resizeMode:ResizeMode, 18 | ?source:ImageSource, 19 | ?style:haxe.extern.EitherType>, 20 | ?testID:String, 21 | ?borderRadius:Int, 22 | // android 23 | ?resizeMethod:ResizeMethodType, 24 | // ios 25 | ?accessibilityLabel:Node, 26 | ?accessible:Bool, 27 | ?blurRadius:Float, 28 | ?capInsets:{top:Float, left:Float, bottom:Float, right:Float}, 29 | ?defaultSource:{uri:String, width:Int, height:Int, scale:Float}, // TODO: number - Opaque type returned by something like require('./image.jpg') 30 | ?onPartialLoad:Function, 31 | ?onProgress:Function, 32 | ?pointerEvents:PointEventTypes 33 | } 34 | -------------------------------------------------------------------------------- /src/react/native/component/props/ImageSource.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | typedef ImageSource = Dynamic; // TODO -------------------------------------------------------------------------------- /src/react/native/component/props/ImageStyle.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | import react.native.component.types.ImagePropsTypes; 3 | 4 | typedef ImageStyle = { 5 | > LayoutProps, 6 | > Transforms, 7 | > ShadowProps, 8 | ?backfaceVisibility:String, 9 | ?backgroundColor:Color, 10 | ?borderBottomLeftRadius:Float, 11 | ?borderBottomRightRadius:Float, 12 | ?borderColor:Color, 13 | ?borderRadius:Float, 14 | ?borderTopLeftRadius:Float, 15 | ?borderTopRightRadius:Float, 16 | ?borderWidth:Float, 17 | ?opacity:Float, 18 | // ?overflow:String, 19 | ?resizeMode:ResizeMode, 20 | ?tintColor:Color, 21 | } 22 | -------------------------------------------------------------------------------- /src/react/native/component/props/KeyboardAvoidingViewProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | @:enum 4 | abstract KeyboardAvoidingBehaviorType(String) { 5 | var Height = 'height'; 6 | var Position = 'position'; 7 | var Padding = 'padding'; 8 | } 9 | 10 | typedef KeyboardAvoidingViewProps = { 11 | > ViewProps, 12 | ?behavior:KeyboardAvoidingBehaviorType, 13 | ?contentContainerStyle:ViewStyle, 14 | ?keyboardVerticalOffset:Float 15 | } -------------------------------------------------------------------------------- /src/react/native/component/props/LayoutProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.extern.EitherType; 4 | 5 | typedef LayoutProps = { 6 | ?alignContent:String, 7 | ?alignItems:String, 8 | ?alignSelf:String, 9 | ?aspectRatio:Float, 10 | 11 | ?bottom:EitherType, 12 | ?display:String, 13 | ?flex:Float, 14 | ?flexBasis:EitherType, 15 | ?flexDirection:String, 16 | ?flexGrow:Float, 17 | ?flexShrink:Float, 18 | ?flexWrap:String, 19 | ?height:EitherType, 20 | ?justifyContent:String, 21 | ?left:EitherType, 22 | ?margin:EitherType, 23 | ?marginBottom:EitherType, 24 | ?marginHorizontal:EitherType, 25 | ?marginLeft:EitherType, 26 | ?marginRight:EitherType, 27 | ?marginTop:EitherType, 28 | ?marginVertical:EitherType, 29 | ?maxHeight:EitherType, 30 | ?maxWidth:EitherType, 31 | ?minHeight:EitherType, 32 | ?minWidth:EitherType, 33 | ?overflow:String, 34 | ?padding:EitherType, 35 | ?paddingBottom:EitherType, 36 | ?paddingHorizontal:EitherType, 37 | ?paddingLeft:EitherType, 38 | ?paddingRight:EitherType, 39 | ?paddingTop:EitherType, 40 | ?paddingVertical:EitherType, 41 | ?position:String, 42 | ?right:EitherType, 43 | ?top:EitherType, 44 | ?width:EitherType, 45 | ?zIndex:Float, 46 | // ios 47 | ?direction:String, 48 | } 49 | 50 | -------------------------------------------------------------------------------- /src/react/native/component/props/ListViewProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | import haxe.extern.EitherType; 5 | import react.native.component.ListView; 6 | 7 | typedef ListViewProps = { 8 | > ScrollViewProps, 9 | dataSource:ListViewDataSource, // TODO: using type parameters causes the compiler to run forever? 10 | ?enableEmptySections:Bool, 11 | ?initialListSize:Int, 12 | ?onChangeVisibleRows:Function, 13 | ?onEndReached:Function, 14 | ?onEndReachedThreshold:Float, 15 | ?pageSize:Int, 16 | ?removeClippedSubviews:Bool, 17 | ?renderFooter:Function, 18 | ?renderHeader:Function, 19 | renderRow:Function, 20 | ?renderScrollComponent:Function, 21 | ?renderSectionHeader:Function, 22 | ?renderSeparator:Function, 23 | ?scrollRenderAheadDistance:Float, 24 | ?stickySectionHeadersEnabled:Bool, 25 | } -------------------------------------------------------------------------------- /src/react/native/component/props/ModalProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | import react.native.component.props.ViewProps;//TODO check, it was typed props directly before 5 | 6 | @:enum 7 | abstract ModalAnimationTypes(String) { 8 | var None = "none"; 9 | var Slide = "slide"; 10 | var Fade = "fade"; 11 | } 12 | 13 | @:enum 14 | abstract ModalSpportedOrientations(String) { 15 | var Portrait = 'portrait'; 16 | var PortaitUpsideDown = 'portrait-upside-down'; 17 | var Landscape = 'landscape'; 18 | var LandscapeLeft = 'landscape-left'; 19 | var LandscapeRight = 'landscape-right'; 20 | } 21 | 22 | @:enum abstract ModalPresentationStyles(String) { 23 | var Fullscreen = "fullscreen"; 24 | var PageSheet = "pageSheet"; 25 | var FormSheet = "formSheet"; 26 | var OverFullScreen = "overFullScreen"; 27 | } 28 | 29 | typedef ModalProps = { 30 | > ViewProps, 31 | ?visible:Bool, 32 | ?transparent:Bool, 33 | ?animated:Bool, 34 | ?animationType:ModalAnimationTypes, 35 | 36 | ?onShow:Function, 37 | ?onDismiss:Function, 38 | 39 | 40 | // android 41 | ?hardwareAccelerated:Bool, 42 | ?onRequestClose:Void->Void, 43 | // ios 44 | ?presentationStyle: ModalPresentationStyles, 45 | ?onOrientationChange:String->Void, 46 | ?supportedOrientations:Array, 47 | } -------------------------------------------------------------------------------- /src/react/native/component/props/NavigatorIOSProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | 5 | typedef NavigatorIOSProps = { 6 | ?barTintColor:String, 7 | initialRoute:{ 8 | component:Function, 9 | title:String, 10 | titleImage:ImageSource, 11 | passProps:Any, 12 | backButtonIcon:ImageSource, 13 | backButtonTitle:String, 14 | leftButtonIcon:ImageSource, 15 | leftButtonTitle:String, 16 | leftButtonSystemIcon:Any, // Object.keys(SystemIcons), 17 | onLeftButtonPress:Function, 18 | rightButtonIcon:ImageSource, 19 | rightButtonTitle:String, 20 | rightButtonSystemIcon:Any, // Object.keys(SystemIcons), 21 | onRightButtonPress:Function, 22 | wrapperStyle:ViewStyle, 23 | navigationBarHidden:Bool, 24 | shadowHidden:Bool, 25 | tintColor:String, 26 | barTintColor:String, 27 | titleTextColor:String, 28 | translucent:Bool 29 | }, 30 | ?interactivePopGestureEnabled:Bool, 31 | ?itemWrapperStyle:ViewStyle, 32 | ?navigationBarHidden:Bool, 33 | ?shadowHidden:Bool, 34 | ?tintColor:String, 35 | ?titleTextColor:String, 36 | ?translucent:Bool, 37 | } -------------------------------------------------------------------------------- /src/react/native/component/props/Node.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | typedef Node = Dynamic; // TODO -------------------------------------------------------------------------------- /src/react/native/component/props/PickerIOSProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | 5 | typedef PickerIOSProps = { 6 | > ViewProps, 7 | ?itemStyle:Dynamic, 8 | ?onValueChange:Function, 9 | ?selectedValue:Dynamic, 10 | } 11 | -------------------------------------------------------------------------------- /src/react/native/component/props/PickerProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | @:enum 4 | abstract PickerMode(String) { 5 | var Dialog = 'dialog'; 6 | var Dropdown = 'dropdown'; 7 | } 8 | 9 | typedef PickerProps = { 10 | > ViewProps.ViewPropsWithoutStyle, 11 | ?onValueChange:Dynamic->Int->Void, 12 | ?selectedValue:Dynamic, 13 | ?style:Dynamic, 14 | ?testID:String, 15 | //android 16 | ?enabled:Bool, 17 | ?mode:PickerMode, 18 | ?prompt:String, 19 | //ios 20 | ?itemStyle:Dynamic, 21 | } -------------------------------------------------------------------------------- /src/react/native/component/props/ProgressBarAndroidProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | 5 | typedef ProgressBarAndroidProps = { 6 | > ViewProps, 7 | ?color:Color, 8 | ?indeterminate:Bool, 9 | ?progress: Float, 10 | ?styleAttr:ProgressBarAndroidStyleAttr, 11 | ?testID:String, 12 | } 13 | 14 | 15 | @:enum 16 | abstract ProgressBarAndroidStyleAttr(String) to String { 17 | var Horizontal = 'Horizontal'; 18 | var Normal = 'Normal'; 19 | var Small = 'Small'; 20 | var Large = 'Large'; 21 | var Inverse = 'Inverse'; 22 | var SmallInverse = 'SmallInverse'; 23 | var LargeInverse = 'LargeInverse'; 24 | } -------------------------------------------------------------------------------- /src/react/native/component/props/ProgressViewIOSProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | 5 | typedef ProgressViewIOSProps = { 6 | > ViewProps, 7 | ?progress:Float, 8 | ?progressImage:ImageSource, 9 | ?progressTintColor:String, 10 | ?progressViewStyle:ProgressViewIOSProgressViewStyle, 11 | ?trackImage:ImageSource, 12 | ?trackTintColor:String, 13 | } 14 | 15 | @:enum 16 | abstract ProgressViewIOSProgressViewStyle(String) to String { 17 | var Default = 'default'; 18 | var Bar = 'bar'; 19 | } -------------------------------------------------------------------------------- /src/react/native/component/props/Props_.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | // typedef Props = react.component.props.Props; 4 | // typedef Child = react.component.props.Props.Child; 5 | // typedef Children = react.component.props.Props.Children; 6 | -------------------------------------------------------------------------------- /src/react/native/component/props/RefreshControlProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | 5 | typedef RefreshControlProps = { 6 | > ViewProps.ViewPropsWithoutStyle, 7 | ?onRefresh:Function, 8 | refreshing:Bool, 9 | // android 10 | ?colors:Array, 11 | ?enabled:Bool, 12 | ?progressBackgroundColor:Color, 13 | ?progressViewOffset:Float, 14 | ?size:RefreshControlSize, 15 | // ios 16 | ?tintColor:Color, 17 | ?title:String, 18 | ?titleColor:Color, 19 | } 20 | 21 | abstract RefreshControlSize(Dynamic) {} -------------------------------------------------------------------------------- /src/react/native/component/props/ScrollViewProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import react.native.component.types.AnimationTypes; 4 | import react.native.component.types.ViewPropTypes; 5 | import react.ReactComponent; 6 | import haxe.Constraints; 7 | import haxe.extern.EitherType; 8 | 9 | typedef ScrollViewProps = { 10 | > ViewProps.ViewPropsWithoutStyle, 11 | ?contentContainerStyle:ViewStyle, 12 | ?horizontal:Bool, 13 | ?keyboardDismissMode:KeyboardDismissModeType, 14 | ?keyboardShouldPersistTaps:EitherType, 15 | ?onContentSizeChange:Function, 16 | ?onScroll:Function, 17 | ?onScrollBeginDrag:Function, 18 | ?onScrollEndDrag:Function, 19 | ?onMomentumScrollBegin:Function, 20 | ?onMomentumScrollEnd:Function, 21 | ?pagingEnabled:Bool, 22 | ?refreshControl:ReactSingleFragment, 23 | ?removeClippedSubviews:Bool, 24 | ?scrollEnabled:Bool, 25 | ?showsHorizontalScrollIndicator:Bool, 26 | ?showsVerticalScrollIndicator:Bool, 27 | ?stickyHeaderIndices:Array, 28 | ?style:ScrollViewStyle, 29 | ?scrollToOverflowEnabled:Bool, 30 | // android 31 | ?endFillColor:Color, 32 | ?overScrollMode:OverScrollModeType, 33 | ?scrollPerfTag:String, 34 | // ios 35 | ?alwaysBounceHorizontal:Bool, 36 | ?alwaysBounceVertical:Bool, 37 | ?automaticallyAdjustContentInsets:Bool, 38 | ?bounces:Bool, 39 | ?bouncesZoom:Bool, 40 | ?canCancelContentTouches:Bool, 41 | ?centerContent:Bool, 42 | ?contentInset:{?top:Float, ?left:Float, ?bottom:Float, ?right:Float}, 43 | ?contentOffset:{?x:Float, ?y:Float}, 44 | ?decelerationRate:EitherType, 45 | ?directionalLockEnabled:Bool, 46 | ?indicatorStyle:IndicatorStyleType, 47 | ?maximumZoomScale:Float, 48 | ?minimumZoomScale:Float, 49 | ?onScrollAnimationEnd:Function, 50 | ?scrollEventThrottle:Float, 51 | ?scrollIndicatorInsets:{top:Float, left:Float, bottom:Float, right:Float}, 52 | ?scrollsToTop:Bool, 53 | ?snapToAlignment:SnappingType, 54 | ?snapToInterval:Float, 55 | ?zoomScale:Float, 56 | } 57 | -------------------------------------------------------------------------------- /src/react/native/component/props/ScrollViewStyle.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | typedef ScrollViewStyle = { 4 | > LayoutProps, 5 | > Transforms, 6 | > ShadowProps, 7 | ?backfaceVisibility:String, 8 | ?backgroundColor:Color, 9 | ?borderBottomColor:Color, 10 | ?borderBottomLeftRadius:Float, 11 | ?borderBottomRightRadius:Float, 12 | ?borderBottomWidth:Float, 13 | ?borderColor:Color, 14 | ?borderLeftColor:Color, 15 | ?borderLeftWidth:Float, 16 | ?borderRadius:Float, 17 | ?borderRightColor:Color, 18 | ?borderRightWidth:Float, 19 | ?borderStyle:String, 20 | ?borderTopColor:Color, 21 | ?borderTopLeftRadius:Float, 22 | ?borderTopRightRadius:Float, 23 | ?borderTopWidth:Float, 24 | ?borderWidth:Float, 25 | ?opacity:Float, 26 | // android 27 | ?elevation:Float, 28 | } -------------------------------------------------------------------------------- /src/react/native/component/props/SectionListProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import react.ReactComponent; 4 | import haxe.Constraints; 5 | import haxe.extern.EitherType; 6 | 7 | typedef SectionListProps}> = { 8 | > ScrollViewProps, 9 | ?ItemSeparatorComponent:EitherType, Function>, 10 | ?ListFooterComponent:EitherType, Function>, 11 | ?ListHeaderComponent:EitherType, Function>, 12 | ?SectionSeparatorComponent:EitherType, Function>, 13 | ?extraData:Any, 14 | sections:Array, 15 | ?inverted:Bool, 16 | ?initialNumToRender:Int, 17 | ?keyExtractor:T->Int->String, 18 | ?onEndReached:{distanceFromEnd:Float}->Void, 19 | ?onEndReachedThreshold:Float, 20 | ?onRefresh:Void->Void, 21 | ?onViewableItemsChanged:{viewableItems:Array, changed:Array}->Void, 22 | ?hanged:Array, 23 | ?refreshing:Bool, 24 | ?renderItem:{item:T, index:Int, section:S}->ReactFragment, 25 | ?renderSectionHeader:{section:{title:String, ?data:Array}}->ReactFragment, 26 | ?renderSectionFooter:{section:{title:String, ?data:Array}}->ReactFragment, 27 | ?stickySectionHeadersEnabled:Bool, 28 | } 29 | 30 | private typedef ViewToken = Dynamic; 31 | private typedef ViewabilityConfig = Dynamic; 32 | -------------------------------------------------------------------------------- /src/react/native/component/props/SegmentedControlIOSProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | 5 | typedef SegmentedControlIOSProps = { 6 | > ViewProps, 7 | ?enabled:Bool, 8 | ?momentary:Bool, 9 | ?onChange:Function, 10 | ?onValueChange:Function, 11 | ?selectedIndex:Int, 12 | ?tintColor:String, 13 | ?values:Array, 14 | } -------------------------------------------------------------------------------- /src/react/native/component/props/ShadowProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | typedef ShadowProps = { 4 | // ios 5 | ?shadowColor:Color, 6 | ?shadowOffset:{width:Float, height:Float}, 7 | ?shadowOpacity:Float, 8 | ?shadowRadius:Float, 9 | } -------------------------------------------------------------------------------- /src/react/native/component/props/SliderProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | 5 | typedef SliderProps = { 6 | > ViewProps.ViewPropsWithoutStyle, 7 | ?disabled:Bool, 8 | ?maximumTrackTintColor:Color, 9 | ?maximumValue:Float, 10 | ?minimumTrackTintColor:Color, 11 | ?minimumValue:Float, 12 | ?onSlidingComplete:Function, 13 | ?onValueChange:Function, 14 | ?step:Float, 15 | ?style:ViewStyle, 16 | ?testID:String, 17 | ?value:Float, 18 | // android 19 | ?thumbTintColor:Color, 20 | // ios 21 | ?maximumTrackImage:ImageSource, 22 | ?minimumTrackImage:ImageSource, 23 | ?thumbImage:ImageSource, 24 | ?trackImage:ImageSource, 25 | } -------------------------------------------------------------------------------- /src/react/native/component/props/SnapshotViewIOSProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | 5 | typedef SnapshotViewIOSProps = { 6 | > ViewProps, 7 | ?onSnapshotReady:Function, 8 | ?testIdentifier:String, 9 | } -------------------------------------------------------------------------------- /src/react/native/component/props/StatusBarProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | 5 | typedef StatusBarProps = { 6 | ?animated:Bool, 7 | ?barStyle:StatusBarBarStyle, 8 | ?hidden:Bool, 9 | // android 10 | ?backgroundColor:Color, 11 | ?translucent:Bool, 12 | // ios 13 | ?networkActivityIndicatorVisible:Bool, 14 | ?showHideTransition:StatusBarShowHideTransition, 15 | } 16 | 17 | @:enum 18 | abstract StatusBarBarStyle(String) to String { 19 | var Default = 'default'; 20 | var LightContent = 'light-content'; 21 | var DarkContent = 'dark-content'; 22 | } 23 | 24 | @:enum 25 | abstract StatusBarShowHideTransition(String) to String { 26 | var Fade = 'fade'; 27 | var Slide = 'slide'; 28 | } -------------------------------------------------------------------------------- /src/react/native/component/props/Style.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | 4 | @:coreType 5 | abstract Style to ViewStyle to TextStyle to ImageStyle to ScrollViewStyle from {} to {} {} -------------------------------------------------------------------------------- /src/react/native/component/props/SwitchProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | 5 | typedef SwitchProps = { 6 | > ViewProps.ViewPropsWithoutStyle, 7 | ?disabled:Bool, 8 | ?onTintColor:Color,//`onTintColor` is deprecated, use `trackColor` instead. 9 | ?trackColor:Color, 10 | ?onValueChange:Function, 11 | ?testID:String, 12 | ?thumbTintColor:Color, 13 | ?tintColor:Color, 14 | ?value:Bool, 15 | } 16 | -------------------------------------------------------------------------------- /src/react/native/component/props/TextInputProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | import haxe.extern.EitherType; 5 | 6 | @:enum 7 | abstract TextContentType(String) 8 | { 9 | var None = "none"; 10 | var URL = "URL"; 11 | var AddressCity = "addressCity"; 12 | var AddressCityAndState = "addressCityAndState"; 13 | var AddressState = "addressState"; 14 | var CountryName = "countryName"; 15 | var CreditCardNumber = "creditCardNumber"; 16 | var EmailAddress = "emailAddress"; 17 | var FamilyName = "familyName"; 18 | var FullStreetAddress = "fullStreetAddress"; 19 | var GivenName = "givenName"; 20 | var JobTitle = "jobTitle"; 21 | var Location = "location"; 22 | var MiddleName = "middleName"; 23 | var Name = "name"; 24 | var NamePrefix = "namePrefix"; 25 | var NameSuffix = "nameSuffix"; 26 | var Nickname = "nickname"; 27 | var OrganizationName = "organizationName"; 28 | var PostalCode = "postalCode"; 29 | var StreetAddressLine1 = "streetAddressLine1"; 30 | var StreetAddressLine2 = "streetAddressLine2"; 31 | var Sublocality = "sublocality"; 32 | var TelephoneNumber = "telephoneNumber"; 33 | var Username = "username"; 34 | var Password = "password"; 35 | var NewPassword = "newPassword"; 36 | var OneTimeCode = "oneTimeCode"; 37 | } 38 | 39 | @:deprecated('KeyBoardType is deprecated, use KeyboardType instead') 40 | typedef KeyBoardType = KeyboardType; 41 | 42 | @:enum 43 | abstract KeyboardType(String) { 44 | var Default = 'default'; 45 | var EmailAddress = 'email-address'; 46 | var Numeric = 'numeric'; 47 | var PhonePad = 'phone-pad'; 48 | var ASCIICapable = 'ascii-capable'; 49 | var NumbersAndPunctuation = 'numbers-and-punctuation'; 50 | var Url = 'url'; 51 | var NumberPad = 'number-pad'; 52 | var NamePhonePad = 'name-phone-pad'; 53 | var DecimalPad = 'decimal-pad'; 54 | var Twitter = 'twitter'; 55 | var WebSearch = 'web-search'; 56 | } 57 | 58 | @:enum 59 | abstract AutoCapitalizeType(String) { 60 | var None = 'none'; 61 | var Sentences = 'sentences'; 62 | var Words = 'words'; 63 | var Characters = 'characters'; 64 | } 65 | 66 | @:enum 67 | abstract ReturnKeyType(String) { 68 | var Done = 'done'; 69 | var Go = 'go'; 70 | var Next = 'next'; 71 | var Search = 'search'; 72 | var Send = 'send'; 73 | var None = 'none'; 74 | var Previous = 'previous'; 75 | var Default = 'default'; 76 | var EmergencyCall = 'emergency-call'; 77 | var Google = 'google'; 78 | var Join = 'join'; 79 | var Route = 'route'; 80 | var Yahoo = 'yahoo'; 81 | } 82 | 83 | @:enum 84 | abstract TextBreakStrategyType(String) { 85 | var Simple = 'simple'; 86 | var HighQuality = 'highQuality'; 87 | var Balanced = 'balanced'; 88 | } 89 | 90 | @:enum 91 | abstract ClearButtonType(String) { 92 | var Never = 'never'; 93 | var WhileEditing = 'while-editing'; 94 | var UnlessEdition = 'unless-editing'; 95 | var Always = 'always'; 96 | } 97 | 98 | @:enum 99 | abstract KeyboardAppearanceType(String) { 100 | var Default = 'default'; 101 | var Light = 'light'; 102 | var Dark = 'dark'; 103 | } 104 | 105 | @:enum 106 | abstract DataDetectorType(String) { 107 | var PhoneNumber = 'phoneNumber'; 108 | var Link = 'link'; 109 | var Adress = 'address'; 110 | var CalendarEvent= 'calendarEvent'; 111 | var None = 'none'; 112 | var All = 'all'; 113 | } 114 | 115 | typedef TextInputProps = { 116 | > ViewProps.ViewPropsWithoutStyle, 117 | ?autoCapitalize:AutoCapitalizeType, 118 | ?autoCorrect:Bool, 119 | ?autoFocus:Bool, 120 | ?blurOnSubmit:Bool, 121 | ?caretHidden:Bool, 122 | ?defaultValue:String, 123 | ?editable:Bool, 124 | ?keyboardType:KeyboardType, 125 | ?maxLength:Float, 126 | ?maxHeight:Float, 127 | ?multiline:Bool, 128 | ?onBlur:Function, 129 | ?onChange:Function, 130 | ?onChangeText:Function, 131 | ?onContentSizeChange:Function, 132 | ?onEndEditing:Function, 133 | ?onFocus:Function, 134 | ?onLayout:Function, 135 | ?onScroll:Function, 136 | ?onSelectionChange:Function, 137 | ?onSubmitEditing:Function, 138 | ?placeholder:Node, 139 | ?placeholderTextColor:Color, 140 | ?returnKeyType:ReturnKeyType, 141 | ?secureTextEntry:Bool, 142 | ?selectTextOnFocus:Bool, 143 | ?selection:{start:Int, end:Int}, 144 | ?selectionColor:Color, 145 | ?style:haxe.extern.EitherType>, 146 | ?value:String, 147 | ?testID:String, 148 | ?textContentType:TextContentType, 149 | ?allowFontScaling:Bool, 150 | ?textAlignVertical:String, 151 | // android 152 | ?disableFullscreenUI:Bool, 153 | ?autoGrow:Bool, 154 | ?inlineImageLeft:String, 155 | ?inlineImagePadding:Float, 156 | ?numberOfLines:Float, 157 | ?returnKeyLabel:String, 158 | ?textBreakStrategy:TextBreakStrategyType, 159 | ?underlineColorAndroid:Color, 160 | // ios 161 | ?clearButtonMode:ClearButtonType, 162 | ?clearTextOnFocus:Bool, 163 | ?dataDetectorTypes:EitherType>, 164 | ?enablesReturnKeyAutomatically:Bool, 165 | ?keyboardAppearance:KeyboardAppearanceType, 166 | ?onKeyPress:{nativeEvent:{key:String}}->Void, 167 | ?selectionState:Dynamic, // DocumentSelectionState, 168 | ?spellCheck:Bool, 169 | } 170 | -------------------------------------------------------------------------------- /src/react/native/component/props/TextProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | import react.native.component.types.TextPropsTypes; 3 | import react.BaseProps; 4 | 5 | import haxe.Constraints; 6 | 7 | typedef TextProps = { 8 | > BasePropsWithOptChildren, 9 | ?accessible:Bool, 10 | ?allowFontScaling:Bool, 11 | ?maxFontSizeMultiplier:Float, 12 | ?ellipsizeMode:EllipseModeTypes, 13 | ?numberOfLines:Int, 14 | ?onLayout:Function, 15 | ?onLongPress:Function, 16 | ?onPress:Function, 17 | ?pressRetentionOffset:{top: Int, left: Int, bottom: Int, right: Int}, 18 | ?selectable:Bool, 19 | ?style:haxe.extern.EitherType>, 20 | ?testID:String, 21 | // android 22 | ?selectionColor:Color, 23 | ?textBreakStrategy:TextBreakStrategyTypes, 24 | // ios 25 | ?adjustsFontSizeToFit:Bool, 26 | ?minimumFontScale:Float, 27 | ?suppressHighlighting:Bool, 28 | } 29 | -------------------------------------------------------------------------------- /src/react/native/component/props/TextStyle.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | typedef TextStyle = { 4 | > ViewStyle, 5 | ?color:Color, 6 | ?fontFamily:String, 7 | ?fontSize:Float, 8 | ?fontStyle:String, 9 | ?fontWeight:String, 10 | ?lineHeight:Float, 11 | ?textAlign:String, 12 | ?textDecorationLine:String, 13 | ?textShadowColor:Color, 14 | ?textShadowOffset:{width: Float, height: Float}, 15 | ?textShadowRadius:Float, 16 | // android 17 | ?includeFontPadding:Bool, 18 | ?textAlignVertical:String, 19 | // ios 20 | ?fontVariant:Array, 21 | ?letterSpacing:Float, 22 | ?textDecorationColor:Color, 23 | ?textDecorationStyle:String, 24 | ?writingDirection:String, 25 | ?textTransform:String, 26 | } -------------------------------------------------------------------------------- /src/react/native/component/props/ToolbarAndroidProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | 5 | typedef ToolbarAndroidProps = { 6 | > ViewProps, 7 | ?actions:Array<{title:String, ?icon:ImageSource, ?show:ToolbarAndroidActionsShow, ?showWithText:Bool}>, 8 | ?contentInsetEnd:Float, 9 | ?contentInsetStart:Float, 10 | ?logo:ImageSource, 11 | ?navIcon:ImageSource, 12 | ?onActionSelected:Function, 13 | ?onIconClicked:Function, 14 | ?overflowIcon:ImageSource, 15 | ?rtl:Bool, 16 | ?subtitle:String, 17 | ?subtitleColor:Color, 18 | ?testID:String, 19 | ?title:String, 20 | ?titleColor:Color, 21 | } 22 | 23 | @:enum 24 | abstract ToolbarAndroidActionsShow(String) to String { 25 | var Always = 'always'; 26 | var IfRoom = 'ifRoom'; 27 | var Never = 'never'; 28 | } -------------------------------------------------------------------------------- /src/react/native/component/props/TouchableHighlightProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | 5 | typedef TouchableHighlightProps = { 6 | > TouchableWithoutFeedbackProps, 7 | ?activeOpacity:Float, 8 | ?onHideUnderlay:Void->Void, 9 | ?onShowUnderlay:Void->Void, 10 | ?underlayColor:String, 11 | #if ios 12 | ?hasTVPreferredFocus:Bool, 13 | ?tvParallaxProperties:Bool, 14 | #end 15 | } 16 | -------------------------------------------------------------------------------- /src/react/native/component/props/TouchableNativeFeedbackProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | 5 | typedef TouchableNativeFeedbackProps = { 6 | > TouchableProps, 7 | ?background:TouchableNativeFeedbackBackground, 8 | ?useForeground:Bool, 9 | } 10 | 11 | extern class TouchableNativeFeedbackBackground {} -------------------------------------------------------------------------------- /src/react/native/component/props/TouchableOpacityProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | typedef TouchableOpacityProps = { 4 | > TouchableProps, 5 | ?activeOpacity:Float,//default 0.2 6 | } 7 | -------------------------------------------------------------------------------- /src/react/native/component/props/TouchableProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | import react.ReactComponent; 5 | import react.BaseProps; 6 | 7 | typedef TouchableProps = { 8 | > BasePropsWithChildren, 9 | ?onPress:Function, 10 | ?onPressOut:Function, 11 | ?onPressIn:Function, 12 | ?style:haxe.extern.EitherType>, 13 | ?disabled:Bool, 14 | ?delayPressIn:Float, 15 | ?delayPressOut:Float, 16 | ?onLongPress:Function, 17 | ?delayLongPress:Float, 18 | ?hitSlop:{top:Float, bottom:Float, left:Float, right:Float}, 19 | ?testID:String, 20 | } 21 | -------------------------------------------------------------------------------- /src/react/native/component/props/TouchableWithoutFeedbackProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | 5 | private typedef TouchableArea = {top:Float, left:Float, bottom:Float, right:Float}; 6 | 7 | typedef TouchableWithoutFeedbackProps = { 8 | > TouchableProps, 9 | ?hitSlop:TouchableArea, 10 | //?accessibilityComponentType:AccessibilityComponentTypes, - DEPRECATED 11 | //TODO HERE 12 | //?accessibilityHint:String, 13 | //?accessibilityLabel:ReactType, 14 | //?accessibilityRole:AccessibilityRoles, 15 | //?accessibilityStates:Array, 16 | //?accessibilityTraits - DEPRECATED 17 | ?accessible:Bool, 18 | ?delayLongPress:Float, 19 | ?delayPressIn:Float, 20 | ?delayPressOut:Float, 21 | ?disabled:Bool, 22 | ?onLayout:{nativeEvent: {layout: {x:Float, y:Float, width:Float, height:Float}}} -> Void, 23 | 24 | //?onPressIn:Null->Void, 25 | //?onPressOut:Null->Void, 26 | ?pressRetentionOffset:TouchableArea, 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/react/native/component/props/Transforms.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | typedef Transforms = { 4 | ?decomposedMatrix:Dynamic, // DecomposedMatrixPropType 5 | ?transform:Dynamic, // [{perspective: number}, {rotate: string}, {rotateX: string}, {rotateY: string}, {rotateZ: string}, {scale: number}, {scaleX: number}, {scaleY: number}, {translateX: number}, {translateY: number}, {skewX: string}, {skewY: string}] 6 | ?transformMatrix:Dynamic, // TransformMatrixPropType 7 | } -------------------------------------------------------------------------------- /src/react/native/component/props/ViewPagerAndroidProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.Constraints; 4 | 5 | typedef ViewPagerAndroidProps = { 6 | > ViewProps, 7 | ?initialPage:Int, 8 | ?keyboardDismissMode:ViewPagerAndroidKeyboardDismissMode, 9 | ?onPageScroll:Function, 10 | ?onPageScrollStateChanged:{state:ViewPagerAndroidPageScrollState}->Void, 11 | ?onPageSelected:Function, 12 | ?pageMargin:Float, 13 | ?scrollEnabled:Bool, 14 | } 15 | 16 | @:enum 17 | abstract ViewPagerAndroidKeyboardDismissMode(String) to String { 18 | var None = 'none'; 19 | var OnDrag = 'on-drag'; 20 | } 21 | 22 | @:enum 23 | abstract ViewPagerAndroidPageScrollState(String) to String { 24 | var Idle = 'idle'; 25 | var Dragging = 'dragging'; 26 | var Settling = 'settling'; 27 | } -------------------------------------------------------------------------------- /src/react/native/component/props/ViewProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import react.BaseProps; 4 | import react.native.component.types.AccessibilityTypes; 5 | import react.native.component.types.EventTypes; 6 | import haxe.Constraints; 7 | import haxe.extern.EitherType; 8 | 9 | typedef ViewProps = { 10 | > ViewPropsWithoutStyle, 11 | ?style:haxe.extern.EitherType>,//after 12 | } 13 | 14 | typedef ViewPropsWithoutStyle = { 15 | > BasePropsWithOptChildren, 16 | ?accessibilityLabel:Node, 17 | ?accessible:Bool, 18 | ?hitSlop:{top:Int, left:Int, bottom:Int, right:Int}, 19 | ?onAccessibilityTap:Function, 20 | ?onLayout:Function, 21 | ?onMagicTap:Function, 22 | ?onMoveShouldSetResponder:Function, 23 | ?onMoveShouldSetResponderCapture:Function, 24 | ?onResponderGrant:Function, 25 | ?onResponderMove:Function, 26 | ?onResponderReject:Function, 27 | ?onResponderRelease:Function, 28 | ?onResponderTerminate:Function, 29 | ?onResponderTerminationRequest:Function, 30 | ?onStartShouldSetResponder:Function, 31 | ?onStartShouldSetResponderCapture:Function, 32 | ?pointerEvents:PointEventTypes, 33 | ?removeClippedSubviews:Bool, 34 | ?testID:String, 35 | // android 36 | ?accessibilityComponentType:AccessibilityComponentType, 37 | ?accessibilityLiveRegion:AccessibilityLiveRegion, 38 | ?collapsable:Bool, 39 | ?importantForAccessibility:ImportantForAccessibility, 40 | ?needsOffscreenAlphaCompositing:Bool, 41 | ?renderToHardwareTextureAndroid:Bool, 42 | // ios 43 | ?accessibilityTraits:EitherType>, 44 | ?accessibilityViewIsModal:Bool, 45 | ?shouldRasterizeIOS:Bool, 46 | } 47 | 48 | -------------------------------------------------------------------------------- /src/react/native/component/props/ViewStyle.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | typedef ViewStyle = { 4 | > LayoutProps, 5 | > Transforms, 6 | > ShadowProps, 7 | > ViewStyleProps, 8 | ?color:String, 9 | } -------------------------------------------------------------------------------- /src/react/native/component/props/ViewStyleProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | typedef ViewStyleProps = { 4 | ?backfaceVisibility:String, 5 | ?backgroundColor:Color, 6 | ?borderBottomColor:Color, 7 | ?borderBottomLeftRadius:Float, 8 | ?borderBottomRightRadius:Float, 9 | ?borderBottomWidth:Float, 10 | ?borderColor:Color, 11 | ?borderLeftColor:Color, 12 | ?borderLeftWidth:Float, 13 | ?borderRadius:Float, 14 | ?borderRightColor:Color, 15 | ?borderRightWidth:Float, 16 | ?borderStyle:String, 17 | ?borderTopColor:Color, 18 | ?borderTopLeftRadius:Float, 19 | ?borderTopRightRadius:Float, 20 | ?borderTopWidth:Float, 21 | ?borderWidth:Float, 22 | ?opacity:Float, 23 | //android 24 | ?elevation:Int 25 | } 26 | -------------------------------------------------------------------------------- /src/react/native/component/props/VirtualizedListProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import react.ReactComponent; 4 | import haxe.Constraints; 5 | import haxe.DynamicAccess; 6 | 7 | typedef VirtualizedListProps = { 8 | ?data:Any , 9 | ?debug:Bool, 10 | ?extraData:Any , 11 | ?getItem:Any->Int->T, 12 | getItemCount:Any->Int, 13 | ?getItemLayout:Any->Int->{length:Int, offset:Int, index:Int}, 14 | ?horizontal:Bool, 15 | initialNumToRender:Int, 16 | keyExtractor:T->Int->String, 17 | maxToRenderPerBatch:Int, 18 | ?onEndReached:{distanceFromEnd:Float}->Void, 19 | ?onEndReachedThreshold:Float, 20 | ?onLayout:Function, 21 | ?onRefresh:Function, 22 | ?onViewableItemsChanged:{viewableItems:Array, changed:Array}->Void, 23 | viewableItems:Array, 24 | changed:Array, 25 | ?refreshing:Bool, 26 | ?removeClippedSubviews:Bool, 27 | ?renderItem:{item:T, index:Int}->ReactFragment, 28 | renderScrollComponent:DynamicAccess->ReactFragment, 29 | updateCellsBatchingPeriod:Float, 30 | ?viewabilityConfig:ViewabilityConfig, 31 | windowSize:Float, 32 | } 33 | 34 | private typedef ViewToken = Dynamic; 35 | private typedef ViewabilityConfig = Dynamic; -------------------------------------------------------------------------------- /src/react/native/component/props/WebViewProps.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.props; 2 | 3 | import haxe.extern.EitherType; 4 | import haxe.Constraints; 5 | 6 | @:enum 7 | abstract MixedContentModeTypes(String) { 8 | var Never = "never"; 9 | var Always = "always"; 10 | var Compatibility = "compatibility"; 11 | } 12 | 13 | @:enum 14 | abstract WebViewDataDetectorType(String) { 15 | var PhoneNumber = 'phoneNumber'; 16 | var Link = 'link'; 17 | var Adress = 'address'; 18 | var CalendarEvent = 'calendarEvent'; 19 | var None = 'none'; 20 | var All = 'all'; 21 | } 22 | 23 | typedef WebViewProps = { 24 | > ViewProps, 25 | ?automaticallyAdjustContentInsets:Bool, 26 | ?contentInset: {top:Float, left:Float, bottom:Float, right:Float}, 27 | // ?html:String, // deprecated 28 | ?injectJavaScript:Function, 29 | ?injectedJavaScript:String, 30 | ?mediaPlaybackRequiresUserAction:Bool, 31 | ?onError:Function, 32 | ?onLoad:Function, 33 | ?onLoadEnd:Function, 34 | ?onLoadStart:Function, 35 | ?onMessage:Function, 36 | ?onNavigationStateChange:Function, 37 | ?renderError:Function, 38 | ?renderLoading:Function, 39 | ?scalesPageToFit:Bool, 40 | ?source: EitherType<{?uri:String, ?method:String, ?headers:Dynamic, ?body:String}, EitherType<{?html:String, ?baseUrl:String}, Float>>, 41 | ?startInLoadingState:Bool, 42 | // ?url:String, // deprecated 43 | // android 44 | ?domStorageEnabled:Bool, 45 | ?javaScriptEnabled:Bool, 46 | ?mixedContentMode: MixedContentModeTypes, 47 | ?userAgent:String, 48 | // ios 49 | ?allowsInlineMediaPlayback:Bool, 50 | ?bounces:Bool, 51 | ?dataDetectorTypes:EitherType>, 52 | ?decelerationRate:Dynamic, 53 | ?onShouldStartLoadWithRequest:Function, 54 | ?scrollEnabled:Bool, 55 | ?useWebKit:Bool, 56 | } -------------------------------------------------------------------------------- /src/react/native/component/types/AccessibilityTypes.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.types; 2 | 3 | @:enum 4 | abstract AccessibilityComponentType(String) { 5 | var None = 'none'; 6 | var Button = 'button'; 7 | var RadioChecked = 'radiobutton_checked'; 8 | var RadioUnchecked = 'radiobutton_unchecked'; 9 | } 10 | 11 | @:enum 12 | abstract AccessibilityLiveRegion(String) { 13 | var None = 'none'; 14 | var Polite = 'polite'; 15 | var Assertive = 'assertive'; 16 | } 17 | 18 | 19 | @:enum 20 | abstract ImportantForAccessibility(String) { 21 | var Auto = 'auto'; 22 | var Yes = 'yes'; 23 | var No = 'no'; 24 | var NoHideDescendants = 'no-hide-descendants'; 25 | } 26 | 27 | @:enum 28 | abstract AccessibilityTraitsTypes(String) { 29 | var None = 'none'; 30 | var Button = 'button'; 31 | var Link = 'link'; 32 | var Header = 'header'; 33 | var Search = 'search'; 34 | var Image = 'image'; 35 | var Selected = 'selected'; 36 | var Plays = 'plays'; 37 | var Key = 'key'; 38 | var Text = 'text'; 39 | var Summary = 'summary'; 40 | var Disabled = 'disabled'; 41 | var FrequentUpdates = 'frequentUpdates'; 42 | var StartsMedia = 'startsMedia'; 43 | var Adjustable = 'adjustable'; 44 | var AllowsDirectInteraction = 'allowsDirectInteraction'; 45 | var PageTurn = 'pageTurn'; 46 | } -------------------------------------------------------------------------------- /src/react/native/component/types/AnimationTypes.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.types; 2 | 3 | @:enum 4 | abstract DecelarationRate(String) { 5 | var Fast = 'fast'; 6 | var Normal = 'normal'; 7 | } -------------------------------------------------------------------------------- /src/react/native/component/types/EventTypes.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.types; 2 | 3 | @:enum 4 | abstract PointEventTypes(String) { 5 | var BoxNone = 'box-none'; 6 | var None = 'none'; 7 | var BoxOnly= 'box-only'; 8 | var Auto = 'auto'; 9 | } -------------------------------------------------------------------------------- /src/react/native/component/types/ImagePropsTypes.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.types; 2 | 3 | @:enum 4 | abstract ResizeMethodType(String) { 5 | var Auto = 'auto'; 6 | var Resize = 'resize'; 7 | var Scale = 'scale'; 8 | } 9 | 10 | 11 | @:enum 12 | abstract ResizeMode(String) { 13 | var Cover = 'cover'; 14 | var Contain = 'contain'; 15 | var Stretch = 'stretch'; 16 | var Repeat = 'repeat'; 17 | var Center = 'center'; 18 | } 19 | -------------------------------------------------------------------------------- /src/react/native/component/types/TextPropsTypes.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.types; 2 | 3 | @:enum 4 | abstract EllipseModeTypes(String) { 5 | var Head = 'head'; 6 | var Middle = 'middle'; 7 | var Tail = 'tail'; 8 | var Clip = 'clip'; 9 | } 10 | 11 | @:enum 12 | abstract TextBreakStrategyTypes(String) { 13 | var Simple = 'simple'; 14 | var HeightQuality = 'hightQuality'; 15 | var Balanced = 'balanced'; 16 | } -------------------------------------------------------------------------------- /src/react/native/component/types/ViewPropTypes.hx: -------------------------------------------------------------------------------- 1 | package react.native.component.types; 2 | 3 | @:enum 4 | abstract IndicatorStyleType(String) { 5 | var Default = 'default'; 6 | var Black = 'black'; 7 | var White = 'white'; 8 | } 9 | 10 | @:enum 11 | abstract SnappingType(String) { 12 | var Start = 'start'; 13 | var Center = 'center'; 14 | var End = 'end'; 15 | } 16 | 17 | @:enum 18 | abstract KeyboardPersistType(String) { 19 | var Always = 'always'; 20 | var Never = 'never'; 21 | var Handled = 'handled'; 22 | } 23 | 24 | @:enum 25 | abstract KeyboardDismissModeType(String) { 26 | var None = 'none'; 27 | var Interactive = 'interactive'; 28 | var OnDrag = 'on-drag'; 29 | } 30 | 31 | @:enum 32 | abstract OverScrollModeType(String) { 33 | var Auto = 'auto'; 34 | var Always = 'always'; 35 | var Never = 'never'; 36 | } 37 | -------------------------------------------------------------------------------- /submit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | zip -r temp.zip haxelib.json src README.md 4 | haxelib submit temp.zip 5 | rm temp.zip -------------------------------------------------------------------------------- /tests.hxml: -------------------------------------------------------------------------------- 1 | -cp tests 2 | -main RunTests -------------------------------------------------------------------------------- /tests/RunTests.hx: -------------------------------------------------------------------------------- 1 | package ; 2 | 3 | import react.native.api.*; 4 | import react.native.component.props.*; 5 | 6 | class RunTests { 7 | 8 | static function main() { 9 | var style = StyleSheet.create({ 10 | container: @:type(ViewStyle) { 11 | alignItems: Center, 12 | }, 13 | view: { 14 | justifyContent: 'center', 15 | }, 16 | }); 17 | 18 | $type(style.view); 19 | 20 | travix.Logger.println('it works'); 21 | travix.Logger.exit(0); // make sure we exit properly, which is necessary on some targets, e.g. flash & (phantom)js 22 | } 23 | 24 | } --------------------------------------------------------------------------------