├── .config └── dotnet-tools.json ├── .editorconfig ├── .github └── workflows │ └── publish.yml ├── .gitignore ├── Feliz.ReactNative.sln ├── LICENSE ├── README.md ├── paket.dependencies ├── paket.lock └── src ├── Animation ├── Animation.fs ├── NativeModules.fs └── Types.fs ├── Components.fs ├── Feliz.ReactNative.fsproj ├── Helpers.fs ├── Interop.fs ├── Props.fs ├── Styles.fs ├── Types.fs └── paket.references /.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "paket": { 6 | "version": "7.2.0", 7 | "commands": [ 8 | "paket" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | 2 | root = true 3 | 4 | [*] 5 | indent_size = 2 6 | indent_style = space 7 | charset = utf-8 8 | end_of_line = crlf 9 | insert_final_newline = false 10 | trim_trailing_whitespace = true 11 | 12 | [*.fs] 13 | indent_size = 4 -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: Publish on NuGet 2 | 3 | on: 4 | push: 5 | branches: 6 | - prod 7 | tags: 8 | - "*" 9 | 10 | jobs: 11 | Publish: 12 | runs-on: ubuntu-latest 13 | environment: production 14 | steps: 15 | - uses: actions/checkout@v3 16 | - uses: actions/setup-dotnet@v2 17 | with: 18 | dotnet-version: '6.0.x' 19 | - run: dotnet tool restore 20 | - run: dotnet paket restore 21 | - run: dotnet restore 22 | - name: Build the package 23 | run: dotnet build src/Feliz.ReactNative.fsproj --no-restore --configuration Release 24 | - name: Publish the package 25 | run: dotnet nuget push src/bin/Release/*.nupkg --api-key ${{secrets.NUGET_AUTH_TOKEN}} --source https://api.nuget.org/v3/index.json -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | #Ionide 2 | .fake 3 | .ionide 4 | 5 | bin/ 6 | obj/ 7 | 8 | #Paket 9 | .paket/ 10 | paket-files/ 11 | packages/ 12 | 13 | **.fs.js -------------------------------------------------------------------------------- /Feliz.ReactNative.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30114.105 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".paket", ".paket", "{AEE56936-F14E-43E9-9378-B619D4901037}" 7 | ProjectSection(SolutionItems) = preProject 8 | paket.dependencies = paket.dependencies 9 | EndProjectSection 10 | EndProject 11 | Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Feliz.ReactNative", "src\Feliz.ReactNative.fsproj", "{BDC57843-88DD-42B5-A69E-6F40D82D3409}" 12 | EndProject 13 | Global 14 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 15 | Debug|Any CPU = Debug|Any CPU 16 | Release|Any CPU = Release|Any CPU 17 | EndGlobalSection 18 | GlobalSection(SolutionProperties) = preSolution 19 | HideSolutionNode = FALSE 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {BDC57843-88DD-42B5-A69E-6F40D82D3409}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {BDC57843-88DD-42B5-A69E-6F40D82D3409}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {BDC57843-88DD-42B5-A69E-6F40D82D3409}.Release|Any CPU.ActiveCfg = Release|Any CPU 25 | {BDC57843-88DD-42B5-A69E-6F40D82D3409}.Release|Any CPU.Build.0 = Release|Any CPU 26 | EndGlobalSection 27 | EndGlobal 28 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Gaël Bouquain 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Feliz.ReactNative [![Nuget](https://img.shields.io/nuget/v/Feliz.ReactNative.svg?maxAge=0&colorB=brightgreen)](https://www.nuget.org/packages/Feliz.ReactNative) [![Publish on NuGet](https://github.com/carne8/Feliz.ReactNative/actions/workflows/publish.yml/badge.svg)](https://github.com/carne8/Feliz.ReactNative/actions/workflows/publish.yml) 2 | 3 | React Native bindings for [Feliz](https://github.com/Zaid-Ajaj/Feliz) 4 | 5 | Usage: 6 | 7 | ```fsharp 8 | module App 9 | 10 | open Feliz 11 | open Feliz.ReactNative 12 | 13 | [] 14 | let Counter() = 15 | let (count, setCount) = React.useState(0) 16 | Comp.view [ 17 | Comp.text [ 18 | prop.style [ 19 | style.width 50. 20 | style.height 50. 21 | style.backgroundColor "red" 22 | ] 23 | prop.onPress (fun _ -> setCount(count + 1)) 24 | prop.text "Increment" 25 | ] 26 | 27 | Comp.text [ 28 | prop.style [ 29 | style.width 50. 30 | style.height 50. 31 | style.backgroundColor "blue" 32 | ] 33 | prop.onPress (fun _ -> setCount(count - 1)) 34 | prop.text "Decrement" 35 | ] 36 | 37 | Comp.text (count |> string) 38 | ] 39 | ``` 40 | -------------------------------------------------------------------------------- /paket.dependencies: -------------------------------------------------------------------------------- 1 | source https://api.nuget.org/v3/index.json 2 | 3 | nuget FSharp.Core 4 | nuget Fable.Core 5 | nuget Fable.React 6 | nuget Feliz -------------------------------------------------------------------------------- /paket.lock: -------------------------------------------------------------------------------- 1 | NUGET 2 | remote: https://api.nuget.org/v3/index.json 3 | Fable.AST (4.2.1) - restriction: >= netstandard2.0 4 | Fable.Browser.Blob (1.2) - restriction: >= netstandard2.0 5 | Fable.Core (>= 3.0) - restriction: >= netstandard2.0 6 | FSharp.Core (>= 4.7.2) - restriction: >= netstandard2.0 7 | Fable.Browser.Dom (2.10.1) - restriction: >= netstandard2.0 8 | Fable.Browser.Blob (>= 1.2) - restriction: >= netstandard2.0 9 | Fable.Browser.Event (>= 1.5) - restriction: >= netstandard2.0 10 | Fable.Browser.WebStorage (>= 1.1) - restriction: >= netstandard2.0 11 | Fable.Core (>= 3.2.8) - restriction: >= netstandard2.0 12 | FSharp.Core (>= 4.7.2) - restriction: >= netstandard2.0 13 | Fable.Browser.Event (1.5) - restriction: >= netstandard2.0 14 | Fable.Browser.Gamepad (>= 1.1) - restriction: >= netstandard2.0 15 | Fable.Core (>= 3.0) - restriction: >= netstandard2.0 16 | FSharp.Core (>= 4.7.2) - restriction: >= netstandard2.0 17 | Fable.Browser.Gamepad (1.1) - restriction: >= netstandard2.0 18 | Fable.Core (>= 3.0) - restriction: >= netstandard2.0 19 | FSharp.Core (>= 4.7.2) - restriction: >= netstandard2.0 20 | Fable.Browser.WebStorage (1.1) - restriction: >= netstandard2.0 21 | Fable.Browser.Event (>= 1.5) - restriction: >= netstandard2.0 22 | Fable.Core (>= 3.0) - restriction: >= netstandard2.0 23 | FSharp.Core (>= 4.7.2) - restriction: >= netstandard2.0 24 | Fable.Core (3.7.1) 25 | Fable.React (9.1) 26 | Fable.React.Types (>= 18.1) - restriction: >= netstandard2.0 27 | Fable.ReactDom.Types (>= 18.0) - restriction: >= netstandard2.0 28 | FSharp.Core (>= 4.7.2) - restriction: >= netstandard2.0 29 | Fable.React.Types (18.1) - restriction: >= netstandard2.0 30 | Fable.Browser.Dom (>= 2.4.4) - restriction: >= netstandard2.0 31 | Fable.Core (>= 3.2.7) - restriction: >= netstandard2.0 32 | FSharp.Core (>= 4.7.2) - restriction: >= netstandard2.0 33 | Fable.ReactDom.Types (18.0) - restriction: >= netstandard2.0 34 | Fable.React.Types (>= 18.1) - restriction: >= netstandard2.0 35 | FSharp.Core (>= 4.7.2) - restriction: >= netstandard2.0 36 | Feliz (2.3) 37 | Fable.React.Types (>= 18.1) - restriction: >= netstandard2.0 38 | Feliz.CompilerPlugins (>= 2.0) - restriction: >= netstandard2.0 39 | FSharp.Core (>= 4.7.2) - restriction: >= netstandard2.0 40 | Feliz.CompilerPlugins (2.0) - restriction: >= netstandard2.0 41 | Fable.AST (>= 4.2.1) - restriction: >= netstandard2.0 42 | FSharp.Core (>= 4.7.2) - restriction: >= netstandard2.0 43 | FSharp.Core (7.0) 44 | -------------------------------------------------------------------------------- /src/Animation/Animation.fs: -------------------------------------------------------------------------------- 1 | namespace Feliz.ReactNative.Animation 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | 6 | open Feliz.ReactNative 7 | open Feliz.ReactNative.Animation.Types 8 | open Feliz.ReactNative.Animation.NativeModule 9 | 10 | 11 | module animProp = 12 | [] 13 | type config = 14 | static member inline bounciness (value: float) = unbox ("bounciness", value) 15 | static member inline damping (value: float) = unbox ("damping", value) 16 | static member inline deceleration (value: float) = unbox ("deceleration", value) 17 | static member inline delay (value: float) = unbox ("delay", value) 18 | static member inline duration (value: float) = unbox ("duration", value) 19 | static member inline friction (value: float) = unbox ("friction", value) 20 | static member inline isInteraction (value: bool) = unbox ("isInteraction", value) 21 | static member inline mass (value: float) = unbox ("mass", value) 22 | static member inline overshootClamping (value: bool) = unbox ("overshootClamping", value) 23 | static member inline overshootTension (value: float) = unbox ("overshootTension", value) 24 | static member inline restDisplacementThreshold (value: float) = unbox ("restDisplacementThreshold", value) 25 | static member inline restSpeedThreshold (value: float) = unbox ("restSpeedThreshold", value) 26 | static member inline speed (value: float) = unbox ("speed", value) 27 | static member inline stiffness (value: float) = unbox ("stiffness", value) 28 | static member inline tension (value: float) = unbox ("tension", value) 29 | static member inline toValue (value: float) = unbox ("toValue", value) 30 | static member inline useNativeDriver (value: bool) = unbox ("useNativeDriver", value) 31 | static member inline velocity (value: float) = unbox ("velocity", value) 32 | static member inline easing (value: IEasing) = unbox ("easing", value) 33 | 34 | [] 35 | type compose = 36 | static member inline iterations (value: int) = unbox ("iterations", value) 37 | static member inline isInteraction (value: bool) = unbox ("isInteraction", value) 38 | static member inline useNativeDriver (value: bool) = unbox ("useNativeDriver", value) 39 | static member inline listener (value: (obj -> unit) -> unit) = unbox ("listener", value) 40 | static member inline stopTogether (value: bool) = unbox ("stopTogether", value) 41 | 42 | [] 43 | type interpolateProp = 44 | static member inline inputRange (value: seq) = unbox ("inputRange", value) 45 | static member inline outputRange (value: seq) = unbox ("outputRange", value) 46 | static member inline easing (value: IEasing) = unbox ("easing", value) 47 | [] 48 | module interpolateProp = 49 | [] 50 | type extrapolate = 51 | static member inline extend = unbox ("extrapolate", "extend") 52 | static member inline identity = unbox ("extrapolate", "identity") 53 | static member inline clamp = unbox ("extrapolate", "clamp") 54 | [] 55 | type extrapolateLeft = 56 | static member inline left = unbox ("extrapolateLeft", "left") 57 | static member inline identity = unbox ("extrapolateLeft", "identity") 58 | static member inline clamp = unbox ("extrapolateLeft", "clamp") 59 | [] 60 | type extrapolateRight = 61 | static member inline right = unbox ("extrapolateRight", "right") 62 | static member inline identity = unbox ("extrapolateRight", "identity") 63 | static member inline clamp = unbox ("extrapolateRight", "clamp") 64 | 65 | 66 | /// This module contains many helpers for manipulating animations. 67 | [] 68 | module Animation = 69 | /// Same as ``new Animated.Value(value)`` in JS. 70 | let inline create value = Animated.value value 71 | /// Same as ``new Animated.ValueXY(value)`` in JS. 72 | let inline createXY value = Animated.valueXY value 73 | 74 | /// Transform a react component in an animated component. 75 | /// ``` 76 | /// let AnimatedView = Animation.createAnimatedComponent Comp.view 77 | /// ``` 78 | let inline createAnimatedComponent component' = Animated.createAnimatedComponent component' 79 | 80 | let inline decay config animation = Animated.decay animation config 81 | let inline timing config animation = Animated.timing animation config 82 | let inline spring config animation = Animated.spring animation config 83 | 84 | let inline delay ms = Animated.delay ms 85 | let inline sequence animations = Animated.sequence animations 86 | let inline parallel' animations = Animated.parallel' animations 87 | let inline parallelCF config animations = Animated.parallel' (animations, config) 88 | let inline stagger ms animations = Animated.stagger animations ms 89 | 90 | let inline add a b = Animated.add a b 91 | let inline sub a b = Animated.subtract a b 92 | let inline multiply a b = Animated.multiply a b 93 | let inline divide a b = Animated.divide a b 94 | let inline modulo a b = Animated.modulo a b 95 | let inline diffClamp min max animation = Animated.diffClamp animation min max 96 | 97 | let inline event listener = Animated.event listener 98 | let inline eventCF listener config = Animated.event (listener, config) 99 | let inline loop animation = Animated.loop animation 100 | let inline loopCF config animation = Animated.loop (animation, config) 101 | 102 | let inline forkEvent listener event = Animated.forkEvent event listener 103 | let inline unforkEvent listener event = Animated.unforkEvent event listener 104 | 105 | /// Same as ``animation.x``. 106 | /// Take only XY animations. 107 | let inline getX (animation: AnimValue) : float = animation?x 108 | /// Same as ``animation.y``. 109 | /// Take only XY animations. 110 | let inline getY (animation: AnimValue) : float = animation?y 111 | 112 | /// Same as ``animation.start()``. 113 | let inline start (animation: AnimFunc) = animation.start() 114 | /// Same as ``startAnimation``, but with a callback. 115 | let inline startCB callback (animation: AnimFunc) = animation.start callback 116 | /// Same as ``animation.stop()``. 117 | let inline stop (animation: AnimFunc) = animation.stop() 118 | /// Same as ``animation.reset()``. 119 | let inline reset (animation: AnimFunc) = animation.reset() 120 | /// Same as ``animation.setValue(newValue)``. 121 | let inline setValue (newValue: float) (animation: AnimValue) : unit = animation?setValue newValue 122 | /// Same as ``animation.setOffset(offset)``. 123 | let inline setOffset (offset: float) (animation: AnimValue) : unit = animation?setOffset offset 124 | /// Same as ``animation.flattenOffset()``. 125 | let inline flattenOffset (animation: AnimValue) : unit = animation?flattenOffset() 126 | /// Same as ``animation.extractOffset()``. 127 | let inline extractOffset (animation: AnimValue) : unit = animation?extractOffset() 128 | /// Same as ``animation.addListener(callback)``. 129 | let inline addListener (callback: {| value: AnimValue |} -> unit) (animation: AnimValue) : string = animation?addListener callback 130 | /// Same as ``animation.removeListener(id)``. 131 | let inline removeListener (id: string) (animation: AnimValue) : unit = animation?removeListener id 132 | /// Same as ``animation.removeAllListeners()``. 133 | let inline removeAllListeners (animation: AnimValue) : unit = animation?removeAllListeners() 134 | /// Same as ``animation.stopAnimation()``. 135 | let inline stopAnimation (animation: AnimValue) : unit = animation?stopAnimation() 136 | /// Same as ``animation.stopAnimation(callback)``. 137 | let inline stopAnimationCB (callback: {| value: AnimValue |} -> unit) (animation: AnimValue) : unit = animation?stopAnimation callback 138 | /// Same as ``animation.resetAnimation()``. 139 | let inline resetAnimation (animation: AnimValue) : unit = animation?resetAnimation() 140 | /// Same as ``animation.resetAnimation(callback)``. 141 | let inline resetAnimationCB (callback: {| value: AnimValue |} -> unit) (animation: AnimValue) : unit = animation?resetAnimation callback 142 | /// Same as ``animation.interpolate(config)``. 143 | let inline interpolate (config: seq) (animation: AnimValue) : AnimValue = animation?interpolate (createObj !!config) 144 | /// Same as ``animation.getLayout()``. 145 | let inline getLayout (animation: AnimValue) : {| left: float; top: float |} = animation?getLayout() 146 | /// Same as ``animation.getTranslateTransform()``. 147 | let inline getTranslateTransform (animation: AnimValue) : ITransform = animation?getTranslateTransform() 148 | 149 | 150 | [] 151 | module Comp = 152 | /// This type contains the animated components available in the ``Animated`` module. 153 | [] 154 | type animated = 155 | static member inline view = Interop.createElementFromName "Animated.View" 156 | static member inline image = Interop.createElementFromName "Animated.Image" 157 | static member inline text = Interop.createElementFromName "Animated.Text" 158 | static member inline scrollView = Interop.createElementFromName "Animated.ScrollView" 159 | static member inline flatList = Interop.createElementFromName "Animated.FlatList" 160 | static member inline sectionList = Interop.createElementFromName "Animated.SectionList" -------------------------------------------------------------------------------- /src/Animation/NativeModules.fs: -------------------------------------------------------------------------------- 1 | module Feliz.ReactNative.Animation.NativeModule 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open Feliz.ReactNative.Animation.Types 6 | 7 | let inline private moduleAnimated () = import "Animated" "react-native" 8 | let inline private moduleEasing () = import "Easing" "react-native" 9 | 10 | /// This type represents the ``Animated`` module of react-native. 11 | [] 12 | type Animated = 13 | static member inline value (value: float) : AnimValue = !!createNew (moduleAnimated?Value) value 14 | static member inline valueXY (value: float) : AnimValue = !!createNew (moduleAnimated?ValueXY) value 15 | 16 | static member inline decay (animation: AnimValue) (config: seq) : AnimFunc = moduleAnimated?decay (animation, (createObj !!config)) 17 | static member inline timing (animation: AnimValue) (config: seq) : AnimFunc = moduleAnimated?timing (animation, (createObj !!config)) 18 | static member inline spring (animation: AnimValue) (config: seq) : AnimFunc = moduleAnimated?spring (animation, (createObj !!config)) 19 | 20 | static member inline delay (ms: int) : AnimFunc = moduleAnimated?delay ms 21 | static member inline parallel' (animations: seq) : AnimFunc = moduleAnimated?("parallel") animations 22 | static member inline parallel' (animations: seq, config: seq) : AnimFunc = moduleAnimated?("parallel") (animations, (createObj !!config)) 23 | static member inline sequence (animations: seq) : AnimFunc = moduleAnimated?sequence animations 24 | static member inline stagger (ms: int) (animations: seq) : AnimFunc = moduleAnimated?stagger (ms, animations) 25 | 26 | static member inline add (a: AnimValue) (b: AnimValue) : AnimValue = moduleAnimated?add (a, b) 27 | static member inline subtract (a: AnimValue) (b: AnimValue) : AnimValue = moduleAnimated?subtract (a, b) 28 | static member inline divide (a: AnimValue) (b: AnimValue) : AnimValue = moduleAnimated?divide (a, b) 29 | static member inline modulo (a: AnimValue) (b: AnimValue) : AnimValue = moduleAnimated?modulo (a, b) 30 | static member inline multiply (a: AnimValue) (b: AnimValue) : AnimValue = moduleAnimated?multiply (a, b) 31 | static member inline diffClamp (a: AnimValue) (b: float) (c: float) : AnimValue = moduleAnimated?diffClamp (a, b, c) 32 | 33 | static member inline event (listeners: seq<_>) : _ -> AnimEvent = moduleAnimated?event listeners 34 | static member inline event (events: seq<_>, config: seq) : _ -> AnimEvent = moduleAnimated?event (events, (createObj !!config)) 35 | static member inline loop (animation: AnimValue) : AnimFunc = moduleAnimated?loop animation 36 | static member inline loop (animation: AnimValue, config: seq) : AnimFunc = moduleAnimated?loop (animation, (createObj !!config)) 37 | 38 | static member inline forkEvent (event: AnimEvent) (listener: _ -> unit) = moduleAnimated?forkEvent event listener 39 | static member inline unforkEvent (event: AnimEvent) (listener: _ -> unit) = moduleAnimated?unforkEvent event listener 40 | 41 | static member inline createAnimatedComponent (component': seq -> Feliz.ReactElement) : seq -> Feliz.ReactElement = moduleAnimated?createAnimatedComponent component' 42 | 43 | 44 | /// This type represents the ``Easing`` module of react-native. 45 | [] 46 | type Easing = 47 | static member inline step0 (value: float) = unbox (moduleEasing?step0 value) 48 | static member inline step1 (value: float) = unbox (moduleEasing?step1 value) 49 | 50 | static member inline back () = unbox (moduleEasing?back) 51 | static member inline back (value: float) = unbox (moduleEasing?back value) 52 | static member inline bounce () = unbox (moduleEasing?bounce) 53 | static member inline bounce (value: float) = unbox (moduleEasing?bounce value) 54 | static member inline ease () = unbox (moduleEasing?ease) 55 | static member inline ease (value: float) = unbox (moduleEasing?ease value) 56 | static member inline elastic () = unbox (moduleEasing?elastic) 57 | static member inline elastic (value: float) = unbox (moduleEasing?elastic value) 58 | static member inline linear () = unbox (moduleEasing?linear) 59 | static member inline linear (value: float) = unbox (moduleEasing?linear value) 60 | static member inline quad () = unbox (moduleEasing?quad) 61 | static member inline quad (value: float) = unbox (moduleEasing?quad value) 62 | static member inline cubic () = unbox (moduleEasing?cubic) 63 | static member inline cubic (value: float) = unbox (moduleEasing?cubic value) 64 | static member inline poly () = unbox (moduleEasing?poly) 65 | static member inline poly (value: float) = unbox (moduleEasing?poly value) 66 | static member inline bezier (x1: float, y1: float, x2: float, y2: float) = unbox (moduleEasing?bezier x1 y1 x2 y2) 67 | static member inline circle () = unbox (moduleEasing?circle) 68 | static member inline circle (value: float) = unbox (moduleEasing?circle value) 69 | static member inline sin () = unbox (moduleEasing?sin) 70 | static member inline sin (value: float) = unbox (moduleEasing?sin value) 71 | static member inline exp () = unbox (moduleEasing?exp) 72 | static member inline exp (value: float) = unbox (moduleEasing?exp value) 73 | 74 | static member inline in' (value: IEasing) = unbox (moduleEasing?("in") value) 75 | static member inline inOut (value: IEasing) = unbox (moduleEasing?inOut value) 76 | static member inline out (value: IEasing) = unbox (moduleEasing?out value) -------------------------------------------------------------------------------- /src/Animation/Types.fs: -------------------------------------------------------------------------------- 1 | namespace Feliz.ReactNative.Animation.Types 2 | 3 | type AnimValue = float 4 | type AnimEvent = interface end 5 | type AnimFunc = 6 | abstract member start: unit -> unit 7 | abstract member start: callback: (obj -> unit) -> unit 8 | abstract member stop: unit -> unit 9 | abstract member reset: unit -> unit 10 | 11 | type IEasing = interface end 12 | type IConfigProp = interface end 13 | type IComposeProp = interface end 14 | type IInterpolateProp = interface end -------------------------------------------------------------------------------- /src/Components.fs: -------------------------------------------------------------------------------- 1 | namespace Feliz.ReactNative 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open Fable.React 6 | 7 | [] 8 | type Comp = 9 | static member inline fragment (children: seq) = Interop.createElement (import "Fragment" "react") (createObj [ "children", children ]) 10 | static member inline keyedFragment (key: string) (children: seq) = Interop.createElement (import "Fragment" "react") (createObj [ "key", key; "children", children ]) 11 | 12 | static member inline view props = Interop.createElementFromName "View" props 13 | static member inline view (children: seq) = Interop.createElementFromNameWithChildren "View" children 14 | 15 | static member inline text props = Interop.createElementFromName "Text" props 16 | static member inline text (text: string) = Interop.createElementFromName "Text" [ prop.text text ] 17 | 18 | static member inline textInput props = Interop.createElementFromName "TextInput" props 19 | 20 | static member inline image props = Interop.createElementFromName "Image" props 21 | static member inline image (imageSource: IImageSource) = Interop.createElementFromName "Image" [ prop.source imageSource ] 22 | static member inline image (imageSource: seq) = Interop.createElementFromName "Image" [ prop.source imageSource ] 23 | 24 | static member inline scrollView props = Interop.createElementFromName "ScrollView" props 25 | static member inline scrollView (child: ReactElement) = Interop.createElementFromNameWithChildren "ScrollView" [| child |] 26 | static member inline scrollView (children: seq) = Interop.createElementFromNameWithChildren "ScrollView" children 27 | 28 | static member inline flatList props = Interop.createElementFromName "FlatList" props 29 | static member inline flatList (child: ReactElement) = Interop.createElementFromNameWithChildren "FlatList" [| child |] 30 | static member inline flatList (children: seq) = Interop.createElementFromNameWithChildren "FlatList" children 31 | 32 | static member inline statusBar props = Interop.createElementFromName "StatusBar" props 33 | 34 | static member inline pressable props = Interop.createElementFromName "Pressable" props -------------------------------------------------------------------------------- /src/Feliz.ReactNative.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.1 5 | true 6 | Feliz.ReactNative 7 | 0.8.2 8 | Gaël Bouquain 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/Helpers.fs: -------------------------------------------------------------------------------- 1 | namespace Feliz.ReactNative 2 | 3 | open Fable.Core.JsInterop 4 | 5 | type ReactComponent = Feliz.ReactComponentAttribute 6 | 7 | type ColorScheme = 8 | | Light 9 | | Dark 10 | | Unspecified 11 | 12 | module React = 13 | let useColorScheme () = 14 | match (import "useColorScheme" "react-native")() with 15 | | "light" -> Light 16 | | "dark" -> Dark 17 | | _ -> Unspecified 18 | 19 | /// Return the height, the width, the scale and the fontScale of the window. 20 | /// ``` 21 | /// let height, width, scale, fontScale = React.useWindowDimensions() 22 | /// ``` 23 | let useWindowDimensions () : float * float * float * float = 24 | let dimensions = (import "useWindowDimensions" "react-native")() 25 | dimensions?height, dimensions?width, dimensions?scale, dimensions?fontScale -------------------------------------------------------------------------------- /src/Interop.fs: -------------------------------------------------------------------------------- 1 | namespace Feliz.ReactNative 2 | 3 | open Feliz 4 | open Fable.Core.JsInterop 5 | 6 | [] 7 | module Interop = 8 | let createElement (_element: obj) (_props: obj) : ReactElement = import "createElement" "react" 9 | 10 | let inline createElementFromName (name: string) (properties: IReactProperty list) : ReactElement = 11 | createElement (import name "react-native") (createObj !!properties) 12 | 13 | let inline createElementFromNameWithChildren (name: string) (children: seq) = 14 | createElement (import name "react-native") (createObj [ "children", Interop.reactApi.Children.toArray (Array.ofSeq children) ]) -------------------------------------------------------------------------------- /src/Props.fs: -------------------------------------------------------------------------------- 1 | namespace Feliz.ReactNative 2 | 3 | open Feliz 4 | open Fable.Core 5 | open Fable.Core.JsInterop 6 | 7 | [] 8 | type prop = 9 | /// Use this if there isn't a the adapted prop. 10 | static member inline custom (key: string) value = Interop.mkAttr key value 11 | 12 | // View props 13 | static member inline accessibilityActions (value: AccessibilityActions []) = Interop.mkAttr "accessibilityActions" value 14 | /// Only on iOS. 15 | static member inline accessibilityElementsHidden (value: bool) = Interop.mkAttr "accessibilityElementsHidden" value 16 | static member inline accessibilityHint (value: string) = Interop.mkAttr "accessibilityHint" value 17 | static member inline accessibilityLabel (value: string) = Interop.mkAttr "accessibilityLabel" value 18 | /// Only on iOS. 19 | static member inline accessibilityLanguage (value: string) = Interop.mkAttr "accessibilityLanguage" value 20 | /// Only on iOS. 21 | static member inline accessibilityIgnoresInvertColors (value: bool) = Interop.mkAttr "accessibilityIgnoresInvertColors" value 22 | static member inline accessibilityState (value: {| disabled: bool option; selected: bool option; ``checked``: bool option; busy: bool option; expanded: bool option |}) = 23 | [ "disabled" ==> Option.defaultValue !!Interop.undefined value.disabled 24 | "selected" ==> Option.defaultValue !!Interop.undefined value.selected 25 | "checked" ==> Option.defaultValue !!Interop.undefined value.``checked`` 26 | "busy" ==> Option.defaultValue !!Interop.undefined value.busy 27 | "expanded" ==> Option.defaultValue !!Interop.undefined value.expanded ] 28 | |> createObj 29 | |> Interop.mkAttr "accessibilityState" 30 | static member inline accessibilityState (value: {| disabled: bool option; selected: bool option; ``checked``: string option; busy: bool option; expanded: bool option |}) = 31 | [ "disabled" ==> Option.defaultValue !!Interop.undefined value.disabled 32 | "selected" ==> Option.defaultValue !!Interop.undefined value.selected 33 | "checked" ==> Option.defaultValue !!Interop.undefined value.``checked`` 34 | "busy" ==> Option.defaultValue !!Interop.undefined value.busy 35 | "expanded" ==> Option.defaultValue !!Interop.undefined value.expanded ] 36 | |> createObj 37 | |> Interop.mkAttr "accessibilityState" 38 | static member inline accessibilityValue (value: {| min: float; max: float; now: float; text: string |}) = Interop.mkAttr "accessibilityValue" value 39 | /// Only on iOS. 40 | static member inline accessibilityViewIsModal (value: bool) = Interop.mkAttr "accessibilityViewIsModal" value 41 | static member inline accessible (value: bool) = Interop.mkAttr "accessible" value 42 | static member inline children (value: ReactElement) = Interop.mkAttr "children" value 43 | static member inline children (elems: ReactElement seq) = Interop.mkAttr "children" (Feliz.Interop.reactApi.Children.toArray (Array.ofSeq elems)) 44 | static member inline collapsable (value: bool) = Interop.mkAttr "collapsable" value 45 | static member inline focusable (value: bool) = Interop.mkAttr "focusable" value 46 | static member inline hitSlop (value: float) = Interop.mkAttr "hitSlop" value 47 | static member inline hitSlop (value: seq) = Interop.mkAttr "hitSlop" (createObj !!value) 48 | static member inline key (value: string) = Interop.mkAttr "key" value 49 | static member inline nativeID (value: string) = Interop.mkAttr "nativeID" value 50 | static member inline needsOffscreenAlphaCompositing (value: bool) = Interop.mkAttr "needsOffscreenAlphaCompositing" value 51 | /// Only on Android. 52 | static member inline nextFocusDown (value: float) = Interop.mkAttr "nextFocusDown" value 53 | /// Only on Android. 54 | static member inline nextFocusForward (value: float) = Interop.mkAttr "nextFocusForward" value 55 | /// Only on Android. 56 | static member inline nextFocusLeft (value: float) = Interop.mkAttr "nextFocusLeft" value 57 | /// Only on Android. 58 | static member inline nextFocusRight (value: float) = Interop.mkAttr "nextFocusRight" value 59 | /// Only on Android. 60 | static member inline nextFocusUp (value: float) = Interop.mkAttr "nextFocusUp" value 61 | static member inline onAccessibilityActions (value: AccessibilityActions -> unit) = Interop.mkAttr "onAccessibilityActions" value 62 | /// Only on iOS. 63 | static member inline onAccessibilityEscape (value: unit -> unit) = Interop.mkAttr "onAccessibilityEscape" value 64 | static member inline onAccessibilityTap (value: unit -> unit) = Interop.mkAttr "onAccessibilityTap" value 65 | static member inline onLayout (value: {| nativeEvent: LayoutEvent |} -> unit) = Interop.mkAttr "onLayout" value 66 | /// Only on iOS. 67 | static member inline onMagicTap (value: unit -> unit) = Interop.mkAttr "omMagicTap" value 68 | static member inline onMoveShouldSetResponder (value: {| nativeEvent: PressEvent |} -> bool) = Interop.mkAttr "onMoveShouldSetResponder" value 69 | static member inline onMoveShouldSetResponderCapture (value: {| nativeEvent: PressEvent |} -> bool) = Interop.mkAttr "onMoveShouldSetResponderCapture" value 70 | static member inline onResponderGrant (value: {| nativeEvent: PressEvent |} -> unit) = Interop.mkAttr "onResponderGrant" value 71 | static member inline onResponderMove (value: {| nativeEvent: PressEvent |} -> unit) = Interop.mkAttr "onResponderMove" value 72 | static member inline onResponderReject (value: {| nativeEvent: PressEvent |} -> unit) = Interop.mkAttr "onResponderReject" value 73 | static member inline onResponderRelease (value: {| nativeEvent: PressEvent |} -> unit) = Interop.mkAttr "onResponderRelease" value 74 | static member inline onResponderTerminate (value: {| nativeEvent: PressEvent |} -> unit) = Interop.mkAttr "onResponderTerminate" value 75 | static member inline onResponderTerminationRequest (value: {| nativeEvent: PressEvent |} -> bool) = Interop.mkAttr "onResponderTerminationRequest" value 76 | static member inline onStartShouldSetResponder (value: {| nativeEvent: PressEvent |} -> bool) = Interop.mkAttr "onStartShouldSetResponder" value 77 | static member inline onStartShouldSetResponderCapture (value: {| nativeEvent: PressEvent |} -> bool) = Interop.mkAttr "onStartShouldSetResponderCapture" value 78 | static member inline removeClippedSubviews (value: bool) = Interop.mkAttr "removeClippedSubviews" value 79 | /// Only on Android. 80 | static member inline renderToHardwareTextureAndroid (value: bool) = Interop.mkAttr "renderToHardwareTextureAndroid " value 81 | /// Only on iOS. 82 | static member inline shouldRasterizeIOS (value: bool) = Interop.mkAttr "shouldRasterizeIOS " value 83 | static member inline style (properties: seq) = Interop.mkAttr "style" (createObj !!properties) 84 | static member inline testID (value: string) = Interop.mkAttr "testID" value 85 | 86 | // Text props 87 | static member inline adjustsFontSizeToFit (value: bool) = Interop.mkAttr "adjustsFontSizeToFit" value 88 | static member inline allowFontScaling (value: bool) = Interop.mkAttr "allowFontScaling" value 89 | /// Only on Android. 90 | static member inline disabled (value: bool) = Interop.mkAttr "disabled" value 91 | static member inline maxFontSizeMultiplier (value: float) = Interop.mkAttr "maxFontSizeMultiplier" value 92 | static member inline maxFontSizeMultiplier (value: obj) = Interop.mkAttr "maxFontSizeMultiplier" value 93 | /// Only on iOS. 94 | static member inline minimumFontScale (value: float) = Interop.mkAttr "minimumFontScale" value 95 | static member inline numberOfLines (value: float) = Interop.mkAttr "numberOfLines" value 96 | static member inline onLongPress (value: {| nativeEvent: PressEvent |} -> unit) = Interop.mkAttr "onLongPress" value 97 | static member inline onPress (value: {| nativeEvent: PressEvent |} -> unit) = Interop.mkAttr "onPress" value 98 | static member inline onPressIn (value: {| nativeEvent: PressEvent |} -> unit) = Interop.mkAttr "onPressIn" value 99 | static member inline onPressOut (value: {| nativeEvent: PressEvent |} -> unit) = Interop.mkAttr "onPressOut" value 100 | static member inline onTextLayout (value: TextLayoutEvent -> 'a) = Interop.mkAttr "onTextLayout" value 101 | static member inline pressRetentionOffset (value: seq) = Interop.mkAttr "pressRetentionOffset" (createObj !!value) 102 | static member inline pressRetentionOffset (value: float) = Interop.mkAttr "pressRetentionOffset" value 103 | static member inline selectable (value: bool) = Interop.mkAttr "selectable" value 104 | /// Only on Android. 105 | static member inline selectionColor (value: string) = Interop.mkAttr "selectionColor" value 106 | /// Only on iOS. 107 | static member inline suppressHighlighting (value: string) = Interop.mkAttr "suppressHighlighting" value 108 | static member inline text (value: string) = Interop.mkAttr "children" value 109 | 110 | // Image props 111 | static member inline blurRadius (value: float) = Interop.mkAttr "blurRadius" value 112 | /// Only on iOS. 113 | static member inline capInsets (value: seq) = Interop.mkAttr "capInsets" (createObj !!value) 114 | static member inline defaultSource (value: IImageSource) = Interop.mkAttr "defaultSource" value 115 | static member inline defaultSource (value: seq) = Interop.mkAttr "defaultSource" (createObj !!value) 116 | /// Only on Android. 117 | static member inline fadeDuration (value: float) = Interop.mkAttr "fadeDuration" value 118 | static member inline loadingIndicatorSource (uri: string) = Interop.mkAttr "loadingIndicatorSource" (createObj [ "uri" ==> uri ]) 119 | static member inline onError (value: {| nativeEvent: obj |} -> unit) = Interop.mkAttr "onError" value 120 | static member inline onLoad (value: {| nativeEvent: ImageLoadEvent |} -> unit) = Interop.mkAttr "onLoad" value 121 | static member inline onLoadEnd (value: unit -> unit) = Interop.mkAttr "onLoadEnd" value 122 | static member inline onLoadStart (value: unit -> unit) = Interop.mkAttr "onLoadStart" value 123 | /// Only on iOS. 124 | static member inline onPartialLoad (value: unit -> unit) = Interop.mkAttr "onPartialLoad" value 125 | static member inline onProgress (value: {| nativeEvent: {| loaded: float; total: float |} |} -> unit) = Interop.mkAttr "onProgress" value 126 | /// Only on Android. 127 | static member inline progressiveRenderingEnabled (value: bool) = Interop.mkAttr "progressiveRenderingEnabled" value 128 | static member inline source (value: IImageSource) = Interop.mkAttr "source" value 129 | static member inline source (value: seq) = Interop.mkAttr "source" (createObj !!value) 130 | 131 | // Text input 132 | static member inline autoCorrect (value: bool) = Interop.mkAttr "autoCorrect" value 133 | static member inline autoFocus (value: bool) = Interop.mkAttr "autoFocus" value 134 | static member inline blurOnSubmit (value: bool) = Interop.mkAttr "blurOnSubmit" value 135 | static member inline caretHidden (value: bool) = Interop.mkAttr "caretHidden" value 136 | /// Only on iOS. 137 | static member inline clearTextOnFocus (value: bool) = Interop.mkAttr "clearTextOnFocus" value 138 | static member inline contextMenuHidden (value: bool) = Interop.mkAttr "contextMenuHidden" value 139 | static member inline defaultValue (value: string) = Interop.mkAttr "defaultValue" value 140 | /// Only on Android. 141 | static member inline disableFullscreenUI (value: bool) = Interop.mkAttr "disableFullscreenUI" value 142 | static member inline editable (value: bool) = Interop.mkAttr "editable" value 143 | /// Only on iOS. 144 | static member inline enableReturnKeyAutomatically (value: bool) = Interop.mkAttr "enableReturnKeyAutomatically" value 145 | /// Only on Android. 146 | static member inline inlineImageLeft (value: string) = Interop.mkAttr "inlineImageLeft" value 147 | /// Only on Android. 148 | static member inline inlineImagePadding (value: string) = Interop.mkAttr "inlineImagePadding" value 149 | /// Only on iOS. 150 | static member inline inputAccessoryViewID (value: string) = Interop.mkAttr "inputAccessoryViewID" value 151 | static member inline maxLength (value: float) = Interop.mkAttr "maxLength" value 152 | static member inline multiline (value: bool) = Interop.mkAttr "multiline" value 153 | static member inline onBlur (value: unit -> unit) = Interop.mkAttr "onChange" value 154 | static member inline onChange (value: {| nativeEvent: {| eventCount: int; target: int; text: string |} |} -> unit) = Interop.mkAttr "onChange" value 155 | static member inline onChangeText (value: string -> unit) = Interop.mkAttr "onChangeText" value 156 | static member inline onContentSizeChange (value: {| nativeEvent: {| contentSize: {| width: float; height: float |} |} |} -> unit) = Interop.mkAttr "onContentSizeChange" value 157 | static member inline onEndEditing (value: unit -> unit) = Interop.mkAttr "onEndEditing" value 158 | static member inline onFocus (value: {| nativeEvent: LayoutEvent |} -> unit) = Interop.mkAttr "onFocus" value 159 | static member inline onKeyPress (value: {| nativeEvent: {| key: string |} |} -> unit) = Interop.mkAttr "onKeyPress" value 160 | static member inline onScroll 161 | (value: 162 | {| nativeEvent: 163 | {| contentOffset: {| x: float; y: float |} 164 | contentInset: {| bottom: float; left: float; right: float; top: float |} 165 | contentSize: {| height: float; width: float |} |} |} -> unit) = 166 | Interop.mkAttr "onScroll" value 167 | static member inline onSelectionChange (value: {| nativeEvent: {| selection: {| start: int; ``end``: int |} |} |} -> unit) = Interop.mkAttr "onSelectionChange" value 168 | static member inline onSubmitEditing (value: {| nativeEvent: {| eventCount: int; target: int; text: string |} |} -> unit) = Interop.mkAttr "onSubmitEditing" value 169 | static member inline placeholder (value: string) = Interop.mkAttr "placeholder" value 170 | static member inline placeholderTextColor (value: string) = Interop.mkAttr "placeholderTextColor" value 171 | /// Only on Android. 172 | static member inline returnKeyLabel (value: string) = Interop.mkAttr "returnKeyLabel" value 173 | /// Only on iOS. 174 | static member inline rejectResponderTermination (value: bool) = Interop.mkAttr "rejectResponderTermination" value 175 | /// Only on iOS. 176 | static member inline scrollEnabled (value: bool) = Interop.mkAttr "scrollEnabled" value 177 | static member inline secureTextEntry (value: bool) = Interop.mkAttr "secureTextEntry" value 178 | static member inline selection (value: {| start: int; ``end``: int |}) = Interop.mkAttr "selection" value 179 | static member inline selectTextOnFocus (value: bool) = Interop.mkAttr "selectTextOnFocus" value 180 | static member inline showSoftInputOnFocus (value: bool) = Interop.mkAttr "showSoftInputOnFocus" value 181 | /// Only on iOS. 182 | static member inline spellCheck (value: bool) = Interop.mkAttr "spellCheck" value 183 | /// Only on iOS. 184 | static member inline passwordRules (value: string) = Interop.mkAttr "passwordRules" value 185 | /// Only on Android. 186 | static member inline underlineColorAndroid (value: string) = Interop.mkAttr "underlineColorAndroid" value 187 | static member inline value (value: string) = Interop.mkAttr "value" value 188 | 189 | // ScrollView 190 | static member inline stickyHeaderComponent (value: seq) = Interop.mkAttr "StickyHeaderComponent" value 191 | static member inline stickyHeaderComponent (value: ReactElement) = Interop.mkAttr "StickyHeaderComponent" value 192 | /// Only on iOS. 193 | static member inline alwaysBounceHorizontal (value: bool) = Interop.mkAttr "alwaysBounceHorizontal" value 194 | /// Only on iOS. 195 | static member inline alwaysBounceVertical (value: bool) = Interop.mkAttr "alwaysBounceVertical" value 196 | /// Only on iOS. 197 | static member inline automaticallyAdjustContentInsets (value: bool) = Interop.mkAttr "automaticallyAdjustContentInsets" value 198 | /// Only on iOS. 199 | static member inline automaticallyAdjustsScrollIndicatorInsets (value: bool) = Interop.mkAttr "automaticallyAdjustsScrollIndicatorInsets" value 200 | /// Only on iOS. 201 | static member inline bounces (value: bool) = Interop.mkAttr "bounces" value 202 | /// Only on iOS. 203 | static member inline bouncesZoom (value: bool) = Interop.mkAttr "bouncesZoom" value 204 | /// Only on iOS. 205 | static member inline canCancelContentTouches (value: bool) = Interop.mkAttr "canCancelContentTouches" value 206 | /// Only on iOS. 207 | static member inline centerContent (value: bool) = Interop.mkAttr "centerContent" value 208 | static member inline contentContainerStyle (value: seq) = Interop.mkAttr "contentContainerStyle" value 209 | /// Only on iOS. 210 | static member inline contentInset (top: float, bottom: float, left: float, right: float) = Interop.mkAttr "contentInset" {| top = top; bottom = bottom; left = left; right = right |} 211 | static member inline contentOffset (value: {| x: float; y: float |}) = Interop.mkAttr "contentOffset" value 212 | static member inline decelerationRate (value: float) = Interop.mkAttr "decelerationRate" value 213 | static member inline directionalLockEnabled (value: bool) = Interop.mkAttr "directionalLockEnabled" value 214 | static member inline disableIntervalMomentum (value: bool) = Interop.mkAttr "disableIntervalMomentum" value 215 | static member inline disableScrollViewPanResponder (value: bool) = Interop.mkAttr "disableScrollViewPanResponder" value 216 | /// Only on Android. 217 | static member inline endFillColor (value: string) = Interop.mkAttr "endFillColor" value 218 | /// Only on Android. 219 | static member inline fadingEdgeLength (value: float) = Interop.mkAttr "fadingEdgeLength" value 220 | static member inline horizontal (value: bool) = Interop.mkAttr "horizontal" value 221 | static member inline invertStickyHeaders (value: bool) = Interop.mkAttr "invertStickyHeaders" value 222 | static member inline maintainVisibleContentPosition (value: {| minIndexForVisible: float; autoscrollToTopThreshold: float |}) = Interop.mkAttr "maintainVisibleContentPosition" value 223 | /// Only on iOS. 224 | static member inline maximumZoomScale (value: float) = Interop.mkAttr "maximumZoomScale" value 225 | /// Only on iOS. 226 | static member inline minimumZoomScale (value: float) = Interop.mkAttr "minimumZoomScale" value 227 | /// Only on Android. 228 | static member inline nestedScrollEnabled (value: bool) = Interop.mkAttr "nestedScrollEnabled" value 229 | static member inline onContentSizeChange (value: (float * float) -> unit) = Interop.mkAttr "onContentSizeChange" value 230 | static member inline onMomentumScrollBegin (value: unit -> unit) = Interop.mkAttr "onMomentumScrollBegin" value 231 | static member inline onMomentumScrollEnd (value: unit -> unit) = Interop.mkAttr "onMomentumScrollEnd" value 232 | static member inline onScrollBeginDrag (value: unit -> unit) = Interop.mkAttr "onScrollBeginDrag" value 233 | static member inline onScrollEndDrag (value: unit -> unit) = Interop.mkAttr "onScrollEndDrag" value 234 | /// Only on iOS. 235 | static member inline onScrollToTop (value: unit -> unit) = Interop.mkAttr "onScrollToTop" value 236 | static member inline pagingEnabled (value: bool) = Interop.mkAttr "pagingEnabled" value 237 | /// Only on Android. 238 | static member inline persistentScrollbar (value: bool) = Interop.mkAttr "persistentScrollbar" value 239 | /// Only on iOS. 240 | static member inline pinchGestureEnabled (value: bool) = Interop.mkAttr "pinchGestureEnabled" value 241 | static member inline refreshControl (value: ReactElement) = Interop.mkAttr "refreshControl" value 242 | /// Only on iOS. 243 | static member inline scrollEventThrottle (value: float) = Interop.mkAttr "scrollEventThrottle" value 244 | /// Only on iOS. 245 | static member inline scrollIndicatorInsets (top: float, bottom: float, left: float, right: float) = Interop.mkAttr "scrollIndicatorInsets" {| top = top; bottom = bottom; left = left; right = right |} 246 | /// Only on Android. 247 | static member inline scrollPerfTag (value: string) = Interop.mkAttr "scrollPerfTag" value 248 | /// Only on iOS. 249 | static member inline scrollToOverflowEnabled (value: bool) = Interop.mkAttr "scrollToOverflowEnabled" value 250 | /// Only on iOS. 251 | static member inline scrollsToTop (value: bool) = Interop.mkAttr "scrollsToTop" value 252 | static member inline showsHorizontalScrollIndicator (value: bool) = Interop.mkAttr "showsHorizontalScrollIndicator" value 253 | static member inline showsVerticalScrollIndicator (value: bool) = Interop.mkAttr "showsVerticalScrollIndicator" value 254 | static member inline snapToEnd (value: bool) = Interop.mkAttr "snapToEnd" value 255 | static member inline snapToIntervale (value: float) = Interop.mkAttr "snapToIntervale" value 256 | static member inline snapToOffsets (value: seq) = Interop.mkAttr "snapToOffsets" value 257 | static member inline snapToStart (value: seq) = Interop.mkAttr "snapToStart" value 258 | static member inline stickyHeaderHiddenOnScroll (value: bool) = Interop.mkAttr "snapToStartstickyHeaderHiddenOnScroll" value 259 | static member inline stickyHeaderIndices (value: seq) = Interop.mkAttr "stickyHeaderIndices" value 260 | /// Only on iOS. 261 | static member inline zoomScale (value: float) = Interop.mkAttr "zoomScale" value 262 | 263 | // FlatList 264 | static member inline renderItem (value: FlatListItem<_> -> ReactElement) = Interop.mkAttr "renderItem" value 265 | static member inline data (value: seq<'Item>) = Interop.mkAttr "data" value 266 | static member inline ItemSeparatorComponent (value: ReactElement) = Interop.mkAttr "ItemSeparatorComponent" value 267 | static member inline ListEmptyComponent (value: ReactElement) = Interop.mkAttr "ListEmptyComponent" value 268 | static member inline ListFooterComponent (value: ReactElement) = Interop.mkAttr "ListFooterComponent" value 269 | static member inline ListFooterComponentStyle (value: seq) = Interop.mkAttr "ListFooterComponentStyle" value 270 | static member inline ListHeaderComponent (value: ReactElement) = Interop.mkAttr "ListHeaderComponent" value 271 | static member inline ListHeaderComponentStyle (value: seq) = Interop.mkAttr "ListHeaderComponentStyle" value 272 | static member inline columnWrapperStyle (value: seq) = Interop.mkAttr "columnWrapperStyle" value 273 | static member inline extraData (value: _) = Interop.mkAttr "extraData" value 274 | static member inline getItemLayout (value: (obj * int) -> {| length: int; offset: int; index: int |}) = Interop.mkAttr "getItemLayout" value 275 | static member inline initialNumToRender (value: int) = Interop.mkAttr "initialNumToRender" value 276 | static member inline initialScrollIndex (value: float) = Interop.mkAttr "initialScrollIndex" value 277 | static member inline inverted (value: bool) = Interop.mkAttr "inverted" value 278 | static member inline keyExtractor (value: ('Item * int) -> string) = Interop.mkAttr "keyExtractor" value 279 | static member inline numColumns (value: int) = Interop.mkAttr "numColumns" value 280 | static member inline onEndReached (value: {| info: {| distanceFromEnd: int |} |} -> unit) = Interop.mkAttr "onEndReached" value 281 | static member inline onEndReachedThreshold (value: float) = Interop.mkAttr "onEndReachedThreshold" value 282 | static member inline onRefresh (value: unit -> unit) = Interop.mkAttr "onRefresh" value 283 | static member inline onViewableItemsChanged (value: {| callback: {| changed: ViewToken []; viewableItems: ViewToken [] |} |} -> unit) = Interop.mkAttr "onViewableItemsChanged" value 284 | static member inline progressViewOffset (value: float) = Interop.mkAttr "progressViewOffset" value 285 | static member inline refreshing (value: bool) = Interop.mkAttr "refreshing" value 286 | static member inline viewabilityConfig (value: seq) = Interop.mkAttr "viewabilityConfig" (createObj !!value) 287 | static member inline viewabilityConfigCallbackPairs 288 | (value: 289 | (seq * 290 | ({| info: 291 | {| viewableItems: ViewToken [] 292 | changed: ViewToken [] |} |} -> unit))) 293 | = 294 | let config, callback = value 295 | 296 | createObj [ 297 | "viewabilityConfig" ==> (createObj !!config) 298 | "onViewableItemsChanged" ==> callback 299 | ] 300 | |> Interop.mkAttr "viewabilityConfigCallbackPairs" 301 | 302 | // StatusBar 303 | static member inline animated (value: bool) = Interop.mkAttr "animated" value 304 | /// Only on Android. 305 | static member inline backgroundColor (value: string) = Interop.mkAttr "backgroundColor" value 306 | static member inline hidden (value: bool) = Interop.mkAttr "hidden" value 307 | /// Only on iOS. 308 | static member inline networkActivityIndicatorVisible (value: bool) = Interop.mkAttr "networkActivityIndicatorVisible" value 309 | static member inline translucent (value: bool) = Interop.mkAttr "translucent" value 310 | 311 | // Pressable 312 | /// Only on Android. 313 | static member inline androidDisableSound (value: bool) = Interop.mkAttr "android_disableSound" value 314 | /// Only on Android. 315 | static member inline androidRipple (value: seq) = Interop.mkAttr "android_ripple" (createObj !!value) 316 | static member inline unstablePressDelay (value: float) = Interop.mkAttr "unstable_pressDelay" value 317 | static member inline delayLongPress (value: float) = Interop.mkAttr "delayLongPress" value 318 | static member inline testOnlyPressed (value: bool) = Interop.mkAttr "testOnly_pressed" value 319 | 320 | 321 | [] 322 | module prop = 323 | [] 324 | type accessibilityLiveRegion = 325 | static member inline none = Interop.mkAttr "accessibilityLiveRegion" "none" 326 | static member inline polite = Interop.mkAttr "accessibilityLiveRegion" "polite" 327 | static member inline assertive = Interop.mkAttr "accessibilityLiveRegion" "assertive" 328 | [] 329 | type accessibilityRole = 330 | static member inline adjustable = Interop.mkAttr "accessibilityRole" "adjustable" 331 | static member inline alert = Interop.mkAttr "accessibilityRole" "alert" 332 | static member inline button = Interop.mkAttr "accessibilityRole" "button" 333 | static member inline checkbox = Interop.mkAttr "accessibilityRole" "checkbox" 334 | static member inline combobox = Interop.mkAttr "accessibilityRole" "combobox" 335 | static member inline header = Interop.mkAttr "accessibilityRole" "header" 336 | static member inline image = Interop.mkAttr "accessibilityRole" "image" 337 | static member inline imagebutton = Interop.mkAttr "accessibilityRole" "imagebutton" 338 | static member inline keyboardkey = Interop.mkAttr "accessibilityRole" "keyboardkey" 339 | static member inline link = Interop.mkAttr "accessibilityRole" "link" 340 | static member inline menu = Interop.mkAttr "accessibilityRole" "menu" 341 | static member inline menubar = Interop.mkAttr "accessibilityRole" "menubar" 342 | static member inline menuitem = Interop.mkAttr "accessibilityRole" "menuitem" 343 | static member inline none = Interop.mkAttr "accessibilityRole" "none" 344 | static member inline progressbar = Interop.mkAttr "accessibilityRole" "progressbar" 345 | static member inline radio = Interop.mkAttr "accessibilityRole" "radio" 346 | static member inline radiogroup = Interop.mkAttr "accessibilityRole" "radiogroup" 347 | static member inline scrollbar = Interop.mkAttr "accessibilityRole" "scrollbar" 348 | static member inline search = Interop.mkAttr "accessibilityRole" "search" 349 | static member inline spinbutton = Interop.mkAttr "accessibilityRole" "spinbutton" 350 | static member inline summary = Interop.mkAttr "accessibilityRole" "summary" 351 | static member inline switch = Interop.mkAttr "accessibilityRole" "switch" 352 | static member inline tab = Interop.mkAttr "accessibilityRole" "tab" 353 | static member inline tablist = Interop.mkAttr "accessibilityRole" "tablist" 354 | static member inline text = Interop.mkAttr "accessibilityRole" "text" 355 | static member inline timer = Interop.mkAttr "accessibilityRole" "timer" 356 | static member inline togglebutton = Interop.mkAttr "accessibilityRole" "togglebutton" 357 | static member inline toolbar = Interop.mkAttr "accessibilityRole" "toolbar" 358 | [] 359 | type android_hyphenationFrequency = 360 | /// Only on Android. 361 | static member inline none = Interop.mkAttr "android_hyphenationFrequency" "none" 362 | /// Only on Android. 363 | static member inline normal = Interop.mkAttr "android_hyphenationFrequency" "normal" 364 | /// Only on Android. 365 | static member inline full = Interop.mkAttr "android_hyphenationFrequency" "full" 366 | [] 367 | type autoCapitalize = 368 | static member inline none = Interop.mkAttr "autoCapitalize" "none" 369 | static member inline characters = Interop.mkAttr "autoCapitalize" "characters" 370 | static member inline words = Interop.mkAttr "autoCapitalize" "words" 371 | static member inline sentences = Interop.mkAttr "autoCapitalize" "sentences" 372 | [] 373 | type autoComplete = 374 | static member inline birthdateDay = Interop.mkAttr "autoComplete" "birthdate-day" 375 | static member inline birthdateFull = Interop.mkAttr "autoComplete" "birthdate-full" 376 | static member inline birthdateMonth = Interop.mkAttr "autoComplete" "birthdate-month" 377 | static member inline birthdateYear = Interop.mkAttr "autoComplete" "birthdate-year" 378 | static member inline ccCsc = Interop.mkAttr "autoComplete" "cc-csc" 379 | static member inline ccExp = Interop.mkAttr "autoComplete" "cc-exp" 380 | static member inline ccExpDay = Interop.mkAttr "autoComplete" "cc-exp-day" 381 | static member inline ccExpMonth = Interop.mkAttr "autoComplete" "cc-exp-month" 382 | static member inline ccExpYear = Interop.mkAttr "autoComplete" "cc-exp-year" 383 | static member inline ccNumber = Interop.mkAttr "autoComplete" "cc-number" 384 | static member inline email = Interop.mkAttr "autoComplete" "email" 385 | static member inline gender = Interop.mkAttr "autoComplete" "gender" 386 | static member inline name = Interop.mkAttr "autoComplete" "name" 387 | static member inline nameFamily = Interop.mkAttr "autoComplete" "name-family" 388 | static member inline nameGiven = Interop.mkAttr "autoComplete" "name-given" 389 | static member inline nameMiddle = Interop.mkAttr "autoComplete" "name-middle" 390 | static member inline nameMiddleInitial = Interop.mkAttr "autoComplete" "name-middle-initial" 391 | static member inline namePrefix = Interop.mkAttr "autoComplete" "name-prefix" 392 | static member inline nameSuffix = Interop.mkAttr "autoComplete" "name-suffix" 393 | static member inline password = Interop.mkAttr "autoComplete" "password" 394 | static member inline passwordNew = Interop.mkAttr "autoComplete" "password-new" 395 | static member inline postalAddress = Interop.mkAttr "autoComplete" "postal-address" 396 | static member inline postalAddressCountry = Interop.mkAttr "autoComplete" "postal-address-country" 397 | static member inline postalAddressExtended = Interop.mkAttr "autoComplete" "postal-address-extended" 398 | static member inline postalAddressExtendedPostalCode = Interop.mkAttr "autoComplete" "postal-address-extended-postal-code" 399 | static member inline postalAddressLocality = Interop.mkAttr "autoComplete" "postal-address-locality" 400 | static member inline postalAddressRegion = Interop.mkAttr "autoComplete" "postal-address-region" 401 | static member inline postalCode = Interop.mkAttr "autoComplete" "postal-code" 402 | static member inline streetAddress = Interop.mkAttr "autoComplete" "street-address" 403 | static member inline smsOtp = Interop.mkAttr "autoComplete" "sms-otp" 404 | static member inline tel = Interop.mkAttr "autoComplete" "tel" 405 | static member inline telCountryCode = Interop.mkAttr "autoComplete" "tel-country-code" 406 | static member inline telNational = Interop.mkAttr "autoComplete" "tel-national" 407 | static member inline telDevice = Interop.mkAttr "autoComplete" "tel-device" 408 | static member inline username = Interop.mkAttr "autoComplete" "username" 409 | static member inline usernameNew = Interop.mkAttr "autoComplete" "username-new" 410 | static member inline off = Interop.mkAttr "autoComplete" "off" 411 | [] 412 | type clearButtonMode = 413 | /// Only on iOS. 414 | static member inline never = Interop.mkAttr "clearButtonMode" "never" 415 | /// Only on iOS. 416 | static member inline whileEditing = Interop.mkAttr "clearButtonMode" "while-editing" 417 | /// Only on iOS. 418 | static member inline unlessEditing = Interop.mkAttr "clearButtonMode" "unless-editing" 419 | /// Only on iOS. 420 | static member inline always = Interop.mkAttr "clearButtonMode" "always" 421 | [] 422 | type contentInsetAdjustmentBehavior = 423 | /// Only on iOS. 424 | static member inline automatic = Interop.mkAttr "contentInsetAdjustmentBehavior" "automatic" 425 | /// Only on iOS. 426 | static member inline scrollableAxes = Interop.mkAttr "contentInsetAdjustmentBehavior" "scrollableAxes" 427 | /// Only on iOS. 428 | static member inline never = Interop.mkAttr "contentInsetAdjustmentBehavior" "never" 429 | /// Only on iOS. 430 | static member inline always = Interop.mkAttr "contentInsetAdjustmentBehavior" "always" 431 | [] 432 | type dataDetectorType = 433 | static member inline phoneNumber = Interop.mkAttr "dataDetectorType" "phoneNumber" 434 | static member inline link = Interop.mkAttr "dataDetectorType" "link" 435 | static member inline address = Interop.mkAttr "dataDetectorType" "address" 436 | static member inline calendarEvent = Interop.mkAttr "dataDetectorType" "calendarEvent" 437 | static member inline email = Interop.mkAttr "dataDetectorType" "email" 438 | static member inline none = Interop.mkAttr "dataDetectorType" "none" 439 | static member inline all = Interop.mkAttr "dataDetectorType" "all" 440 | [] 441 | type decelerationRate = 442 | static member normal = Interop.mkAttr "decelerationRate" "normal" 443 | static member fast = Interop.mkAttr "decelerationRate" "fast" 444 | [] 445 | type ellipsizeMode = 446 | static member inline head = Interop.mkAttr "ellipsizeMode" "head" 447 | static member inline middle = Interop.mkAttr "ellipsizeMode" "middle" 448 | static member inline tail = Interop.mkAttr "ellipsizeMode" "tail" 449 | static member inline clip = Interop.mkAttr "ellipsizeMode" "clip" 450 | [] 451 | type importantForAccessibility = 452 | static member inline auto = Interop.mkAttr "importantForAccessibility" "auto" 453 | static member inline yes = Interop.mkAttr "importantForAccessibility" "yes" 454 | static member inline no = Interop.mkAttr "importantForAccessibility" "no" 455 | static member inline noHideDescendants = Interop.mkAttr "importantForAccessibility" "no-hide-descendants" 456 | [] 457 | type importantForAutofill = 458 | static member inline auto = Interop.mkAttr "importantForAutofill" "auto" 459 | static member inline no = Interop.mkAttr "importantForAutofill" "no" 460 | static member inline noExcludeDescendants = Interop.mkAttr "importantForAutofill" "noExcludeDescendants" 461 | static member inline yes = Interop.mkAttr "importantForAutofill" "yes" 462 | static member inline yesExcludeDescendants = Interop.mkAttr "importantForAutofill" "yesExcludeDescendants" 463 | [] 464 | type indicatorStyle = 465 | /// Only on iOS. 466 | static member inline default' = Interop.mkAttr "indicatorStyle" "default" 467 | /// Only on iOS. 468 | static member inline black = Interop.mkAttr "indicatorStyle" "black" 469 | /// Only on iOS. 470 | static member inline white = Interop.mkAttr "indicatorStyle" "white" 471 | [] 472 | type keyboardAppearance = 473 | /// Only on iOS. 474 | static member inline default' = Interop.mkAttr "keyboardAppearance" "default" 475 | /// Only on iOS. 476 | static member inline light = Interop.mkAttr "keyboardAppearance" "light" 477 | /// Only on iOS. 478 | static member inline dark = Interop.mkAttr "keyboardAppearance" "dark" 479 | [] 480 | type keyboardDismissMode = 481 | static member inline none = Interop.mkAttr "keyboardDismissMode" "none" 482 | static member inline noDrag = Interop.mkAttr "keyboardDismissMode" "no-drag" 483 | /// Only on iOS. 484 | static member inline interactive = Interop.mkAttr "keyboardDismissMode" "interactive" 485 | [] 486 | type keyboardShouldPersistTaps = 487 | static member inline never = Interop.mkAttr "keyboardShouldPersistTaps" "never" 488 | static member inline always = Interop.mkAttr "keyboardShouldPersistTaps" "always" 489 | static member inline handled = Interop.mkAttr "keyboardShouldPersistTaps" "handled" 490 | [] 491 | type keyboardType = 492 | static member inline default' = Interop.mkAttr "keyboardType" "default" 493 | static member inline numberPad = Interop.mkAttr "keyboardType" "number-pad" 494 | static member inline decimalPad = Interop.mkAttr "keyboardType" "decimal-pad" 495 | static member inline numeric = Interop.mkAttr "keyboardType" "numeric" 496 | static member inline emailAddress = Interop.mkAttr "keyboardType" "email-address" 497 | static member inline phonePad = Interop.mkAttr "keyboardType" "phone-pad" 498 | static member inline url = Interop.mkAttr "keyboardType" "url" 499 | 500 | /// Only on iOS. 501 | static member inline asciiCapable = Interop.mkAttr "keyboardType" "ascii-capable" 502 | /// Only on iOS. 503 | static member inline numbersAndPunctuation = Interop.mkAttr "keyboardType" "numbers-and-punctuation" 504 | /// Only on iOS. 505 | static member inline namePhonePad = Interop.mkAttr "keyboardType" "name-phone-pad" 506 | /// Only on iOS. 507 | static member inline twitter = Interop.mkAttr "keyboardType" "twitter" 508 | /// Only on iOS. 509 | static member inline webSearch = Interop.mkAttr "keyboardType" "web-search" 510 | 511 | /// Only on Android. 512 | static member inline visiblePassword = Interop.mkAttr "keyboardType" "visible-password" 513 | [] 514 | type overScrollMode = 515 | /// Only on Android. 516 | static member inline auto = Interop.mkAttr "overScrollMode" "auto" 517 | /// Only on Android. 518 | static member inline always = Interop.mkAttr "overScrollMode" "always" 519 | /// Only on Android. 520 | static member inline never = Interop.mkAttr "overScrollMode" "never" 521 | [] 522 | type pointerEvents = 523 | static member inline auto = Interop.mkAttr "pointerEvents" "auto" 524 | static member inline none = Interop.mkAttr "pointerEvents" "none" 525 | static member inline boxNone = Interop.mkAttr "pointerEvents" "box-none" 526 | static member inline boxOnly = Interop.mkAttr "pointerEvents" "box-only" 527 | [] 528 | type resizeMethod = 529 | /// Only on Android. 530 | static member inline auto = Interop.mkAttr "resizeMethod" "auto" 531 | /// Only on Android. 532 | static member inline resize = Interop.mkAttr "resizeMethod" "resize" 533 | /// Only on Android. 534 | static member inline scale = Interop.mkAttr "resizeMethod" "scale" 535 | [] 536 | type resizeMode = 537 | static member inline cover = Interop.mkStyle "resizeMode" "cover" 538 | static member inline contain = Interop.mkStyle "resizeMode" "contain" 539 | static member inline stretch = Interop.mkStyle "resizeMode" "stretch" 540 | static member inline repeat = Interop.mkStyle "resizeMode" "repeat" 541 | static member inline center = Interop.mkStyle "resizeMode" "center" 542 | [] 543 | type returnKeyType = 544 | static member inline done' = Interop.mkAttr "returnKeyType" "done" 545 | static member inline go = Interop.mkAttr "returnKeyType" "go" 546 | static member inline next = Interop.mkAttr "returnKeyType" "next" 547 | static member inline search = Interop.mkAttr "returnKeyType" "search" 548 | static member inline send = Interop.mkAttr "returnKeyType" "send" 549 | 550 | /// Only on Android. 551 | static member inline none = Interop.mkAttr "returnKeyType" "none" 552 | /// Only on Android. 553 | static member inline previous = Interop.mkAttr "returnKeyType" "previous" 554 | 555 | /// Only on iOS. 556 | static member inline default' = Interop.mkAttr "returnKeyType" "default" 557 | /// Only on iOS. 558 | static member inline emergencyCall = Interop.mkAttr "returnKeyType" "emergency-call" 559 | /// Only on iOS. 560 | static member inline google = Interop.mkAttr "returnKeyType" "google" 561 | /// Only on iOS. 562 | static member inline join = Interop.mkAttr "returnKeyType" "join" 563 | /// Only on iOS. 564 | static member inline route = Interop.mkAttr "returnKeyType" "route" 565 | /// Only on iOS. 566 | static member inline yahoo = Interop.mkAttr "returnKeyType" "yahoo" 567 | [] 568 | type snapToAlignment = 569 | /// Only on iOS. 570 | static member inline start = Interop.mkAttr "snapToAlignment" "start" 571 | /// Only on iOS. 572 | static member inline center = Interop.mkAttr "snapToAlignment" "center" 573 | /// Only on iOS. 574 | static member inline end' = Interop.mkAttr "snapToAlignment" "end" 575 | [] 576 | type textAlign = 577 | static member inline left = Interop.mkAttr "textAlign" "left" 578 | static member inline center = Interop.mkAttr "textAlign" "center" 579 | static member inline right = Interop.mkAttr "textAlign" "right" 580 | [] 581 | type textContentType = 582 | /// Only on iOS. 583 | static member inline none = Interop.mkAttr "textContentType" "none" 584 | /// Only on iOS. 585 | static member inline URL = Interop.mkAttr "textContentType" "URL" 586 | /// Only on iOS. 587 | static member inline addressCity = Interop.mkAttr "textContentType" "addressCity" 588 | /// Only on iOS. 589 | static member inline addressCityAndState = Interop.mkAttr "textContentType" "addressCityAndState" 590 | /// Only on iOS. 591 | static member inline addressState = Interop.mkAttr "textContentType" "addressState" 592 | /// Only on iOS. 593 | static member inline countryName = Interop.mkAttr "textContentType" "countryName" 594 | /// Only on iOS. 595 | static member inline creditCardNumber = Interop.mkAttr "textContentType" "creditCardNumber" 596 | /// Only on iOS. 597 | static member inline emailAddress = Interop.mkAttr "textContentType" "emailAddress" 598 | /// Only on iOS. 599 | static member inline familyName = Interop.mkAttr "textContentType" "familyName" 600 | /// Only on iOS. 601 | static member inline fullStreetAddress = Interop.mkAttr "textContentType" "fullStreetAddress" 602 | /// Only on iOS. 603 | static member inline givenName = Interop.mkAttr "textContentType" "givenName" 604 | /// Only on iOS. 605 | static member inline jobTitle = Interop.mkAttr "textContentType" "jobTitle" 606 | /// Only on iOS. 607 | static member inline location = Interop.mkAttr "textContentType" "location" 608 | /// Only on iOS. 609 | static member inline middleName = Interop.mkAttr "textContentType" "middleName" 610 | /// Only on iOS. 611 | static member inline name = Interop.mkAttr "textContentType" "name" 612 | /// Only on iOS. 613 | static member inline namePrefix = Interop.mkAttr "textContentType" "namePrefix" 614 | /// Only on iOS. 615 | static member inline nameSuffix = Interop.mkAttr "textContentType" "nameSuffix" 616 | /// Only on iOS. 617 | static member inline nickname = Interop.mkAttr "textContentType" "nickname" 618 | /// Only on iOS. 619 | static member inline organizationName = Interop.mkAttr "textContentType" "organizationName" 620 | /// Only on iOS. 621 | static member inline postalCode = Interop.mkAttr "textContentType" "postalCode" 622 | /// Only on iOS. 623 | static member inline streetAddressLine1 = Interop.mkAttr "textContentType" "streetAddressLine1" 624 | /// Only on iOS. 625 | static member inline streetAddressLine2 = Interop.mkAttr "textContentType" "streetAddressLine2" 626 | /// Only on iOS. 627 | static member inline sublocality = Interop.mkAttr "textContentType" "sublocality" 628 | /// Only on iOS. 629 | static member inline telephoneNumber = Interop.mkAttr "textContentType" "telephoneNumber" 630 | /// Only on iOS. 631 | static member inline username = Interop.mkAttr "textContentType" "username" 632 | /// Only on iOS. 633 | static member inline password = Interop.mkAttr "textContentType" "password" 634 | /// Only on iOS. 635 | static member inline newPassword = Interop.mkAttr "textContentType" "newPassword" 636 | /// Only on iOS. 637 | static member inline oneTimeCode = Interop.mkAttr "textContentType" "oneTimeCode" 638 | [] 639 | type textBreakStrategy = 640 | /// Only on Android. 641 | static member inline simple = Interop.mkAttr "textBreakStrategy" "simple" 642 | /// Only on Android. 643 | static member inline hightQuality = Interop.mkAttr "textBreakStrategy" "hightQuality" 644 | /// Only on Android. 645 | static member inline balanced = Interop.mkAttr "textBreakStrategy" "balanced" 646 | [] 647 | type barStyle = 648 | static member inline default' = Interop.mkAttr "barStyle" "default" 649 | static member inline lightContent = Interop.mkAttr "barStyle" "light-content" 650 | static member inline darkContent = Interop.mkAttr "barStyle" "dark-content" 651 | [] 652 | type showHideTransition = 653 | static member inline none = Interop.mkAttr "showHideTransition" "none" 654 | static member inline fade = Interop.mkAttr "showHideTransition" "fade" 655 | static member inline slide = Interop.mkAttr "showHideTransition" "slide" -------------------------------------------------------------------------------- /src/Styles.fs: -------------------------------------------------------------------------------- 1 | namespace Feliz.ReactNative 2 | 3 | open Feliz 4 | open Fable.Core 5 | open Fable.Core.JsInterop 6 | 7 | [] 8 | type style = 9 | static member inline height (value: float) = Interop.mkStyle "height" value 10 | static member inline height (value: string) = Interop.mkStyle "height" value 11 | static member inline width (value: float) = Interop.mkStyle "width" value 12 | static member inline width (value: string) = Interop.mkStyle "width" value 13 | static member inline maxHeight (value: float) = Interop.mkStyle "maxHeight" value 14 | static member inline maxHeight (value: string) = Interop.mkStyle "maxHeight" value 15 | static member inline maxWidth (value: float) = Interop.mkStyle "maxWidth" value 16 | static member inline maxWidth (value: string) = Interop.mkStyle "maxWidth" value 17 | static member inline minHeight (value: float) = Interop.mkStyle "minHeight" value 18 | static member inline minHeight (value: string) = Interop.mkStyle "minHeight" value 19 | static member inline minWidth (value: float) = Interop.mkStyle "minWidth" value 20 | static member inline minWidth (value: string) = Interop.mkStyle "minWidth" value 21 | static member inline backgroundColor(value: string) = Interop.mkStyle "backgroundColor" value 22 | static member inline elevation (value: float) = Interop.mkStyle "elevation" value 23 | static member inline opacity (value: float) = Interop.mkStyle "opacity" value 24 | /// Only on Android. 25 | static member inline overlayColor (value: string) = Interop.mkStyle "overlayColor" value 26 | static member inline tintColor (value: string) = Interop.mkStyle "tintColor" value 27 | 28 | // Border 29 | static member inline borderColor (value: string) = Interop.mkStyle "borderColor" value 30 | static member inline borderStartColor (value: string) = Interop.mkStyle "borderStartColor" value 31 | static member inline borderEndColor (value: string) = Interop.mkStyle "borderEndColor" value 32 | static member inline borderLeftColor (value: string) = Interop.mkStyle "borderLeftColor" value 33 | static member inline borderRightColor (value: string) = Interop.mkStyle "borderRightColor" value 34 | static member inline borderTopColor (value: float) = Interop.mkStyle "borderTopColor" value 35 | static member inline borderBottomColor (value: float) = Interop.mkStyle "borderBottomColor" value 36 | 37 | static member inline borderWidth (value: float) = Interop.mkStyle "borderWidth" value 38 | static member inline borderStartWidth (value: float) = Interop.mkStyle "borderStartWidth" value 39 | static member inline borderEndWidth (value: float) = Interop.mkStyle "borderEndWidth" value 40 | static member inline borderLeftWidth (value: float) = Interop.mkStyle "borderLeftWidth" value 41 | static member inline borderRightWidth (value: float) = Interop.mkStyle "borderRightWidth" value 42 | static member inline borderTopWidth (value: float) = Interop.mkStyle "borderTopWidth" value 43 | static member inline borderBottomWidth (value: float) = Interop.mkStyle "borderBottomWidth" value 44 | 45 | static member inline borderRadius (value: float) = Interop.mkStyle "borderRadius" value 46 | static member inline borderBottomStartRadius (value: float) = Interop.mkStyle "borderBottomStartRadius" value 47 | static member inline borderBottomEndRadius (value: float) = Interop.mkStyle "borderBottomEndRadius" value 48 | static member inline borderBottomLeftRadius (value: float) = Interop.mkStyle "borderBottomLeftRadius" value 49 | static member inline borderBottomRightRadius (value: float) = Interop.mkStyle "borderBottomRightRadius" value 50 | static member inline borderTopStartRadius (value: float) = Interop.mkStyle "borderTopStartRadius" value 51 | static member inline borderTopEndRadius (value: float) = Interop.mkStyle "borderTopEndRadius" value 52 | static member inline borderTopLeftRadius (value: float) = Interop.mkStyle "borderTopLeftRadius" value 53 | static member inline borderTopRightRadius (value: float) = Interop.mkStyle "borderTopRightRadius" value 54 | 55 | // Text 56 | static member inline color (value: string) = Interop.mkStyle "color" value 57 | static member inline fontFamily (value: string) = Interop.mkStyle "fontFamily" value 58 | static member inline fontSize (value: float) = Interop.mkStyle "fontSize" value 59 | /// Only on Android. 60 | static member inline includeFontPadding (value: bool) = Interop.mkStyle "includeFontPadding" value 61 | static member inline letterSpacing (value: float) = Interop.mkStyle "letterSpacing" value 62 | static member inline lineHeight (value: float) = Interop.mkStyle "lineHeight" value 63 | /// Only on iOS. 64 | static member inline textDecorationColor (value: string) = Interop.mkStyle "textDecorationColor" value 65 | static member inline textShadowColor (value: string) = Interop.mkStyle "textShadowColor" value 66 | static member inline textShadowOffset (width: float) (height: float) = Interop.mkStyle "textShadowOffset" {| width = width; height = height |} 67 | static member inline textShadowRadius (value: float) = Interop.mkStyle "textShadowRadius" value 68 | 69 | // Shadow 70 | static member inline shadowColor (value: string) = Interop.mkStyle "shadowColor" value 71 | /// Only on iOS. 72 | static member inline shadowOffset (width: float) (height: float) = Interop.mkStyle "shadowOffset" {| width = width; height = height |} 73 | /// Only on iOS. 74 | static member inline shadowOpacity (value: float) = Interop.mkStyle "shadowOpacity" value 75 | /// Only on iOS. 76 | static member inline shadowRadius (value: float) = Interop.mkStyle "shadowRadius" value 77 | 78 | // Layout 79 | static member inline aspectRatio (value: float) = Interop.mkStyle "aspectRatio" value 80 | 81 | static member inline flex (value: float) = Interop.mkStyle "flex" value 82 | static member inline flexBasis (value: float) = Interop.mkStyle "flexBasis" value 83 | static member inline flexGrow (value: float) = Interop.mkStyle "flexGrow" value 84 | static member inline flexShrink (value: float) = Interop.mkStyle "flexShrink" value 85 | 86 | static member inline start (value: float) = Interop.mkStyle "start" value 87 | static member inline start (value: string) = Interop.mkStyle "start" value 88 | static member inline end' (value: float) = Interop.mkStyle "end" value 89 | static member inline end' (value: string) = Interop.mkStyle "end" value 90 | static member inline top (value: float) = Interop.mkStyle "top" value 91 | static member inline top (value: string) = Interop.mkStyle "top" value 92 | static member inline bottom (value: float) = Interop.mkStyle "bottom" value 93 | static member inline bottom (value: string) = Interop.mkStyle "bottom" value 94 | static member inline left (value: float) = Interop.mkStyle "left" value 95 | static member inline left (value: string) = Interop.mkStyle "left" value 96 | static member inline right (value: float) = Interop.mkStyle "right" value 97 | static member inline right (value: string) = Interop.mkStyle "right" value 98 | 99 | static member inline margin (value: float) = Interop.mkStyle "margin" value 100 | static member inline margin (value: string) = Interop.mkStyle "margin" value 101 | static member inline marginVertical (value: float) = Interop.mkStyle "marginVertical" value 102 | static member inline marginVertical (value: string) = Interop.mkStyle "marginVertical" value 103 | static member inline marginHorizontal (value: float) = Interop.mkStyle "marginHorizontal" value 104 | static member inline marginHorizontal (value: string) = Interop.mkStyle "marginHorizontal" value 105 | static member inline marginStart (value: float) = Interop.mkStyle "marginStart" value 106 | static member inline marginStart (value: string) = Interop.mkStyle "marginStart" value 107 | static member inline marginEnd (value: float) = Interop.mkStyle "marginEnd" value 108 | static member inline marginEnd (value: string) = Interop.mkStyle "marginEnd" value 109 | static member inline marginTop (value: float) = Interop.mkStyle "marginTop" value 110 | static member inline marginTop (value: string) = Interop.mkStyle "marginTop" value 111 | static member inline marginBottom (value: float) = Interop.mkStyle "marginBottom" value 112 | static member inline marginBottom (value: string) = Interop.mkStyle "marginBottom" value 113 | static member inline marginLeft (value: float) = Interop.mkStyle "marginLeft" value 114 | static member inline marginLeft (value: string) = Interop.mkStyle "marginLeft" value 115 | static member inline marginRight (value: float) = Interop.mkStyle "marginRight" value 116 | static member inline marginRight (value: string) = Interop.mkStyle "marginRight" value 117 | 118 | static member inline padding (value: float) = Interop.mkStyle "padding" value 119 | static member inline padding (value: string) = Interop.mkStyle "padding" value 120 | static member inline paddingVertical (value: float) = Interop.mkStyle "paddingVertical" value 121 | static member inline paddingVertical (value: string) = Interop.mkStyle "paddingVertical" value 122 | static member inline paddingHorizontal (value: float) = Interop.mkStyle "paddingHorizontal" value 123 | static member inline paddingHorizontal (value: string) = Interop.mkStyle "paddingHorizontal" value 124 | static member inline paddingStart (value: float) = Interop.mkStyle "paddingStart" value 125 | static member inline paddingStart (value: string) = Interop.mkStyle "paddingStart" value 126 | static member inline paddingEnd (value: float) = Interop.mkStyle "paddingEnd" value 127 | static member inline paddingEnd (value: string) = Interop.mkStyle "paddingEnd" value 128 | static member inline paddingTop (value: float) = Interop.mkStyle "paddingTop" value 129 | static member inline paddingTop (value: string) = Interop.mkStyle "paddingTop" value 130 | static member inline paddingBottom (value: float) = Interop.mkStyle "paddingBottom" value 131 | static member inline paddingBottom (value: string) = Interop.mkStyle "paddingBottom" value 132 | static member inline paddingLeft (value: float) = Interop.mkStyle "paddingLeft" value 133 | static member inline paddingLeft (value: string) = Interop.mkStyle "paddingLeft" value 134 | static member inline paddingRight (value: float) = Interop.mkStyle "paddingRight" value 135 | static member inline paddingRight (value: string) = Interop.mkStyle "paddingRight" value 136 | 137 | static member inline transform (value: seq) = Interop.mkStyle "transform" value 138 | 139 | static member inline zIndex (value: float) = Interop.mkStyle "zIndex" value 140 | 141 | 142 | [] 143 | module style = 144 | [] 145 | type backfaceVisibility = 146 | static member inline visible = Interop.mkStyle "backfaceVisibility" "visible" 147 | static member inline hidden = Interop.mkStyle "backfaceVisibility" "hidden" 148 | [] 149 | type resizeMode = 150 | static member inline cover = Interop.mkStyle "resizeMode" "cover" 151 | static member inline contain = Interop.mkStyle "resizeMode" "contain" 152 | static member inline stretch = Interop.mkStyle "resizeMode" "stretch" 153 | static member inline repeat = Interop.mkStyle "resizeMode" "repeat" 154 | static member inline center = Interop.mkStyle "resizeMode" "center" 155 | 156 | // Text 157 | [] 158 | type fontStyle = 159 | static member inline normal = Interop.mkStyle "fontStyle" "normal" 160 | static member inline italic = Interop.mkStyle "fontStyle" "italic" 161 | [] 162 | type fontWeight = 163 | static member inline normal = Interop.mkStyle "fontWeight" "normal" 164 | static member inline bold = Interop.mkStyle "fontWeight" "bold" 165 | static member inline ``100`` = Interop.mkStyle "fontWeight" "100" 166 | static member inline ``200`` = Interop.mkStyle "fontWeight" "200" 167 | static member inline ``300`` = Interop.mkStyle "fontWeight" "300" 168 | static member inline ``400`` = Interop.mkStyle "fontWeight" "400" 169 | static member inline ``500`` = Interop.mkStyle "fontWeight" "500" 170 | static member inline ``600`` = Interop.mkStyle "fontWeight" "600" 171 | static member inline ``700`` = Interop.mkStyle "fontWeight" "700" 172 | static member inline ``800`` = Interop.mkStyle "fontWeight" "800" 173 | static member inline ``900`` = Interop.mkStyle "fontWeight" "900" 174 | [] 175 | type fontVariant = 176 | static member inline smallCaps = Interop.mkStyle "fontVariant" "small-caps" 177 | static member inline oldstyleNums = Interop.mkStyle "fontVariant" "oldstyle-nums" 178 | static member inline liningNums = Interop.mkStyle "fontVariant" "lining-nums" 179 | static member inline tabularNums = Interop.mkStyle "fontVariant" "tabular-nums" 180 | static member inline proportionalsNums = Interop.mkStyle "fontVariant" "proportionals-nums" 181 | [] 182 | type textAlign = 183 | static member inline auto = Interop.mkStyle "textAlign" "auto" 184 | static member inline left = Interop.mkStyle "textAlign" "left" 185 | static member inline right = Interop.mkStyle "textAlign" "right" 186 | static member inline center = Interop.mkStyle "textAlign" "center" 187 | static member inline justify = Interop.mkStyle "textAlign" "justify" 188 | [] 189 | type textAlignVertical = 190 | /// Only on Android. 191 | static member inline auto = Interop.mkStyle "textAlignVertical" "auto" 192 | /// Only on Android. 193 | static member inline top = Interop.mkStyle "textAlignVertical" "top" 194 | /// Only on Android. 195 | static member inline bottom = Interop.mkStyle "textAlignVertical" "bottom" 196 | /// Only on Android. 197 | static member inline center = Interop.mkStyle "textAlignVertical" "center" 198 | [] 199 | type textDecorationLine = 200 | static member inline none = Interop.mkStyle "textDecorationLine" "none" 201 | static member inline underline = Interop.mkStyle "textDecorationLine" "underline" 202 | static member inline lineThrough = Interop.mkStyle "textDecorationLine" "line-through" 203 | static member inline underlineLineThrough = Interop.mkStyle "textDecorationLine" "underline line-through" 204 | [] 205 | type textDecorationStyle = 206 | /// Only on iOS. 207 | static member inline solid = Interop.mkStyle "textDecorationStyle" "solid" 208 | /// Only on iOS. 209 | static member inline double = Interop.mkStyle "textDecorationStyle" "double" 210 | /// Only on iOS. 211 | static member inline dotted = Interop.mkStyle "textDecorationStyle" "dotted" 212 | /// Only on iOS. 213 | static member inline dashed = Interop.mkStyle "textDecorationStyle" "dashed" 214 | [] 215 | type textTransform = 216 | static member inline none = Interop.mkStyle "textTransform" "none" 217 | static member inline uppercase = Interop.mkStyle "textTransform" "uppercase" 218 | static member inline lowercase = Interop.mkStyle "textTransform" "lowercase" 219 | static member inline capitalize = Interop.mkStyle "textTransform" "capitalize" 220 | [] 221 | type writingDirection = 222 | static member inline auto = Interop.mkStyle "writingDirection" "auto" 223 | static member inline ltr = Interop.mkStyle "writingDirection" "ltr" 224 | static member inline rtl = Interop.mkStyle "writingDirection" "rtl" 225 | 226 | // Layout 227 | [] 228 | type alignContent = 229 | static member inline flexStart = Interop.mkStyle "alignContent" "flex-start" 230 | static member inline flexEnd = Interop.mkStyle "alignContent" "flex-end" 231 | static member inline center = Interop.mkStyle "alignContent" "center" 232 | static member inline stretch = Interop.mkStyle "alignContent" "stretch" 233 | static member inline spaceBetween = Interop.mkStyle "alignContent" "space-between" 234 | static member inline spaceAround = Interop.mkStyle "alignContent" "space-around" 235 | [] 236 | type alignItems = 237 | static member inline flexStart = Interop.mkStyle "alignItems" "flex-start" 238 | static member inline flexEnd = Interop.mkStyle "alignItems" "flex-end" 239 | static member inline center = Interop.mkStyle "alignItems" "center" 240 | static member inline stretch = Interop.mkStyle "alignItems" "stretch" 241 | static member inline baseline = Interop.mkStyle "alignItems" "baseline" 242 | [] 243 | type alignSelf = 244 | static member inline auto = Interop.mkStyle "alignSelf" "auto" 245 | static member inline flexStart = Interop.mkStyle "alignSelf" "flex-start" 246 | static member inline flexEnd = Interop.mkStyle "alignSelf" "flex-end" 247 | static member inline center = Interop.mkStyle "alignSelf" "center" 248 | static member inline stretch = Interop.mkStyle "alignSelf" "stretch" 249 | static member inline baseline = Interop.mkStyle "alignSelf" "baseline" 250 | [] 251 | type direction = 252 | static member inline inherit' = Interop.mkStyle "direction" "inherit" 253 | static member inline ltr = Interop.mkStyle "direction" "ltr" 254 | static member inline rtl = Interop.mkStyle "direction" "rtl" 255 | [] 256 | type display = 257 | static member inline none = Interop.mkStyle "display" "none" 258 | static member inline auto = Interop.mkStyle "display" "auto" 259 | [] 260 | type flexDirection = 261 | static member inline row = Interop.mkStyle "flexDirection" "row" 262 | static member inline rowReverse = Interop.mkStyle "flexDirection" "row-reverse" 263 | static member inline column = Interop.mkStyle "flexDirection" "column" 264 | static member inline columnReverse = Interop.mkStyle "flexDirection" "column-reverse" 265 | [] 266 | type flexWrap = 267 | static member inline wrap = Interop.mkStyle "flexWrap" "wrap" 268 | static member inline nowrap = Interop.mkStyle "flexWrap" "nowrap" 269 | static member inline wrapReverse = Interop.mkStyle "flexWrap" "wrap-reverse" 270 | [] 271 | type justifyContent = 272 | static member inline flexStart = Interop.mkStyle "justifyContent" "flex-start" 273 | static member inline flexEnd = Interop.mkStyle "justifyContent" "flex-end" 274 | static member inline center = Interop.mkStyle "justifyContent" "center" 275 | static member inline spaceBetween = Interop.mkStyle "justifyContent" "space-between" 276 | static member inline spaceAround = Interop.mkStyle "justifyContent" "space-around" 277 | static member inline spaceEvenly = Interop.mkStyle "justifyContent" "space-evenly" 278 | [] 279 | type overflow = 280 | static member inline visible = Interop.mkStyle "overflow" "visible" 281 | static member inline hidden = Interop.mkStyle "overflow" "hidden" 282 | static member inline scroll = Interop.mkStyle "overflow" "scroll" 283 | [] 284 | type position = 285 | static member inline absolute = Interop.mkStyle "position" "absolute" 286 | static member inline relative = Interop.mkStyle "position" "relative" -------------------------------------------------------------------------------- /src/Types.fs: -------------------------------------------------------------------------------- 1 | namespace Feliz.ReactNative 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | 6 | type LayoutEvent = 7 | { layout: {| width: float; height: float; x: float; y: float |} 8 | target: float } 9 | 10 | type PressEvent = 11 | { changedTouches: PressEvent [] 12 | identifier: float 13 | locationX: float 14 | locationY: float 15 | pageX: float 16 | pageY: float 17 | target: float 18 | timestamp: float 19 | touches: PressEvent [] } 20 | 21 | [] 22 | type AccessibilityRole = 23 | | Adjustable 24 | | Alert 25 | | Button 26 | | Checkbox 27 | | Combobox 28 | | Header 29 | | Image 30 | | Imagebutton 31 | | Keyboardkey 32 | | Link 33 | | Menu 34 | | Menubar 35 | | Menuitem 36 | | None 37 | | Progressbar 38 | | Radio 39 | | Radiogroup 40 | | Scrollbar 41 | | Search 42 | | Spinbutton 43 | | Summary 44 | | Switch 45 | | Tab 46 | | Tablist 47 | | Text 48 | | Timer 49 | | Togglebutton 50 | | Toolbar 51 | 52 | type AccessibilityActions = 53 | { name: string 54 | label: string option } 55 | 56 | type TextLayout = 57 | { capHeight: float 58 | ascender: float 59 | descender: float 60 | width: float 61 | height: float 62 | xHeight: float 63 | x: float 64 | y: float } 65 | 66 | type TextLayoutEvent = 67 | { lines: TextLayout [] 68 | target: float } 69 | 70 | type ImageLoadEvent = 71 | { source: 72 | {| uri: string 73 | width: float 74 | height: float |} } 75 | 76 | 77 | type IRect = interface end 78 | [] 79 | type Rect = 80 | static member inline top (value: float) = unbox ("top", value) 81 | static member inline left (value: float) = unbox ("left", value) 82 | static member inline right (value: float) = unbox ("right", value) 83 | static member inline bottom (value: float) = unbox ("bottom", value) 84 | 85 | type IImageSource = interface end 86 | type IImageSourceProp = interface end 87 | type IImageCacheEnum = interface end 88 | 89 | module ImageSource = 90 | [] 91 | type cache = 92 | static member inline default' = unbox "default" 93 | static member inline reload = unbox "reload" 94 | static member inline forceCache = unbox "force-cache" 95 | static member inline onlyIfCached = unbox "only-if-cached" 96 | 97 | [] 98 | type prop = 99 | static member inline uri (value: string) = unbox ("uri", value) 100 | static member inline width (value: float) = unbox ("width", value) 101 | static member inline height (value: float) = unbox ("height", value) 102 | static member inline scale (value: float) = unbox ("scale", value) 103 | /// Only on iOS. 104 | static member inline bundle (value: float) = unbox ("bundle", value) 105 | static member inline method (value: string) = unbox ("method", value) 106 | static member inline headers (value: obj) = unbox ("headers", value) 107 | static member inline body (value: string) = unbox ("body", value) 108 | static member inline cache (value: IImageCacheEnum) = unbox ("cache", value) 109 | 110 | [] 111 | type ImageSource = 112 | static member inline local (path: string) = unbox (importDefault path) 113 | 114 | type ViewToken = 115 | { item: {| key: string |} 116 | key: string 117 | index: int 118 | isViewable: bool } 119 | 120 | type IViewabilityConfig = interface end 121 | [] 122 | type ViewabilityConfig = 123 | static member inline minimumViewTime (value: float) = unbox ("minimumViewTime", value) 124 | static member inline viewAreaCoveragePercentThreshold (value: float) = unbox ("viewAreaCoveragePercentThreshold", value) 125 | static member inline itemVisiblePercentThreshold (value: float) = unbox ("itemVisiblePercentThreshold", value) 126 | static member inline waitForInteraction (value: bool) = unbox ("waitForInteraction", value) 127 | 128 | type IRippleConfig = interface end 129 | [] 130 | type RippleConfig = 131 | static member inline color (value: string) = unbox ("color", value) 132 | static member inline borderless (value: bool) = unbox ("borderless", value) 133 | static member inline radius (value: float) = unbox ("radius", value) 134 | static member inline foreground (value: bool) = unbox ("foreground", value) 135 | 136 | type FlatListItem<'Item> = 137 | { index: int 138 | item: 'Item 139 | separators: 140 | {| highlight: (unit -> unit) 141 | newProps: 'Item 142 | select: string 143 | unhighlight: (unit -> unit) 144 | updateProps: (unit -> unit) |} } 145 | 146 | type ITransform = interface end 147 | [] 148 | type transform = 149 | static member inline matrix (value: seq) = unbox (createObj [ "matrix", value ]) 150 | static member inline perspective (value: float) = unbox (createObj [ "perspective", value ]) 151 | 152 | static member inline rotate (value: string) = unbox (createObj [ "rotate", value ]) 153 | static member inline rotateX (value: string) = unbox (createObj [ "rotateX", value ]) 154 | static member inline rotateY (value: string) = unbox (createObj [ "rotateY", value ]) 155 | static member inline rotateZ (value: string) = unbox (createObj [ "rotateZ", value ]) 156 | 157 | static member inline scale (value: float) = unbox (createObj [ "scale", value ]) 158 | static member inline scaleX (value: float) = unbox (createObj [ "scaleX", value ]) 159 | static member inline scaleY (value: float) = unbox (createObj [ "scaleY", value ]) 160 | 161 | static member inline translateX (value: float) = unbox (createObj [ "translateX", value ]) 162 | static member inline translateY (value: float) = unbox (createObj [ "translateY", value ]) 163 | 164 | static member inline skewX (value: string) = unbox (createObj [ "skewX", value ]) 165 | static member inline skewY (value: string) = unbox (createObj [ "skewY", value ]) -------------------------------------------------------------------------------- /src/paket.references: -------------------------------------------------------------------------------- 1 | FSharp.Core 2 | Fable.Core 3 | Feliz 4 | Fable.React --------------------------------------------------------------------------------