├── .gitattributes ├── .gitignore ├── .paket ├── Paket.Restore.targets └── paket.exe ├── .travis.yml ├── .vscode └── settings.json ├── Animejs ├── Fable.Import.Animejs.fs ├── Fable.Import.Animejs.fsproj ├── README.md ├── RELEASE_NOTES.md └── paket.references ├── Browser ├── Fable.Import.Browser.fs ├── Fable.Import.Browser.fsproj ├── RELEASE_NOTES.md └── paket.references ├── Electron ├── Fable.Import.Electron.fs ├── Fable.Import.Electron.fsproj ├── README.md ├── RELEASE_NOTES.md └── paket.references ├── Express ├── Fable.Import.Express.fs ├── Fable.Import.Express.fsproj ├── Meta.props ├── README.md ├── RELEASE_NOTES.md └── paket.references ├── GeoJSON ├── Fable.Geojson.fsproj ├── Geojson.fs ├── RELEASE_NOTES.md └── paket.references ├── GoogleMaps ├── Fable.Helper.GoogleMaps.fs ├── Fable.Import.GoogleMaps.fs ├── Fable.Import.GoogleMaps.fsproj ├── README.md ├── RELEASE_NOTES.md └── paket.references ├── HMR ├── Fable.Import.HMR.fsproj ├── HMR.fs ├── RELEASE_NOTES.md └── paket.references ├── LICENSE ├── Leaflet ├── Fable.Leaflet.fsproj ├── Leaflet.fs ├── RELEASE_NOTES.md └── paket.references ├── Mocha ├── Fable.Import.Mocha.fs ├── Fable.Import.Mocha.fsproj ├── README.md ├── RELEASE_NOTES.md └── paket.references ├── Node ├── Base.fs ├── Buffer.fs ├── ChildProcess.fs ├── Crypto.fs ├── Events.fs ├── Exports.fs ├── Fable.Import.Node.fsproj ├── Fs.fs ├── Globals.fs ├── Http.fs ├── Https.fs ├── Meta.props ├── Net.fs ├── OS.fs ├── Path.fs ├── Process.fs ├── Querystring.fs ├── RELEASE_NOTES.md ├── Stream.fs ├── Tls.fs ├── Url.fs └── paket.references ├── Pg ├── Fable.Import.Pg.fs ├── Fable.Import.Pg.fsproj ├── Meta.props ├── README.md ├── RELEASE_NOTES.md └── paket.references ├── Pixi ├── Fable.Import.Pixi.fs ├── Fable.Import.Pixi.fsproj ├── README.md ├── RELEASE_NOTES.md └── paket.references ├── PixiParticles ├── Fable.Import.Pixi.Particles.fs ├── Fable.Import.Pixi.Particles.fsproj ├── README.md ├── RELEASE_NOTES.md └── paket.references ├── PixiSound ├── Fable.Import.Pixi.Sound.fs ├── Fable.Import.Pixi.Sound.fsproj ├── README.md ├── RELEASE_NOTES.md └── paket.references ├── README.md ├── SocketIo ├── Fable.Import.SocketIo.fs ├── Fable.Import.SocketIo.fsproj ├── Meta.props ├── README.md ├── RELEASE_NOTES.md └── paket.references ├── Uws ├── Fable.Import.Uws.fs ├── Fable.Import.Uws.fsproj ├── Meta.props ├── README.md ├── RELEASE_NOTES.md └── paket.references ├── VSCode ├── Fable.Import.VSCode.Proposed.fs ├── Fable.Import.VSCode.fs ├── Fable.Import.VSCode.fsproj ├── LICENSE ├── README.md ├── RELEASE_NOTES.md └── paket.references ├── build.cmd ├── build.fsx ├── build.sh ├── global.json ├── paket.dependencies ├── paket.lock └── test ├── .babelrc ├── Base.fsproj ├── Node ├── ChildProcess.Test.fs ├── Http.Test.fs ├── NodeTest.fsproj ├── Stream.Test.fs ├── jest.config.js └── paket.references ├── package-lock.json ├── package.json └── paket.references /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.suo 8 | *.user 9 | *.userosscache 10 | *.sln.docstates 11 | 12 | # User-specific files (MonoDevelop/Xamarin Studio) 13 | *.userprefs 14 | 15 | # Build results 16 | [Dd]ebug/ 17 | [Dd]ebugPublic/ 18 | [Rr]elease/ 19 | [Rr]eleases/ 20 | x64/ 21 | x86/ 22 | bld/ 23 | [Bb]in/ 24 | [Oo]bj/ 25 | [Ll]og/ 26 | 27 | # Visual Studio 2015 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # MSTest test Results 33 | [Tt]est[Rr]esult*/ 34 | [Bb]uild[Ll]og.* 35 | 36 | # NUNIT 37 | *.VisualState.xml 38 | TestResult.xml 39 | 40 | # Build Results of an ATL Project 41 | [Dd]ebugPS/ 42 | [Rr]eleasePS/ 43 | dlldata.c 44 | 45 | # .NET Core 46 | project.lock.json 47 | project.fragment.lock.json 48 | artifacts/ 49 | **/Properties/launchSettings.json 50 | 51 | *_i.c 52 | *_p.c 53 | *_i.h 54 | *.ilk 55 | *.meta 56 | *.obj 57 | *.pch 58 | *.pdb 59 | *.pgc 60 | *.pgd 61 | *.rsp 62 | *.sbr 63 | *.tlb 64 | *.tli 65 | *.tlh 66 | *.tmp 67 | *.tmp_proj 68 | *.log 69 | *.vspscc 70 | *.vssscc 71 | .builds 72 | *.pidb 73 | *.svclog 74 | *.scc 75 | 76 | # Chutzpah Test files 77 | _Chutzpah* 78 | 79 | # Visual C++ cache files 80 | ipch/ 81 | *.aps 82 | *.ncb 83 | *.opendb 84 | *.opensdf 85 | *.sdf 86 | *.cachefile 87 | *.VC.db 88 | *.VC.VC.opendb 89 | 90 | # Visual Studio profiler 91 | *.psess 92 | *.vsp 93 | *.vspx 94 | *.sap 95 | 96 | # TFS 2012 Local Workspace 97 | $tf/ 98 | 99 | # Guidance Automation Toolkit 100 | *.gpState 101 | 102 | # ReSharper is a .NET coding add-in 103 | _ReSharper*/ 104 | *.[Rr]e[Ss]harper 105 | *.DotSettings.user 106 | 107 | # JustCode is a .NET coding add-in 108 | .JustCode 109 | 110 | # TeamCity is a build add-in 111 | _TeamCity* 112 | 113 | # DotCover is a Code Coverage Tool 114 | *.dotCover 115 | 116 | # Visual Studio code coverage results 117 | *.coverage 118 | *.coveragexml 119 | 120 | # NCrunch 121 | _NCrunch_* 122 | .*crunch*.local.xml 123 | nCrunchTemp_* 124 | 125 | # MightyMoose 126 | *.mm.* 127 | AutoTest.Net/ 128 | 129 | # Web workbench (sass) 130 | .sass-cache/ 131 | 132 | # Installshield output folder 133 | [Ee]xpress/ 134 | 135 | # DocProject is a documentation generator add-in 136 | DocProject/buildhelp/ 137 | DocProject/Help/*.HxT 138 | DocProject/Help/*.HxC 139 | DocProject/Help/*.hhc 140 | DocProject/Help/*.hhk 141 | DocProject/Help/*.hhp 142 | DocProject/Help/Html2 143 | DocProject/Help/html 144 | 145 | # Click-Once directory 146 | publish/ 147 | 148 | # Publish Web Output 149 | *.[Pp]ublish.xml 150 | *.azurePubxml 151 | # TODO: Comment the next line if you want to checkin your web deploy settings 152 | # but database connection strings (with potential passwords) will be unencrypted 153 | *.pubxml 154 | *.publishproj 155 | 156 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 157 | # checkin your Azure Web App publish settings, but sensitive information contained 158 | # in these scripts will be unencrypted 159 | PublishScripts/ 160 | 161 | # NuGet Packages 162 | *.nupkg 163 | # The packages folder can be ignored because of Package Restore 164 | **/packages/* 165 | # Uncomment if necessary however generally it will be regenerated when needed 166 | #!**/packages/repositories.config 167 | # NuGet v3's project.json files produces more ignorable files 168 | *.nuget.props 169 | *.nuget.targets 170 | 171 | # Microsoft Azure Build Output 172 | csx/ 173 | *.build.csdef 174 | 175 | # Microsoft Azure Emulator 176 | ecf/ 177 | rcf/ 178 | 179 | # Windows Store app package directories and files 180 | AppPackages/ 181 | BundleArtifacts/ 182 | Package.StoreAssociation.xml 183 | _pkginfo.txt 184 | 185 | # Visual Studio cache files 186 | # files ending in .cache can be ignored 187 | *.[Cc]ache 188 | # but keep track of directories ending in .cache 189 | !*.[Cc]ache/ 190 | 191 | # Others 192 | ClientBin/ 193 | ~$* 194 | *~ 195 | *.dbmdl 196 | *.dbproj.schemaview 197 | *.jfm 198 | *.pfx 199 | *.publishsettings 200 | orleans.codegen.cs 201 | 202 | # Since there are multiple workflows, uncomment next line to ignore bower_components 203 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 204 | #bower_components/ 205 | 206 | # RIA/Silverlight projects 207 | Generated_Code/ 208 | 209 | # Backup & report files from converting an old project file 210 | # to a newer Visual Studio version. Backup files are not needed, 211 | # because we have git ;-) 212 | _UpgradeReport_Files/ 213 | Backup*/ 214 | UpgradeLog*.XML 215 | UpgradeLog*.htm 216 | 217 | # SQL Server files 218 | *.mdf 219 | *.ldf 220 | *.ndf 221 | 222 | # Business Intelligence projects 223 | *.rdl.data 224 | *.bim.layout 225 | *.bim_*.settings 226 | 227 | # Microsoft Fakes 228 | FakesAssemblies/ 229 | 230 | # GhostDoc plugin setting file 231 | *.GhostDoc.xml 232 | 233 | # Node.js Tools for Visual Studio 234 | .ntvs_analysis.dat 235 | node_modules/ 236 | 237 | # Typescript v1 declaration files 238 | typings/ 239 | 240 | # Visual Studio 6 build log 241 | *.plg 242 | 243 | # Visual Studio 6 workspace options file 244 | *.opt 245 | 246 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 247 | *.vbw 248 | 249 | # Visual Studio LightSwitch build output 250 | **/*.HTMLClient/GeneratedArtifacts 251 | **/*.DesktopClient/GeneratedArtifacts 252 | **/*.DesktopClient/ModelManifest.xml 253 | **/*.Server/GeneratedArtifacts 254 | **/*.Server/ModelManifest.xml 255 | _Pvt_Extensions 256 | 257 | # Paket dependency manager 258 | .paket/paket.exe 259 | paket-files/ 260 | 261 | # FAKE - F# Make 262 | .fake/ 263 | 264 | # JetBrains Rider 265 | .idea/ 266 | *.sln.iml 267 | 268 | # CodeRush 269 | .cr/ 270 | 271 | # Python Tools for Visual Studio (PTVS) 272 | __pycache__/ 273 | *.pyc 274 | 275 | # Cake - Uncomment if you are using it 276 | # tools/** 277 | # !tools/packages.config 278 | 279 | # Telerik's JustMock configuration file 280 | *.jmconfig 281 | 282 | # BizTalk build output 283 | *.btp.cs 284 | *.btm.cs 285 | *.odx.cs 286 | *.xsd.cs 287 | 288 | Browser/service-worker\.d\.ts 289 | -------------------------------------------------------------------------------- /.paket/paket.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fable-compiler/fable-import/17971d694cc8a158438a9ec5c2933949468c8eb6/.paket/paket.exe -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | jobs: 2 | include: 3 | - 4 | stage: test 5 | env: Type='unit test' 6 | language: csharp 7 | dotnet: 2.1.200 8 | mono: latest 9 | before_script: 10 | - nvm install 10 11 | script: 12 | - cd test 13 | - npm i 14 | - dotnet restore 15 | - dotnet restore Node/NodeTest.fsproj 16 | - dotnet fable npm-test 17 | - 18 | stage: deploy 19 | env: Type='node bindings' 20 | language: csharp 21 | dotnet: 2.1.200 22 | mono: latest 23 | if: branch =~ ^v.+node$ 24 | script: 25 | - cd Node 26 | - dotnet pack 27 | - cd bin/Debug 28 | - dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k $NUGET_KEY 29 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "FSharp.linter": false 4 | } -------------------------------------------------------------------------------- /Animejs/Fable.Import.Animejs.fs: -------------------------------------------------------------------------------- 1 | module Fable.Import.Animejs 2 | 3 | (* 4 | bindings based on typescript definitions located here: https://github.com/kohashi/types-npm-animejs/blob/master/index.d.ts 5 | *) 6 | open System 7 | open Fable.Core 8 | open Fable.Import.Browser 9 | open Fable.Import.JS 10 | 11 | type target = 12 | obj 13 | 14 | and [] AnimeStatic = 15 | abstract version: string with get, set 16 | abstract speed: float with get, set 17 | abstract running: ResizeArray with get, set 18 | abstract easings: Easings with get, set 19 | [] abstract Invoke: ?``params``: AnimInput -> AnimInstance 20 | abstract remove: targets: target -> unit 21 | abstract getValue: targets: target * propName: string -> U2 22 | abstract path: path: obj * ?percent: float-> (string -> FunctionBasedValues) 23 | abstract setDashoffset: el: SVGPathElement -> float 24 | abstract bezier: x1: float * x2: float * y1: float * y2: float -> Func 25 | abstract timeline: ?``params``: AnimInput -> TimelineInstance 26 | abstract random: min: float * max: float -> float 27 | 28 | and [] AnimInput = 29 | inherit Targets 30 | inherit AnimatableProperties 31 | inherit PropertyParameters 32 | inherit AnimationParameters 33 | inherit animationCallbacks 34 | 35 | and [] Targets = 36 | abstract targets: target option with get, set 37 | 38 | and [] AnimatableProperties = 39 | abstract translateX: animatableProperty option with get, set 40 | abstract translateY: animatableProperty option with get, set 41 | abstract rotate: animatableProperty option with get, set 42 | abstract scale: animatableProperty option with get, set 43 | abstract opacity: animatableProperty option with get, set 44 | abstract color: animatableProperty option with get, set 45 | abstract backgroundColor: animatableProperty option with get, set 46 | abstract left: animatableProperty option with get, set 47 | abstract top: animatableProperty option with get, set 48 | abstract border: animatableProperty option with get, set 49 | abstract points: animatableProperty option with get, set 50 | abstract strokeDashoffset: animatableProperty option with get, set 51 | abstract value: animatableProperty option with get, set 52 | abstract round: float option with get, set 53 | [] abstract Item: prop: string -> obj with get, set 54 | 55 | and propertyValue = 56 | U2 57 | 58 | and FunctionBasedValues = 59 | Element -> float -> float -> propertyValue 60 | 61 | and FromToValues = 62 | U2 * U2 63 | 64 | and propertyValues = 65 | U3 66 | 67 | and [] PropertyParameters = 68 | abstract value: propertyValues with get, set 69 | abstract duration: U2 with get, set 70 | abstract delay: U2 option with get, set 71 | abstract elasticity: U2 option with get, set 72 | abstract easing: U2 option with get, set 73 | abstract round: U3 option with get, set 74 | 75 | and Keyframes = 76 | ResizeArray 77 | 78 | and animatableProperty = 79 | U3 80 | 81 | and [] AnimationParameters = 82 | abstract loop: U2 option with get, set 83 | abstract direction: Direction option with get, set 84 | abstract autoplay: bool option with get, set 85 | 86 | and [] AnimInstance = 87 | inherit animationCallbacks 88 | inherit AnimationParameters 89 | inherit instanceParams 90 | abstract children: ResizeArray with get, set 91 | abstract animatables: ResizeArray with get, set 92 | abstract animations: ResizeArray with get, set 93 | abstract currentTime: float with get, set 94 | abstract progress: float with get, set 95 | abstract paused: bool with get, set 96 | abstract began: bool with get, set 97 | abstract completed: bool with get, set 98 | abstract reversed: bool with get, set 99 | abstract remaining: bool with get, set 100 | abstract reset: unit -> obj 101 | abstract tick: t: float -> obj 102 | abstract seek: t: float -> obj 103 | abstract pause: unit -> obj 104 | abstract play: unit -> obj 105 | abstract reverse: unit -> obj 106 | abstract restart: unit -> obj 107 | abstract finished: Promise with get, set 108 | 109 | and [] instanceParams = 110 | abstract offset: FunctionBasedValues with get, set 111 | abstract duration: FunctionBasedValues with get, set 112 | abstract delay: FunctionBasedValues with get, set 113 | 114 | and animCallback = 115 | AnimInstance -> unit 116 | 117 | and [] animationCallbacks = 118 | abstract update: animCallback with get, set 119 | abstract ``begin``: animCallback with get, set 120 | abstract complete: animCallback with get, set 121 | abstract run: animCallback with get, set 122 | 123 | and [] TimelineInstance = 124 | inherit animationCallbacks 125 | inherit AnimInstance 126 | abstract add: ``params``: AnimInput -> obj 127 | 128 | and [] Easings = 129 | abstract easeInElastic: a: obj * b: obj -> obj 130 | abstract easeInOutElastic: b: obj * c: obj -> obj 131 | abstract easeOutElastic: b: obj * c: obj -> obj 132 | abstract easeInBack: h: obj -> obj 133 | abstract easeInCirc: h: obj -> obj 134 | abstract easeInCubic: h: obj -> obj 135 | abstract easeInExpo: h: obj -> obj 136 | abstract easeInOutBack: h: obj -> obj 137 | abstract easeInOutCirc: h: obj -> obj 138 | abstract easeInOutCubic: h: obj -> obj 139 | abstract easeInOutExpo: h: obj -> obj 140 | abstract easeInOutQuad: h: obj -> obj 141 | abstract easeInOutQuart: h: obj -> obj 142 | abstract easeInOutQuint: h: obj -> obj 143 | abstract easeInOutSine: h: obj -> obj 144 | abstract easeInQuad: h: obj -> obj 145 | abstract easeInQuart: h: obj -> obj 146 | abstract easeInQuint: h: obj -> obj 147 | abstract easeInSine: h: obj -> obj 148 | abstract easeOutBack: h: obj -> obj 149 | abstract easeOutCirc: h: obj -> obj 150 | abstract easeOutCubic: h: obj -> obj 151 | abstract easeOutExpo: h: obj -> obj 152 | abstract easeOutQuad: h: obj -> obj 153 | abstract easeOutQuart: h: obj -> obj 154 | abstract easeOutQuint: h: obj -> obj 155 | abstract easeOutSine: h: obj -> obj 156 | 157 | and []Easing = 158 | | EaseInSine 159 | | EaseOutSine 160 | | EaseInOutSine 161 | | EaseInCirc 162 | | EaseOutCirc 163 | | EaseInOutCirc 164 | | EaseInElastic 165 | | EaseOutElastic 166 | | EaseInOutElastic 167 | | EaseInBack 168 | | EaseOutBack 169 | | EaseInOutBack 170 | | EaseInBounce 171 | | EaseOutBounce 172 | | EaseInOutBounce 173 | | EaseInQuad 174 | | EaseOutQuad 175 | | EaseInOutQuad 176 | | EaseInCubic 177 | | EaseOutCubic 178 | | EaseInOutCubic 179 | | EaseInQuart 180 | | EaseOutQuart 181 | | EaseInOutQuart 182 | | EaseInQuint 183 | | EaseOutQuint 184 | | EaseInOutQuint 185 | | EaseInExpo 186 | | EaseOutExpo 187 | | EaseInOutExpo 188 | | Linear 189 | 190 | and [] Direction = 191 | | Normal 192 | | Reverse 193 | | Alternate 194 | 195 | [] 196 | let anime: AnimeStatic = jsNative 197 | -------------------------------------------------------------------------------- /Animejs/Fable.Import.Animejs.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0.2.1 4 | 0.2.1 5 | netstandard1.6 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Animejs/README.md: -------------------------------------------------------------------------------- 1 | Fable bindings for [Animejs](http://animejs.com). 2 | ======= 3 | 4 | ### Using 5 | 1. `paket add Fable.Import.Animejs` 6 | 2. `yarn add animejs` 7 | 8 | In your webpack config add `"animejs"` to your entry option. 9 | 10 | Example: 11 | 12 | ```js 13 | module.exports = { 14 | entry: [ 15 | "animejs", 16 | "MyProject.fsproj" 17 | ] 18 | ... 19 | } 20 | ``` 21 | 22 | ### Building the package 23 | 1. `dotnet restore` 24 | 2. `dotnet pack` 25 | -------------------------------------------------------------------------------- /Animejs/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 0.2.1 2 | 3 | * Add AnimInstance.finished Promise definition #44 (@chadunit) 4 | 5 | ### 0.2.0 6 | 7 | * Update binding to support `import * from 'animejs'` 8 | 9 | ### 0.1.0 10 | 11 | * First push 12 | -------------------------------------------------------------------------------- /Animejs/paket.references: -------------------------------------------------------------------------------- 1 | FSharp.Core 2 | Fable.Core 3 | Fable.Import.Browser -------------------------------------------------------------------------------- /Browser/Fable.Import.Browser.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 1.4.0 4 | 1.4.0 5 | netstandard1.6 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /Browser/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 1.4.0 2 | 3 | * Add `navigator.languages` (by @nelson831002) 4 | 5 | ### 1.3.0 6 | 7 | * Override 1.2.0-beta-001 release 8 | 9 | ### 1.1.3 10 | 11 | * ServiceWorker events #66 12 | 13 | ### 1.1.2 14 | 15 | * Added: ServiceWorker 16 | 17 | ### 1.1.1 18 | 19 | * Fix: OverSampleType.None breaks Option.None 20 | 21 | ### 1.1.0 22 | 23 | * Update webaudio to match 2015 draft specification @JohnStov 24 | 25 | ### 1.0.0 26 | 27 | * Add doc comments 28 | * Use curried functions instead of `Func` 29 | * Allow returning unit from event callbacks 30 | 31 | ### 0.1.2 32 | 33 | * Remove optional arguments before `ParamArray` 34 | 35 | ### 0.1.1 36 | 37 | * Add `ValidityState.tooShort` 38 | 39 | ### 0.1.0 40 | 41 | * First push 42 | -------------------------------------------------------------------------------- /Browser/paket.references: -------------------------------------------------------------------------------- 1 | FSharp.Core 2 | Fable.Core -------------------------------------------------------------------------------- /Electron/Fable.Import.Electron.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0.1.1 4 | 0.1.1 5 | netstandard1.6 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Electron/README.md: -------------------------------------------------------------------------------- 1 | Fable bindings for [Electron](https://github.com/electron/electron). 2 | ======= 3 | [![nuget](https://badge.fury.io/nu/Fable.Import.Electron.svg)](https://badge.fury.io/nu/Fable.Import.Electron) 4 | 5 | 6 | 7 | ### Using 8 | 1. `paket add Fable.Import.Electron` 9 | 2. `yarn add -D electron` 10 | 11 | ### Building the package 12 | 1. `dotnet restore` 13 | 2. `dotnet pack` 14 | -------------------------------------------------------------------------------- /Electron/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 0.1.1 2 | 3 | * Build with dotnet SDK 2 4 | 5 | ### 0.1.0 6 | 7 | * Nugetized version -------------------------------------------------------------------------------- /Electron/paket.references: -------------------------------------------------------------------------------- 1 | FSharp.Core 2 | Fable.Core 3 | Fable.Import.Node 4 | Fable.Import.Browser -------------------------------------------------------------------------------- /Express/Fable.Import.Express.fs: -------------------------------------------------------------------------------- 1 | namespace Fable.Import 2 | open System 3 | open System.Text.RegularExpressions 4 | open Fable.Core 5 | open Fable.Import.JS 6 | open Fable.Import.Node 7 | 8 | module Express = 9 | type Request = 10 | interface end 11 | 12 | and Response = 13 | interface end 14 | 15 | and Application = 16 | interface end 17 | 18 | // [] 19 | // type express = interface end 20 | // [] 21 | module express = 22 | type IRoute = 23 | abstract path: string with get, set 24 | abstract stack: obj with get, set 25 | abstract all: [] handler: RequestHandler[] -> IRoute 26 | abstract get: [] handler: RequestHandler[] -> IRoute 27 | abstract post: [] handler: RequestHandler[] -> IRoute 28 | abstract put: [] handler: RequestHandler[] -> IRoute 29 | abstract delete: [] handler: RequestHandler[] -> IRoute 30 | abstract patch: [] handler: RequestHandler[] -> IRoute 31 | abstract options: [] handler: RequestHandler[] -> IRoute 32 | abstract head: [] handler: RequestHandler[] -> IRoute 33 | 34 | and IRouter<'T> = 35 | // inherit RequestHandler 36 | abstract all: name: U2 * [] handlers: RequestHandler[] -> obj 37 | abstract get: name: U2 * [] handlers: RequestHandler[] -> obj 38 | abstract post: name: U2 * [] handlers: RequestHandler[] -> obj 39 | abstract put: name: U2 * [] handlers: RequestHandler[] -> obj 40 | abstract delete: name: U2 * [] handlers: RequestHandler[] -> obj 41 | abstract patch: name: U2 * [] handlers: RequestHandler[] -> obj 42 | abstract options: name: U2 * [] handlers: RequestHandler[] -> obj 43 | abstract head: name: U2 * [] handlers: RequestHandler[] -> obj 44 | abstract param: name: string * handler: RequestParamHandler -> 'T 45 | abstract param: name: string * matcher: Regex -> 'T 46 | abstract param: name: string * mapper: Func -> 'T 47 | abstract param: callback: Func -> 'T 48 | abstract route: path: string -> IRoute 49 | abstract ``use``: [] handler: RequestHandler[] -> 'T 50 | // abstract ``use``: handler: U2 -> 'T 51 | abstract ``use``: path: string * [] handler: RequestHandler[] -> 'T 52 | // abstract ``use``: path: string * handler: U2 -> 'T 53 | abstract ``use``: path: string[] * [] handler: RequestHandler[] -> 'T 54 | // abstract ``use``: path: ResizeArray * handler: ErrorRequestHandler -> 'T 55 | abstract ``use``: path: Regex * [] handler: RequestHandler[] -> 'T 56 | // abstract ``use``: path: Regex * handler: ErrorRequestHandler -> 'T 57 | abstract ``use``: path: string * router: Router -> 'T 58 | 59 | and Router = 60 | inherit IRouter 61 | 62 | 63 | and CookieOptions = 64 | abstract maxAge: float option with get, set 65 | abstract signed: bool option with get, set 66 | abstract expires: DateTime option with get, set 67 | abstract httpOnly: bool option with get, set 68 | abstract path: string option with get, set 69 | abstract domain: string option with get, set 70 | abstract secure: bool option with get, set 71 | 72 | and Errback = Func 73 | // [] abstract Invoke: err: Error -> unit 74 | 75 | and Request = 76 | inherit Http.ServerRequest 77 | inherit Express.Request 78 | abstract headers: obj with get, set 79 | abstract accepted: ResizeArray with get, set 80 | abstract protocol: string with get, set 81 | abstract secure: bool with get, set 82 | abstract ip: string with get, set 83 | abstract ips: ResizeArray with get, set 84 | abstract subdomains: ResizeArray with get, set 85 | abstract path: string with get, set 86 | abstract hostname: string with get, set 87 | abstract host: string with get, set 88 | abstract fresh: bool with get, set 89 | abstract stale: bool with get, set 90 | abstract xhr: bool with get, set 91 | abstract body: obj with get, set 92 | abstract cookies: obj with get, set 93 | abstract ``method``: string with get, set 94 | abstract ``params``: obj with get, set 95 | abstract user: obj with get, set 96 | abstract authenticatedUser: obj with get, set 97 | abstract query: obj with get, set 98 | abstract route: obj with get, set 99 | abstract signedCookies: obj with get, set 100 | abstract originalUrl: string with get, set 101 | abstract url: string with get, set 102 | abstract baseUrl: string with get, set 103 | abstract app: Application with get, set 104 | abstract get: name: string -> string 105 | abstract header: name: string -> string 106 | abstract accepts: ``type``: string -> string 107 | abstract accepts: ``type``: ResizeArray -> string 108 | abstract acceptsCharsets: ?charset: U2> -> ResizeArray 109 | abstract acceptsEncodings: ?encoding: U2> -> ResizeArray 110 | abstract acceptsLanguages: ?lang: U2> -> ResizeArray 111 | abstract range: size: float -> ResizeArray 112 | abstract param: name: string * ?defaultValue: obj -> string 113 | abstract is: ``type``: string -> bool 114 | abstract clearCookie: name: string * ?options: obj -> Response 115 | 116 | and MediaType = 117 | abstract value: string with get, set 118 | abstract quality: float with get, set 119 | abstract ``type``: string with get, set 120 | abstract subtype: string with get, set 121 | 122 | and Response = 123 | inherit Http.ServerResponse 124 | inherit Express.Response 125 | abstract send: body: obj -> Response 126 | abstract json: body: obj -> Response 127 | abstract jsonp: body: obj -> Response 128 | abstract send: status: int * ?body: obj -> Response 129 | abstract json: status: int * ?body: obj -> Response 130 | abstract jsonp: status: int * ?body: obj -> Response 131 | abstract headersSent: bool with get, set 132 | abstract locals: obj with get, set 133 | abstract charset: string with get, set 134 | abstract status: code: int -> Response 135 | abstract sendStatus: code: int -> Response 136 | abstract links: links: obj -> Response 137 | abstract sendFile: path: string -> unit 138 | abstract sendFile: path: string * options: obj -> unit 139 | abstract sendFile: path: string * fn: Errback -> unit 140 | abstract sendFile: path: string * options: obj * fn: Errback -> unit 141 | abstract sendfile: path: string -> unit 142 | abstract sendfile: path: string * options: obj -> unit 143 | abstract sendfile: path: string * fn: Errback -> unit 144 | abstract sendfile: path: string * options: obj * fn: Errback -> unit 145 | abstract download: path: string -> unit 146 | abstract download: path: string * filename: string -> unit 147 | abstract download: path: string * fn: Errback -> unit 148 | abstract download: path: string * filename: string * fn: Errback -> unit 149 | abstract contentType: ``type``: string -> Response 150 | abstract ``type``: ``type``: string -> Response 151 | abstract format: obj: obj -> Response 152 | abstract attachment: ?filename: string -> Response 153 | abstract set: field: obj -> Response 154 | abstract set: field: string * ?value: string -> Response 155 | abstract header: field: obj -> Response 156 | abstract header: field: string * ?value: string -> Response 157 | abstract get: field: string -> string 158 | abstract clearCookie: name: string * ?options: obj -> Response 159 | abstract cookie: name: string * ``val``: string * options: CookieOptions -> Response 160 | abstract cookie: name: string * ``val``: obj * options: CookieOptions -> Response 161 | abstract cookie: name: string * ``val``: obj -> Response 162 | abstract location: url: string -> Response 163 | abstract redirect: url: string -> unit 164 | abstract redirect: status: int * url: string -> unit 165 | abstract redirect: url: string * status: int -> unit 166 | abstract render: view: string * ?options: obj * ?callback: Func -> unit 167 | abstract render: view: string * ?callback: Func -> unit 168 | 169 | and NextFunction = Func 170 | // [] abstract Invoke: unit -> unit 171 | // [] abstract Invoke: err: obj -> unit 172 | 173 | and ErrorRequestHandler = Funcunit), obj> 174 | // [] abstract Invoke: err: obj * req: Request * res: Response * next: NextFunction -> obj 175 | 176 | and RequestHandler = Funcunit), obj> 177 | // [] abstract Invoke: req: Request * res: Response * next: NextFunction -> obj 178 | 179 | and Handler = RequestHandler 180 | // inherit RequestHandler 181 | 182 | and RequestParamHandler = Funcunit), obj, obj> 183 | // [] abstract Invoke: req: Request * res: Response * next: NextFunction * param: obj -> obj 184 | 185 | and Application = 186 | inherit IRouter 187 | inherit Express.Application 188 | // abstract get: obj with get, set 189 | abstract router: string with get, set 190 | abstract settings: obj with get, set 191 | abstract resource: obj with get, set 192 | abstract map: obj with get, set 193 | abstract locals: obj with get, set 194 | abstract routes: obj with get, set 195 | abstract init: unit -> unit 196 | abstract defaultConfiguration: unit -> unit 197 | abstract engine: ext: string * fn: Function -> Application 198 | abstract set: setting: string * ``val``: obj -> Application 199 | abstract path: unit -> string 200 | abstract enabled: setting: string -> bool 201 | abstract disabled: setting: string -> bool 202 | abstract enable: setting: string -> Application 203 | abstract disable: setting: string -> Application 204 | abstract configure: fn: Function -> Application 205 | abstract configure: env0: string * fn: Function -> Application 206 | abstract configure: env0: string * env1: string * fn: Function -> Application 207 | abstract configure: env0: string * env1: string * env2: string * fn: Function -> Application 208 | abstract configure: env0: string * env1: string * env2: string * env3: string * fn: Function -> Application 209 | abstract configure: env0: string * env1: string * env2: string * env3: string * env4: string * fn: Function -> Application 210 | abstract render: name: string * ?options: obj * ?callback: Func -> unit 211 | abstract render: name: string * callback: Func -> unit 212 | abstract listen: port: int * hostname: string * backlog: float * ?callback: Function -> Http.Server 213 | abstract listen: port: int * hostname: string * ?callback: Function -> Http.Server 214 | abstract listen: port: int * ?callback: Function -> Http.Server 215 | abstract listen: path: string * ?callback: Function -> Http.Server 216 | abstract listen: handle: obj * ?listeningListener: Function -> Http.Server 217 | abstract route: path: string -> IRoute 218 | 219 | and Express = 220 | inherit Application 221 | abstract version: string with get, set 222 | abstract mime: string with get, set 223 | abstract application: obj with get, set 224 | abstract request: Request with get, set 225 | abstract response: Response with get, set 226 | [] abstract Invoke: unit -> Application 227 | abstract createApplication: unit -> Application 228 | abstract createServer: unit -> Application 229 | 230 | module mime = 231 | type Charsets = 232 | abstract lookup: mime: string -> string 233 | 234 | type Globals = 235 | member __.charsets with get(): Charsets = jsNative and set(v: Charsets): unit = jsNative 236 | member __.default_type with get(): string = jsNative and set(v: string): unit = jsNative 237 | member __.lookup(path: string): string = jsNative 238 | member __.extension(mime: string): string = jsNative 239 | member __.load(filepath: string): unit = jsNative 240 | member __.define(mimes: obj): unit = jsNative 241 | 242 | module ``serve-static`` = 243 | type Options = 244 | abstract dotfiles: string option with get, set 245 | abstract etag: bool option with get, set 246 | abstract extensions: ResizeArray option with get, set 247 | abstract index: U3> option with get, set 248 | abstract lastModified: bool option with get, set 249 | abstract maxAge: U2 option with get, set 250 | abstract redirect: bool option with get, set 251 | abstract setHeaders: Func option with get, set 252 | 253 | type Globals = 254 | member __.mime: mime.Globals = jsNative 255 | [] member __.Invoke(root: string, ?options: Options): Handler = jsNative 256 | 257 | type Globals = 258 | member __.``static``: ``serve-static``.Globals = jsNative 259 | member __.Router(?options: obj): Router = jsNative 260 | [] member __.Invoke(): Express = jsNative 261 | 262 | 263 | [] 264 | module express_Extensions = 265 | let [] express: express.Globals = jsNative 266 | -------------------------------------------------------------------------------- /Express/Fable.Import.Express.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0.1.0 5 | 0.1.0 6 | netstandard1.6 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Express/Meta.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | Fable bindings for Express 4 | https://github.com/fable-compiler/fable-import 5 | https://raw.githubusercontent.com/fable-compiler/fable-import/master/LICENSE 6 | https://github.com/fable-compiler/fable-import.git 7 | express;fsharp;fable 8 | Alfonso Garcia-Caro 9 | 10 | 11 | -------------------------------------------------------------------------------- /Express/README.md: -------------------------------------------------------------------------------- 1 | Fable bindings for [Express](https://github.com/expressjs/express). 2 | ======= 3 | [![nuget](https://badge.fury.io/nu/Fable.Import.Express.svg)](https://badge.fury.io/nu/Fable.Import.Express) 4 | 5 | 6 | 7 | ### Using 8 | 1. `paket add Fable.Import.Express` 9 | 2. `yarn add express` 10 | 11 | ### Building the package 12 | 1. `dotnet restore` 13 | 2. `dotnet pack` 14 | -------------------------------------------------------------------------------- /Express/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 0.1.0 2 | 3 | * Nugetized version -------------------------------------------------------------------------------- /Express/paket.references: -------------------------------------------------------------------------------- 1 | FSharp.Core 2 | Fable.Core 3 | -------------------------------------------------------------------------------- /GeoJSON/Fable.Geojson.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0.1.0 4 | 0.1.0 5 | netstandard1.6 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /GeoJSON/Geojson.fs: -------------------------------------------------------------------------------- 1 | // ts2fable 0.5.2 2 | module rec Geojson 3 | 4 | open System 5 | open Fable.Core 6 | open Fable.Import.JS 7 | 8 | 9 | type [] [] GeoJsonGeometryTypes = 10 | | [] Point 11 | | [] LineString 12 | | [] MultiPoint 13 | | [] Polygon 14 | | [] MultiLineString 15 | | [] MultiPolygon 16 | | [] GeometryCollection 17 | 18 | type GeoJsonTypes = 19 | U3 20 | 21 | [] 22 | module GeoJsonTypes = 23 | let ofCase1 v: GeoJsonTypes = v |> U3.Case1 24 | let isCase1 (v: GeoJsonTypes) = match v with U3.Case1 _ -> true | _ -> false 25 | let asCase1 (v: GeoJsonTypes) = match v with U3.Case1 o -> Some o | _ -> None 26 | let ofCase2 v: GeoJsonTypes = v |> U3.Case2 27 | let isCase2 (v: GeoJsonTypes) = match v with U3.Case2 _ -> true | _ -> false 28 | let asCase2 (v: GeoJsonTypes) = match v with U3.Case2 o -> Some o | _ -> None 29 | let ofGeoJsonGeometryTypes v: GeoJsonTypes = v |> U3.Case3 30 | let isGeoJsonGeometryTypes (v: GeoJsonTypes) = match v with U3.Case3 _ -> true | _ -> false 31 | let asGeoJsonGeometryTypes (v: GeoJsonTypes) = match v with U3.Case3 o -> Some o | _ -> None 32 | 33 | type BBox = 34 | U2 35 | 36 | [] 37 | module BBox = 38 | let ofCase1 v: BBox = v |> U2.Case1 39 | let isCase1 (v: BBox) = match v with U2.Case1 _ -> true | _ -> false 40 | let asCase1 (v: BBox) = match v with U2.Case1 o -> Some o | _ -> None 41 | let ofCase2 v: BBox = v |> U2.Case2 42 | let isCase2 (v: BBox) = match v with U2.Case2 _ -> true | _ -> false 43 | let asCase2 (v: BBox) = match v with U2.Case2 o -> Some o | _ -> None 44 | 45 | type Position = 46 | ResizeArray 47 | 48 | /// The base GeoJSON object. 49 | /// https://tools.ietf.org/html/rfc7946#section-3 50 | /// The GeoJSON specification also allows foreign members 51 | /// (https://tools.ietf.org/html/rfc7946#section-6.1) 52 | /// Developers should use "&" type in TypeScript or extend the interface 53 | /// to add these foreign members. 54 | type [] GeoJsonObject = 55 | /// Specifies the type of GeoJSON object. 56 | abstract ``type``: GeoJsonTypes with get, set 57 | /// Bounding box of the coordinate range of the object's Geometries, Features, or Feature Collections. 58 | /// https://tools.ietf.org/html/rfc7946#section-5 59 | abstract bbox: BBox option with get, set 60 | 61 | /// A geometry object. 62 | /// https://tools.ietf.org/html/rfc7946#section-3 63 | type [] GeometryObject = 64 | inherit GeoJsonObject 65 | abstract ``type``: GeoJsonGeometryTypes with get, set 66 | 67 | /// Point geometry object. 68 | /// https://tools.ietf.org/html/rfc7946#section-3.1.2 69 | type [] Point = 70 | inherit GeometryObject 71 | abstract ``type``: string with get, set 72 | abstract coordinates: Position with get, set 73 | 74 | /// MultiPoint geometry object. 75 | /// https://tools.ietf.org/html/rfc7946#section-3.1.3 76 | type [] MultiPoint = 77 | inherit GeometryObject 78 | abstract ``type``: string with get, set 79 | abstract coordinates: ResizeArray with get, set 80 | 81 | /// LineString geometry object. 82 | /// https://tools.ietf.org/html/rfc7946#section-3.1.4 83 | type [] LineString = 84 | inherit GeometryObject 85 | abstract ``type``: string with get, set 86 | abstract coordinates: ResizeArray with get, set 87 | 88 | /// MultiLineString geometry object. 89 | /// https://tools.ietf.org/html/rfc7946#section-3.1.5 90 | type [] MultiLineString = 91 | inherit GeometryObject 92 | abstract ``type``: string with get, set 93 | abstract coordinates: ResizeArray> with get, set 94 | 95 | /// Polygon geometry object. 96 | /// https://tools.ietf.org/html/rfc7946#section-3.1.6 97 | type [] Polygon = 98 | inherit GeometryObject 99 | abstract ``type``: string with get, set 100 | abstract coordinates: ResizeArray> with get, set 101 | 102 | /// MultiPolygon geometry object. 103 | /// https://tools.ietf.org/html/rfc7946#section-3.1.7 104 | type [] MultiPolygon = 105 | inherit GeometryObject 106 | abstract ``type``: string with get, set 107 | abstract coordinates: ResizeArray>> with get, set 108 | 109 | /// Geometry Collection 110 | /// https://tools.ietf.org/html/rfc7946#section-3.1.8 111 | type [] GeometryCollection = 112 | inherit GeometryObject 113 | abstract ``type``: string with get, set 114 | abstract geometries: Array> with get, set 115 | 116 | type GeoJsonProperties = 117 | obj option 118 | 119 | /// A feature object which contains a geometry and associated properties. 120 | /// https://tools.ietf.org/html/rfc7946#section-3.2 121 | type [] Feature<'G, 'P> = 122 | inherit GeoJsonObject 123 | abstract ``type``: string with get, set 124 | /// The feature's geometry 125 | abstract geometry: 'G with get, set 126 | /// A value that uniquely identifies this feature in a 127 | /// https://tools.ietf.org/html/rfc7946#section-3.2. 128 | abstract id: U2 option with get, set 129 | /// Properties associated with this feature. 130 | abstract properties: 'P with get, set 131 | 132 | /// A collection of feature objects. 133 | /// https://tools.ietf.org/html/rfc7946#section-3.3 134 | type [] FeatureCollection<'G, 'P> = 135 | inherit GeoJsonObject 136 | abstract ``type``: string with get, set 137 | abstract features: Array> with get, set 138 | -------------------------------------------------------------------------------- /GeoJSON/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 0.1.0 2 | 3 | * Initial Release 4 | -------------------------------------------------------------------------------- /GeoJSON/paket.references: -------------------------------------------------------------------------------- 1 | FSharp.Core 2 | Fable.Core -------------------------------------------------------------------------------- /GoogleMaps/Fable.Helper.GoogleMaps.fs: -------------------------------------------------------------------------------- 1 | module Fable.Helpers.GoogleMaps 2 | 3 | open Fable.Import.GoogleMaps 4 | open Fable.Core.JsInterop 5 | 6 | module Literal = 7 | 8 | let createLatLng lat lng : LatLngLiteral = 9 | jsOptions (fun latLngLiteral -> 10 | latLngLiteral.lat <- lat 11 | latLngLiteral.lng <- lng 12 | ) 13 | 14 | let createLatLngBounds north east south west : LatLngBoundsLiteral = 15 | jsOptions (fun latLngBoundsLiteral -> 16 | latLngBoundsLiteral.north <- north 17 | latLngBoundsLiteral.east <- east 18 | latLngBoundsLiteral.south <- south 19 | latLngBoundsLiteral.west <- west 20 | ) 21 | 22 | let createCircle center radius : CircleLiteral = 23 | jsOptions (fun circleLiteral -> 24 | circleLiteral.center <- center 25 | circleLiteral.radius <- radius 26 | ) -------------------------------------------------------------------------------- /GoogleMaps/Fable.Import.GoogleMaps.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard1.6 5 | 0.2.0 6 | 0.2.0 7 | true 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /GoogleMaps/README.md: -------------------------------------------------------------------------------- 1 | Fable bindings for [Google maps](https://developers.google.com/maps/documentation/javascript/reference/) 2 | ======= 3 | 4 | Add 5 | 6 | ```js 7 | externals: { 8 | 'google.maps': 'window.google.maps' 9 | } 10 | ``` 11 | 12 | if you are using webpack. -------------------------------------------------------------------------------- /GoogleMaps/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 0.2.0 2 | 3 | * Make `LocationBias` an `obj` type so Fable don't complain about 'Cannot type test: interface' 4 | 5 | ### 0.1.0 6 | 7 | * Initial Release 8 | * Scaffolded with ts2fable 0.6.1 9 | -------------------------------------------------------------------------------- /GoogleMaps/paket.references: -------------------------------------------------------------------------------- 1 | FSharp.Core 2 | Fable.Core -------------------------------------------------------------------------------- /HMR/Fable.Import.HMR.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0.1.0 4 | 0.1.0 5 | netstandard1.6 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /HMR/HMR.fs: -------------------------------------------------------------------------------- 1 | namespace Fable.Import 2 | 3 | module HMR = 4 | 5 | open Fable.Core 6 | open Fable.Import 7 | 8 | [] 9 | type Status = 10 | /// The process is waiting for a call to check (see below) 11 | | [] Idle 12 | /// The process is checking for updates 13 | | [] Check 14 | /// The process is getting ready for the update (e.g. downloading the updated module) 15 | | [] Prepare 16 | /// The update is prepared and available 17 | | [] Ready 18 | /// The process is calling the dispose handlers on the modules that will be replaced 19 | | [] Dispose 20 | /// The process is calling the accept handlers and re-executing self-accepted modules 21 | | [] Apply 22 | /// An update was aborted, but the system is still in it's previous state 23 | | [] Abort 24 | /// An update has thrown an exception and the system's state has been compromised 25 | | [] Fail 26 | 27 | type ApplyOptions = 28 | /// Ignore changes made to unaccepted modules. 29 | abstract ignoreUnaccepted : bool option with get, set 30 | /// Ignore changes made to declined modules. 31 | abstract ignoreDeclined : bool option with get, set 32 | /// Ignore errors throw in accept handlers, error handlers and while reevaluating module. 33 | abstract ignoreErrored : bool option with get, set 34 | /// Notifier for declined modules 35 | abstract onDeclined : (obj -> unit) option with get, set 36 | /// Notifier for unaccepted modules 37 | abstract onUnaccepted : (obj -> unit) option with get, set 38 | /// Notifier for accepted modules 39 | abstract onAccepted : (obj -> unit) option with get, set 40 | /// Notifier for disposed modules 41 | abstract onDisposed : (obj -> unit) option with get, set 42 | /// Notifier for errors 43 | abstract onErrored : (obj -> unit) option with get, set 44 | 45 | 46 | [] 47 | type IHot = 48 | 49 | /// **Description** 50 | /// Retrieve the current status of the hot module replacement process. 51 | /// **Parameters** 52 | /// 53 | /// 54 | /// **Output Type** 55 | /// * `Status` 56 | /// 57 | /// **Exceptions** 58 | /// 59 | abstract status: unit -> Status 60 | 61 | /// **Description** 62 | /// Accept updates for the given dependencies and fire a callback to react to those updates. 63 | /// **Parameters** 64 | /// * `dependencies` - parameter of type `U2` - Either a string or an array of strings 65 | /// * `errorHandler` - parameter of type `(obj -> unit) option` - Function to fire when the dependencies are updated 66 | /// **Output Type** 67 | /// * `unit` 68 | /// 69 | /// **Exceptions** 70 | /// 71 | abstract accept: dependencies: U2 * ?errorHandler: (obj -> unit) -> unit 72 | 73 | /// **Description** 74 | /// Accept updates for itself. 75 | /// **Parameters** 76 | /// * `errorHandler` - parameter of type `(obj -> unit) option` - Function to fire when the dependencies are updated 77 | /// 78 | /// **Output Type** 79 | /// * `unit` 80 | /// 81 | /// **Exceptions** 82 | /// 83 | abstract accept: ?errorHandler: (obj -> unit) -> unit 84 | 85 | /// **Description** 86 | /// Reject updates for the given dependencies forcing the update to fail with a 'decline' code. 87 | /// **Parameters** 88 | /// * `dependencies` - parameter of type `U2` - Either a string or an array of strings 89 | /// 90 | /// **Output Type** 91 | /// * `unit` 92 | /// 93 | /// **Exceptions** 94 | /// 95 | abstract decline: dependencies: U2 -> unit 96 | 97 | /// **Description** 98 | /// Reject updates for itself. 99 | /// **Parameters** 100 | /// 101 | /// 102 | /// **Output Type** 103 | /// * `unit` 104 | /// 105 | /// **Exceptions** 106 | /// 107 | abstract decline: unit -> unit 108 | 109 | /// **Description** 110 | /// Add a handler which is executed when the current module code is replaced. 111 | /// This should be used to remove any persistent resource you have claimed or created. 112 | /// If you want to transfer state to the updated module, add it to given `data` parameter. 113 | /// This object will be available at `module.hot.data` after the update. 114 | /// **Parameters** 115 | /// * `data` - parameter of type `obj` 116 | /// 117 | /// **Output Type** 118 | /// * `unit` 119 | /// 120 | /// **Exceptions** 121 | /// 122 | abstract dispose: data: obj -> unit 123 | 124 | /// **Description** 125 | /// Add a handler which is executed when the current module code is replaced. 126 | /// This should be used to remove any persistent resource you have claimed or created. 127 | /// If you want to transfer state to the updated module, add it to given `data` parameter. 128 | /// This object will be available at `module.hot.data` after the update. 129 | /// **Parameters** 130 | /// * `handler` - parameter of type `obj -> unit` 131 | /// 132 | /// **Output Type** 133 | /// * `unit` 134 | /// 135 | /// **Exceptions** 136 | /// 137 | abstract addDisposeHandler: handler: (obj -> unit) -> unit 138 | 139 | /// **Description** 140 | /// Remove the callback added via `dispose` or `addDisposeHandler`. 141 | /// **Parameters** 142 | /// * `callback` - parameter of type `obj -> unit` 143 | /// 144 | /// **Output Type** 145 | /// * `unit` 146 | /// 147 | /// **Exceptions** 148 | /// 149 | abstract removeDisposeHandler: callback: (obj -> unit) -> unit 150 | 151 | /// **Description** 152 | /// Test all loaded modules for updates and, if updates exist, `apply` them. 153 | /// **Parameters** 154 | /// * `autoApply` - parameter of type `U2` 155 | /// 156 | /// **Output Type** 157 | /// * `JS.Promise` 158 | /// 159 | /// **Exceptions** 160 | /// 161 | abstract check: autoApply: U2 -> JS.Promise 162 | 163 | /// **Description** 164 | /// Continue the update process (as long as `module.hot.status() === 'ready'`). 165 | /// **Parameters** 166 | /// * `options` - parameter of type `U2` 167 | /// 168 | /// **Output Type** 169 | /// * `JS.Promise` 170 | /// 171 | /// **Exceptions** 172 | /// 173 | abstract apply: options : ApplyOptions -> JS.Promise 174 | 175 | /// **Description** 176 | /// Register a function to listen for changes in `status`. 177 | /// **Parameters** 178 | /// 179 | /// 180 | /// **Output Type** 181 | /// * `unit` 182 | /// 183 | /// **Exceptions** 184 | /// 185 | abstract addStatusHandler: (obj -> unit) -> unit 186 | 187 | /// **Description** 188 | /// Remove a registered status handler. 189 | /// **Parameters** 190 | /// * `callback` - parameter of type `obj -> unit` 191 | /// 192 | /// **Output Type** 193 | /// * `unit` 194 | /// 195 | /// **Exceptions** 196 | /// 197 | abstract removeStatusHandler: callback: (obj -> unit) -> unit 198 | 199 | type IModule = 200 | abstract hot: IHot with get, set 201 | 202 | let [] [] ``module`` : IModule = jsNative 203 | -------------------------------------------------------------------------------- /HMR/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 0.1.0 2 | 3 | * Initial Release 4 | -------------------------------------------------------------------------------- /HMR/paket.references: -------------------------------------------------------------------------------- 1 | FSharp.Core 2 | Fable.Core -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /Leaflet/Fable.Leaflet.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0.1.0 4 | 0.1.0 5 | netstandard1.6 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Leaflet/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 0.1.0 2 | 3 | * Initial Release 4 | -------------------------------------------------------------------------------- /Leaflet/paket.references: -------------------------------------------------------------------------------- 1 | FSharp.Core 2 | Fable.Core -------------------------------------------------------------------------------- /Mocha/Fable.Import.Mocha.fs: -------------------------------------------------------------------------------- 1 | module Fable.Import.Mocha 2 | open System 3 | open System.Text.RegularExpressions 4 | open Fable.Core 5 | open Fable.Import.JS 6 | 7 | type MochaSetupOptions = 8 | abstract slow: float option with get, set 9 | abstract timeout: float option with get, set 10 | abstract ui: string option with get, set 11 | abstract globals: ResizeArray option with get, set 12 | abstract reporter: obj option with get, set 13 | abstract bail: bool option with get, set 14 | abstract ignoreLeaks: bool option with get, set 15 | abstract grep: obj option with get, set 16 | 17 | type IRunnable = 18 | abstract title: string with get, set 19 | abstract fn: Function with get, set 20 | abstract async: bool with get, set 21 | abstract sync: bool with get, set 22 | abstract timedOut: bool with get, set 23 | 24 | and ISuite = 25 | abstract parent: ISuite with get, set 26 | abstract title: string with get, set 27 | abstract fullTitle: unit -> string 28 | 29 | and ITest = 30 | inherit IRunnable 31 | abstract parent: ISuite with get, set 32 | abstract pending: bool with get, set 33 | abstract fullTitle: unit -> string 34 | 35 | and IRunner = 36 | interface end 37 | 38 | and IContextDefinition = 39 | [] abstract Invoke: description: string * spec: (unit->unit) -> ISuite 40 | abstract only: description: string * spec: (unit->unit) -> ISuite 41 | abstract skip: description: string * spec: (unit->unit) -> unit 42 | abstract timeout: ms: float -> unit 43 | 44 | and ITestDefinition = 45 | [] abstract Invoke: expectation: string * ?assertion: (unit->unit) -> ITest 46 | [] abstract Invoke: expectation: string * ?assertion: ((Error option -> unit)->unit) -> ITest 47 | abstract only: expectation: string * ?assertion: (unit->unit) -> ITest 48 | abstract only: expectation: string * ?assertion: ((Error option -> unit)->unit) -> ITest 49 | abstract skip: expectation: string * ?assertion: (unit->unit) -> unit 50 | abstract skip: expectation: string * ?assertion: ((Error option -> unit)->unit) -> unit 51 | abstract timeout: ms: float -> unit 52 | 53 | module reporters = 54 | type [] Base(runner: IRunner) = 55 | member __.stats with get(): obj = jsNative and set(v: obj): unit = jsNative 56 | 57 | and [] Doc(runner: IRunner) = 58 | inherit Base(runner) 59 | 60 | and [] Dot(runner: IRunner) = 61 | inherit Base(runner) 62 | 63 | and [] HTML(runner: IRunner) = 64 | inherit Base(runner) 65 | 66 | and [] HTMLCov(runner: IRunner) = 67 | inherit Base(runner) 68 | 69 | and [] JSON(runner: IRunner) = 70 | inherit Base(runner) 71 | 72 | and [] JSONCov(runner: IRunner) = 73 | inherit Base(runner) 74 | 75 | and [] JSONStream(runner: IRunner) = 76 | inherit Base(runner) 77 | 78 | and [] Landing(runner: IRunner) = 79 | inherit Base(runner) 80 | 81 | and [] List(runner: IRunner) = 82 | inherit Base(runner) 83 | 84 | and [] Markdown(runner: IRunner) = 85 | inherit Base(runner) 86 | 87 | and [] Min(runner: IRunner) = 88 | inherit Base(runner) 89 | 90 | and [] Nyan(runner: IRunner) = 91 | inherit Base(runner) 92 | 93 | and [] Progress(runner: IRunner, ?options: obj) = 94 | inherit Base(runner) 95 | 96 | and [] Spec(runner: IRunner) = 97 | inherit Base(runner) 98 | 99 | and [] TAP(runner: IRunner) = 100 | inherit Base(runner) 101 | 102 | and [] XUnit(runner: IRunner, ?options: obj) = 103 | inherit Base(runner) 104 | 105 | type [] Mocha(?options: obj) = 106 | member __.setup(options: MochaSetupOptions): Mocha = jsNative 107 | member __.bail(?value: bool): Mocha = jsNative 108 | member __.addFile(file: string): Mocha = jsNative 109 | member __.reporter(name: string): Mocha = jsNative 110 | member __.reporter(reporter: Func): Mocha = jsNative 111 | member __.ui(value: string): Mocha = jsNative 112 | member __.grep(value: string): Mocha = jsNative 113 | member __.grep(value: Regex): Mocha = jsNative 114 | member __.invert(): Mocha = jsNative 115 | member __.ignoreLeaks(value: bool): Mocha = jsNative 116 | member __.checkLeaks(): Mocha = jsNative 117 | member __.throwError(error: Error): unit = jsNative 118 | member __.growl(): Mocha = jsNative 119 | member __.globals(value: string): Mocha = jsNative 120 | member __.globals(values: ResizeArray): Mocha = jsNative 121 | member __.useColors(value: bool): Mocha = jsNative 122 | member __.useInlineDiffs(value: bool): Mocha = jsNative 123 | member __.timeout(value: float): Mocha = jsNative 124 | member __.slow(value: float): Mocha = jsNative 125 | member __.enableTimeouts(value: bool): Mocha = jsNative 126 | member __.asyncOnly(value: bool): Mocha = jsNative 127 | member __.noHighlighting(value: bool): Mocha = jsNative 128 | member __.run(?onComplete: float->unit): IRunner = jsNative 129 | 130 | module Globals = 131 | let [] mocha: Mocha = jsNative 132 | let [] describe: IContextDefinition = jsNative 133 | let [] xdescribe: IContextDefinition = jsNative 134 | let [] context: IContextDefinition = jsNative 135 | let [] suite: IContextDefinition = jsNative 136 | let [] it: ITestDefinition = jsNative 137 | let [] xit: ITestDefinition = jsNative 138 | let [] test: ITestDefinition = jsNative -------------------------------------------------------------------------------- /Mocha/Fable.Import.Mocha.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0.1.0 4 | 0.1.0 5 | netstandard1.6 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Mocha/README.md: -------------------------------------------------------------------------------- 1 | Fable bindings for [Mocha](https://mochajs.org/). 2 | ======= 3 | [![nuget](https://badge.fury.io/nu/Fable.Import.Mocha.svg)](https://badge.fury.io/nu/Fable.Import.Mocha) 4 | 5 | ### Using 6 | 1. `paket add Fable.Import.Mocha` 7 | 2. `yarn add --dev mocha` or `npm install --save-dev mocha` 8 | -------------------------------------------------------------------------------- /Mocha/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 0.1.0 2 | 3 | * Initial Release -------------------------------------------------------------------------------- /Mocha/paket.references: -------------------------------------------------------------------------------- 1 | FSharp.Core 2 | Fable.Core -------------------------------------------------------------------------------- /Node/Base.fs: -------------------------------------------------------------------------------- 1 | module rec Fable.Import.Node.Base 2 | 3 | open System 4 | open Fable.Core 5 | open Fable.Import.JS 6 | 7 | module NodeJS = 8 | type [] Console = 9 | abstract ``assert``: value: obj * ?message: string * [] optionalParams: obj[] -> unit 10 | abstract dir: obj: obj * ?options: obj -> unit 11 | abstract error: ?message: obj * [] optionalParams: obj[] -> unit 12 | abstract info: ?message: obj * [] optionalParams: obj[] -> unit 13 | abstract log: ?message: obj * [] optionalParams: obj[] -> unit 14 | abstract time: label: string -> unit 15 | abstract timeEnd: label: string -> unit 16 | abstract trace: ?message: obj * [] optionalParams: obj[] -> unit 17 | abstract warn: ?message: obj * [] optionalParams: obj[] -> unit 18 | 19 | type [] Error = 20 | abstract name: string with get, set 21 | abstract stack: string with get, set 22 | abstract message: string with get, set 23 | 24 | type [] NodeRequireFunction = 25 | [] abstract Invoke: id: string -> obj 26 | 27 | type [] NodeRequire = 28 | inherit NodeRequireFunction 29 | abstract cache: obj with get, set 30 | abstract extensions: obj with get, set 31 | abstract main: NodeJS.NodeModule with get, set 32 | abstract resolve: id: string -> string 33 | 34 | type [] NodeModule = 35 | abstract exports: obj with get, set 36 | abstract require: NodeRequireFunction with get, set 37 | abstract id: string with get, set 38 | abstract filename: string with get, set 39 | abstract loaded: bool with get, set 40 | abstract parent: U2 with get, set 41 | abstract ``null``: obj with get, set 42 | abstract children: ResizeArray with get, set 43 | 44 | type [] IterableIterator<'T> = 45 | interface end 46 | 47 | type [] ErrnoException = 48 | inherit Error 49 | abstract errno: float option with get, set 50 | abstract code: string option with get, set 51 | abstract path: string option with get, set 52 | abstract syscall: string option with get, set 53 | abstract stack: string option with get, set 54 | 55 | type [] ProcessVersions = 56 | abstract http_parser: string with get, set 57 | abstract node: string with get, set 58 | abstract v8: string with get, set 59 | abstract ares: string with get, set 60 | abstract uv: string with get, set 61 | abstract zlib: string with get, set 62 | abstract modules: string with get, set 63 | abstract openssl: string with get, set 64 | 65 | type [] MemoryUsage = 66 | abstract rss: float with get, set 67 | abstract heapTotal: float with get, set 68 | abstract heapUsed: float with get, set 69 | 70 | type [] CpuUsage = 71 | abstract user: float with get, set 72 | abstract system: float with get, set 73 | 74 | type [] Arch = 75 | | Arm | Arm64 | Ia32 | Mips | Mipsel | Ppc | Ppc64 | S390 | S390x | X32 | X64 | X86 76 | 77 | type [] Platform = 78 | | Aix | Android | Darwin | Freebsd | Linux | Openbsd | Sunos | Win32 79 | 80 | type [] Timer = 81 | abstract ref: unit -> unit 82 | abstract unref: unit -> unit 83 | 84 | type [] Global = 85 | abstract Array: obj with get, set 86 | abstract ArrayBuffer: obj with get, set 87 | abstract Boolean: obj with get, set 88 | abstract Buffer: obj with get, set 89 | abstract DataView: obj with get, set 90 | abstract Date: obj with get, set 91 | abstract Error: obj with get, set 92 | abstract EvalError: obj with get, set 93 | abstract Float32Array: obj with get, set 94 | abstract Float64Array: obj with get, set 95 | abstract Function: obj with get, set 96 | abstract GLOBAL: Global with get, set 97 | abstract Infinity: obj with get, set 98 | abstract Int16Array: obj with get, set 99 | abstract Int32Array: obj with get, set 100 | abstract Int8Array: obj with get, set 101 | abstract Intl: obj with get, set 102 | abstract JSON: obj with get, set 103 | abstract Map: MapConstructor with get, set 104 | abstract Math: obj with get, set 105 | abstract NaN: obj with get, set 106 | abstract Number: obj with get, set 107 | abstract Object: obj with get, set 108 | abstract Promise: Function with get, set 109 | abstract RangeError: obj with get, set 110 | abstract ReferenceError: obj with get, set 111 | abstract RegExp: obj with get, set 112 | abstract Set: SetConstructor with get, set 113 | abstract String: obj with get, set 114 | abstract Symbol: Function with get, set 115 | abstract SyntaxError: obj with get, set 116 | abstract TypeError: obj with get, set 117 | abstract URIError: obj with get, set 118 | abstract Uint16Array: obj with get, set 119 | abstract Uint32Array: obj with get, set 120 | abstract Uint8Array: obj with get, set 121 | abstract Uint8ClampedArray: Function with get, set 122 | abstract WeakMap: WeakMapConstructor with get, set 123 | abstract WeakSet: WeakSetConstructor with get, set 124 | abstract console: Console with get, set 125 | abstract decodeURI: obj with get, set 126 | abstract decodeURIComponent: obj with get, set 127 | abstract encodeURI: obj with get, set 128 | abstract encodeURIComponent: obj with get, set 129 | abstract escape: Func with get, set 130 | abstract eval: obj with get, set 131 | abstract ``global``: Global with get, set 132 | abstract isFinite: obj with get, set 133 | abstract isNaN: obj with get, set 134 | abstract parseFloat: obj with get, set 135 | abstract parseInt: obj with get, set 136 | abstract root: Global with get, set 137 | abstract undefined: obj with get, set 138 | abstract unescape: Func with get, set 139 | abstract gc: Func with get, set 140 | abstract v8debug: obj option with get, set -------------------------------------------------------------------------------- /Node/Buffer.fs: -------------------------------------------------------------------------------- 1 | module rec Fable.Import.Node.Buffer 2 | 3 | open Fable.Core 4 | open Fable.Import.JS 5 | 6 | [] 7 | type BufferEncoding = 8 | ///For 7-bit ASCII data only. This encoding is fast and will strip the high bit if set. 9 | | Ascii 10 | /// Multibyte encoded Unicode characters. Many web pages and other document formats use UTF-8. 11 | | Utf8 12 | /// 2 or 4 bytes, little-endian encoded Unicode characters. Surrogate pairs (U+10000 to U+10FFFF) are supported. 13 | | Utf16le 14 | /// Alias of 'utf16le' 15 | | Usc2 16 | /// Base64 encoding. When creating a Buffer from a string, this encoding will also correctly accept "URL and Filename Safe Alphabet" as specified in RFC4648, Section 5. 17 | | Base64 18 | /// A way of encoding the Buffer into a one-byte encoded string (as defined by the IANA in RFC1345, page 63, to be the Latin-1 supplement block and C0/C1 control codes) 19 | | Latin1 20 | /// Alias for 'latin1'. 21 | | Binary 22 | /// Encode each byte as two hexadecimal characters. 23 | | Hex 24 | 25 | type Buffer = 26 | abstract write: string: string * ?offset: float * ?length: float * ?encoding: string -> float 27 | abstract toString: ?encoding: string * ?start: float * ?``end``: float -> string 28 | abstract toJSON: unit -> obj 29 | abstract equals: otherBuffer: Buffer -> bool 30 | abstract compare: otherBuffer: Buffer * ?targetStart: float * ?targetEnd: float * ?sourceStart: float * ?sourceEnd: float -> float 31 | abstract copy: targetBuffer: Buffer * ?targetStart: float * ?sourceStart: float * ?sourceEnd: float -> float 32 | abstract slice: ?start: float * ?``end``: float -> Buffer 33 | abstract writeUIntLE: value: float * offset: float * byteLength: float * ?noAssert: bool -> float 34 | abstract writeUIntBE: value: float * offset: float * byteLength: float * ?noAssert: bool -> float 35 | abstract writeIntLE: value: float * offset: float * byteLength: float * ?noAssert: bool -> float 36 | abstract writeIntBE: value: float * offset: float * byteLength: float * ?noAssert: bool -> float 37 | abstract readUIntLE: offset: float * byteLength: float * ?noAssert: bool -> float 38 | abstract readUIntBE: offset: float * byteLength: float * ?noAssert: bool -> float 39 | abstract readIntLE: offset: float * byteLength: float * ?noAssert: bool -> float 40 | abstract readIntBE: offset: float * byteLength: float * ?noAssert: bool -> float 41 | abstract readUInt8: offset: float * ?noAssert: bool -> float 42 | abstract readUInt16LE: offset: float * ?noAssert: bool -> float 43 | abstract readUInt16BE: offset: float * ?noAssert: bool -> float 44 | abstract readUInt32LE: offset: float * ?noAssert: bool -> float 45 | abstract readUInt32BE: offset: float * ?noAssert: bool -> float 46 | abstract readInt8: offset: float * ?noAssert: bool -> float 47 | abstract readInt16LE: offset: float * ?noAssert: bool -> float 48 | abstract readInt16BE: offset: float * ?noAssert: bool -> float 49 | abstract readInt32LE: offset: float * ?noAssert: bool -> float 50 | abstract readInt32BE: offset: float * ?noAssert: bool -> float 51 | abstract readFloatLE: offset: float * ?noAssert: bool -> float 52 | abstract readFloatBE: offset: float * ?noAssert: bool -> float 53 | abstract readDoubleLE: offset: float * ?noAssert: bool -> float 54 | abstract readDoubleBE: offset: float * ?noAssert: bool -> float 55 | abstract swap16: unit -> Buffer 56 | abstract swap32: unit -> Buffer 57 | abstract swap64: unit -> Buffer 58 | abstract writeUInt8: value: float * offset: float * ?noAssert: bool -> float 59 | abstract writeUInt16LE: value: float * offset: float * ?noAssert: bool -> float 60 | abstract writeUInt16BE: value: float * offset: float * ?noAssert: bool -> float 61 | abstract writeUInt32LE: value: float * offset: float * ?noAssert: bool -> float 62 | abstract writeUInt32BE: value: float * offset: float * ?noAssert: bool -> float 63 | abstract writeInt8: value: float * offset: float * ?noAssert: bool -> float 64 | abstract writeInt16LE: value: float * offset: float * ?noAssert: bool -> float 65 | abstract writeInt16BE: value: float * offset: float * ?noAssert: bool -> float 66 | abstract writeInt32LE: value: float * offset: float * ?noAssert: bool -> float 67 | abstract writeInt32BE: value: float * offset: float * ?noAssert: bool -> float 68 | abstract writeFloatLE: value: float * offset: float * ?noAssert: bool -> float 69 | abstract writeFloatBE: value: float * offset: float * ?noAssert: bool -> float 70 | abstract writeDoubleLE: value: float * offset: float * ?noAssert: bool -> float 71 | abstract writeDoubleBE: value: float * offset: float * ?noAssert: bool -> float 72 | abstract fill: value: obj * ?offset: float * ?``end``: float -> obj 73 | abstract indexOf: value: U3 * ?byteOffset: float * ?encoding: string -> float 74 | abstract lastIndexOf: value: U3 * ?byteOffset: float * ?encoding: string -> float 75 | abstract entries: unit -> IterableIterator 76 | abstract includes: value: U3 * ?byteOffset: float * ?encoding: string -> bool 77 | abstract keys: unit -> IterableIterator 78 | abstract values: unit -> IterableIterator 79 | abstract from: array: ResizeArray -> Buffer 80 | abstract from: arrayBuffer: ArrayBuffer * ?byteOffset: float * ?length: float -> Buffer 81 | abstract from: buffer: Buffer -> Buffer 82 | abstract from: str: string * ?encoding: string -> Buffer 83 | abstract isBuffer: obj: obj -> obj 84 | abstract isEncoding: encoding: string -> bool 85 | abstract byteLength: string: string * ?encoding: string -> float 86 | abstract compare: buf1: Buffer * buf2: Buffer -> float 87 | abstract alloc: size: float * ?fill: U3 * ?encoding: string -> Buffer 88 | abstract allocUnsafe: size: float -> Buffer 89 | abstract allocUnsafeSlow: size: float -> Buffer 90 | 91 | type [] BufferStatic = 92 | [] abstract Create: str: string * ?encoding: string -> Buffer 93 | [] abstract Create: str: float -> Buffer 94 | [] abstract Create: array: Uint8Array -> Buffer 95 | [] abstract Create: arrayBuffer: ArrayBuffer -> Buffer 96 | [] abstract Create: array: ResizeArray -> Buffer 97 | [] abstract Create: buffer: Buffer -> Buffer 98 | abstract from: array: ResizeArray -> Buffer 99 | abstract from: buffer: Buffer -> Buffer 100 | abstract from: arrayBuffer: ArrayBuffer * ?byteOffset: float * ?length: float -> Buffer 101 | abstract from: str: string * ?encoding: string -> Buffer 102 | abstract concat: list: Buffer [] * ?totalLength: float -> Buffer 103 | 104 | type [] SlowBuffer = 105 | abstract prototype: Buffer with get, set 106 | abstract isBuffer: obj: obj -> bool 107 | abstract byteLength: string: string * ?encoding: string -> float 108 | abstract concat: list: ResizeArray * ?totalLength: float -> Buffer 109 | 110 | type [] SlowBufferStatic = 111 | [] abstract Create: str: string * ?encoding: string -> Buffer 112 | [] abstract Create: str: float -> Buffer 113 | [] abstract Create: array: Uint8Array -> Buffer 114 | [] abstract Create: array: ResizeArray -> Buffer 115 | 116 | type IExports = 117 | abstract Buffer: BufferStatic with get, set 118 | abstract SlowBuffer: SlowBufferStatic with get, set -------------------------------------------------------------------------------- /Node/ChildProcess.fs: -------------------------------------------------------------------------------- 1 | module rec Fable.Import.Node.ChildProcess 2 | 3 | open Fable.Core 4 | open Fable.Import.Node 5 | open Fable.Import.Node.Base 6 | 7 | type ExecError = 8 | inherit NodeJS.Error 9 | abstract code: int with get, set 10 | abstract signal: string option with get, set 11 | 12 | type [] ChildProcess = 13 | inherit Events.EventEmitter 14 | abstract stdin: Stream.Writable with get, set 15 | abstract stdout: Stream.Readable with get, set 16 | abstract stderr: Stream.Readable with get, set 17 | abstract connected: bool with get, set 18 | abstract stdio: U2,Stream.Writable>[] with get, set 19 | abstract pid: float with get, set 20 | abstract kill: ?signal: string -> unit 21 | abstract send: message: obj * ?sendHandle: obj -> unit 22 | abstract disconnect: unit -> unit 23 | abstract unref: unit -> unit 24 | 25 | type [] ChildProcessStatic = 26 | [] abstract Create: unit -> ChildProcess 27 | 28 | type [] ExecOptions = 29 | /// Default: 'utf8' 30 | abstract encoding : string option with get, set 31 | 32 | /// Current working directory of the child process 33 | abstract cwd: string option with get, set 34 | 35 | /// Timeout, in milliseconds. Default is zero (no timeout). 36 | abstract timeout: int option with get, set 37 | 38 | type IExports = 39 | abstract ChildProcess: ChildProcessStatic with get, set 40 | abstract spawn: command: string * ?args: ResizeArray * ?options: obj -> ChildProcess 41 | abstract exec: command: string * ?options: ExecOptions * ?callback:(ExecError option -> U2 -> U2 -> unit) -> ChildProcessStatic 42 | 43 | abstract execFile: file: string * ?callback: (ExecError option -> Buffer.Buffer -> Buffer.Buffer -> unit) -> ChildProcess 44 | 45 | abstract execFile: file: string * ?args: ResizeArray * ?callback: (ExecError option -> Buffer.Buffer -> Buffer.Buffer -> unit) -> ChildProcess 46 | 47 | abstract execFile :file: string * ?args: ResizeArray * ?options: ExecOptions * ?callback: (ExecError option -> Buffer.Buffer -> Buffer.Buffer -> unit) -> ChildProcess 48 | 49 | abstract fork: modulePath: string * ?args: ResizeArray * ?options: obj -> ChildProcess 50 | 51 | abstract execSync: command: string * ?options: obj -> U2 52 | 53 | abstract execFileSync: command: string * ?args: ResizeArray * ?options: obj -> U2 54 | 55 | abstract spawnSync: command: string * ?args: ResizeArray * ?options: obj -> obj -------------------------------------------------------------------------------- /Node/Crypto.fs: -------------------------------------------------------------------------------- 1 | module rec Fable.Import.Node.Crypto 2 | 3 | open Fable.Core 4 | open Fable.Import.JS 5 | open Fable.Import.Node 6 | 7 | type [] CredentialDetails = 8 | abstract pfx: string with get, set 9 | abstract key: string with get, set 10 | abstract passphrase: string with get, set 11 | abstract cert: string with get, set 12 | abstract ca: obj with get, set 13 | abstract crl: obj with get, set 14 | abstract ciphers: string with get, set 15 | 16 | type [] Credentials = 17 | abstract context: obj option with get, set 18 | 19 | type [] Hash = 20 | abstract update: data: obj * ?input_encoding: string -> Hash 21 | [] abstract digest_buffer: unit -> Buffer.Buffer 22 | abstract digest: encoding: string -> obj 23 | abstract digest: unit -> Buffer.Buffer 24 | 25 | type [] Hmac = 26 | abstract update: data: obj * ?input_encoding: string -> Hmac 27 | [] abstract digest_buffer: unit -> Buffer.Buffer 28 | abstract digest: encoding: string -> obj 29 | abstract digest: unit -> Buffer.Buffer 30 | 31 | type [] Cipher = 32 | abstract update: data: Buffer.Buffer -> Buffer.Buffer 33 | abstract update: data: string * ?input_encoding: string * ?output_encoding: string -> string 34 | abstract final: unit -> Buffer.Buffer 35 | abstract final: output_encoding: string -> string 36 | abstract setAutoPadding: auto_padding: bool -> unit 37 | 38 | type [] Decipher = 39 | abstract update: data: Buffer.Buffer -> Buffer.Buffer 40 | abstract update: data: string * ?input_encoding: string * ?output_encoding: string -> string 41 | abstract final: unit -> Buffer.Buffer 42 | abstract final: output_encoding: string -> string 43 | abstract setAutoPadding: auto_padding: bool -> unit 44 | 45 | type [] Signer = 46 | inherit Stream.Writable 47 | abstract update: data: obj -> unit 48 | abstract sign: private_key: string * output_format: string -> string 49 | 50 | type [] Verify = 51 | inherit Stream.Writable 52 | abstract update: data: obj -> unit 53 | abstract verify: ``object``: string * signature: string * ?signature_format: string -> bool 54 | 55 | type [] DiffieHellman = 56 | abstract generateKeys: ?encoding: string -> string 57 | abstract computeSecret: other_public_key: string * ?input_encoding: string * ?output_encoding: string -> string 58 | abstract getPrime: ?encoding: string -> string 59 | abstract getGenerator: encoding: string -> string 60 | abstract getPublicKey: ?encoding: string -> string 61 | abstract getPrivateKey: ?encoding: string -> string 62 | abstract setPublicKey: public_key: string * ?encoding: string -> unit 63 | abstract setPrivateKey: public_key: string * ?encoding: string -> unit 64 | 65 | type IExports = 66 | abstract createCredentials: details: CredentialDetails -> Credentials 67 | abstract createHash: algorithm: string -> Hash 68 | abstract createHmac: algorithm: string * key: string -> Hmac 69 | abstract createHmac: algorithm: string * key: Buffer.Buffer -> Hmac 70 | abstract createCipher: algorithm: string -> password: obj -> Cipher 71 | abstract createCipheriv: algorithm: string -> key: obj -> iv: obj -> Cipher 72 | abstract createDecipher: algorithm: string -> password: obj -> Decipher 73 | abstract createDecipheriv: algorithm: string -> key: obj -> iv: obj -> Decipher 74 | abstract createSign: algorithm: string -> Signer 75 | abstract createVerify: algorith: string -> Verify 76 | abstract createDiffieHellman: prime_length: float -> DiffieHellman 77 | abstract createDiffieHellman: prime: float * ?encoding: string -> DiffieHellman 78 | abstract getDiffieHellman: group_name: string -> DiffieHellman 79 | abstract pbkdf2: password: string * salt: string * iterations: float * keylen: float * callback: (Error -> Buffer.Buffer -> obj) -> unit 80 | abstract pbkdf2: password: string * salt: string * iterations: float * keylen: float * digest: string * callback: (Error -> Buffer.Buffer -> obj) -> unit 81 | abstract pbkdf2Sync: password: string * salt: string * iterations: float * keylen: float -> Buffer.Buffer 82 | abstract pbkdf2Sync: password: string * salt: string * iterations: float * keylen: float * digest: string -> Buffer.Buffer 83 | abstract randomBytes: size: float -> Buffer.Buffer 84 | abstract randomBytes: size: float * callback: (Error -> Buffer.Buffer -> unit) -> unit 85 | abstract pseudoRandomBytes: size: float -> Buffer.Buffer 86 | abstract pseudoRandomBytes: size: float * callback: (Error -> Buffer.Buffer -> unit) -> unit 87 | -------------------------------------------------------------------------------- /Node/Events.fs: -------------------------------------------------------------------------------- 1 | module rec Fable.Import.Node.Events 2 | 3 | open System 4 | open Fable.Import.JS 5 | open Fable.Core 6 | 7 | type [] EventEmitter = 8 | abstract defaultMaxListeners: float with get, set 9 | abstract addListener: ev: string * listener: Function -> EventEmitter 10 | abstract on: ev: string * listener: ('a -> unit) -> EventEmitter 11 | abstract on: ev: string * listener: ('a -> 'b -> unit) -> EventEmitter 12 | abstract once: ev: string * listener: ('a -> unit) -> EventEmitter 13 | abstract once: ev: string * listener: ('a -> 'b -> unit) -> EventEmitter 14 | abstract prependListener: ev: string * listener: Function -> EventEmitter 15 | abstract prependOnceListener: ev: string * listener: Function -> EventEmitter 16 | abstract removeListener: ev: string * listener: Function -> EventEmitter 17 | abstract removeAllListener: ev: string * listener: Function -> EventEmitter 18 | abstract setMaxListeners: n: int -> EventEmitter 19 | abstract getMaxListeners: unit -> int 20 | abstract listeners: ev: string -> ResizeArray 21 | abstract emit: ev: string * [] args: obj[] -> bool 22 | abstract eventNames: unit -> ResizeArray 23 | 24 | type [] EventEmitterStatic = 25 | [] abstract Create: unit -> EventEmitter 26 | 27 | type IExports = 28 | abstract defaultMaxListeners: float with get, set 29 | abstract EventEmitter: EventEmitterStatic with get, set -------------------------------------------------------------------------------- /Node/Exports.fs: -------------------------------------------------------------------------------- 1 | [] 2 | module Fable.Import.Node.Exports 3 | 4 | open Fable.Import.Node 5 | open Fable.Core 6 | 7 | [] 8 | let buffer: Buffer.IExports = jsNative 9 | 10 | [] 11 | let childProcess: ChildProcess.IExports = jsNative 12 | 13 | [] 14 | let events: Events.IExports = jsNative 15 | 16 | [] 17 | let fs: Fs.IExports = jsNative 18 | 19 | [] 20 | let net: Net.IExports = jsNative 21 | 22 | [] 23 | let crypto: Crypto.IExports = jsNative 24 | 25 | [] 26 | let tls: Tls.IExports = jsNative 27 | 28 | [] 29 | let http: Http.IExports = jsNative 30 | 31 | [] 32 | let https: Https.IExports = jsNative 33 | 34 | [] 35 | let os: OS.IExports = jsNative 36 | 37 | [] 38 | let querystring: Querystring.IExports = jsNative 39 | 40 | [] 41 | let stream: Stream.IExports = jsNative 42 | 43 | [] 44 | let url: Url.IExports = jsNative 45 | 46 | [] 47 | let path: Path.IExports = jsNative -------------------------------------------------------------------------------- /Node/Fable.Import.Node.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0.4.3 5 | 0.4.3 6 | netstandard2.0 7 | true 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Node/Globals.fs: -------------------------------------------------------------------------------- 1 | module rec Fable.Import.Node.Globals 2 | 3 | open Fable.Import.Node 4 | open Fable.Import.Node.Process 5 | open Fable.Import.Node.Base 6 | 7 | open Fable.Core 8 | 9 | 10 | let [] ``global``: NodeJS.Global = jsNative 11 | let [] __filename: string = jsNative 12 | let [] __dirname: string = jsNative 13 | let [] require: NodeJS.NodeRequire = jsNative 14 | let [] ``module``: NodeJS.NodeModule = jsNative 15 | 16 | let [] exports: obj = jsNative 17 | 18 | let [] undefined: obj = jsNative 19 | let [] SlowBuffer: Buffer.SlowBufferStatic = jsNative 20 | let [] Buffer: Buffer.BufferStatic = jsNative 21 | let [] ``process``:Process = jsNative -------------------------------------------------------------------------------- /Node/Http.fs: -------------------------------------------------------------------------------- 1 | module rec Fable.Import.Node.Http 2 | 3 | open System 4 | open Fable.Core 5 | open Fable.Import.Node 6 | open Fable.Import.JS 7 | 8 | 9 | type [] RequestOptions = 10 | abstract protocol: string option with get, set 11 | abstract host: string option with get, set 12 | abstract hostname: string option with get, set 13 | abstract family: int option with get, set 14 | abstract port: int option with get, set 15 | abstract localAddress: string option with get, set 16 | abstract socketPath: string option with get, set 17 | abstract ``method``: Methods option with get, set 18 | abstract path: string option with get, set 19 | abstract headers: obj option with get, set 20 | abstract auth: string option with get, set 21 | abstract agent: U2 option with get, set 22 | 23 | type [] Server = 24 | inherit Net.Server 25 | abstract maxHeadersCount: int with get, set 26 | abstract timeout: int with get, set 27 | abstract listening: bool with get, set 28 | abstract setTimeout: msecs: int * callback: (unit -> unit) -> unit 29 | 30 | type [] ServerRequest = 31 | inherit IncomingMessage 32 | abstract connection: Net.Socket with get, set 33 | 34 | type [] ServerResponse = 35 | inherit Stream.Writable 36 | abstract statusCode: int with get, set 37 | abstract statusMessage: string with get, set 38 | abstract headersSent: bool with get, set 39 | abstract sendDate: bool with get, set 40 | abstract finished: bool with get, set 41 | abstract write: buffer: Buffer.Buffer -> bool 42 | abstract write: buffer: Buffer.Buffer * ?cb: Function -> bool 43 | abstract write: str: string * ?cb: Function -> bool 44 | abstract write: str: string * ?encoding: string * ?cb: Function -> bool 45 | abstract write: str: string * ?encoding: string * ?fd: string -> bool 46 | abstract writeContinue: unit -> unit 47 | abstract writeHead: statusCode: int -> unit 48 | abstract writeHead: statusCode: int * reasonPhrase: string * ?headers: obj -> unit 49 | abstract writeHead: statusCode: int * headers: obj -> unit 50 | abstract setHeader: name: string * value: U2> -> unit 51 | abstract setTimeout: msecs: int * callback: Function -> ServerResponse 52 | abstract getHeader: name: string -> string 53 | abstract removeHeader: name: string -> unit 54 | abstract write: chunk: obj * ?encoding: string -> obj 55 | abstract addTrailers: headers: obj -> unit 56 | abstract ``end``: unit -> unit 57 | abstract ``end``: buffer: Buffer.Buffer * ?cb: Function -> unit 58 | abstract ``end``: str: string * ?cb: Function -> unit 59 | abstract ``end``: str: string * encoding: string * ?cb: Function -> unit 60 | 61 | type [] ClientRequest<'a> = 62 | inherit Stream.Writable<'a> 63 | abstract abort: unit -> unit 64 | abstract setTimeout: timeout: int * ?callback: Function -> unit 65 | abstract setNoDelay: ?noDelay: bool -> unit 66 | abstract setSocketKeepAlive: ?enable: bool * ?initialDelay: int -> unit 67 | abstract setHeader: name: string * value: string -> unit 68 | abstract setHeader: name: string * value: ResizeArray -> unit 69 | abstract getHeader: name: string -> string 70 | abstract removeHeader: name: string -> unit 71 | abstract addTrailers: headers: obj -> unit 72 | 73 | type [] IncomingMessage = 74 | inherit Stream.Readable 75 | abstract httpVersion: string with get, set 76 | abstract httpVersionMajor: int with get, set 77 | abstract httpVersionMinor: int with get, set 78 | abstract connection: Net.Socket with get, set 79 | abstract headers: obj with get, set 80 | abstract rawHeaders: ResizeArray with get, set 81 | abstract trailers: obj with get, set 82 | abstract rawTrailers: obj with get, set 83 | abstract ``method``: string option with get, set 84 | abstract url: string option with get, set 85 | abstract statusCode: int option with get, set 86 | abstract statusMessage: string option with get, set 87 | abstract socket: Net.Socket with get, set 88 | abstract setTimeout: msecs: int * callback: (unit -> unit) -> Base.NodeJS.Timer 89 | abstract destroy: ?error: Error -> unit 90 | 91 | type [] ClientResponse = 92 | inherit IncomingMessage 93 | 94 | type [] AgentOptions = 95 | abstract keepAlive: bool option with get, set 96 | abstract keepAliveMsecs: int option with get, set 97 | abstract maxSockets: int option with get, set 98 | abstract maxFreeSockets: int option with get, set 99 | 100 | type [] Agent = 101 | abstract maxSockets: int with get, set 102 | abstract sockets: obj with get, set 103 | abstract requests: obj with get, set 104 | abstract destroy: unit -> unit 105 | 106 | type [] AgentStatic = 107 | [] abstract Create<'a> : ?opts:AgentOptions -> Agent 108 | 109 | 110 | type [] STATUS_CODESType = 111 | [] abstract Item: errorCode: int -> string with get, set 112 | [] abstract Item: errorCode: string -> string with get, set 113 | 114 | type [] Methods = 115 | | [] Acl | [] Bind | [] Checkout | [] Connect | [] Copy | [] Delete | [] Get | [] Head | [] Link | [] Lock | [] ``M-search`` | [] Merge | [] Mkactivity | [] Mkcalendar | [] Mkcol | [] Move | [] Notify | [] Options | [] Patch | [] Post | [] Propfind | [] Proppatch | [] Purge | [] Put | [] Rebind | [] Report | [] Search | [] Subscribe | [] Trace | [] Unbind | [] Unlink | [] Unlock | [] Unsubscribe 116 | 117 | type IExports = 118 | abstract Agent: AgentStatic with get, set 119 | abstract METHODS: Methods with get, set 120 | abstract STATUS_CODES: STATUS_CODESType with get, set 121 | abstract globalAgent: Agent with get, set 122 | abstract createServer: ?requestListener: (IncomingMessage -> ServerResponse -> unit) -> Server 123 | abstract createClient: ?port: int * ?host: string -> obj 124 | abstract request: options: RequestOptions * ?callback: (IncomingMessage -> unit) -> ClientRequest<_> 125 | abstract get: options: RequestOptions * ?callback: (IncomingMessage -> unit) -> ClientRequest<_> 126 | abstract get: options: string * ?callback: (IncomingMessage -> unit) -> ClientRequest<_> 127 | -------------------------------------------------------------------------------- /Node/Https.fs: -------------------------------------------------------------------------------- 1 | module rec Fable.Import.Node.Https 2 | 3 | open Fable.Core 4 | open Fable.Import.JS 5 | open Fable.Import.Node 6 | 7 | type [] ServerOptions = 8 | abstract pfx: obj option with get, set 9 | abstract key: obj option with get, set 10 | abstract passphrase: string option with get, set 11 | abstract cert: obj option with get, set 12 | abstract ca: obj option with get, set 13 | abstract crl: obj option with get, set 14 | abstract ciphers: string option with get, set 15 | abstract honorCipherOrder: bool option with get, set 16 | abstract requestCert: bool option with get, set 17 | abstract rejectUnauthorized: bool option with get, set 18 | abstract NPNProtocols: obj option with get, set 19 | abstract SNICallback: (string -> (Error -> Tls.SecureContext -> obj) -> obj) option with get, set 20 | 21 | type [] RequestOptions = 22 | inherit Http.RequestOptions 23 | /// Optional PFX or PKCS12 encoded private key and certificate chain. 24 | /// pfx is an alternative to providing key and cert individually. 25 | /// PFX is usually encrypted, if it is, passphrase will be used to decrypt it. 26 | /// Multiple PFX can be provided either as an array of unencrypted PFX buffers, or an array of objects in the form {buf: [, passphrase: ]}. 27 | /// The object form can only occur in an array. 28 | /// object.passphrase is optional. 29 | /// Encrypted PFX will be decrypted with object.passphrase if provided, or options.passphrase if it is not. 30 | abstract pfx: obj option with get, set 31 | /// Optional private keys in PEM format. PEM allows the option of private keys being encrypted. 32 | /// Encrypted keys will be decrypted with options.passphrase. 33 | /// Multiple keys using different algorithms can be provided either as an array of unencrypted key strings or buffers, or an array of objects in the form {pem: [, passphrase: ]}. 34 | /// The object form can only occur in an array. object.passphrase is optional. 35 | /// Encrypted keys will be decrypted with object.passphrase if provided, or options.passphrase if it is not. 36 | abstract key: obj option with get, set 37 | /// Optional shared passphrase used for a single private key and/or a PFX. 38 | abstract passphrase: string option with get, set 39 | /// Optional cert chains in PEM format. 40 | /// One cert chain should be provided per private key. 41 | /// Each cert chain should consist of the PEM formatted certificate for a provided private key, 42 | /// followed by the PEM formatted intermediate certificates (if any), in order, and not including the root CA 43 | /// (the root CA must be pre-known to the peer, see ca). 44 | /// When providing multiple cert chains, they do not have to be in the same order as their private keys in key. 45 | /// If the intermediate certificates are not provided, the peer will not be able to validate the certificate, and the handshake will fail. 46 | abstract cert: obj option with get, set 47 | /// Optionally override the trusted CA certificates. 48 | /// Default is to trust the well-known CAs curated by Mozilla. 49 | /// Mozilla's CAs are completely replaced when CAs are explicitly specified using this option. 50 | /// The value can be a string or Buffer, or an Array of strings and/or Buffers. 51 | /// Any string or Buffer can contain multiple PEM CAs concatenated together. 52 | /// The peer's certificate must be chainable to a CA trusted by the server for the connection to be authenticated. 53 | /// When using certificates that are not chainable to a well-known CA, 54 | /// the certificate's CA must be explicitly specified as a trusted or the connection will fail to authenticate. 55 | /// If the peer uses a certificate that doesn't match or chain to one of the default CAs, 56 | /// use the ca option to provide a CA certificate that the peer's certificate can match or chain to. 57 | /// For self-signed certificates, the certificate is its own CA, and must be provided. 58 | abstract ca: obj option with get, set 59 | /// Optional cipher suite specification, replacing the default 60 | abstract ciphers: string option with get, set 61 | /// If not false, the server certificate is verified against the list of supplied CAs. 62 | /// An 'error' event is emitted if verification fails; err.code contains the OpenSSL error code. Default: true. 63 | abstract rejectUnauthorized: bool option with get, set 64 | /// Optional SSL method to use. The possible values are listed as SSL_METHODS, use the function names as strings. 65 | /// For example, 'TLSv1_2_method' to force TLS version 1.2. Default: 'TLS_method'. 66 | abstract secureProtocol: string option with get, set 67 | 68 | type [] Agent = 69 | abstract maxSockets: float with get, set 70 | abstract sockets: obj with get, set 71 | abstract requests: obj with get, set 72 | abstract destroy: unit -> unit 73 | 74 | type [] AgentOptions = 75 | inherit Http.AgentOptions 76 | abstract pfx: obj option with get, set 77 | abstract key: obj option with get, set 78 | abstract passphrase: string option with get, set 79 | abstract cert: obj option with get, set 80 | abstract ca: obj option with get, set 81 | abstract ciphers: string option with get, set 82 | abstract rejectUnauthorized: bool option with get, set 83 | abstract secureProtocol: string option with get, set 84 | abstract maxCachedSessions: float option with get, set 85 | 86 | type [] AgentStatic = 87 | [] abstract Create: ?options: AgentOptions -> Agent 88 | 89 | type [] Server = 90 | inherit Tls.Server 91 | 92 | type IExports = 93 | abstract Agent: AgentStatic with get, set 94 | abstract globalAgent: Agent with get, set 95 | abstract createServer: options: ServerOptions * ?requestListener: (Http.IncomingMessage -> Http.ServerResponse -> unit) -> Server 96 | abstract request: options: RequestOptions * ?callback: (Http.IncomingMessage -> unit) -> Http.ClientRequest<_> 97 | abstract get: options: RequestOptions * ?callback: (Http.IncomingMessage -> unit) -> Http.ClientRequest<_> -------------------------------------------------------------------------------- /Node/Meta.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | Fable bindings for Node.js 4 | https://github.com/fable-compiler/fable-import 5 | https://raw.githubusercontent.com/fable-compiler/fable-import/master/LICENSE 6 | https://github.com/fable-compiler/fable-import.git 7 | node;fsharp;fable 8 | Joe Grund 9 | 10 | 11 | -------------------------------------------------------------------------------- /Node/Net.fs: -------------------------------------------------------------------------------- 1 | module Fable.Import.Node.Net 2 | 3 | open Fable.Core 4 | open Fable.Import.JS 5 | open Fable.Import.Node 6 | 7 | type [] Socket = 8 | inherit Stream.Readable 9 | inherit Stream.Writable 10 | abstract bufferSize: float with get, set 11 | abstract remoteAddress: string with get, set 12 | abstract remoteFamily: string with get, set 13 | abstract remotePort: int with get, set 14 | abstract localAddress: string with get, set 15 | abstract localPort: int with get, set 16 | abstract bytesRead: float with get, set 17 | abstract bytesWritten: float with get, set 18 | abstract connect: port: int * ?host: string * ?connectionListener:(Socket -> unit) -> unit 19 | abstract connect: path: string * ?connectionListener:(Socket -> unit) -> unit 20 | abstract setEncoding: ?encoding: string -> unit 21 | abstract destroy: unit -> unit 22 | abstract destroyed: bool 23 | abstract setTimeout: timeout: float * ?callback: Function -> unit 24 | abstract setNoDelay: ?noDelay: bool -> unit 25 | abstract setKeepAlive: ?enable: bool * ?initialDelay: float -> unit 26 | abstract address: unit -> obj 27 | abstract unref: unit -> unit 28 | abstract ref: unit -> unit 29 | 30 | type [] SocketStatic = 31 | [] abstract Create: unit -> Socket 32 | 33 | type [] Fd = 34 | abstract fd: int with get, set 35 | 36 | type [] Server = 37 | inherit Socket 38 | abstract maxConnections: float with get, set 39 | abstract connections: float with get, set 40 | abstract listen: port: int * ?host: string * ?backlog: float * ?listeningListener:(unit -> unit) -> Server 41 | abstract listen: path: string * ?listeningListener:(unit -> unit) -> Server 42 | abstract listen: handle: Fd * ?listeningListener:(unit -> unit) -> Server 43 | abstract listen: handle: obj * ?listeningListener:(unit -> unit) -> Server 44 | abstract close: ?callback: (Error option -> unit) -> Server 45 | abstract address: unit -> obj 46 | 47 | type [] ServerStatic = 48 | [] abstract Create: unit -> Server 49 | 50 | type [] CreateServerOptions = 51 | abstract allowHalfOpen: bool option with get, set 52 | abstract pauseOnConnect: bool option with get, set 53 | 54 | type [] ConnectOptions = 55 | /// port Port the socket should connect to. 56 | abstract port: int option with get, set 57 | /// host Host the socket should connect to. Default: 'localhost' 58 | abstract host: string option with get, set 59 | /// localAddress Local address the socket should connect from. 60 | abstract localAddress: string option with get, set 61 | /// localPort Local port the socket should connect from. 62 | abstract localPort: int option with get, set 63 | /// family Version of IP stack, can be either 4 or 6. Default: 4 64 | abstract family: int option with get, set 65 | // hints Optional dns.lookup() hints. 66 | abstract hints: int option with get, set 67 | // lookup Custom lookup function. Default: dns.lookup() 68 | abstract lookup: (string -> obj -> (Error option -> string option -> int option -> unit)) option with get, set 69 | /// path Path the client should connect to. If provided, the TCP-specific options above are ignored. 70 | abstract path: string option with get, set 71 | 72 | 73 | type IExports = 74 | abstract Socket: SocketStatic with get, set 75 | abstract createServer: ?connectionListener:(Socket -> unit) -> Server 76 | abstract createServer: ?options: CreateServerOptions * ?connectionListener:(Socket -> unit) -> Server 77 | abstract connect: options: ConnectOptions * ?connectionListener:(Socket -> unit) -> Socket 78 | abstract connect: port: int * ?host: string * ?connectionListener:(Socket -> unit) -> Socket 79 | abstract connect: path: string * ?connectionListener:(Socket -> unit) -> Socket 80 | abstract createConnection: options: ConnectOptions * ?connectionListener:(Socket -> unit) -> Socket 81 | abstract createConnection: port: int * ?host: string * ?connectionListener:(Socket -> unit) -> Socket 82 | abstract createConnection: path: string * ?connectionListener:(Socket -> unit) -> Socket 83 | abstract isIP: input: string -> float 84 | abstract isIPv4: input: string -> bool 85 | abstract isIPv6: input: string -> bool 86 | -------------------------------------------------------------------------------- /Node/OS.fs: -------------------------------------------------------------------------------- 1 | module rec Fable.Import.Node.OS 2 | 3 | open Fable.Core 4 | open Fable.Import.Node.Base 5 | 6 | type [] CpuTimes = 7 | abstract user: float with get, set 8 | abstract nice: float with get, set 9 | abstract sys: float with get, set 10 | abstract idle: float with get, set 11 | abstract irq: float with get, set 12 | 13 | type [] CpuInfo = 14 | abstract model: string with get, set 15 | abstract speed: float with get, set 16 | abstract times: CpuTimes with get, set 17 | 18 | type [] NetworkInterfaceInfo = 19 | abstract address: string with get, set 20 | abstract netmask: string with get, set 21 | abstract family: string with get, set 22 | abstract mac: string with get, set 23 | abstract ``internal``: bool with get, set 24 | 25 | type [] Constants = 26 | abstract UV_UDP_REUSEADDR: float with get, set 27 | abstract signals: obj with get, set 28 | abstract errno: obj with get, set 29 | 30 | type [] Endianness = 31 | | [] Be | [] Le 32 | 33 | type [] UserInfoOptions = 34 | abstract encoding: string option with get, set 35 | 36 | type [] UserInfo = 37 | abstract username: string with get, set 38 | abstract uid: float with get, set 39 | abstract gid: float with get, set 40 | abstract shell: string with get, set 41 | abstract homedir: string with get, set 42 | 43 | type IExports = 44 | /// A string constant defining the operating system-specific end-of-line marker: 45 | /// - \n on POSIX 46 | /// - \r\n on Windows 47 | abstract EOL: string with get, set 48 | /// The os.arch() method returns a string identifying the operating system CPU architecture for which the Node.js binary was compiled. 49 | abstract arch: unit -> NodeJS.Arch 50 | /// Returns an object containing commonly used operating system specific constants for error codes, process signals, and so on. 51 | abstract constants: Constants with get, set 52 | /// The os.cpus() method returns an array of objects containing information about each CPU/core installed. 53 | abstract cpus: unit -> ResizeArray 54 | /// The os.endianness() method returns a string identifying the endianness of the CPU for which the Node.js binary was compiled. 55 | /// Possible values are: 56 | /// - 'BE' for big endian 57 | /// - 'LE' for little endian. 58 | abstract endianness: unit -> Endianness 59 | /// The os.freemem() method returns the amount of free system memory in bytes as an integer. 60 | abstract freemem: unit -> float 61 | /// The os.homedir() method returns the home directory of the current user as a string. 62 | abstract homedir: unit -> string 63 | /// The os.hostname() method returns the hostname of the operating system as a string. 64 | abstract hostname: unit -> string 65 | /// The os.loadavg() method returns an array containing the 1, 5, and 15 minute load averages. 66 | /// The load average is a measure of system activity, calculated by the operating system and expressed as a fractional number. As a rule of thumb, the load average should ideally be less than the number of logical CPUs in the system. 67 | /// The load average is a UNIX-specific concept with no real equivalent on Windows platforms. On Windows, the return value is always [0, 0, 0]. 68 | abstract loadavg: unit -> (float * float * float) 69 | /// The os.networkInterfaces() method returns an object containing only network interfaces that have been assigned a network address. 70 | /// Each key on the returned object identifies a network interface. The associated value is an array of objects that each describe an assigned network address. 71 | abstract networkInterfaces: unit -> obj 72 | /// The os.platform() method returns a string identifying the operating system platform as set during compile time of Node.js. 73 | abstract platform: unit -> NodeJS.Platform 74 | /// The os.release() method returns a string identifying the operating system release. 75 | /// Note: On POSIX systems, the operating system release is determined by calling uname(3). On Windows, GetVersionExW() is used. Please see https://en.wikipedia.org/wiki/Uname#Examples for more information. 76 | abstract release: unit -> string 77 | /// The os.tmpdir() method returns a string specifying the operating system's default directory for temporary files. 78 | abstract tmpdir: unit -> string 79 | /// The os.totalmem() method returns the total amount of system memory in bytes as an integer. 80 | abstract totalmem: unit -> float 81 | /// The os.type() method returns a string identifying the operating system name as returned by uname(3). For example 'Linux' on Linux, 'Darwin' on macOS and 'Windows_NT' on Windows. 82 | /// Please see https://en.wikipedia.org/wiki/Uname#Examples for additional information about the output of running uname(3) on various operating systems. 83 | abstract ``type``: unit -> string 84 | /// The os.uptime() method returns the system uptime in number of seconds. 85 | /// Note: On Windows the returned value includes fractions of a second. 86 | abstract uptime: unit -> float 87 | /// The os.userInfo() method returns information about the currently effective user -- on POSIX platforms, this is typically a subset of the password file. The returned object includes the username, uid, gid, shell, and homedir. On Windows, the uid and gid fields are -1, and shell is null. 88 | abstract userInfo: ?options: UserInfoOptions -> UserInfo 89 | -------------------------------------------------------------------------------- /Node/Path.fs: -------------------------------------------------------------------------------- 1 | module rec Fable.Import.Node.Path 2 | 3 | open System 4 | open Fable.Core 5 | 6 | type PathObjectProps = 7 | abstract dir : string with get, set 8 | abstract root : string with get, set 9 | [] // using this because back ticks are way too ugly to read in code 10 | abstract baseName : string with get, set 11 | abstract name : string with get, set 12 | abstract ext : string with get, set 13 | 14 | type IExports = 15 | /// Returns the last portion of 'path' argument. Similar to the "basename" command in UNIX.Trailing directory separators are ignored 16 | abstract basename : path:string -> string 17 | /// Returns the last portion of 'path' argument. Similar to the "basename" command in UNIX.Trailing directory separators are ignored 18 | abstract basename : path:string * ext:string -> string 19 | /// Provides the platform-specific path delimiter. ";" for Windows. ":" 20 | abstract delimiter : string 21 | /// Returns the directory name of a 'path' 22 | abstract dirname : path:string -> string 23 | /// The path.extname() method returns the extension of the path, from the last occurrence of the . (period) character to end of string in the last portion of the path. If there is no . in the last portion of the path, or if the first character of the basename of path is ., then an empty string is returned. 24 | abstract extname : path:string -> string 25 | /// Returns a path string from an object, this is the oppisite of path.parse 26 | abstract format : PathObjectProps -> string 27 | /// Determines if path is an absolute path. 28 | abstract isAbsolute : path:string -> bool 29 | /// Joins all given path segments together using the platform specific separator as a delimiter, then normalizes the resulting path. Zero-length path segments are ignored. If the joined path string is a zero-length string then '.' will be returned, representing the current working directory. 30 | abstract join : [] paths : string [] -> string 31 | /// Normalizes the given path, resolving '..' and '.' segments. 32 | abstract normalize : string -> string 33 | /// Returns an object whose properties represent significant elements of the path. Trailing directory separators are ignored. 34 | abstract parse : string -> PathObjectProps 35 | /// returns the relative path from from to to. If from and to each resolve to the same path (after calling path.resolve() on each), a zero-length string is returned. 36 | abstract relative : string * string -> string 37 | /// resolves a sequence of paths or path segments into an absolute path. 38 | abstract resolve : [] paths : string [] -> string 39 | /// Provides the platform-specific path segment separator. "\" On Windows, "/" on POSIX 40 | abstract sep : string 41 | /// Provides access to Windows-specific implementations of the path methods. 42 | abstract win32 : obj 43 | /// Provides access to POSIX specific implementations of the path methods. 44 | abstract posix : obj -------------------------------------------------------------------------------- /Node/Process.fs: -------------------------------------------------------------------------------- 1 | module rec Fable.Import.Node.Process 2 | 3 | open System 4 | open Fable.Core 5 | open Fable.Import.Node 6 | open Fable.Import.Node.Base 7 | open Fable.Import.JS 8 | 9 | type [] Process = 10 | inherit Events.EventEmitter 11 | abstract stdout: Stream.Writable with get, set 12 | abstract stderr: Stream.Writable with get, set 13 | abstract stdin: Stream.Readable with get, set 14 | abstract argv: ResizeArray with get, set 15 | abstract argv0: string with get, set 16 | abstract execArgv: ResizeArray with get, set 17 | abstract execPath: string with get, set 18 | abstract env: obj with get, set 19 | abstract exitCode: float with get, set 20 | abstract version: string with get, set 21 | abstract config: obj with get, set 22 | abstract pid: float with get, set 23 | abstract title: string with get, set 24 | abstract arch: NodeJS.Arch with get, set 25 | abstract platform: NodeJS.Platform with get, set 26 | abstract connected: bool with get, set 27 | abstract abort: unit -> unit 28 | abstract chdir: directory: string -> unit 29 | abstract cwd: unit -> string 30 | abstract exit: ?code: int -> unit 31 | abstract getgid: unit -> float 32 | abstract setgid: id: float -> unit 33 | abstract setgid: id: string -> unit 34 | /// The process.getuid() method returns the numeric user identity of the process. (See getuid(2).) 35 | abstract getuid: unit -> int 36 | /// The process.geteuid() method returns the numerical effective user identity of the process. (See geteuid(2).) 37 | abstract geteuid: unit -> int 38 | abstract setuid: id: float -> unit 39 | abstract setuid: id: string -> unit 40 | abstract kill: pid: float * ?signal: U2 -> unit 41 | abstract nextTick: callback: Function * [] args: obj[] -> unit 42 | abstract umask: ?mask: float -> float 43 | abstract uptime: unit -> float 44 | abstract hrtime: ?time: float * float -> float * float 45 | abstract send: message: obj * ?sendHandle: obj -> unit 46 | abstract disconnect: unit -> unit -------------------------------------------------------------------------------- /Node/Querystring.fs: -------------------------------------------------------------------------------- 1 | module rec Fable.Import.Node.Querystring 2 | 3 | open Fable.Core 4 | 5 | type [] StringifyOptions = 6 | abstract encodeURIComponent: (string -> string) option with get, set 7 | 8 | type [] ParseOptions = 9 | abstract maxKeys: float option with get, set 10 | abstract decodeURIComponent: (string -> string) option with get, set 11 | 12 | type IExports = 13 | abstract stringify: obj: 'T * ?sep: string * ?eq: string * ?options: StringifyOptions -> string 14 | abstract parse: str: string * ?sep: string * ?eq: string * ?options: ParseOptions -> 'T 15 | abstract escape: str: string -> string 16 | abstract unescape: str: string -> string -------------------------------------------------------------------------------- /Node/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 0.4.3 2 | 3 | * Update ClientRequest @jgrund 4 | 5 | ### 0.4.2 6 | 7 | * Add `ConnectOptions` to `net` @jgrund 8 | * Fix broken module casing in `Node.fsproj` @jgrund 9 | 10 | ### 0.4.1 11 | 12 | * Remove Func from connection listeners @tanabarr 13 | * Make http / net ports int instead of float @tanabarr 14 | 15 | ### 0.4.0 16 | 17 | * Use lower case for export let bindings 18 | * Generate documentation 19 | 20 | ### 0.3.2 21 | 22 | * ChildProcess callback should take curried args (PR #37 @johnsonw) 23 | * PassThrough stream should take options (PR #38 @jgrund) 24 | 25 | ### 0.3.1 26 | 27 | * Node Import Fixups (PR #35 @jgrund) 28 | 29 | ### 0.3.0 30 | 31 | * Update Streams (PR #34 @jgrund) 32 | 33 | ### 0.2.1 34 | 35 | * Change childprocess callback to use tupled args (#32 @jgrund) 36 | 37 | ### 0.1.5 38 | 39 | * Add OS module 40 | 41 | ### 0.1.4 42 | 43 | * Fix `Fs.mkDirSync` overloads 44 | 45 | ### 0.1.2 46 | 47 | * Turn concrete types into interfaces 48 | 49 | ### 0.1.1 50 | 51 | * Add 'cwd' and 'timeout' to ChildProcess.ExecOptions. #11 52 | 53 | ### 0.1.0 54 | 55 | * First push 56 | -------------------------------------------------------------------------------- /Node/Tls.fs: -------------------------------------------------------------------------------- 1 | module rec Fable.Import.Node.Tls 2 | 3 | open Fable.Import.Node 4 | open Fable.Import.JS 5 | 6 | 7 | type [] TlsOptions = 8 | abstract pfx: obj option with get, set 9 | abstract key: obj option with get, set 10 | abstract passphrase: string option with get, set 11 | abstract cert: obj option with get, set 12 | abstract ca: obj option with get, set 13 | abstract crl: obj option with get, set 14 | abstract ciphers: string option with get, set 15 | abstract honorCipherOrder: obj option with get, set 16 | abstract requestCert: bool option with get, set 17 | abstract rejectUnauthorized: bool option with get, set 18 | abstract NPNProtocols: obj option with get, set 19 | abstract SNICallback: (string -> obj) option with get, set 20 | 21 | type [] ConnectionOptions = 22 | abstract host: string option with get, set 23 | abstract port: float option with get, set 24 | abstract socket: Net.Socket option with get, set 25 | abstract pfx: obj option with get, set 26 | abstract key: obj option with get, set 27 | abstract passphrase: string option with get, set 28 | abstract cert: obj option with get, set 29 | abstract ca: obj option with get, set 30 | abstract rejectUnauthorized: bool option with get, set 31 | abstract NPNProtocols: obj option with get, set 32 | abstract servername: string option with get, set 33 | 34 | type [] Server = 35 | inherit Net.Server 36 | abstract maxConnections: float with get, set 37 | abstract connections: float with get, set 38 | abstract listen: port: float * ?host: string * ?backlog: float * ?listeningListener: Function -> Server 39 | abstract listen: path: string * ?listeningListener: Function -> Server 40 | abstract listen: handle: obj * ?listeningListener: Function -> Server 41 | abstract listen: port: float * ?host: string * ?callback: Function -> Server 42 | abstract close: unit -> Server 43 | abstract address: unit -> obj 44 | abstract addContext: hostName: string * credentials: obj -> unit 45 | 46 | type [] ClearTextStream = 47 | abstract writable: bool with get, set 48 | abstract _write: chunk: obj * encoding: string * callback: Function -> unit 49 | abstract write: chunk: obj * ?cb: Function -> bool 50 | abstract write: chunk: obj * ?encoding: string * ?cb: Function -> bool 51 | abstract ``end``: unit -> unit 52 | abstract ``end``: chunk: obj * ?cb: Function -> unit 53 | abstract ``end``: chunk: obj * ?encoding: string * ?cb: Function -> unit 54 | abstract authorized: bool with get, set 55 | abstract authorizationError: Error with get, set 56 | abstract getCipher: obj with get, set 57 | abstract address: obj with get, set 58 | abstract remoteAddress: string with get, set 59 | abstract remotePort: float with get, set 60 | abstract getPeerCertificate: unit -> obj 61 | 62 | type [] SecurePair = 63 | abstract encrypted: obj with get, set 64 | abstract cleartext: obj with get, set 65 | 66 | type [] SecureContextOptions = 67 | abstract pfx: obj option with get, set 68 | abstract key: obj option with get, set 69 | abstract passphrase: string option with get, set 70 | abstract cert: obj option with get, set 71 | abstract ca: obj option with get, set 72 | abstract crl: obj option with get, set 73 | abstract ciphers: string option with get, set 74 | abstract honorCipherOrder: bool option with get, set 75 | 76 | type [] SecureContext = 77 | abstract context: obj with get, set 78 | 79 | type IExports = 80 | abstract CLIENT_RENEG_LIMIT: float with get, set 81 | abstract CLIENT_RENEG_WINDOW: float with get, set 82 | abstract createServer: options: TlsOptions * ?secureConnectionListener: (ClearTextStream -> unit) -> Server 83 | abstract connect: options: TlsOptions * ?secureConnectionListener: (unit -> unit) -> ClearTextStream 84 | abstract connect: port: float * ?host: string * ?options: ConnectionOptions * ?secureConnectListener: (unit -> unit) -> ClearTextStream 85 | abstract connect: port: float * ?options: ConnectionOptions * ?secureConnectListener: (unit -> unit) -> ClearTextStream 86 | abstract createSecurePair: ?credentials: Crypto.Credentials * ?isServer: bool * ?requestCert: bool * ?rejectUnauthorized: bool -> SecurePair 87 | abstract createSecureContext: details: SecureContextOptions -> SecureContext 88 | -------------------------------------------------------------------------------- /Node/Url.fs: -------------------------------------------------------------------------------- 1 | module rec Fable.Import.Node.Url 2 | 3 | open Fable.Core 4 | 5 | type [] Url<'a> = 6 | abstract href: string option with get, set 7 | abstract protocol: string option with get, set 8 | abstract auth: string option with get, set 9 | abstract hostname: string option with get, set 10 | abstract port: string option with get, set 11 | abstract host: string option with get, set 12 | abstract pathname: string option with get, set 13 | abstract search: string option with get, set 14 | abstract query: 'a option with get, set 15 | abstract slashes: bool option with get, set 16 | abstract hash: string option with get, set 17 | abstract path: string option with get, set 18 | 19 | type IExports = 20 | abstract parse: urlStr: string -> Url 21 | abstract parse: urlStr: string * ?parseQueryString: bool -> Url 22 | abstract parse: urlStr: string * ?parseQueryString: bool * ?slashesDenoteHost: bool -> Url> 23 | abstract format: url: Url -> string 24 | abstract format: url: Url -> string 25 | abstract resolve: from: string * ``to``: string -> string -------------------------------------------------------------------------------- /Node/paket.references: -------------------------------------------------------------------------------- 1 | FSharp.Core 2 | Fable.Core -------------------------------------------------------------------------------- /Pg/Fable.Import.Pg.fs: -------------------------------------------------------------------------------- 1 | module rec Fable.Import.Pg 2 | open System 3 | open System.Text.RegularExpressions 4 | open Fable.Core 5 | open Fable.Import.JS 6 | open Fable.Import.Node 7 | open System.Collections.Generic 8 | 9 | type [] ConnectionConfig = 10 | abstract user: string option with get, set 11 | abstract database: string option with get, set 12 | abstract password: string option with get, set 13 | abstract port: float option with get, set 14 | abstract host: string option with get, set 15 | 16 | type [] Defaults = 17 | inherit ConnectionConfig 18 | abstract poolSize: float option with get, set 19 | abstract poolIdleTimeout: float option with get, set 20 | abstract reapIntervalMillis: float option with get, set 21 | abstract binary: bool option with get, set 22 | abstract parseInt8: bool option with get, set 23 | 24 | type [] ClientConfig = 25 | inherit ConnectionConfig 26 | abstract ssl: bool option with get, set 27 | 28 | type [] PoolConfig = 29 | inherit ClientConfig 30 | abstract max: float option with get, set 31 | abstract min: float option with get, set 32 | abstract refreshIdle: bool option with get, set 33 | abstract idleTimeoutMillis: float option with get, set 34 | abstract reapIntervalMillis: float option with get, set 35 | abstract returnToHead: bool option with get, set 36 | abstract application_name: string option with get, set 37 | 38 | type [] QueryConfig = 39 | abstract name: string option with get, set 40 | abstract text: string with get, set 41 | abstract values: ResizeArray option with get, set 42 | 43 | type [] QueryResult = 44 | abstract command: string with get, set 45 | abstract rowCount: float with get, set 46 | abstract oid: float with get, set 47 | abstract rows: 'a array with get, set 48 | 49 | type [] ResultBuilder = 50 | inherit QueryResult 51 | abstract addRow: row: obj -> unit 52 | 53 | type [] Pool = 54 | inherit Events.EventEmitter 55 | abstract connect: unit -> Promise 56 | abstract connect: (Error -> Client -> (unit -> unit) -> unit) -> unit 57 | abstract ``end``: unit -> Promise 58 | abstract query: QueryConfig -> Promise 59 | abstract query: string -> Promise 60 | abstract query: obj -> Stream.Readable 61 | abstract query: string * obj list -> Promise 62 | abstract query: string * (Error -> QueryResult -> unit) -> Query 63 | abstract query: QueryConfig * (Error -> QueryResult -> unit) -> Query 64 | abstract query: string * obj list * (Error -> QueryResult -> unit) -> Query 65 | 66 | 67 | type [] PoolStatic = 68 | [] abstract Create: PoolConfig -> Pool 69 | [] abstract Create: unit -> Pool 70 | 71 | type [] Client = 72 | inherit Events.EventEmitter 73 | abstract connect: ?callback: (Error -> unit) -> unit 74 | abstract ``end``: ?callback: (Error -> unit) -> unit 75 | abstract release: ?err: Error -> unit 76 | abstract query: queryStream: obj -> Stream.Readable 77 | abstract query: string -> Promise 78 | abstract query: QueryConfig -> Promise 79 | abstract query: string * ResizeArray -> Promise 80 | abstract query: string * ResizeArray * (Error -> QueryResult -> unit) -> Query 81 | abstract query: string * (Error -> QueryResult -> unit) -> Query 82 | abstract query: QueryConfig * (Error -> QueryResult -> unit) -> Query 83 | abstract copyFrom: queryText: string -> Stream.Writable 84 | abstract copyTo: queryText: string -> Stream.Readable 85 | abstract pauseDrain: unit -> unit 86 | abstract resumeDrain: unit -> unit 87 | 88 | type [] ClientStatic = 89 | [] abstract Create: ClientConfig -> Client 90 | 91 | type [] Query = 92 | inherit Events.EventEmitter 93 | abstract on:(string * (obj -> ResultBuilder -> unit)) -> Query 94 | abstract on:(string * (Error -> unit)) -> Query 95 | abstract on:(string * (ResultBuilder -> unit)) -> Query 96 | 97 | type [] QueryStatic = 98 | [] abstract Create: unit -> Query 99 | 100 | type IExports = 101 | abstract Pool: PoolStatic with get, set 102 | abstract Client: ClientStatic with get, set 103 | abstract Query: QueryStatic with get, set 104 | abstract types: obj with get, set 105 | abstract defaults: obj with get, set 106 | abstract connect: (string * (Error -> Client -> (obj -> unit) -> unit)) -> unit 107 | abstract connect: (ClientConfig * (Error -> Client -> (obj -> unit) -> unit)) -> unit 108 | abstract ``end``: unit -> unit 109 | 110 | [] 111 | let Pg:IExports = jsNative 112 | -------------------------------------------------------------------------------- /Pg/Fable.Import.Pg.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0.1.0 5 | 0.1.0 6 | netstandard1.6 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Pg/Meta.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | Fable bindings for node-postgres 4 | https://github.com/fable-compiler/fable-import 5 | https://raw.githubusercontent.com/fable-compiler/fable-import/master/LICENSE 6 | https://github.com/fable-compiler/fable-import.git 7 | pg;postgres;fsharp;fable 8 | Joe Grund 9 | 10 | 11 | -------------------------------------------------------------------------------- /Pg/README.md: -------------------------------------------------------------------------------- 1 | Fable bindings for [node-postgres](https://github.com/brianc/node-postgres). 2 | ======= 3 | [![nuget](https://badge.fury.io/nu/Fable.Import.Pg.svg)](https://badge.fury.io/nu/Fable.Import.Pg) 4 | 5 | 6 | 7 | ### Using 8 | 1. `paket add Fable.Import.Pg` 9 | 2. `yarn add pg` 10 | 11 | ### Building the package 12 | 1. `dotnet restore` 13 | 2. `dotnet pack` 14 | -------------------------------------------------------------------------------- /Pg/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 0.1.0 2 | 3 | * Initial release -------------------------------------------------------------------------------- /Pg/paket.references: -------------------------------------------------------------------------------- 1 | FSharp.Core 2 | Fable.Core 3 | -------------------------------------------------------------------------------- /Pixi/Fable.Import.Pixi.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0.1.0 4 | 0.1.0 5 | netstandard1.6 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Pixi/README.md: -------------------------------------------------------------------------------- 1 | Fable bindings for [Pixi](https://github.com/pixijs/pixi.js). 2 | ======= 3 | 4 | ### Using 5 | 1. `paket add Fable.Import.Pixi` 6 | 2. `yarn add pixi.js` 7 | 8 | ### Building the package 9 | 1. `dotnet restore` 10 | 2. `dotnet pack` 11 | -------------------------------------------------------------------------------- /Pixi/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 0.1.0 2 | 3 | * First push 4 | -------------------------------------------------------------------------------- /Pixi/paket.references: -------------------------------------------------------------------------------- 1 | FSharp.Core 2 | Fable.Core 3 | Fable.Import.Browser -------------------------------------------------------------------------------- /PixiParticles/Fable.Import.Pixi.Particles.fs: -------------------------------------------------------------------------------- 1 | namespace rec Fable.Import.Pixi.Particles 2 | 3 | open System 4 | open Fable.Core 5 | open Fable.Import.Pixi 6 | 7 | module PIXI = 8 | module particles = 9 | type TexSrc = 10 | U2 11 | 12 | and [] ParticleConstructor = 13 | [] abstract Create: emitter: Emitter -> Particle 14 | 15 | and [] AnimatedParticleArt = 16 | abstract textures: ResizeArray> with get, set 17 | abstract framerate: U2 with get, set 18 | abstract loop: bool option with get, set 19 | 20 | and [] ParsedAnimatedParticleArt = 21 | abstract textures: ResizeArray with get, set 22 | abstract framerate: float with get, set 23 | abstract elapsed: float with get, set 24 | abstract loop: bool with get, set 25 | 26 | and [] [] AnimatedParticle(emitter: Emitter) = 27 | inherit Particle(emitter) 28 | member __.textures with get(): ResizeArray = jsNative and set(v: ResizeArray): unit = jsNative 29 | member __.duration with get(): float = jsNative and set(v: float): unit = jsNative 30 | member __.framerate with get(): float = jsNative and set(v: float): unit = jsNative 31 | member __.elapsed with get(): float = jsNative and set(v: float): unit = jsNative 32 | member __.loop with get(): bool = jsNative and set(v: bool): unit = jsNative 33 | static member parseArt(art: ResizeArray): ResizeArray = jsNative 34 | member __.applyArt(art: ParsedAnimatedParticleArt): unit = jsNative 35 | 36 | and [] [] Emitter(particleParent: PIXI.Container, particleImages: obj, config: obj) = 37 | member __._particleConstructor with get(): obj = jsNative and set(v: obj): unit = jsNative 38 | member __._frequency with get(): float = jsNative and set(v: float): unit = jsNative 39 | member __._spawnFunc with get(): Func = jsNative and set(v: Func): unit = jsNative 40 | member __._prevEmitterPos with get(): PIXI.Point = jsNative and set(v: PIXI.Point): unit = jsNative 41 | member __._prevPosIsValid with get(): bool = jsNative and set(v: bool): unit = jsNative 42 | member __._posChanged with get(): bool = jsNative and set(v: bool): unit = jsNative 43 | member __._parentIsPC with get(): bool = jsNative and set(v: bool): unit = jsNative 44 | member __._parent with get(): PIXI.Container = jsNative and set(v: PIXI.Container): unit = jsNative 45 | member __._emit with get(): bool = jsNative and set(v: bool): unit = jsNative 46 | member __._spawnTimer with get(): float = jsNative and set(v: float): unit = jsNative 47 | member __._emitterLife with get(): float = jsNative and set(v: float): unit = jsNative 48 | member __._activeParticlesFirst with get(): Particle = jsNative and set(v: Particle): unit = jsNative 49 | member __._activeParticlesLast with get(): Particle = jsNative and set(v: Particle): unit = jsNative 50 | member __._poolFirst with get(): Particle = jsNative and set(v: Particle): unit = jsNative 51 | member __._origConfig with get(): obj = jsNative and set(v: obj): unit = jsNative 52 | member __._origArt with get(): obj = jsNative and set(v: obj): unit = jsNative 53 | member __._autoUpdate with get(): bool = jsNative and set(v: bool): unit = jsNative 54 | member __.particleImages with get(): ResizeArray = jsNative and set(v: ResizeArray): unit = jsNative 55 | member __.startAlpha with get(): float = jsNative and set(v: float): unit = jsNative 56 | member __.endAlpha with get(): float = jsNative and set(v: float): unit = jsNative 57 | member __.startSpeed with get(): float = jsNative and set(v: float): unit = jsNative 58 | member __.endSpeed with get(): float = jsNative and set(v: float): unit = jsNative 59 | member __.minimumSpeedMultiplier with get(): float = jsNative and set(v: float): unit = jsNative 60 | member __.acceleration with get(): PIXI.Point = jsNative and set(v: PIXI.Point): unit = jsNative 61 | member __.maxSpeed with get(): float = jsNative and set(v: float): unit = jsNative 62 | member __.startScale with get(): float = jsNative and set(v: float): unit = jsNative 63 | member __.endScale with get(): float = jsNative and set(v: float): unit = jsNative 64 | member __.minimumScaleMultiplier with get(): float = jsNative and set(v: float): unit = jsNative 65 | member __.startColor with get(): float * float * float = jsNative and set(v: float * float * float): unit = jsNative 66 | member __.endColor with get(): float * float * float = jsNative and set(v: float * float * float): unit = jsNative 67 | member __.minLifetime with get(): float = jsNative and set(v: float): unit = jsNative 68 | member __.maxLifetime with get(): float = jsNative and set(v: float): unit = jsNative 69 | member __.minStartRotation with get(): float = jsNative and set(v: float): unit = jsNative 70 | member __.maxStartRotation with get(): float = jsNative and set(v: float): unit = jsNative 71 | member __.noRotation with get(): bool = jsNative and set(v: bool): unit = jsNative 72 | member __.minRotationSpeed with get(): float = jsNative and set(v: float): unit = jsNative 73 | member __.maxRotationSpeed with get(): float = jsNative and set(v: float): unit = jsNative 74 | member __.particleBlendMode with get(): float = jsNative and set(v: float): unit = jsNative 75 | member __.customEase with get(): Func = jsNative and set(v: Func): unit = jsNative 76 | member __.extraData with get(): obj = jsNative and set(v: obj): unit = jsNative 77 | member __.maxParticles with get(): float = jsNative and set(v: float): unit = jsNative 78 | member __.emitterLifetime with get(): float = jsNative and set(v: float): unit = jsNative 79 | member __.spawnPos with get(): PIXI.Point = jsNative and set(v: PIXI.Point): unit = jsNative 80 | member __.spawnType with get(): (* TODO StringEnum point | rectangle | circle | burst | ring *) string = jsNative and set(v: (* TODO StringEnum point | rectangle | circle | burst | ring *) string): unit = jsNative 81 | member __.spawnRect with get(): PIXI.Rectangle = jsNative and set(v: PIXI.Rectangle): unit = jsNative 82 | member __.spawnCircle with get(): PIXI.Circle = jsNative and set(v: PIXI.Circle): unit = jsNative 83 | member __.particlesPerWave with get(): float = jsNative and set(v: float): unit = jsNative 84 | member __.particleSpacing with get(): float = jsNative and set(v: float): unit = jsNative 85 | member __.angleStart with get(): float = jsNative and set(v: float): unit = jsNative 86 | member __.rotation with get(): float = jsNative and set(v: float): unit = jsNative 87 | member __.ownerPos with get(): PIXI.Point = jsNative and set(v: PIXI.Point): unit = jsNative 88 | member __.addAtBack with get(): bool = jsNative and set(v: bool): unit = jsNative 89 | member __.particleCount with get(): float = jsNative and set(v: float): unit = jsNative 90 | member __.frequency with get(): float = jsNative and set(v: float): unit = jsNative 91 | member __.particleConstructor with get(): ParticleConstructor = jsNative and set(v: ParticleConstructor): unit = jsNative 92 | member __.parent with get(): PIXI.Container = jsNative and set(v: PIXI.Container): unit = jsNative 93 | member __.emit with get(): bool = jsNative and set(v: bool): unit = jsNative 94 | member __.autoUpdate with get(): bool = jsNative and set(v: bool): unit = jsNative 95 | member __.recycle(p: Particle): unit = jsNative 96 | member __._spawnPoint(p: Particle, emitPosX: float, emitPosY: float, i: float): unit = jsNative 97 | member __._spawnRect(p: Particle, emitPosX: float, emitPosY: float, i: float): unit = jsNative 98 | member __._spawnCircle(p: Particle, emitPosX: float, emitPosY: float, i: float): unit = jsNative 99 | member __._spawnRing(p: Particle, emitPosX: float, emitPosY: float, i: float): unit = jsNative 100 | member __._spawnBurst(p: Particle, emitPosX: float, emitPosY: float, i: float): unit = jsNative 101 | member __.init(art: obj, config: obj): unit = jsNative 102 | member __.rotate(newRot: float): unit = jsNative 103 | member __.updateSpawnPos(x: float, y: float): unit = jsNative 104 | member __.updateOwnerPos(x: float, y: float): unit = jsNative 105 | member __.resetPositionTracking(): unit = jsNative 106 | member __.update(delta: float): unit = jsNative 107 | member __.cleanup(): unit = jsNative 108 | member __.destroy(): unit = jsNative 109 | 110 | and [] [] Particle(emitter: Emitter) = 111 | inherit PIXI.Sprite() 112 | member __._sR with get(): float = jsNative and set(v: float): unit = jsNative 113 | member __._sG with get(): float = jsNative and set(v: float): unit = jsNative 114 | member __._sB with get(): float = jsNative and set(v: float): unit = jsNative 115 | member __._eR with get(): float = jsNative and set(v: float): unit = jsNative 116 | member __._eG with get(): float = jsNative and set(v: float): unit = jsNative 117 | member __._eB with get(): float = jsNative and set(v: float): unit = jsNative 118 | member __._doAlpha with get(): bool = jsNative and set(v: bool): unit = jsNative 119 | member __._doScale with get(): bool = jsNative and set(v: bool): unit = jsNative 120 | member __._doSpeed with get(): bool = jsNative and set(v: bool): unit = jsNative 121 | member __._doAcceleration with get(): bool = jsNative and set(v: bool): unit = jsNative 122 | member __._doColor with get(): bool = jsNative and set(v: bool): unit = jsNative 123 | member __._doNormalMovement with get(): bool = jsNative and set(v: bool): unit = jsNative 124 | member __._oneOverLife with get(): float = jsNative and set(v: float): unit = jsNative 125 | member __.next with get(): Particle = jsNative and set(v: Particle): unit = jsNative 126 | member __.prev with get(): Particle = jsNative and set(v: Particle): unit = jsNative 127 | member __.emitter with get(): Emitter = jsNative and set(v: Emitter): unit = jsNative 128 | member __.velocity with get(): PIXI.Point = jsNative and set(v: PIXI.Point): unit = jsNative 129 | member __.maxLife with get(): float = jsNative and set(v: float): unit = jsNative 130 | member __.age with get(): float = jsNative and set(v: float): unit = jsNative 131 | member __.ease with get(): Func = jsNative and set(v: Func): unit = jsNative 132 | member __.extraData with get(): obj = jsNative and set(v: obj): unit = jsNative 133 | member __.startAlpha with get(): float = jsNative and set(v: float): unit = jsNative 134 | member __.endAlpha with get(): float = jsNative and set(v: float): unit = jsNative 135 | member __.startSpeed with get(): float = jsNative and set(v: float): unit = jsNative 136 | member __.endSpeed with get(): float = jsNative and set(v: float): unit = jsNative 137 | member __.acceleration with get(): PIXI.Point = jsNative and set(v: PIXI.Point): unit = jsNative 138 | member __.maxSpeed with get(): float = jsNative and set(v: float): unit = jsNative 139 | member __.startScale with get(): float = jsNative and set(v: float): unit = jsNative 140 | member __.endScale with get(): float = jsNative and set(v: float): unit = jsNative 141 | member __.startColor with get(): ResizeArray = jsNative and set(v: ResizeArray): unit = jsNative 142 | member __.endColor with get(): ResizeArray = jsNative and set(v: ResizeArray): unit = jsNative 143 | static member parseArt(art: obj): obj = jsNative 144 | static member parseData(data: obj): obj = jsNative 145 | member __.Particle_init(): unit = jsNative 146 | member __.Particle_update(delta: float): float = jsNative 147 | member __.init(): unit = jsNative 148 | member __.applyArt(art: obj): unit = jsNative 149 | member __.update(delta: float): float = jsNative 150 | member __.kill(): unit = jsNative 151 | member __.destroy(): unit = jsNative 152 | 153 | and [] EaseSegment = 154 | abstract cp: float with get, set 155 | abstract s: float with get, set 156 | abstract e: float with get, set 157 | 158 | and [] [] ParticleUtils() = 159 | member __.verbose with get(): bool = jsNative and set(v: bool): unit = jsNative 160 | static member rotatePoint(angle: float, p: PIXI.Point): unit = jsNative 161 | static member combineRGBComponents(r: float, g: float, b: float): float = jsNative 162 | static member normalize(p: PIXI.Point): unit = jsNative 163 | static member scaleBy(p: PIXI.Point, value: float): unit = jsNative 164 | static member length(p: PIXI.Point): float = jsNative 165 | static member hexToRGB(color: string, ?output: float * float * float): float * float * float = jsNative 166 | static member generateEase(segments: ResizeArray): Func = jsNative 167 | static member getBlendMode(name: string): float = jsNative 168 | 169 | and [] [] PathParticle(emitter:Emitter) = 170 | inherit Particle(emitter) 171 | member __.path with get(): Func = jsNative and set(v: Func): unit = jsNative 172 | member __.initialRotation with get(): float = jsNative and set(v: float): unit = jsNative 173 | member __.initialPosition with get(): PIXI.Point = jsNative and set(v: PIXI.Point): unit = jsNative 174 | member __.movement with get(): float = jsNative and set(v: float): unit = jsNative 175 | static member parseArt(art: ResizeArray): ResizeArray = jsNative 176 | static member parseData(data: obj): obj = jsNative 177 | 178 | 179 | -------------------------------------------------------------------------------- /PixiParticles/Fable.Import.Pixi.Particles.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0.1.0 4 | 0.1.0 5 | netstandard1.6 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /PixiParticles/README.md: -------------------------------------------------------------------------------- 1 | Fable bindings for [pixi-particles](https://github.com/pixijs/pixi-particles) 2 | ======= 3 | 4 | ### Using 5 | 1. `paket add Fable.Import.Pixi.Particles` 6 | 2. `yarn add pixi-particles` 7 | 8 | ### Building the package 9 | 1. `dotnet restore` 10 | 2. `dotnet pack` 11 | -------------------------------------------------------------------------------- /PixiParticles/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 0.1.0 2 | 3 | * First push 4 | -------------------------------------------------------------------------------- /PixiParticles/paket.references: -------------------------------------------------------------------------------- 1 | FSharp.Core 2 | Fable.Core -------------------------------------------------------------------------------- /PixiSound/Fable.Import.Pixi.Sound.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0.1.0 4 | 0.1.0 5 | netstandard1.6 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /PixiSound/README.md: -------------------------------------------------------------------------------- 1 | Fable bindings for [pixi-sound](https://github.com/pixijs/pixi-sound). 2 | ======= 3 | 4 | ### Using 5 | 1. `paket add Fable.Import.Pixi.Sound` 6 | 2. `yarn add pixi-sound` 7 | 8 | ### Building the package 9 | 1. `dotnet restore` 10 | 2. `dotnet pack` 11 | -------------------------------------------------------------------------------- /PixiSound/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 0.1.0 2 | 3 | * First push 4 | -------------------------------------------------------------------------------- /PixiSound/paket.references: -------------------------------------------------------------------------------- 1 | FSharp.Core 2 | Fable.Core 3 | Fable.Import.Browser -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # fable-import 2 | 3 | **EDIT**: This repository has been deprecated in favour of having separate repositories per binding for easier maintenance. To track the new repositories, please check [this issue](https://github.com/fable-compiler/fable-import/issues/80). 4 | 5 | Fable bindings for JavaScript libraries. This repository contains only _pure_ bindings maintained by fable-compiler.org. Pure bindings only contain metadata and no helper code. The distinction is important because Fable packages must include the F# source code in a folder named `fable` ([example](https://github.com/fable-compiler/fable-powerpack/blob/b035313b7376922446d51e503ef2913ef41d2172/Fable.PowerPack.fsproj#L20-L23)) in order to compile it to JS. Packages in this repo don't do that. 6 | 7 | You can find more bindings by other contributors. The convention is prefixing the packages with `Fable.Import` so please use that to make a search in [Nuget](https://www.nuget.org/). 8 | 9 | > You can also check [awesome-fable](https://github.com/kunjee17/awesome-fable) for more bindings and useful Fable libraries and tools. 10 | 11 | See README.md on each directory for instructions on how to install each binding. 12 | -------------------------------------------------------------------------------- /SocketIo/Fable.Import.SocketIo.fs: -------------------------------------------------------------------------------- 1 | module rec Fable.Import.SocketIo 2 | open System 3 | open System.Text.RegularExpressions 4 | open Fable.Core 5 | open Fable.Import.JS 6 | open Fable.Import.Node 7 | 8 | type [] Server = 9 | inherit Events.EventEmitter 10 | abstract engine: obj with get, set 11 | abstract nsps: obj with get, set 12 | abstract sockets: Namespace with get, set 13 | abstract json: Server with get, set 14 | abstract checkRequest: req: obj * fn: (obj -> bool -> unit) -> unit 15 | abstract serveClient: unit -> bool 16 | abstract serveClient: v: bool -> Server 17 | abstract path: unit -> string 18 | abstract path: v: string -> Server 19 | abstract adapter: unit -> obj 20 | abstract adapter: v: obj -> Server 21 | abstract origins: unit -> string 22 | abstract origins: v: string -> Server 23 | abstract attach: srv: obj * ?opts: ServerOptions -> Server 24 | abstract attach: port: float * ?opts: ServerOptions -> Server 25 | abstract listen: srv: obj * ?opts: ServerOptions -> Server 26 | abstract listen: port: float * ?opts: ServerOptions -> Server 27 | abstract bind: srv: obj -> Server 28 | abstract onconnection: socket: obj -> Server 29 | abstract ``of``: nsp: string -> Namespace 30 | abstract close: ?fn: (unit -> unit) -> unit 31 | [] abstract on_connection: listener: (Socket -> unit) -> Namespace 32 | [] abstract on_connect: listener: (Socket -> unit) -> Namespace 33 | abstract on: ``event``: string * listener: Function -> Namespace 34 | abstract ``to``: room: string -> Namespace 35 | abstract ``in``: room: string -> Namespace 36 | abstract ``use``: fn: (Socket -> (obj -> unit) -> unit) -> Namespace 37 | abstract emit: ``event``: string * [] args: obj[] -> Namespace 38 | abstract send: [] args: obj[] -> Namespace 39 | abstract write: [] args: obj[] -> Namespace 40 | abstract clients: [] args: obj[] -> Namespace 41 | abstract compress: [] args: obj[] -> Namespace 42 | 43 | type [] ServerOptions = 44 | abstract path: string option with get, set 45 | abstract serveClient: bool option with get, set 46 | abstract adapter: Adapter option with get, set 47 | abstract origins: string option with get, set 48 | abstract pingTimeout: float option with get, set 49 | abstract pingInterval: float option with get, set 50 | abstract maxHttpBufferSize: float option with get, set 51 | abstract allowRequest: (obj -> (float -> bool -> unit) -> unit) option with get, set 52 | abstract transports: ResizeArray option with get, set 53 | abstract allowUpgrades: bool option with get, set 54 | abstract perMessageDeflate: U2 option with get, set 55 | abstract httpCompression: U2 option with get, set 56 | abstract cookie: U2 option with get, set 57 | 58 | type [] ServerStatic = 59 | [] abstract Invoke: unit -> Server 60 | [] abstract Invoke: srv: obj * ?opts: ServerOptions -> Server 61 | [] abstract Invoke: port: string * ?opts: ServerOptions -> Server 62 | [] abstract Invoke: port: float * ?opts: ServerOptions -> Server 63 | [] abstract Invoke: opts: ServerOptions -> Server 64 | 65 | type [] Namespace = 66 | inherit Events.EventEmitter 67 | abstract name: string with get, set 68 | abstract server: Server with get, set 69 | abstract sockets: obj with get, set 70 | abstract connected: obj with get, set 71 | abstract adapter: Adapter with get, set 72 | abstract json: Namespace with get, set 73 | abstract ``use``: fn: (Socket -> (obj -> unit) -> unit) -> Namespace 74 | abstract ``to``: room: string -> Namespace 75 | abstract ``in``: room: string -> Namespace 76 | abstract send: [] args: obj[] -> Namespace 77 | abstract write: [] args: obj[] -> Namespace 78 | [] abstract on_connection: listener: (Socket -> unit) -> obj 79 | [] abstract on_connect: listener: (Socket -> unit) -> obj 80 | abstract on: ``event``: string * listener: Function -> obj 81 | abstract clients: fn: Function -> Namespace 82 | abstract compress: compress: bool -> Namespace 83 | 84 | type [] Packet = 85 | abstract ``type``: string with get, set 86 | abstract data: Option with get, set 87 | abstract id: int option with get, set 88 | 89 | type SocketUseArgs<'T> = string * 'T option * (obj -> unit) option 90 | 91 | type [] Socket = 92 | inherit Events.EventEmitter 93 | abstract nsp: Namespace with get, set 94 | abstract server: Server with get, set 95 | abstract adapter: Adapter with get, set 96 | abstract id: string with get, set 97 | abstract request: obj with get, set 98 | abstract client: Client with get, set 99 | abstract conn: EngineSocket with get, set 100 | abstract rooms: obj with get, set 101 | abstract connected: bool with get, set 102 | abstract disconnected: bool with get, set 103 | abstract handshake: obj with get, set 104 | abstract json: Socket with get, set 105 | abstract ``volatile``: Socket with get, set 106 | abstract broadcast: Socket with get, set 107 | abstract ``to``: room: string -> Socket 108 | abstract ``in``: room: string -> Socket 109 | abstract send: [] args: obj[] -> Socket 110 | abstract write: [] args: obj[] -> Socket 111 | abstract join: name: string * ?fn: (obj -> unit) -> Socket 112 | abstract leave: name: string * ?fn: Function -> Socket 113 | abstract leaveAll: unit -> unit 114 | abstract disconnect: ?close: bool -> Socket 115 | abstract listeners: ``event``: string -> ResizeArray 116 | abstract compress: compress: bool -> Socket 117 | abstract ``use``: fn:('a -> (Error option -> unit) -> unit) -> Socket 118 | 119 | type [] Adapter = 120 | inherit Events.EventEmitter 121 | abstract nsp: Namespace with get, set 122 | abstract rooms: obj with get, set 123 | abstract sids: obj with get, set 124 | abstract add: id: string * room: string * ?callback: (obj -> unit) -> unit 125 | abstract del: id: string * room: string * ?callback: (obj -> unit) -> unit 126 | abstract delAll: id: string -> unit 127 | abstract broadcast: packet: obj * opts: obj -> unit 128 | 129 | type [] Client = 130 | abstract server: Server with get, set 131 | abstract conn: EngineSocket with get, set 132 | abstract id: string with get, set 133 | abstract request: obj with get, set 134 | abstract sockets: obj with get, set 135 | abstract nsps: obj with get, set 136 | 137 | type [] EngineSocket = 138 | inherit Events.EventEmitter 139 | abstract id: string with get, set 140 | abstract server: obj with get, set 141 | abstract readyState: string with get, set 142 | abstract remoteAddress: string with get, set 143 | abstract upgraded: bool with get, set 144 | abstract request: obj with get, set 145 | abstract transport: obj with get, set 146 | 147 | 148 | [] 149 | let ``socket.io``:ServerStatic = jsNative 150 | 151 | -------------------------------------------------------------------------------- /SocketIo/Fable.Import.SocketIo.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0.1.0 5 | 0.1.0 6 | netstandard1.6 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /SocketIo/Meta.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | Fable bindings for Socket.io 4 | https://github.com/fable-compiler/fable-import 5 | https://raw.githubusercontent.com/fable-compiler/fable-import/master/LICENSE 6 | https://github.com/fable-compiler/fable-import.git 7 | socket.io;fsharp;fable 8 | Joe Grund 9 | 10 | 11 | -------------------------------------------------------------------------------- /SocketIo/README.md: -------------------------------------------------------------------------------- 1 | Fable bindings for [Socket.io](https://github.com/socketio/socket.io). 2 | ======= 3 | [![nuget](https://badge.fury.io/nu/Fable.Import.SocketIo.svg)](https://badge.fury.io/nu/Fable.Import.SocketIo) 4 | 5 | 6 | 7 | ### Using 8 | 1. `paket add Fable.Import.SocketIo` 9 | 2. `yarn add socket.io` 10 | 11 | ### Building the package 12 | 1. `dotnet restore` 13 | 2. `dotnet pack` 14 | -------------------------------------------------------------------------------- /SocketIo/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 0.1.0 2 | 3 | * Initial Release -------------------------------------------------------------------------------- /SocketIo/paket.references: -------------------------------------------------------------------------------- 1 | FSharp.Core 2 | Fable.Core 3 | -------------------------------------------------------------------------------- /Uws/Fable.Import.Uws.fs: -------------------------------------------------------------------------------- 1 | module rec Fable.Import.Uws 2 | open System 3 | open Fable.Core 4 | open Fable.Import.JS 5 | open Fable.Import.Node 6 | 7 | type [] IWebSocket = 8 | inherit Events.EventEmitter 9 | abstract CONNECTING: float with get, set 10 | abstract OPEN: float with get, set 11 | abstract CLOSING: float with get, set 12 | abstract CLOSED: float with get, set 13 | abstract upgradeReq: Http.IncomingMessage with get, set 14 | abstract onopen: obj -> unit 15 | abstract onerror: Error -> unit 16 | abstract onclose: obj -> unit 17 | abstract onmessage: obj -> unit 18 | abstract close: ?code: float * ?data: obj -> unit 19 | abstract ping: ?data: obj * ?options: obj * ?dontFail: bool -> unit 20 | abstract pong: ?data: obj * ?options: obj * ?dontFail: bool -> unit 21 | abstract send: data: obj * ?cb: (Error -> unit) -> unit 22 | abstract send: data: obj * options: obj * ?cb: (Error -> unit) -> unit 23 | abstract terminate: unit -> unit 24 | 25 | type [] IWebSocketClient = 26 | inherit IWebSocket 27 | 28 | type VerifyClientCallbackSync = 29 | (obj -> bool) 30 | 31 | type VerifyClientCallbackAsync = 32 | (obj -> (bool -> unit) -> unit) 33 | 34 | type [] IClientOptions = 35 | abstract protocol: string option with get, set 36 | abstract agent: Http.Agent option with get, set 37 | abstract headers: obj option with get, set 38 | abstract protocolVersion: obj option with get, set 39 | abstract host: string option with get, set 40 | abstract origin: string option with get, set 41 | abstract pfx: obj option with get, set 42 | abstract key: obj option with get, set 43 | abstract passphrase: string option with get, set 44 | abstract cert: obj option with get, set 45 | abstract ca: ResizeArray option with get, set 46 | abstract ciphers: string option with get, set 47 | abstract rejectUnauthorized: bool option with get, set 48 | 49 | type [] IPerMessageDeflateOptions = 50 | abstract serverNoContextTakeover: bool option with get, set 51 | abstract clientNoContextTakeover: bool option with get, set 52 | abstract serverMaxWindowBits: float option with get, set 53 | abstract clientMaxWindowBits: float option with get, set 54 | abstract memLevel: float option with get, set 55 | 56 | type [] IServerOptions = 57 | abstract host: string option with get, set 58 | abstract port: float option with get, set 59 | abstract server: U2 option with get, set 60 | abstract verifyClient: U2 option with get, set 61 | abstract handleProtocols: obj option with get, set 62 | abstract path: string option with get, set 63 | abstract noServer: bool option with get, set 64 | abstract disableHixie: bool option with get, set 65 | abstract clientTracking: bool option with get, set 66 | abstract perMessageDeflate: U2 option with get, set 67 | 68 | type [] Connection = 69 | | Connection 70 | 71 | type [] IServer = 72 | inherit Events.EventEmitter 73 | abstract on: Connection * (IWebSocket -> unit) -> unit 74 | abstract options: IServerOptions with get, set 75 | abstract path: string with get, set 76 | abstract clients: ResizeArray with get, set 77 | abstract close: (obj -> unit) -> unit 78 | abstract close: unit -> unit 79 | abstract handleUpgrade: Http.IncomingMessage * Net.Socket * ArrayBuffer * (IWebSocket -> unit) -> unit 80 | 81 | type [] IServerStatic = 82 | [] abstract Create: unit -> IServer 83 | [] abstract Create: IServerOptions -> IServer 84 | [] abstract Create: IServerOptions * (unit -> unit) -> IServer 85 | 86 | type [] IUwsHttp = 87 | abstract createServer: ?requestListener: (Http.IncomingMessage -> Http.ServerResponse -> unit) -> Http.Server 88 | abstract getExpressApp: express: obj -> obj 89 | abstract getResponsePrototype: unit -> Http.ServerResponse 90 | abstract getRequestPrototype: unit -> Http.IncomingMessage 91 | 92 | type IExports = 93 | [] abstract Create: string -> IWebSocketClient 94 | abstract Server: IServerStatic with get, set 95 | abstract http: IUwsHttp with get, set 96 | 97 | [] 98 | let uws:IExports = jsNative 99 | -------------------------------------------------------------------------------- /Uws/Fable.Import.Uws.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 0.1.0 5 | 0.1.0 6 | netstandard1.6 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Uws/Meta.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | Fable bindings for µWS 4 | https://github.com/fable-compiler/fable-import 5 | https://raw.githubusercontent.com/fable-compiler/fable-import/master/LICENSE 6 | https://github.com/fable-compiler/fable-import.git 7 | uws;WebSocket;fsharp;fable 8 | Joe Grund 9 | 10 | 11 | -------------------------------------------------------------------------------- /Uws/README.md: -------------------------------------------------------------------------------- 1 | Fable bindings for [µWS](https://github.com/uNetworking/uWebSockets). 2 | ======= 3 | [![nuget](https://badge.fury.io/nu/Fable.Import.Uws.svg)](https://badge.fury.io/nu/Fable.Import.Uws) 4 | 5 | 6 | 7 | ### Using 8 | 1. `paket add Fable.Import.Uws` 9 | 2. `yarn add uws` 10 | 11 | ### Building the package 12 | 1. `dotnet restore` 13 | 2. `dotnet pack` 14 | -------------------------------------------------------------------------------- /Uws/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 0.1.0 2 | 3 | * Initial Release -------------------------------------------------------------------------------- /Uws/paket.references: -------------------------------------------------------------------------------- 1 | FSharp.Core 2 | Fable.Core -------------------------------------------------------------------------------- /VSCode/Fable.Import.VSCode.Proposed.fs: -------------------------------------------------------------------------------- 1 | namespace Fable.Import 2 | 3 | open System 4 | open System.Text.RegularExpressions 5 | open Fable.Core 6 | open Fable.Import.JS 7 | open Fable.Import.vscode 8 | 9 | module vscodeProposed = 10 | type ProblemPattern = 11 | abstract regexp: Regex with get, set 12 | abstract file: float option with get, set 13 | abstract location: float option with get, set 14 | abstract line: float option with get, set 15 | abstract character: float option with get, set 16 | abstract endLine: float option with get, set 17 | abstract endCharacter: float option with get, set 18 | abstract severity: float option with get, set 19 | abstract code: float option with get, set 20 | abstract message: float option with get, set 21 | abstract loop: bool option with get, set 22 | 23 | and MultiLineProblemPattern = 24 | ResizeArray 25 | 26 | and FileLocationKind = 27 | | Auto = 1 28 | | Relative = 2 29 | | Absolute = 3 30 | 31 | and ApplyToKind = 32 | | AllDocuments = 1 33 | | OpenDocuments = 2 34 | | ClosedDocuments = 3 35 | 36 | and BackgroundPattern = 37 | abstract regexp: Regex with get, set 38 | abstract file: float option with get, set 39 | 40 | and BackgroundMonitor = 41 | abstract activeOnStart: bool option with get, set 42 | abstract beginsPattern: U2 with get, set 43 | abstract endsPattern: U2 with get, set 44 | 45 | and ProblemMatcher = 46 | abstract owner: string option with get, set 47 | abstract applyTo: ApplyToKind option with get, set 48 | abstract fileLocation: U2 option with get, set 49 | abstract pattern: U2 with get, set 50 | abstract severity: DiagnosticSeverity option with get, set 51 | abstract backgound: BackgroundMonitor option with get, set 52 | 53 | and RevealKind = 54 | | Always = 1 55 | | Silent = 2 56 | | Never = 3 57 | 58 | and TerminalBehaviour = 59 | abstract reveal: RevealKind option with get, set 60 | abstract echo: bool option with get, set 61 | 62 | and ProcessOptions = 63 | abstract cwd: string option with get, set 64 | abstract env: obj option with get, set 65 | 66 | and [] [] TaskGroup = 67 | | Clean | Build | RebuildAll | Test 68 | 69 | and [] ProcessTask(name: string, ``process``: string, args: ResizeArray, options: ProcessOptions, [] problemMatchers: ProblemMatcher[]) = 70 | member __.name with get(): string = jsNative and set(v: string): unit = jsNative 71 | member __.identifier with get(): string = jsNative and set(v: string): unit = jsNative 72 | member __.isBackground with get(): bool = jsNative and set(v: bool): unit = jsNative 73 | member __.``process`` with get(): string = jsNative and set(v: string): unit = jsNative 74 | member __.args with get(): ResizeArray = jsNative and set(v: ResizeArray): unit = jsNative 75 | member __.group with get(): TaskGroup option = jsNative and set(v: TaskGroup option): unit = jsNative 76 | member __.options with get(): ProcessOptions = jsNative and set(v: ProcessOptions): unit = jsNative 77 | member __.terminal with get(): TerminalBehaviour = jsNative and set(v: TerminalBehaviour): unit = jsNative 78 | member __.problemMatchers with get(): ResizeArray = jsNative and set(v: ResizeArray): unit = jsNative 79 | 80 | and ShellOptions = 81 | U3 82 | 83 | and [] ShellTask(name: string, commandLine: string, options: ShellOptions, [] problemMatchers: ProblemMatcher[]) = 84 | member __.name with get(): string = jsNative and set(v: string): unit = jsNative 85 | member __.identifier with get(): string = jsNative and set(v: string): unit = jsNative 86 | member __.isBackground with get(): bool = jsNative and set(v: bool): unit = jsNative 87 | member __.commandLine with get(): string = jsNative and set(v: string): unit = jsNative 88 | member __.group with get(): TaskGroup option = jsNative and set(v: TaskGroup option): unit = jsNative 89 | member __.options with get(): ShellOptions = jsNative and set(v: ShellOptions): unit = jsNative 90 | member __.terminal with get(): TerminalBehaviour = jsNative and set(v: TerminalBehaviour): unit = jsNative 91 | member __.problemMatchers with get(): ResizeArray = jsNative and set(v: ResizeArray): unit = jsNative 92 | 93 | and Task = 94 | U2 95 | 96 | and TaskProvider = 97 | abstract provideTasks: token: CancellationToken -> ProviderResult> 98 | 99 | and TreeView<'T> = 100 | abstract refresh: [] nodes: 'T[] -> unit 101 | abstract dispose: unit -> unit 102 | 103 | and TreeDataProvider<'T> = 104 | abstract provideRootNode: unit -> U2<'T, PromiseLike<'T>> 105 | abstract resolveChildren: node: 'T -> U2, PromiseLike>> 106 | abstract getLabel: node: 'T -> string 107 | abstract getHasChildren: node: 'T -> bool 108 | abstract getClickCommand: node: 'T -> Command 109 | 110 | and LineChange = 111 | abstract originalStartLineNumber: float with get, set 112 | abstract originalEndLineNumber: float with get, set 113 | abstract modifiedStartLineNumber: float with get, set 114 | abstract modifiedEndLineNumber: float with get, set 115 | 116 | and Terminal = 117 | abstract name: string with get, set 118 | abstract processId: PromiseLike with get, set 119 | abstract sendText: text: string * ?addNewLine: bool -> unit 120 | abstract show: ?preserveFocus: bool -> unit 121 | abstract hide: unit -> unit 122 | abstract dispose: unit -> unit 123 | abstract onData: callback: Func -> unit 124 | 125 | type [] workspace = 126 | inherit vscode.workspace 127 | static member registerTaskProvider(provider: TaskProvider): Disposable = jsNative 128 | 129 | type [] window = 130 | inherit vscode.window 131 | static member sampleFunction(): PromiseLike = jsNative 132 | static member createTreeView(viewId: string, provider: TreeDataProvider<'T>): TreeView<'T> = jsNative 133 | 134 | type [] commands = 135 | inherit vscode.commands 136 | static member registerDiffInformationCommand(command: string, callback: Func, obj, obj>, ?thisArg: obj): Disposable = jsNative 137 | -------------------------------------------------------------------------------- /VSCode/Fable.Import.VSCode.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 0.1.2 4 | 0.1.2 5 | netstandard1.6 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /VSCode/LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "{}" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright {yyyy} {name of copyright owner} 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /VSCode/README.md: -------------------------------------------------------------------------------- 1 | Fable bindings for [Visual Studio Code](https://code.visualstudio.com/). 2 | ======= 3 | [![nuget](https://badge.fury.io/nu/Fable.Import.VSCode.svg)](https://badge.fury.io/nu/Fable.Import.VSCode) 4 | 5 | ### Using 6 | 1. `paket add Fable.Import.VSCode` 7 | 2. `yarn add --dev mocha` or `npm install --save-dev mocha` 8 | -------------------------------------------------------------------------------- /VSCode/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 0.1.2 2 | 3 | * window.registerTreeDataProvider function. 4 | * TreeItem.Command property. 5 | * Fix method resolution for OutputChannel.show: when both * have all optional arguments, method resolution can't decide. 6 | * VSCode TextDocument.version is integer. 7 | * VSCode Event<> properties shouldn't be settable. 8 | * Terminal.processId is int, not float. 9 | * Update build script 10 | 11 | ### 0.1.1 12 | 13 | * Fill in missing parts in VSCode import. #13 14 | 15 | ### 0.1.0 16 | 17 | * Initial Release -------------------------------------------------------------------------------- /VSCode/paket.references: -------------------------------------------------------------------------------- 1 | FSharp.Core 2 | Fable.Core 3 | Fable.Import.Node -------------------------------------------------------------------------------- /build.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | cls 3 | 4 | .paket\paket.exe restore 5 | if errorlevel 1 ( 6 | exit /b %errorlevel% 7 | ) 8 | 9 | packages\build\FAKE\tools\FAKE.exe build.fsx %* 10 | -------------------------------------------------------------------------------- /build.fsx: -------------------------------------------------------------------------------- 1 | #r "packages/build/FAKE/tools/FakeLib.dll" 2 | #r "System.IO.Compression.FileSystem" 3 | #load "paket-files/build/fable-compiler/fake-helpers/Fable.FakeHelpers.fs" 4 | 5 | open Fake 6 | open System.IO 7 | open Fable.FakeHelpers 8 | 9 | let packages = [ 10 | // Node is automatically published by CI 11 | // "Node/Fable.Import.Node" 12 | "Browser/Fable.Import.Browser" 13 | "Express/Fable.Import.Express" 14 | "Pg/Fable.Import.Pg" 15 | "SocketIo/Fable.Import.SocketIo" 16 | "Uws/Fable.Import.Uws" 17 | "Mocha/Fable.Import.Mocha" 18 | "VSCode/Fable.Import.VSCode" 19 | "Electron/Fable.Import.Electron" 20 | "Pixi/Fable.Import.Pixi" 21 | "PixiSound/Fable.Import.Pixi.Sound" 22 | "PixiParticles/Fable.Import.Pixi.Particles" 23 | "Animejs/Fable.Import.Animejs" 24 | "GeoJSON/Fable.Geojson" 25 | "Leaflet/Fable.Leaflet" 26 | "HMR/Fable.Import.HMR" 27 | "GoogleMaps/Fable.Import.GoogleMaps" 28 | ] 29 | 30 | #if MONO 31 | // prevent incorrect output encoding (e.g. https://github.com/fsharp/FAKE/issues/1196) 32 | System.Console.OutputEncoding <- System.Text.Encoding.UTF8 33 | #endif 34 | 35 | let mutable dotnetExePath = environVarOrDefault "DOTNET" "dotnet" 36 | 37 | // Clean and install dotnet SDK 38 | Target "Bootstrap" (fun () -> 39 | let dotnetcliVersion = 40 | Path.Combine(__SOURCE_DIRECTORY__, "global.json") 41 | |> findLineAndGetGroupValue "\"version\": \"(.*?)\"" 1 42 | 43 | !! "**/bin" ++ "**/obj" |> CleanDirs 44 | dotnetExePath <- DotNetCli.InstallDotNetSDK dotnetcliVersion 45 | ) 46 | 47 | Target "PublishPackages" (fun () -> 48 | packages 49 | |> List.map (fun p -> p + ".fsproj") 50 | |> publishPackages __SOURCE_DIRECTORY__ dotnetExePath 51 | ) 52 | 53 | "Bootstrap" 54 | ==> "PublishPackages" 55 | 56 | RunTargetOrDefault "Bootstrap" 57 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | if test "$OS" = "Windows_NT"; then 3 | MONO="" 4 | else 5 | # Mono fix for https://github.com/fsharp/FAKE/issues/805 6 | export MONO_MANAGED_WATCHER=false 7 | MONO="mono" 8 | fi 9 | 10 | if [ -e "paket.lock" ]; then 11 | $MONO .paket/paket.exe restore 12 | else 13 | $MONO .paket/paket.exe install 14 | fi 15 | exit_code=$? 16 | if [ $exit_code -ne 0 ]; then 17 | exit $exit_code 18 | fi 19 | $MONO packages/build/FAKE/tools/FAKE.exe $@ --fsiargs build.fsx 20 | -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "2.1.805" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /paket.dependencies: -------------------------------------------------------------------------------- 1 | version 5.243.0 2 | source https://www.nuget.org/api/v2 3 | storage:none 4 | 5 | clitool dotnet-fable 6 | nuget Fable.Core 7 | nuget Fable.Import.Node 8 | nuget Fable.Import.Browser 9 | nuget Fable.Import.Jest 10 | nuget Fable.PowerPack 11 | 12 | group Build 13 | source https://nuget.org/api/v2 14 | nuget FAKE 15 | github fable-compiler/fake-helpers Fable.FakeHelpers.fs 16 | -------------------------------------------------------------------------------- /test/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "env", 5 | { 6 | "targets": { 7 | "node": "current" 8 | } 9 | } 10 | ] 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /test/Base.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/Node/ChildProcess.Test.fs: -------------------------------------------------------------------------------- 1 | module Fable.Import.Node.ChildProcess.Test 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open Fable.Import.Jest 6 | open Fable.PowerPack 7 | open Matchers 8 | open Fable.Import.Node 9 | open Fable.Import.Node.ChildProcess 10 | 11 | let toStr = function 12 | | U2.Case2(x:Buffer.Buffer) -> x.toString "utf8" 13 | | U2.Case1(x:string) -> x 14 | 15 | let exec (cmd:string) = 16 | Promise.create(fun res _ -> 17 | let cb (e:ExecError option) stdout' stderr' = 18 | let stdout = stdout' |> toStr 19 | let stderr = stderr' |> toStr 20 | 21 | match e with 22 | | Some(err) -> 23 | (err, stderr) 24 | |> Result.Error 25 | |> res 26 | | None -> 27 | (stdout, stderr) 28 | |> Result.Ok 29 | |> res 30 | 31 | let opts = createEmpty 32 | childProcess.exec (cmd, opts, cb) |> ignore 33 | ) 34 | 35 | testList "ChildProcess exec" [ 36 | let withSetup f () = 37 | let p = exec "echo 'Print a message'" 38 | 39 | f(p) 40 | 41 | yield! testFixtureAsync withSetup [ 42 | "should execute a process successfully", fun (p) -> 43 | promise { 44 | let! result = p 45 | result == Ok ("Print a message\n", "") 46 | } 47 | ] 48 | ] 49 | 50 | testList "ChildProcess exec" [ 51 | let withSetup f () = 52 | let p = exec "echo 'Print a message' 1>&2 && exit 1" 53 | f(p) 54 | 55 | yield! testFixtureAsync withSetup [ 56 | "should handle errors", fun (p) -> 57 | 58 | promise { 59 | let! result = p 60 | match result with 61 | | Error (e, stderr') -> 62 | e.message == "Command failed: echo 'Print a message' 1>&2 && exit 1\nPrint a message\n" 63 | e.code == 1 64 | stderr' == "Print a message\n" 65 | | _ -> raise (System.Exception("Command didn't fail as it should have.")) 66 | } 67 | ] 68 | ] -------------------------------------------------------------------------------- /test/Node/Http.Test.fs: -------------------------------------------------------------------------------- 1 | module Fable.Import.Node.Http.Test 2 | 3 | #nowarn "40" 4 | 5 | open Fable.Import.Jest 6 | open Matchers 7 | open Fable.Import.Node 8 | 9 | testList "http foo server" [ 10 | let withSetup f (d:Bindings.DoneStatic) = 11 | let server = 12 | http.createServer(fun _ resp -> 13 | resp.``end``("foo") 14 | ).listen(8081, "0.0.0.0") 15 | 16 | let fin () = 17 | server.close(fun _ -> d.``done``()) 18 | |> ignore 19 | 20 | let rec req = http.get("http://0.0.0.0:8081", fun resp -> 21 | f req resp fin 22 | ) 23 | 24 | () 25 | 26 | yield! testFixtureDone withSetup [ 27 | "should emit data", fun req resp fin -> 28 | expect.assertions 1 29 | 30 | resp 31 | .on("data", fun x -> 32 | x == buffer.Buffer.from("foo") 33 | ) 34 | .on("end", fin) 35 | |> ignore 36 | 37 | req.``end``("blah") 38 | "should have statusCode", fun req resp fin -> 39 | resp.statusCode == Some(200) 40 | 41 | req.``end``() 42 | 43 | fin() 44 | ] 45 | ] 46 | -------------------------------------------------------------------------------- /test/Node/NodeTest.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard2.0 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/Node/Stream.Test.fs: -------------------------------------------------------------------------------- 1 | module Fable.Import.Node.Stream.Test 2 | 3 | open Fable.Import.Node 4 | open Buffer 5 | open Fable.Import.Jest 6 | open Fable.PowerPack 7 | open Matchers 8 | open Fable.Core.JsInterop 9 | 10 | let private toBuffer (x:string) = 11 | buffer.Buffer.from x 12 | 13 | let private collectToPromise (x:Stream.Writable<'a>) = 14 | Promise.create(fun res rej -> 15 | let mutable b = [] 16 | 17 | x.on("data", fun (x:'a) -> 18 | b <- x :: b 19 | ) 20 | |> ignore 21 | 22 | x.once("end", fun () -> res b) 23 | |> ignore 24 | ) 25 | 26 | 27 | testAsync "piping streams" <| fun () -> 28 | let r = stream.PassThrough.Create() 29 | let w = stream.PassThrough.Create<_>() 30 | 31 | r.``end`` (toBuffer "foo") 32 | |> ignore 33 | 34 | promise { 35 | let w' = r.pipe(w) 36 | 37 | let! b = 38 | w' 39 | |> collectToPromise 40 | 41 | b == [toBuffer "foo"] 42 | } 43 | 44 | testAsync "transform stream" <| fun () -> 45 | let readableOpts = createEmpty 46 | readableOpts.read <- Some (fun _ -> 47 | let self:Stream.Readable = jsThis 48 | 49 | self.push("foo" |> toBuffer |> Some) 50 | |> ignore 51 | self.push(None) 52 | |> ignore 53 | ) 54 | 55 | let r = stream.Readable.Create(readableOpts) 56 | 57 | let transformOpts = createEmpty> 58 | 59 | transformOpts.transform <- Some (fun chunk _ cb -> 60 | cb None (Some (buffer.Buffer.concat([| chunk; toBuffer "bar" |]))) 61 | ) 62 | 63 | let t = stream.Transform.Create(transformOpts) 64 | 65 | promise { 66 | let t' = r.pipe(t) 67 | 68 | let! b = 69 | t' 70 | |> collectToPromise 71 | 72 | b == [ toBuffer "foobar" ] 73 | } 74 | 75 | testDone "writable stream" <| fun (d) -> 76 | let writableOpts = createEmpty> 77 | writableOpts.write <- Some(fun x _ cb -> 78 | x == toBuffer "foo" 79 | cb(None) 80 | d.``done``() 81 | ) 82 | 83 | let w = stream.Writable.Create(writableOpts) 84 | 85 | w.write(toBuffer "foo") 86 | |> ignore 87 | 88 | type TestRecord = { 89 | foo: string; 90 | } 91 | 92 | test "creating a passThrough with opts" <| fun () -> 93 | let passThroughOpts = createEmpty> 94 | passThroughOpts.objectMode <- Some true 95 | 96 | let ps = stream.PassThrough.Create passThroughOpts 97 | ps.write({ foo = "bar" }) 98 | |> ignore 99 | 100 | ps.read() == Some { foo = "bar" } 101 | -------------------------------------------------------------------------------- /test/Node/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | preset: 'jest-fable-preprocessor', 3 | displayName: 'Node Binding Tests' 4 | }; -------------------------------------------------------------------------------- /test/Node/paket.references: -------------------------------------------------------------------------------- 1 | Fable.Core 2 | Fable.Import.Jest -------------------------------------------------------------------------------- /test/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "scripts": { 4 | "test": "jest --projects Node", 5 | "test-watch": "jest --watchAll" 6 | }, 7 | "license": "MIT", 8 | "devDependencies": { 9 | "babel-core": "^6.26.3", 10 | "babel-preset-env": "^1.7.0", 11 | "jest": "^29.3.1", 12 | "jest-fable-preprocessor": "^1.4.0" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/paket.references: -------------------------------------------------------------------------------- 1 | dotnet-fable --------------------------------------------------------------------------------