├── .config └── dotnet-tools.json ├── .github └── workflows │ └── dotnet.yml ├── .gitignore ├── Browser.sln ├── LICENSE ├── README.md ├── Settings.FSharpLint ├── build.fsx ├── fable_logo.png ├── global.json ├── package-lock.json ├── package.json ├── paket.dependencies ├── paket.lock ├── src ├── Blob │ ├── Browser.Blob.fs │ ├── Browser.Blob.fsproj │ ├── README.md │ └── RELEASE_NOTES.md ├── Css │ ├── Browser.Css.Api.fs │ ├── Browser.Css.Ext.fs │ ├── Browser.Css.fs │ ├── Browser.Css.fsproj │ ├── README.md │ └── RELEASE_NOTES.md ├── Directory.Build.props ├── Directory.Build.targets ├── Dom │ ├── Browser.Dom.Api.fs │ ├── Browser.Dom.Ext.fs │ ├── Browser.Dom.fs │ ├── Browser.Dom.fsproj │ ├── Browser.DomException.fs │ ├── Browser.File.fs │ ├── Browser.History.fs │ ├── README.md │ └── RELEASE_NOTES.md ├── Event │ ├── Browser.Event.fs │ ├── Browser.Event.fsproj │ ├── README.md │ └── RELEASE_NOTES.md ├── EventSource │ ├── Browser.EventSource.fs │ ├── Browser.EventSource.fsproj │ └── RELEASE_NOTES.md ├── Gamepad │ ├── Browser.Gamepad.fs │ ├── Browser.Gamepad.fsproj │ ├── README.md │ └── RELEASE_NOTES.md ├── Geolocation │ ├── Browser.Geolocation.fs │ ├── Browser.Geolocation.fsproj │ ├── README.md │ └── RELEASE_NOTES.md ├── IndexedDB │ ├── Browser.IndexedDB.Api.fs │ ├── Browser.IndexedDB.Ext.fs │ ├── Browser.IndexedDB.fs │ ├── Browser.IndexedDB.fsproj │ ├── README.md │ └── RELEASE_NOTES.md ├── IntersectionObserver │ ├── Browser.IntersectionObserver.fs │ ├── Browser.IntersectionObserver.fsproj │ ├── README.md │ └── RELEASE_NOTES.md ├── MediaQueryList │ ├── Browser.MediaQueryList.Api.fs │ ├── Browser.MediaQueryList.Ext.fs │ ├── Browser.MediaQueryList.fs │ ├── Browser.MediaQueryList.fsproj │ ├── README.md │ └── RELEASE_NOTES.md ├── MediaRecorder │ ├── Browser.MediaRecorder.fs │ ├── Browser.MediaRecorder.fsproj │ ├── README.md │ └── RELEASE_NOTES.md ├── MediaStream │ ├── Browser.MediaStream.fs │ ├── Browser.MediaStream.fsproj │ ├── README.md │ └── RELEASE_NOTES.md ├── Navigator │ ├── Browser.Navigator.fs │ ├── Browser.Navigator.fsproj │ ├── README.md │ └── RELEASE_NOTES.md ├── Performance │ ├── Browser.Performance.fs │ ├── Browser.Performance.fsproj │ ├── README.md │ └── RELEASE_NOTES.md ├── ResizeObserver │ ├── Browser.ResizeObserver.fs │ ├── Browser.ResizeObserver.fsproj │ ├── README.md │ └── RELEASE_NOTES.md ├── Svg │ ├── Browser.Svg.Api.fs │ ├── Browser.Svg.Ext.fs │ ├── Browser.Svg.fs │ ├── Browser.Svg.fsproj │ ├── README.md │ └── RELEASE_NOTES.md ├── Url │ ├── Browser.Url.fs │ ├── Browser.Url.fsproj │ ├── README.md │ └── RELEASE_NOTES.md ├── WebGL │ ├── Browser.WebGL.fs │ ├── Browser.WebGL.fsproj │ ├── README.md │ └── RELEASE_NOTES.md ├── WebRTC │ ├── Browser.WebRTC.fs │ ├── Browser.WebRTC.fsproj │ ├── README.md │ └── RELEASE_NOTES.md ├── WebSocket │ ├── Browser.WebSocket.fs │ ├── Browser.WebSocket.fsproj │ ├── README.md │ └── RELEASE_NOTES.md ├── WebStorage │ ├── Browser.WebStorage.fs │ ├── Browser.WebStorage.fsproj │ ├── README.md │ └── RELEASE_NOTES.md ├── Worker │ ├── Browser.Worker.fs │ ├── Browser.Worker.fsproj │ ├── README.md │ └── RELEASE_NOTES.md └── XMLHttpRequest │ ├── Browser.XMLHttpRequest.fs │ ├── Browser.XMLHttpRequest.fsproj │ ├── README.md │ └── RELEASE_NOTES.md └── test ├── EventTest.fs └── Test.fsproj /.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "fable": { 6 | "version": "4.24.0", 7 | "commands": [ 8 | "fable" 9 | ], 10 | "rollForward": false 11 | }, 12 | "femto": { 13 | "version": "0.11.0", 14 | "commands": [ 15 | "femto" 16 | ], 17 | "rollForward": false 18 | }, 19 | "paket": { 20 | "version": "6.1.3", 21 | "commands": [ 22 | "paket" 23 | ], 24 | "rollForward": false 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /.github/workflows/dotnet.yml: -------------------------------------------------------------------------------- 1 | name: .NET 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - uses: actions/checkout@v2 16 | - name: Setup .NET 17 | uses: actions/setup-dotnet@v1 18 | with: 19 | dotnet-version: 6.0.x 20 | - name: Setup Node.js environment 21 | uses: actions/setup-node@v2.4.0 22 | with: 23 | node-version: 14.17.* 24 | - name: Restore dependencies 25 | run: npm install 26 | - name: Test 27 | run: npm test 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build/test/* 2 | !build/test/__snapshots__ 3 | .vscode/ 4 | .ionide/ 5 | npm/ 6 | 7 | ## Ignore Visual Studio temporary files, build results, and 8 | ## files generated by popular Visual Studio add-ons. 9 | ## 10 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 11 | 12 | # User-specific files 13 | *.suo 14 | *.user 15 | *.userosscache 16 | *.sln.docstates 17 | 18 | # User-specific files (MonoDevelop/Xamarin Studio) 19 | *.userprefs 20 | 21 | # Build results 22 | [Dd]ebug/ 23 | [Dd]ebugPublic/ 24 | [Rr]elease/ 25 | [Rr]eleases/ 26 | x64/ 27 | x86/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | 33 | # Visual Studio 2015/2017 cache/options directory 34 | .vs/ 35 | # Uncomment if you have tasks that create the project's static files in wwwroot 36 | #wwwroot/ 37 | 38 | # Visual Studio 2017 auto generated files 39 | Generated\ Files/ 40 | 41 | # MSTest test Results 42 | [Tt]est[Rr]esult*/ 43 | [Bb]uild[Ll]og.* 44 | 45 | # NUNIT 46 | *.VisualState.xml 47 | TestResult.xml 48 | 49 | # Build Results of an ATL Project 50 | [Dd]ebugPS/ 51 | [Rr]eleasePS/ 52 | dlldata.c 53 | 54 | # Benchmark Results 55 | BenchmarkDotNet.Artifacts/ 56 | 57 | # .NET Core 58 | project.lock.json 59 | project.fragment.lock.json 60 | artifacts/ 61 | **/Properties/launchSettings.json 62 | 63 | # StyleCop 64 | StyleCopReport.xml 65 | 66 | # Files built by Visual Studio 67 | *_i.c 68 | *_p.c 69 | *_i.h 70 | *.ilk 71 | *.meta 72 | *.obj 73 | *.iobj 74 | *.pch 75 | *.pdb 76 | *.ipdb 77 | *.pgc 78 | *.pgd 79 | *.rsp 80 | *.sbr 81 | *.tlb 82 | *.tli 83 | *.tlh 84 | *.tmp 85 | *.tmp_proj 86 | *.log 87 | *.vspscc 88 | *.vssscc 89 | .builds 90 | *.pidb 91 | *.svclog 92 | *.scc 93 | 94 | # Chutzpah Test files 95 | _Chutzpah* 96 | 97 | # Visual C++ cache files 98 | ipch/ 99 | *.aps 100 | *.ncb 101 | *.opendb 102 | *.opensdf 103 | *.sdf 104 | *.cachefile 105 | *.VC.db 106 | *.VC.VC.opendb 107 | 108 | # Visual Studio profiler 109 | *.psess 110 | *.vsp 111 | *.vspx 112 | *.sap 113 | 114 | # Visual Studio Trace Files 115 | *.e2e 116 | 117 | # TFS 2012 Local Workspace 118 | $tf/ 119 | 120 | # Guidance Automation Toolkit 121 | *.gpState 122 | 123 | # ReSharper is a .NET coding add-in 124 | _ReSharper*/ 125 | *.[Rr]e[Ss]harper 126 | *.DotSettings.user 127 | 128 | # JustCode is a .NET coding add-in 129 | .JustCode 130 | 131 | # TeamCity is a build add-in 132 | _TeamCity* 133 | 134 | # DotCover is a Code Coverage Tool 135 | *.dotCover 136 | 137 | # AxoCover is a Code Coverage Tool 138 | .axoCover/* 139 | !.axoCover/settings.json 140 | 141 | # Visual Studio code coverage results 142 | *.coverage 143 | *.coveragexml 144 | 145 | # NCrunch 146 | _NCrunch_* 147 | .*crunch*.local.xml 148 | nCrunchTemp_* 149 | 150 | # MightyMoose 151 | *.mm.* 152 | AutoTest.Net/ 153 | 154 | # Web workbench (sass) 155 | .sass-cache/ 156 | 157 | # Installshield output folder 158 | [Ee]xpress/ 159 | 160 | # DocProject is a documentation generator add-in 161 | DocProject/buildhelp/ 162 | DocProject/Help/*.HxT 163 | DocProject/Help/*.HxC 164 | DocProject/Help/*.hhc 165 | DocProject/Help/*.hhk 166 | DocProject/Help/*.hhp 167 | DocProject/Help/Html2 168 | DocProject/Help/html 169 | 170 | # Click-Once directory 171 | publish/ 172 | 173 | # Publish Web Output 174 | *.[Pp]ublish.xml 175 | *.azurePubxml 176 | # Note: Comment the next line if you want to checkin your web deploy settings, 177 | # but database connection strings (with potential passwords) will be unencrypted 178 | *.pubxml 179 | *.publishproj 180 | 181 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 182 | # checkin your Azure Web App publish settings, but sensitive information contained 183 | # in these scripts will be unencrypted 184 | PublishScripts/ 185 | 186 | # NuGet Packages 187 | *.nupkg 188 | # The packages folder can be ignored because of Package Restore 189 | **/[Pp]ackages/* 190 | # except build/, which is used as an MSBuild target. 191 | !**/[Pp]ackages/build/ 192 | # Uncomment if necessary however generally it will be regenerated when needed 193 | #!**/[Pp]ackages/repositories.config 194 | # NuGet v3's project.json files produces more ignorable files 195 | *.nuget.props 196 | *.nuget.targets 197 | 198 | # Microsoft Azure Build Output 199 | csx/ 200 | *.build.csdef 201 | 202 | # Microsoft Azure Emulator 203 | ecf/ 204 | rcf/ 205 | 206 | # Windows Store app package directories and files 207 | AppPackages/ 208 | BundleArtifacts/ 209 | Package.StoreAssociation.xml 210 | _pkginfo.txt 211 | *.appx 212 | 213 | # Visual Studio cache files 214 | # files ending in .cache can be ignored 215 | *.[Cc]ache 216 | # but keep track of directories ending in .cache 217 | !*.[Cc]ache/ 218 | 219 | # Others 220 | ClientBin/ 221 | ~$* 222 | *~ 223 | *.dbmdl 224 | *.dbproj.schemaview 225 | *.jfm 226 | *.pfx 227 | *.publishsettings 228 | orleans.codegen.cs 229 | 230 | # Including strong name files can present a security risk 231 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 232 | #*.snk 233 | 234 | # Since there are multiple workflows, uncomment next line to ignore bower_components 235 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 236 | #bower_components/ 237 | 238 | # RIA/Silverlight projects 239 | Generated_Code/ 240 | 241 | # Backup & report files from converting an old project file 242 | # to a newer Visual Studio version. Backup files are not needed, 243 | # because we have git ;-) 244 | _UpgradeReport_Files/ 245 | Backup*/ 246 | UpgradeLog*.XML 247 | UpgradeLog*.htm 248 | ServiceFabricBackup/ 249 | *.rptproj.bak 250 | 251 | # SQL Server files 252 | *.mdf 253 | *.ldf 254 | *.ndf 255 | 256 | # Business Intelligence projects 257 | *.rdl.data 258 | *.bim.layout 259 | *.bim_*.settings 260 | *.rptproj.rsuser 261 | 262 | # Microsoft Fakes 263 | FakesAssemblies/ 264 | 265 | # GhostDoc plugin setting file 266 | *.GhostDoc.xml 267 | 268 | # Node.js Tools for Visual Studio 269 | .ntvs_analysis.dat 270 | node_modules/ 271 | 272 | # Visual Studio 6 build log 273 | *.plg 274 | 275 | # Visual Studio 6 workspace options file 276 | *.opt 277 | 278 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 279 | *.vbw 280 | 281 | # Visual Studio LightSwitch build output 282 | **/*.HTMLClient/GeneratedArtifacts 283 | **/*.DesktopClient/GeneratedArtifacts 284 | **/*.DesktopClient/ModelManifest.xml 285 | **/*.Server/GeneratedArtifacts 286 | **/*.Server/ModelManifest.xml 287 | _Pvt_Extensions 288 | 289 | # Paket dependency manager 290 | .paket/ 291 | paket-files/ 292 | 293 | # FAKE - F# Make 294 | .fake/ 295 | 296 | # JetBrains Rider 297 | .idea/ 298 | *.sln.iml 299 | 300 | # CodeRush 301 | .cr/ 302 | 303 | # Python Tools for Visual Studio (PTVS) 304 | __pycache__/ 305 | *.pyc 306 | 307 | # Cake - Uncomment if you are using it 308 | # tools/** 309 | # !tools/packages.config 310 | 311 | # Tabs Studio 312 | *.tss 313 | 314 | # Telerik's JustMock configuration file 315 | *.jmconfig 316 | 317 | # BizTalk build output 318 | *.btp.cs 319 | *.btm.cs 320 | *.odx.cs 321 | *.xsd.cs 322 | 323 | # OpenCover UI analysis results 324 | OpenCover/ 325 | 326 | # Azure Stream Analytics local run output 327 | ASALocalRun/ 328 | 329 | # MSBuild Binary and Structured Log 330 | *.binlog 331 | 332 | # NVidia Nsight GPU debugger configuration file 333 | *.nvuser 334 | 335 | # MFractors (Xamarin productivity tool) working folder 336 | .mfractor/ 337 | src/.DS_Store 338 | .DS_Store 339 | temp/ 340 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Fable 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # fable-browser 2 | 3 | Fable bindings for [Browser Web APIs](https://developer.mozilla.org/docs/Web/API) 4 | 5 | |NuGet|Name|Description| 6 | |-----|----|-----------| 7 | |[![Nuget Package](https://img.shields.io/nuget/v/Fable.Browser.Blob.svg)](https://www.nuget.org/packages/Fable.Browser.Blob)|[Fable.Browser.Blob](src/Blob)|Bindings for the browser Blob API.| 8 | |[![Nuget Package](https://img.shields.io/nuget/v/Fable.Browser.Dom.svg)](https://www.nuget.org/packages/Fable.Browser.Dom)|[Fable.Browser.Dom](src/Dom)|Bindings for DOM and HTML interfaces| 9 | |[![Nuget Package](https://img.shields.io/nuget/v/Fable.Browser.Event.svg)](https://www.nuget.org/packages/Fable.Browser.Event)|[Fable.Browser.Event](src/Event)|Bindings for the browser Event interface| 10 | |[![Nuget Package](https://img.shields.io/nuget/v/Fable.Browser.Performance.svg)](https://www.nuget.org/packages/Fable.Browser.Performance)|[Fable.Browser.Performance](src/Performance)|Bindings for the browser Performance API| 11 | |[![Nuget Package](https://img.shields.io/nuget/v/Fable.Browser.Url.svg)](https://www.nuget.org/packages/Fable.Browser.Url)|[Fable.Browser.Url](src/Url)|Bindings for the browser Url API| 12 | |[![Nuget Package](https://img.shields.io/nuget/v/Fable.Browser.WebSocket.svg)](https://www.nuget.org/packages/Fable.Browser.WebSocket)|[Fable.Browser.WebSocket](src/WebSocket)|Bindings for the browser WebSocket API| 13 | |[![Nuget Package](https://img.shields.io/nuget/v/Fable.Browser.WebRTC.svg)](https://www.nuget.org/packages/Fable.Browser.WebRTC)|[Fable.Browser.WebRTC](src/WebRTC)|Bindings for the browser WebRTC API| 14 | |[![Nuget Package](https://img.shields.io/nuget/v/Fable.Browser.WebStorage.svg)](https://www.nuget.org/packages/Fable.Browser.WebStorage)|[Fable.Browser.WebStorage](src/WebStorage)|Bindings for the Web Storage API| 15 | |[![Nuget Package](https://img.shields.io/nuget/v/Fable.Browser.XMLHttpRequest.svg)](https://www.nuget.org/packages/Fable.Browser.XMLHttpRequest)|[Fable.Browser.XMLHttpRequest](src/XMLHttpRequest)|Bindings for the browser XMLHttpRequest API| 16 | |[![Nuget Package](https://img.shields.io/nuget/v/Fable.Browser.Svg.svg)](https://www.nuget.org/packages/Fable.Browser.Svg)|[Fable.Browser.Svg](src/Svg)|Bindings for the browser Svg API| 17 | |[![Nuget Package](https://img.shields.io/nuget/v/Fable.Browser.Css.svg)](https://www.nuget.org/packages/Fable.Browser.Css)|[Fable.Browser.Css](src/Css)|Bindings for the browser Css API| 18 | |[![Nuget Package](https://img.shields.io/nuget/v/Fable.Browser.Worker.svg)](https://www.nuget.org/packages/Fable.Browser.Worker)|[Fable.Browser.Worker](src/Worker)|Bindings for the browser Worker API| 19 | |[![Nuget Package](https://img.shields.io/nuget/v/Fable.Browser.Geolocation.svg)](https://www.nuget.org/packages/Fable.Browser.Geolocation)|[Fable.Browser.Geolocation](src/Geolocation)|Bindings for the browser Geolocation API| 20 | |[![Nuget Package](https://img.shields.io/nuget/v/Fable.Browser.Navigator.svg)](https://www.nuget.org/packages/Fable.Browser.Navigator)|[Fable.Browser.Navigator](src/Navigator)|Bindings for the browser Navigator API| 21 | |[![Nuget Package](https://img.shields.io/nuget/v/Fable.Browser.MediaStream.svg)](https://www.nuget.org/packages/Fable.Browser.MediaStream)|[Fable.Browser.MediaStream](src/MediaStream)|Bindings for the browser MediaStream API| 22 | |[![Nuget Package](https://img.shields.io/nuget/v/Fable.Browser.MediaRecorder.svg)](https://www.nuget.org/packages/Fable.Browser.MediaRecorder)|[Fable.Browser.MediaRecorder](src/MediaRecorder)|Bindings for the browser MediaRecorder API| 23 | |[![Nuget Package](https://img.shields.io/nuget/v/Fable.Browser.MediaQueryList.svg)](https://www.nuget.org/packages/Fable.Browser.MediaQueryList)|[Fable.Browser.MediaQueryList](src/MediaQueryList)|Bindings for the browser MediaQueryList API| 24 | |[![Nuget Package](https://img.shields.io/nuget/v/Fable.Browser.WebGL.svg)](https://www.nuget.org/packages/Fable.Browser.WebGL)|[Fable.Browser.WebGL](src/WebGL)|Bindings for the browser WebGL API| 25 | |[![Nuget Package](https://img.shields.io/nuget/v/Fable.Browser.IntersectionObserver.svg)](https://www.nuget.org/packages/Fable.Browser.IntersectionObserver)|[Fable.Browser.IntersectionObserver](src/IntersectionObserver)|Bindings for the browser Intersection Observer API| 26 | |[![Nuget Package](https://img.shields.io/nuget/v/Fable.Browser.ResizeObserver.svg)](https://www.nuget.org/packages/Fable.Browser.ResizeObserver)|[Fable.Browser.ResizeObserver](src/ResizeObserver)|Bindings for the browser Resize Observer API| 27 | |[![Nuget Package](https://img.shields.io/nuget/v/Fable.Browser.IndexedDB.svg)](https://www.nuget.org/packages/Fable.Browser.IndexedDB)|[Fable.Browser.IndexedDB](src/IndexedDB)|Bindings for the browser IndexedDB API| 28 | 29 | ## Usage 30 | 31 | After installing one of the Nuget packages you can access the API. For that, you only need to open the `Browser` namespace. 32 | 33 | ```fsharp 34 | open Browser 35 | 36 | let fooEl = document.getElementById("foo") 37 | ``` 38 | 39 | Note the API values are actually contained in an `[]` module, so if you need to fully qualify the value to avoid name conflicts, use the full module name (same as the Nuget package without `Fable.` prefix): 40 | 41 | ```fsharp 42 | let fooEl = Browser.Dom.document.getElementById("foo") 43 | ``` 44 | 45 | If you need to reference one of the types in the package, open the `Browser.Types` namespace: 46 | 47 | ```fsharp 48 | open Browser.Types 49 | 50 | let handleClick (ev: MouseEvent) = printfn "click!" 51 | ``` 52 | 53 | ## Publishing 54 | 55 | If you have rights to publish the packages, the only thing you need to do is to bump the version in the appropriate RELEASE_NOTES file and then run `npm run publish`. The build script will automatically detect what packages have new versions, update the .fsproj file and push a release. Just make sure: 56 | 57 | - Your Nuget API key is in a FABLE_NUGET_KEY environmental variable 58 | - The packages you want to publish are listed in the `packages` list of the Build.fsx script 59 | -------------------------------------------------------------------------------- /Settings.FSharpLint: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | False 6 | 7 | 8 | -------------------------------------------------------------------------------- /build.fsx: -------------------------------------------------------------------------------- 1 | #r "nuget: Fable.PublishUtils, 2.4.0" 2 | 3 | open System 4 | open PublishUtils 5 | 6 | run "npm install && npm test" 7 | 8 | // ATTENTION: Packages must appear in dependency order 9 | let packages = 10 | [ "Blob" 11 | "Gamepad" 12 | "Event" 13 | "Performance" 14 | "Url" 15 | "WebSocket" 16 | "WebStorage" 17 | "Dom" 18 | "XMLHttpRequest" 19 | "Svg" 20 | "Css" 21 | "Worker" 22 | "Geolocation" 23 | "Navigator" 24 | "MediaStream" 25 | "MediaRecorder" 26 | "MediaQueryList" 27 | "WebRTC" 28 | "WebGL" 29 | "IndexedDB" 30 | "IntersectionObserver" 31 | "ResizeObserver" 32 | "EventSource" 33 | ] 34 | 35 | let ignoreCaseEquals (str1: string) (str2: string) = 36 | String.Equals(str1, str2, StringComparison.OrdinalIgnoreCase) 37 | 38 | let args = 39 | fsi.CommandLineArgs 40 | |> Array.skip 1 41 | |> List.ofArray 42 | 43 | match args with 44 | | IgnoreCase "publish"::rest -> 45 | let target = List.tryHead rest 46 | let srcDir = fullPath "src" 47 | let projFiles = packages |> List.map (fun pkg -> 48 | (srcDir pkg), ("Browser." + pkg + ".fsproj")) 49 | 50 | for projDir, file in projFiles do 51 | let publish = 52 | match target with 53 | | Some target -> ignoreCaseEquals file.[..(file.Length - 8)] target 54 | | None -> true 55 | if publish then 56 | pushFableNuget (projDir file) [] doNothing 57 | | _ -> () 58 | 59 | -------------------------------------------------------------------------------- /fable_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fable-compiler/fable-browser/3ab77e510f6f8cc21ec3b6e7861ba3f17022da10/fable_logo.png -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "8.0.0", 4 | "rollForward": "latestMinor" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "private": true, 3 | "name": "fable-browser", 4 | "scripts": { 5 | "postinstall": "dotnet tool restore && dotnet paket restore", 6 | "publish": "dotnet fsi build.fsx Publish", 7 | "test": "dotnet fable test -o build/test --run web-test-runner build/test/*Test.js --node-resolve", 8 | "test:watch": "dotnet fable watch test -o build/test --run web-test-runner build/test/*Test.js --node-resolve --watch" 9 | }, 10 | "devDependencies": { 11 | "@web/test-runner": "^0.20.0", 12 | "@web/test-runner-commands": "^0.5.13" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /paket.dependencies: -------------------------------------------------------------------------------- 1 | source https://api.nuget.org/v3/index.json 2 | 3 | github fable-compiler/Fable.Expect:main -------------------------------------------------------------------------------- /paket.lock: -------------------------------------------------------------------------------- 1 | 2 | GITHUB 3 | remote: fable-compiler/Fable.Expect 4 | FULLPROJECT (ae6ea7a4fadff6e78da0f077f925121206284d0d) -------------------------------------------------------------------------------- /src/Blob/Browser.Blob.fs: -------------------------------------------------------------------------------- 1 | namespace Browser.Types 2 | 3 | open System 4 | open Fable.Core 5 | open Fable.Core.JS 6 | 7 | [] 8 | type BlobEndings = 9 | /// Endings are stored in the blob without change 10 | | [] Transparent 11 | /// Line ending characters are changed to match host OS filesystem convention 12 | | [] Native 13 | 14 | type [] BlobPropertyBag = 15 | abstract ``type``: string with get, set 16 | abstract endings: BlobEndings with get, set 17 | 18 | type [] Blob = 19 | abstract arrayBuffer: unit -> Promise 20 | abstract size: int 21 | abstract ``type``: string 22 | abstract slice: ?start: int * ?``end``: int * ?contentType: string -> Blob 23 | abstract text: unit -> Promise 24 | 25 | type [] BlobType = 26 | [] abstract Create: ?blobParts: obj[] * ?options: BlobPropertyBag -> Blob 27 | 28 | type [] FormData = 29 | abstract append: name: string * value: string -> unit 30 | abstract append: name: string * value: Blob * ?filename: string -> unit 31 | abstract delete: name: string -> unit 32 | abstract entries: unit -> (string * obj) seq 33 | abstract get: name: string -> obj 34 | abstract getAll: name: string -> obj[] 35 | abstract has: name: string -> bool 36 | abstract keys: unit -> string seq 37 | abstract set: name: string * value: string -> unit 38 | abstract set: name: string * value: Blob * ?filename: string -> unit 39 | abstract values: unit -> obj seq 40 | 41 | type [] FormDataType = 42 | [] abstract Create: unit -> FormData 43 | 44 | namespace Browser 45 | 46 | open Fable.Core 47 | open Browser.Types 48 | 49 | [] 50 | module Blob = 51 | let [] Blob: BlobType = jsNative 52 | let [] FormData: FormDataType = jsNative 53 | -------------------------------------------------------------------------------- /src/Blob/Browser.Blob.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.Blob 5 | 1.4.0 6 | 1.4.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /src/Blob/README.md: -------------------------------------------------------------------------------- 1 | # Browser.Blob 2 | 3 | Includes bindings for the browser [Blob API](https://developer.mozilla.org/en-US/docs/Web/API/Blob). -------------------------------------------------------------------------------- /src/Blob/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 1.4.0 2 | 3 | - Align Fable.Core version to 3.2.8 for all of fable-browser packages 4 | 5 | ### 1.3.0 6 | 7 | * Add `tags` to make binding displayed on Fable.Packages 8 | * Fix #106: Add missing `blob.text()` 9 | 10 | ### 1.2.0 11 | 12 | * Add Global attribute to global interfaces @chkn 13 | 14 | ### 1.1.4 15 | 16 | * Downgrade FSharp.Core to 4.7.2 17 | 18 | ### 1.1.3 19 | 20 | * Downgrade FSharp.Core to 4.7.2 21 | 22 | ### 1.1.2 23 | 24 | * Release a new version because one of the dependencies had the licence information missing 25 | 26 | ### 1.1.1 27 | 28 | * Add licence to Nuget package @nojaf 29 | 30 | ### 1.1.0 31 | 32 | * Add `FormData` 33 | 34 | ### 1.0.0 35 | 36 | * First stable release 37 | 38 | ### 1.0.0-alpha-001 39 | 40 | * First release 41 | -------------------------------------------------------------------------------- /src/Css/Browser.Css.Api.fs: -------------------------------------------------------------------------------- 1 | namespace Browser 2 | 3 | open Fable.Core 4 | open Browser.Types 5 | 6 | [] 7 | module Css = 8 | let [] CSSConditionRule: CSSConditionRuleType = jsNative 9 | let [] CSSFontFaceRule: CSSFontFaceRuleType = jsNative 10 | let [] CSSGroupingRule: CSSGroupingRuleType = jsNative 11 | let [] CSSImportRule: CSSImportRuleType = jsNative 12 | let [] CSSKeyframeRule: CSSKeyframeRuleType = jsNative 13 | let [] CSSKeyframesRule: CSSKeyframesRuleType = jsNative 14 | let [] CSSMediaRule: CSSMediaRuleType = jsNative 15 | let [] CSSNamespaceRule: CSSNamespaceRuleType = jsNative 16 | let [] CSSPageRule: CSSPageRuleType = jsNative 17 | let [] CSSRule: CSSRuleType = jsNative 18 | let [] CSSRuleList: CSSRuleListType = jsNative 19 | let [] CSSStyleDeclaration: CSSStyleDeclarationType = jsNative 20 | let [] CSSStyleRule: CSSStyleRuleType = jsNative 21 | let [] CSSStyleSheet: CSSStyleSheetType = jsNative 22 | let [] CSSSupportsRule: CSSSupportsRuleType = jsNative 23 | let [] StyleMedia: StyleMediaType = jsNative 24 | let [] StyleSheet: StyleSheetType = jsNative 25 | let [] StyleSheetList: StyleSheetListType = jsNative 26 | let [] StyleSheetPageList: StyleSheetPageListType = jsNative 27 | -------------------------------------------------------------------------------- /src/Css/Browser.Css.Ext.fs: -------------------------------------------------------------------------------- 1 | [] 2 | module Browser.CssExtensions 3 | 4 | open Fable.Core 5 | open Browser.Types 6 | 7 | type Window with 8 | [] 9 | member __.getComputedStyle(elt: Element, ?pseudoElt: string): CSSStyleDeclaration = jsNative 10 | 11 | type Element with 12 | /// returns this DocumentOrShadow adopted stylesheets or sets them. 13 | /// https://wicg.github.io/construct-stylesheets/#using-constructed-stylesheets 14 | [] 15 | member __.adoptedStyleSheets with get(): CSSStyleSheet array = jsNative and set(v: CSSStyleSheet array) = jsNative 16 | 17 | type ShadowRoot with 18 | /// Returns a StyleSheetList of CSSStyleSheet objects for stylesheets explicitly linked into, or embedded in a shadow tree. 19 | [] 20 | member __.styleSheets: StyleSheetList = jsNative 21 | 22 | type Document with 23 | /// returns this DocumentOrShadowRoot adopted stylesheets or sets them. 24 | /// https://wicg.github.io/construct-stylesheets/#using-constructed-stylesheets 25 | [] 26 | member __.adoptedStyleSheets with get(): CSSStyleSheet array = jsNative and set(v: CSSStyleSheet array) = jsNative 27 | /// Retrieves a collection of styleSheet objects representing the style sheets that correspond to each instance of a link or style object in the document. 28 | [] 29 | member __.styleSheets with get(): StyleSheetList = jsNative and set(v: StyleSheetList) = jsNative 30 | [] 31 | member __.styleMedia with get(): StyleMedia = jsNative and set(v: StyleMedia) = jsNative 32 | [] 33 | member __.getMatchedCSSRules(elt: Element, ?pseudoElt: string): CSSRuleList = jsNative 34 | 35 | type HTMLElement with 36 | [] 37 | member __.style with get(): CSSStyleDeclaration = jsNative and set(v: CSSStyleDeclaration) = jsNative 38 | 39 | type HTMLLinkElement with 40 | [] 41 | member __.sheet with get(): StyleSheet = jsNative and set(v: StyleSheet) = jsNative 42 | 43 | type HTMLStyleElement with 44 | [] 45 | member __.sheet with get(): StyleSheet = jsNative and set(v: StyleSheet) = jsNative 46 | 47 | type SVGStylable with 48 | [] 49 | member __.style with get(): CSSStyleDeclaration = jsNative and set(v: CSSStyleDeclaration) = jsNative 50 | 51 | type SVGSVGElement with 52 | [] 53 | member __.getComputedStyle(elt: Element, ?pseudoElt: string): CSSStyleDeclaration = jsNative 54 | -------------------------------------------------------------------------------- /src/Css/Browser.Css.fs: -------------------------------------------------------------------------------- 1 | namespace rec Browser.Types 2 | 3 | open System 4 | open Fable.Core 5 | 6 | type [] CSS = 7 | abstract supports: property: string * ?value: string -> bool 8 | 9 | type [] CSSConditionRule = 10 | inherit CSSGroupingRule 11 | abstract conditionText: string with get, set 12 | 13 | type CSSConditionRuleType = 14 | abstract prototype: CSSConditionRule with get, set 15 | [] abstract Create: unit -> CSSConditionRule 16 | 17 | type [] CSSFontFaceRule = 18 | inherit CSSRule 19 | abstract style: CSSStyleDeclaration with get, set 20 | 21 | type CSSFontFaceRuleType = 22 | abstract prototype: CSSFontFaceRule with get, set 23 | [] abstract Create: unit -> CSSFontFaceRule 24 | 25 | type [] CSSGroupingRule = 26 | inherit CSSRule 27 | abstract cssRules: CSSRuleList with get, set 28 | abstract deleteRule: ?index: float -> unit 29 | abstract insertRule: rule: string * ?index: float -> float 30 | 31 | type CSSGroupingRuleType = 32 | abstract prototype: CSSGroupingRule with get, set 33 | [] abstract Create: unit -> CSSGroupingRule 34 | 35 | type [] CSSImportRule = 36 | inherit CSSRule 37 | abstract href: string with get, set 38 | // TODO 39 | // abstract media: MediaList with get, set 40 | abstract styleSheet: CSSStyleSheet with get, set 41 | 42 | type CSSImportRuleType = 43 | abstract prototype: CSSImportRule with get, set 44 | [] abstract Create: unit -> CSSImportRule 45 | 46 | type [] CSSKeyframeRule = 47 | inherit CSSRule 48 | abstract keyText: string with get, set 49 | abstract style: CSSStyleDeclaration with get, set 50 | 51 | type CSSKeyframeRuleType = 52 | abstract prototype: CSSKeyframeRule with get, set 53 | [] abstract Create: unit -> CSSKeyframeRule 54 | 55 | type [] CSSKeyframesRule = 56 | inherit CSSRule 57 | abstract cssRules: CSSRuleList with get, set 58 | abstract name: string with get, set 59 | abstract appendRule: rule: string -> unit 60 | abstract deleteRule: rule: string -> unit 61 | abstract findRule: rule: string -> CSSKeyframeRule 62 | 63 | type CSSKeyframesRuleType = 64 | abstract prototype: CSSKeyframesRule with get, set 65 | [] abstract Create: unit -> CSSKeyframesRule 66 | 67 | type [] CSSMediaRule = 68 | inherit CSSConditionRule 69 | /// TODO 70 | // abstract media: MediaList with get, set 71 | 72 | type CSSMediaRuleType = 73 | abstract prototype: CSSMediaRule with get, set 74 | [] abstract Create: unit -> CSSMediaRule 75 | 76 | type [] CSSNamespaceRule = 77 | inherit CSSRule 78 | abstract namespaceURI: string with get, set 79 | abstract prefix: string with get, set 80 | 81 | type CSSNamespaceRuleType = 82 | abstract prototype: CSSNamespaceRule with get, set 83 | [] abstract Create: unit -> CSSNamespaceRule 84 | 85 | type [] CSSPageRule = 86 | inherit CSSRule 87 | abstract pseudoClass: string with get, set 88 | abstract selector: string with get, set 89 | abstract selectorText: string with get, set 90 | abstract style: CSSStyleDeclaration with get, set 91 | 92 | type CSSPageRuleType = 93 | abstract prototype: CSSPageRule with get, set 94 | [] abstract Create: unit -> CSSPageRule 95 | 96 | type [] CSSRule = 97 | abstract cssText: string with get, set 98 | abstract parentRule: CSSRule with get, set 99 | abstract parentStyleSheet: CSSStyleSheet with get, set 100 | abstract ``type``: float with get, set 101 | abstract CHARSET_RULE: float with get, set 102 | abstract FONT_FACE_RULE: float with get, set 103 | abstract IMPORT_RULE: float with get, set 104 | abstract KEYFRAMES_RULE: float with get, set 105 | abstract KEYFRAME_RULE: float with get, set 106 | abstract MEDIA_RULE: float with get, set 107 | abstract NAMESPACE_RULE: float with get, set 108 | abstract PAGE_RULE: float with get, set 109 | abstract STYLE_RULE: float with get, set 110 | abstract SUPPORTS_RULE: float with get, set 111 | abstract UNKNOWN_RULE: float with get, set 112 | abstract VIEWPORT_RULE: float with get, set 113 | 114 | type CSSRuleType = 115 | abstract prototype: CSSRule with get, set 116 | abstract CHARSET_RULE: float with get, set 117 | abstract FONT_FACE_RULE: float with get, set 118 | abstract IMPORT_RULE: float with get, set 119 | abstract KEYFRAMES_RULE: float with get, set 120 | abstract KEYFRAME_RULE: float with get, set 121 | abstract MEDIA_RULE: float with get, set 122 | abstract NAMESPACE_RULE: float with get, set 123 | abstract PAGE_RULE: float with get, set 124 | abstract STYLE_RULE: float with get, set 125 | abstract SUPPORTS_RULE: float with get, set 126 | abstract UNKNOWN_RULE: float with get, set 127 | abstract VIEWPORT_RULE: float with get, set 128 | [] abstract Create: unit -> CSSRule 129 | 130 | type [] CSSRuleList = 131 | abstract length: float with get, set 132 | [] abstract Item: index: int -> CSSRule with get, set 133 | abstract item: index: float -> CSSRule 134 | 135 | type CSSRuleListType = 136 | abstract prototype: CSSRuleList with get, set 137 | [] abstract Create: unit -> CSSRuleList 138 | 139 | type [] CSSStyleDeclaration = 140 | abstract alignContent: string with get, set 141 | abstract alignItems: string with get, set 142 | abstract alignSelf: string with get, set 143 | abstract alignmentBaseline: string with get, set 144 | abstract animation: string with get, set 145 | abstract animationDelay: string with get, set 146 | abstract animationDirection: string with get, set 147 | abstract animationDuration: string with get, set 148 | abstract animationFillMode: string with get, set 149 | abstract animationIterationCount: string with get, set 150 | abstract animationName: string with get, set 151 | abstract animationPlayState: string with get, set 152 | abstract animationTimingFunction: string with get, set 153 | abstract backfaceVisibility: string with get, set 154 | abstract background: string with get, set 155 | abstract backgroundAttachment: string with get, set 156 | abstract backgroundClip: string with get, set 157 | abstract backgroundColor: string with get, set 158 | abstract backgroundImage: string with get, set 159 | abstract backgroundOrigin: string with get, set 160 | abstract backgroundPosition: string with get, set 161 | abstract backgroundPositionX: string with get, set 162 | abstract backgroundPositionY: string with get, set 163 | abstract backgroundRepeat: string with get, set 164 | abstract backgroundSize: string with get, set 165 | abstract baselineShift: string with get, set 166 | abstract border: string with get, set 167 | abstract borderBottom: string with get, set 168 | abstract borderBottomColor: string with get, set 169 | abstract borderBottomLeftRadius: string with get, set 170 | abstract borderBottomRightRadius: string with get, set 171 | abstract borderBottomStyle: string with get, set 172 | abstract borderBottomWidth: string with get, set 173 | abstract borderCollapse: string with get, set 174 | abstract borderColor: string with get, set 175 | abstract borderImage: string with get, set 176 | abstract borderImageOutset: string with get, set 177 | abstract borderImageRepeat: string with get, set 178 | abstract borderImageSlice: string with get, set 179 | abstract borderImageSource: string with get, set 180 | abstract borderImageWidth: string with get, set 181 | abstract borderLeft: string with get, set 182 | abstract borderLeftColor: string with get, set 183 | abstract borderLeftStyle: string with get, set 184 | abstract borderLeftWidth: string with get, set 185 | abstract borderRadius: string with get, set 186 | abstract borderRight: string with get, set 187 | abstract borderRightColor: string with get, set 188 | abstract borderRightStyle: string with get, set 189 | abstract borderRightWidth: string with get, set 190 | abstract borderSpacing: string with get, set 191 | abstract borderStyle: string with get, set 192 | abstract borderTop: string with get, set 193 | abstract borderTopColor: string with get, set 194 | abstract borderTopLeftRadius: string with get, set 195 | abstract borderTopRightRadius: string with get, set 196 | abstract borderTopStyle: string with get, set 197 | abstract borderTopWidth: string with get, set 198 | abstract borderWidth: string with get, set 199 | abstract bottom: string with get, set 200 | abstract boxShadow: string with get, set 201 | abstract boxSizing: string with get, set 202 | abstract breakAfter: string with get, set 203 | abstract breakBefore: string with get, set 204 | abstract breakInside: string with get, set 205 | abstract captionSide: string with get, set 206 | abstract clear: string with get, set 207 | abstract clip: string with get, set 208 | abstract clipPath: string with get, set 209 | abstract clipRule: string with get, set 210 | abstract color: string with get, set 211 | abstract colorInterpolationFilters: string with get, set 212 | abstract columnCount: obj with get, set 213 | abstract columnFill: string with get, set 214 | abstract columnGap: obj with get, set 215 | abstract columnRule: string with get, set 216 | abstract columnRuleColor: obj with get, set 217 | abstract columnRuleStyle: string with get, set 218 | abstract columnRuleWidth: obj with get, set 219 | abstract columnSpan: string with get, set 220 | abstract columnWidth: obj with get, set 221 | abstract columns: string with get, set 222 | abstract content: string with get, set 223 | abstract counterIncrement: string with get, set 224 | abstract counterReset: string with get, set 225 | abstract cssFloat: string with get, set 226 | abstract cssText: string with get, set 227 | abstract cursor: string with get, set 228 | abstract direction: string with get, set 229 | abstract display: string with get, set 230 | abstract dominantBaseline: string with get, set 231 | abstract emptyCells: string with get, set 232 | abstract enableBackground: string with get, set 233 | abstract fill: string with get, set 234 | abstract fillOpacity: string with get, set 235 | abstract fillRule: string with get, set 236 | abstract filter: string with get, set 237 | abstract flex: string with get, set 238 | abstract flexBasis: string with get, set 239 | abstract flexDirection: string with get, set 240 | abstract flexFlow: string with get, set 241 | abstract flexGrow: string with get, set 242 | abstract flexShrink: string with get, set 243 | abstract flexWrap: string with get, set 244 | abstract floodColor: string with get, set 245 | abstract floodOpacity: string with get, set 246 | abstract font: string with get, set 247 | abstract fontFamily: string with get, set 248 | abstract fontFeatureSettings: string with get, set 249 | abstract fontSize: string with get, set 250 | abstract fontSizeAdjust: string with get, set 251 | abstract fontStretch: string with get, set 252 | abstract fontStyle: string with get, set 253 | abstract fontVariant: string with get, set 254 | abstract fontWeight: string with get, set 255 | abstract glyphOrientationHorizontal: string with get, set 256 | abstract glyphOrientationVertical: string with get, set 257 | abstract gap: string with get, set 258 | abstract grid: string with get, set 259 | abstract gridArea: string with get, set 260 | abstract gridAutoColumns: string with get, set 261 | abstract gridAutoFlow: string with get, set 262 | abstract gridAutoRows: string with get, set 263 | abstract gridColumn: string with get, set 264 | abstract gridColumnEnd: string with get, set 265 | abstract gridColumnStart: string with get, set 266 | abstract gridRow: string with get, set 267 | abstract gridRowEnd: string with get, set 268 | abstract gridRowStart: string with get, set 269 | abstract gridTemplate: string with get, set 270 | abstract gridTemplateAreas: string with get, set 271 | abstract gridTemplateColumns: string with get, set 272 | abstract gridTemplateRows: string with get, set 273 | abstract height: string with get, set 274 | abstract imeMode: string with get, set 275 | abstract justifyContent: string with get, set 276 | abstract kerning: string with get, set 277 | abstract left: string with get, set 278 | abstract length: float with get, set 279 | abstract letterSpacing: string with get, set 280 | abstract lightingColor: string with get, set 281 | abstract lineHeight: string with get, set 282 | abstract listStyle: string with get, set 283 | abstract listStyleImage: string with get, set 284 | abstract listStylePosition: string with get, set 285 | abstract listStyleType: string with get, set 286 | abstract margin: string with get, set 287 | abstract marginBottom: string with get, set 288 | abstract marginLeft: string with get, set 289 | abstract marginRight: string with get, set 290 | abstract marginTop: string with get, set 291 | abstract marker: string with get, set 292 | abstract markerEnd: string with get, set 293 | abstract markerMid: string with get, set 294 | abstract markerStart: string with get, set 295 | abstract mask: string with get, set 296 | abstract maxHeight: string with get, set 297 | abstract maxWidth: string with get, set 298 | abstract minHeight: string with get, set 299 | abstract minWidth: string with get, set 300 | abstract msContentZoomChaining: string with get, set 301 | abstract msContentZoomLimit: string with get, set 302 | abstract msContentZoomLimitMax: obj with get, set 303 | abstract msContentZoomLimitMin: obj with get, set 304 | abstract msContentZoomSnap: string with get, set 305 | abstract msContentZoomSnapPoints: string with get, set 306 | abstract msContentZoomSnapType: string with get, set 307 | abstract msContentZooming: string with get, set 308 | abstract msFlowFrom: string with get, set 309 | abstract msFlowInto: string with get, set 310 | abstract msFontFeatureSettings: string with get, set 311 | abstract msGridColumn: obj with get, set 312 | abstract msGridColumnAlign: string with get, set 313 | abstract msGridColumnSpan: obj with get, set 314 | abstract msGridColumns: string with get, set 315 | abstract msGridRow: obj with get, set 316 | abstract msGridRowAlign: string with get, set 317 | abstract msGridRowSpan: obj with get, set 318 | abstract msGridRows: string with get, set 319 | abstract msHighContrastAdjust: string with get, set 320 | abstract msHyphenateLimitChars: string with get, set 321 | abstract msHyphenateLimitLines: obj with get, set 322 | abstract msHyphenateLimitZone: obj with get, set 323 | abstract msHyphens: string with get, set 324 | abstract msImeAlign: string with get, set 325 | abstract msOverflowStyle: string with get, set 326 | abstract msScrollChaining: string with get, set 327 | abstract msScrollLimit: string with get, set 328 | abstract msScrollLimitXMax: obj with get, set 329 | abstract msScrollLimitXMin: obj with get, set 330 | abstract msScrollLimitYMax: obj with get, set 331 | abstract msScrollLimitYMin: obj with get, set 332 | abstract msScrollRails: string with get, set 333 | abstract msScrollSnapPointsX: string with get, set 334 | abstract msScrollSnapPointsY: string with get, set 335 | abstract msScrollSnapType: string with get, set 336 | abstract msScrollSnapX: string with get, set 337 | abstract msScrollSnapY: string with get, set 338 | abstract msScrollTranslation: string with get, set 339 | abstract msTextCombineHorizontal: string with get, set 340 | abstract msTextSizeAdjust: obj with get, set 341 | abstract msTouchAction: string with get, set 342 | abstract msTouchSelect: string with get, set 343 | abstract msUserSelect: string with get, set 344 | abstract msWrapFlow: string with get, set 345 | abstract msWrapMargin: obj with get, set 346 | abstract msWrapThrough: string with get, set 347 | abstract opacity: string with get, set 348 | abstract order: string with get, set 349 | abstract orphans: string with get, set 350 | abstract outline: string with get, set 351 | abstract outlineColor: string with get, set 352 | abstract outlineStyle: string with get, set 353 | abstract outlineWidth: string with get, set 354 | abstract overflow: string with get, set 355 | abstract overflowX: string with get, set 356 | abstract overflowY: string with get, set 357 | abstract padding: string with get, set 358 | abstract paddingBottom: string with get, set 359 | abstract paddingLeft: string with get, set 360 | abstract paddingRight: string with get, set 361 | abstract paddingTop: string with get, set 362 | abstract pageBreakAfter: string with get, set 363 | abstract pageBreakBefore: string with get, set 364 | abstract pageBreakInside: string with get, set 365 | abstract parentRule: CSSRule with get, set 366 | abstract perspective: string with get, set 367 | abstract perspectiveOrigin: string with get, set 368 | abstract pointerEvents: string with get, set 369 | abstract position: string with get, set 370 | abstract quotes: string with get, set 371 | abstract right: string with get, set 372 | abstract rowGap: string with get, set 373 | abstract rubyAlign: string with get, set 374 | abstract rubyOverhang: string with get, set 375 | abstract rubyPosition: string with get, set 376 | abstract stopColor: string with get, set 377 | abstract stopOpacity: string with get, set 378 | abstract stroke: string with get, set 379 | abstract strokeDasharray: string with get, set 380 | abstract strokeDashoffset: string with get, set 381 | abstract strokeLinecap: string with get, set 382 | abstract strokeLinejoin: string with get, set 383 | abstract strokeMiterlimit: string with get, set 384 | abstract strokeOpacity: string with get, set 385 | abstract strokeWidth: string with get, set 386 | abstract tableLayout: string with get, set 387 | abstract textAlign: string with get, set 388 | abstract textAlignLast: string with get, set 389 | abstract textAnchor: string with get, set 390 | abstract textDecoration: string with get, set 391 | abstract textFillColor: string with get, set 392 | abstract textIndent: string with get, set 393 | abstract textJustify: string with get, set 394 | abstract textKashida: string with get, set 395 | abstract textKashidaSpace: string with get, set 396 | abstract textOverflow: string with get, set 397 | abstract textShadow: string with get, set 398 | abstract textTransform: string with get, set 399 | abstract textUnderlinePosition: string with get, set 400 | abstract top: string with get, set 401 | abstract touchAction: string with get, set 402 | abstract transform: string with get, set 403 | abstract transformOrigin: string with get, set 404 | abstract transformStyle: string with get, set 405 | abstract transition: string with get, set 406 | abstract transitionDelay: string with get, set 407 | abstract transitionDuration: string with get, set 408 | abstract transitionProperty: string with get, set 409 | abstract transitionTimingFunction: string with get, set 410 | abstract unicodeBidi: string with get, set 411 | abstract verticalAlign: string with get, set 412 | abstract visibility: string with get, set 413 | abstract webkitAlignContent: string with get, set 414 | abstract webkitAlignItems: string with get, set 415 | abstract webkitAlignSelf: string with get, set 416 | abstract webkitAnimation: string with get, set 417 | abstract webkitAnimationDelay: string with get, set 418 | abstract webkitAnimationDirection: string with get, set 419 | abstract webkitAnimationDuration: string with get, set 420 | abstract webkitAnimationFillMode: string with get, set 421 | abstract webkitAnimationIterationCount: string with get, set 422 | abstract webkitAnimationName: string with get, set 423 | abstract webkitAnimationPlayState: string with get, set 424 | abstract webkitAnimationTimingFunction: string with get, set 425 | abstract webkitAppearance: string with get, set 426 | abstract webkitBackfaceVisibility: string with get, set 427 | abstract webkitBackground: string with get, set 428 | abstract webkitBackgroundAttachment: string with get, set 429 | abstract webkitBackgroundClip: string with get, set 430 | abstract webkitBackgroundColor: string with get, set 431 | abstract webkitBackgroundImage: string with get, set 432 | abstract webkitBackgroundOrigin: string with get, set 433 | abstract webkitBackgroundPosition: string with get, set 434 | abstract webkitBackgroundPositionX: string with get, set 435 | abstract webkitBackgroundPositionY: string with get, set 436 | abstract webkitBackgroundRepeat: string with get, set 437 | abstract webkitBackgroundSize: string with get, set 438 | abstract webkitBorderBottomLeftRadius: string with get, set 439 | abstract webkitBorderBottomRightRadius: string with get, set 440 | abstract webkitBorderImage: string with get, set 441 | abstract webkitBorderImageOutset: string with get, set 442 | abstract webkitBorderImageRepeat: string with get, set 443 | abstract webkitBorderImageSlice: string with get, set 444 | abstract webkitBorderImageSource: string with get, set 445 | abstract webkitBorderImageWidth: string with get, set 446 | abstract webkitBorderRadius: string with get, set 447 | abstract webkitBorderTopLeftRadius: string with get, set 448 | abstract webkitBorderTopRightRadius: string with get, set 449 | abstract webkitBoxAlign: string with get, set 450 | abstract webkitBoxDirection: string with get, set 451 | abstract webkitBoxFlex: string with get, set 452 | abstract webkitBoxOrdinalGroup: string with get, set 453 | abstract webkitBoxOrient: string with get, set 454 | abstract webkitBoxPack: string with get, set 455 | abstract webkitBoxSizing: string with get, set 456 | abstract webkitColumnBreakAfter: string with get, set 457 | abstract webkitColumnBreakBefore: string with get, set 458 | abstract webkitColumnBreakInside: string with get, set 459 | abstract webkitColumnCount: obj with get, set 460 | abstract webkitColumnGap: obj with get, set 461 | abstract webkitColumnRule: string with get, set 462 | abstract webkitColumnRuleColor: obj with get, set 463 | abstract webkitColumnRuleStyle: string with get, set 464 | abstract webkitColumnRuleWidth: obj with get, set 465 | abstract webkitColumnSpan: string with get, set 466 | abstract webkitColumnWidth: obj with get, set 467 | abstract webkitColumns: string with get, set 468 | abstract webkitFilter: string with get, set 469 | abstract webkitFlex: string with get, set 470 | abstract webkitFlexBasis: string with get, set 471 | abstract webkitFlexDirection: string with get, set 472 | abstract webkitFlexFlow: string with get, set 473 | abstract webkitFlexGrow: string with get, set 474 | abstract webkitFlexShrink: string with get, set 475 | abstract webkitFlexWrap: string with get, set 476 | abstract webkitJustifyContent: string with get, set 477 | abstract webkitOrder: string with get, set 478 | abstract webkitPerspective: string with get, set 479 | abstract webkitPerspectiveOrigin: string with get, set 480 | abstract webkitTapHighlightColor: string with get, set 481 | abstract webkitTextFillColor: string with get, set 482 | abstract webkitTextSizeAdjust: obj with get, set 483 | abstract webkitTransform: string with get, set 484 | abstract webkitTransformOrigin: string with get, set 485 | abstract webkitTransformStyle: string with get, set 486 | abstract webkitTransition: string with get, set 487 | abstract webkitTransitionDelay: string with get, set 488 | abstract webkitTransitionDuration: string with get, set 489 | abstract webkitTransitionProperty: string with get, set 490 | abstract webkitTransitionTimingFunction: string with get, set 491 | abstract webkitUserSelect: string with get, set 492 | abstract webkitWritingMode: string with get, set 493 | abstract whiteSpace: string with get, set 494 | abstract widows: string with get, set 495 | abstract width: string with get, set 496 | abstract wordBreak: string with get, set 497 | abstract wordSpacing: string with get, set 498 | abstract wordWrap: string with get, set 499 | abstract writingMode: string with get, set 500 | abstract zIndex: string with get, set 501 | abstract zoom: string with get, set 502 | [] abstract Item: index: int -> string with get, set 503 | abstract getPropertyPriority: propertyName: string -> string 504 | abstract getPropertyValue: propertyName: string -> string 505 | abstract item: index: float -> string 506 | abstract removeProperty: propertyName: string -> string 507 | abstract setProperty: propertyName: string * value: string * ?priority: string -> unit 508 | 509 | type CSSStyleDeclarationType = 510 | abstract prototype: CSSStyleDeclaration with get, set 511 | [] abstract Create: unit -> CSSStyleDeclaration 512 | 513 | type [] CSSStyleRule = 514 | inherit CSSRule 515 | abstract readOnly: bool with get, set 516 | abstract selectorText: string with get, set 517 | abstract style: CSSStyleDeclaration with get, set 518 | 519 | type CSSStyleRuleType = 520 | abstract prototype: CSSStyleRule with get, set 521 | [] abstract Create: unit -> CSSStyleRule 522 | 523 | type [] CSSStyleSheet = 524 | inherit StyleSheet 525 | abstract cssRules: CSSRuleList with get, set 526 | abstract cssText: string with get, set 527 | abstract href: string with get, set 528 | abstract id: string with get, set 529 | abstract imports: StyleSheetList with get, set 530 | abstract isAlternate: bool with get, set 531 | abstract isPrefAlternate: bool with get, set 532 | abstract ownerRule: CSSRule with get, set 533 | abstract owningElement: Element with get, set 534 | abstract pages: StyleSheetPageList with get, set 535 | abstract readOnly: bool with get, set 536 | abstract rules: CSSRuleList with get, set 537 | abstract addImport: bstrURL: string * ?lIndex: float -> float 538 | abstract addPageRule: bstrSelector: string * bstrStyle: string * ?lIndex: float -> float 539 | abstract addRule: bstrSelector: string * ?bstrStyle: string * ?lIndex: float -> float 540 | abstract deleteRule: ?index: float -> unit 541 | abstract insertRule: rule: string * ?index: float -> float 542 | abstract removeImport: lIndex: float -> unit 543 | abstract removeRule: lIndex: float -> unit 544 | /// 545 | /// replaces the content of the stylesheet with the content passed into it. 546 | /// The method returns a promise that resolves with a CSSStyleSheet object. 547 | /// 548 | /// 549 | /// The replaceSync() and CSSStyleSheet.replace() methods can only be used on a stylesheet created with the CSSStyleSheet() constructor. 550 | /// 551 | abstract replace: string -> JS.Promise 552 | /// 553 | /// synchronously replaces the content of the stylesheet with the content passed into it. 554 | /// 555 | /// 556 | /// The replaceSync() and CSSStyleSheet.replace() methods can only be used on a stylesheet created with the CSSStyleSheet() constructor. 557 | /// 558 | abstract replaceSync: string -> unit 559 | 560 | type CSSStyleSheetType = 561 | abstract prototype: CSSStyleSheet with get, set 562 | [] abstract Create: unit -> CSSStyleSheet 563 | 564 | type [] CSSSupportsRule = 565 | inherit CSSConditionRule 566 | 567 | type CSSSupportsRuleType = 568 | abstract prototype: CSSSupportsRule with get, set 569 | [] abstract Create: unit -> CSSSupportsRule 570 | 571 | type [] StyleMedia = 572 | abstract ``type``: string with get, set 573 | abstract matchMedium: mediaquery: string -> bool 574 | 575 | type StyleMediaType = 576 | abstract prototype: StyleMedia with get, set 577 | [] abstract Create: unit -> StyleMedia 578 | 579 | type [] StyleSheet = 580 | abstract disabled: bool with get, set 581 | abstract href: string with get, set 582 | // TODO 583 | // abstract media: MediaList with get, set 584 | abstract ownerNode: Node with get, set 585 | abstract parentStyleSheet: StyleSheet with get, set 586 | abstract title: string with get, set 587 | abstract ``type``: string with get, set 588 | 589 | type StyleSheetType = 590 | abstract prototype: StyleSheet with get, set 591 | [] abstract Create: unit -> StyleSheet 592 | 593 | type [] StyleSheetList = 594 | abstract length: float with get, set 595 | [] abstract Item: index: int -> StyleSheet with get, set 596 | abstract item: ?index: float -> StyleSheet 597 | 598 | type StyleSheetListType = 599 | abstract prototype: StyleSheetList with get, set 600 | [] abstract Create: unit -> StyleSheetList 601 | 602 | type [] StyleSheetPageList = 603 | abstract length: float with get, set 604 | [] abstract Item: index: int -> CSSPageRule with get, set 605 | abstract item: index: float -> CSSPageRule 606 | 607 | type StyleSheetPageListType = 608 | abstract prototype: StyleSheetPageList with get, set 609 | [] abstract Create: unit -> StyleSheetPageList -------------------------------------------------------------------------------- /src/Css/Browser.Css.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.Css 5 | 2.5.0 6 | 2.5.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 28 | 29 | -------------------------------------------------------------------------------- /src/Css/README.md: -------------------------------------------------------------------------------- 1 | # Browser.Css 2 | 3 | Includes bindings for the [CSS Object Model](https://developer.mozilla.org/en-US/docs/Web/API/CSS_Object_Model). 4 | -------------------------------------------------------------------------------- /src/Css/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 2.5.0 2 | 3 | - Align Fable.Core version to 3.2.8 for all of fable-browser packages 4 | 5 | ### 2.4.0 6 | 7 | - `AddCSSStyleDeclaration.gap` (by @chkn) 8 | - `AddCSSStyleDeclaration.grid` (by @chkn) 9 | - `AddCSSStyleDeclaration.gridArea` (by @chkn) 10 | - `AddCSSStyleDeclaration.gridAutoColumns` (by @chkn) 11 | - `AddCSSStyleDeclaration.gridAutoFlow` (by @chkn) 12 | - `AddCSSStyleDeclaration.gridAutoRows` (by @chkn) 13 | - `AddCSSStyleDeclaration.gridColumn` (by @chkn) 14 | - `AddCSSStyleDeclaration.gridColumnEnd` (by @chkn) 15 | - `AddCSSStyleDeclaration.gridColumnStart` (by @chkn) 16 | - `AddCSSStyleDeclaration.gridRow` (by @chkn) 17 | - `AddCSSStyleDeclaration.gridRowEnd` (by @chkn) 18 | - `AddCSSStyleDeclaration.gridRowStart` (by @chkn) 19 | - `AddCSSStyleDeclaration.gridTemplate` (by @chkn) 20 | - `AddCSSStyleDeclaration.gridTemplateAreas` (by @chkn) 21 | - `AddCSSStyleDeclaration.gridTemplateColumns` (by @chkn) 22 | - `AddCSSStyleDeclaration.gridTemplateRows` (by @chkn) 23 | - `AddCSSStyleDeclaration.rowGap` (by @chkn) 24 | 25 | ### 2.3.0 26 | 27 | * Add `tags` to make binding displayed on Fable.Packages 28 | 29 | ### 2.2.0 30 | 31 | * Add Global attribute to global interfaces @chkn 32 | 33 | ### 2.1.0 34 | 35 | * Add shadow root types @AngelMunoz 36 | 37 | ### 2.0.4 38 | 39 | * Downgrade FSharp.Core to 4.7.2 40 | 41 | ### 2.0.3 42 | 43 | * Downgrade FSharp.Core to 4.7.2 44 | 45 | ### 2.0.2 46 | 47 | * Release a new version because one of the dependencies had the licence information missing 48 | 49 | ### 2.0.1 50 | 51 | * Add licence to Nuget package @nojaf 52 | 53 | ### 2.0.0 54 | 55 | * Fix #28: Move `getComputedStyle` to `Window` 56 | 57 | ### 1.0.0 58 | 59 | * Stable release 60 | 61 | ### 1.0.0-beta-001 62 | 63 | * First release 64 | -------------------------------------------------------------------------------- /src/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | http://fable.io 4 | https://github.com/fable-compiler/fable-browser.git 5 | LICENSE 6 | fable_logo.png 7 | fsharp;fable;javascript;f#;js 8 | Fable contributors 9 | true 10 | 11 | 12 | true 13 | true 14 | true 15 | snupkg 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/Directory.Build.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/Dom/Browser.Dom.Api.fs: -------------------------------------------------------------------------------- 1 | namespace Fable.Import 2 | 3 | [] 4 | module Browser = 5 | /// Use Browser 6 | let obsolete<'T> : 'T = failwith "Use Browser" 7 | 8 | namespace Browser 9 | 10 | open Fable.Core 11 | open Browser.Types 12 | 13 | [] 14 | module Dom = 15 | // Make console globally accessible 16 | let [] console: JS.Console = jsNative 17 | 18 | let [] DOMException: DOMExceptionType = jsNative 19 | 20 | let [] File: FileType = jsNative 21 | let [] FileReader: FileReaderType = jsNative 22 | 23 | let [] history: History = jsNative 24 | 25 | let [] window: Window = jsNative 26 | let [] document: Document = jsNative 27 | let [] self: Window = jsNative 28 | 29 | let [] Attr: AttrType = jsNative 30 | let [] CDATASection: CDATASectionType = jsNative 31 | let [] CanvasGradient: CanvasGradientType = jsNative 32 | let [] CanvasPattern: CanvasPatternType = jsNative 33 | let [] CanvasRenderingContext2D: CanvasRenderingContext2DType = jsNative 34 | let [] ClientRect: ClientRectType = jsNative 35 | let [] DOMImplementation: DOMImplementationType = jsNative 36 | let [] DOMStringList: DOMStringListType = jsNative 37 | let [] DOMStringMap: DOMStringMapType = jsNative 38 | let [] DOMTokenList: DOMTokenListType = jsNative 39 | let [] Document: DocumentType = jsNative 40 | let [] DocumentFragment: DocumentFragmentType = jsNative 41 | let [] DocumentType: DocumentTypeType = jsNative 42 | let [] Element: ElementType = jsNative 43 | let [] HTMLAllCollection: HTMLAllCollectionType = jsNative 44 | let [] HTMLAnchorElement: HTMLAnchorElementType = jsNative 45 | let [] HTMLAreaElement: HTMLAreaElementType = jsNative 46 | let [] HTMLAreasCollection: HTMLAreasCollectionType = jsNative 47 | let [] Audio: HTMLAudioElementType = jsNative 48 | let [] HTMLBRElement: HTMLBRElementType = jsNative 49 | let [] HTMLBaseElement: HTMLBaseElementType = jsNative 50 | let [] HTMLBlockElement: HTMLBlockElementType = jsNative 51 | let [] HTMLBodyElement: HTMLBodyElementType = jsNative 52 | let [] HTMLButtonElement: HTMLButtonElementType = jsNative 53 | let [] HTMLCanvasElement: HTMLCanvasElementType = jsNative 54 | let [] HTMLCollection: HTMLCollectionType = jsNative 55 | let [] HTMLDDElement: HTMLDDElementType = jsNative 56 | let [] HTMLDListElement: HTMLDListElementType = jsNative 57 | let [] HTMLDTElement: HTMLDTElementType = jsNative 58 | let [] HTMLDataListElement: HTMLDataListElementType = jsNative 59 | let [] HTMLDirectoryElement: HTMLDirectoryElementType = jsNative 60 | let [] HTMLDocument: HTMLDocumentType = jsNative 61 | let [] HTMLElement: HTMLElementType = jsNative 62 | let [] HTMLEmbedElement: HTMLEmbedElementType = jsNative 63 | let [] HTMLFieldSetElement: HTMLFieldSetElementType = jsNative 64 | let [] HTMLFontElement: HTMLFontElementType = jsNative 65 | let [] HTMLFormElement: HTMLFormElementType = jsNative 66 | let [] HTMLFrameElement: HTMLFrameElementType = jsNative 67 | let [] HTMLHRElement: HTMLHRElementType = jsNative 68 | let [] HTMLHeadElement: HTMLHeadElementType = jsNative 69 | let [] HTMLHeadingElement: HTMLHeadingElementType = jsNative 70 | let [] HTMLHtmlElement: HTMLHtmlElementType = jsNative 71 | let [] HTMLIFrameElement: HTMLIFrameElementType = jsNative 72 | let [] HTMLImageElement: ImageType = jsNative 73 | let [] Image: ImageType = jsNative 74 | let [] HTMLInputElement: HTMLInputElementType = jsNative 75 | let [] HTMLLIElement: HTMLLIElementType = jsNative 76 | let [] HTMLLabelElement: HTMLLabelElementType = jsNative 77 | let [] HTMLLegendElement: HTMLLegendElementType = jsNative 78 | let [] HTMLLinkElement: HTMLLinkElementType = jsNative 79 | let [] HTMLMapElement: HTMLMapElementType = jsNative 80 | let [] HTMLMediaElement: HTMLMediaElementType = jsNative 81 | let [] HTMLMenuElement: HTMLMenuElementType = jsNative 82 | let [] HTMLMetaElement: HTMLMetaElementType = jsNative 83 | let [] HTMLModElement: HTMLModElementType = jsNative 84 | let [] HTMLNextIdElement: HTMLNextIdElementType = jsNative 85 | let [] HTMLOListElement: HTMLOListElementType = jsNative 86 | let [] HTMLObjectElement: HTMLObjectElementType = jsNative 87 | let [] HTMLOptGroupElement: HTMLOptGroupElementType = jsNative 88 | let [] HTMLOptionElement: HTMLOptionElementType = jsNative 89 | let [] HTMLParagraphElement: HTMLParagraphElementType = jsNative 90 | let [] HTMLParamElement: HTMLParamElementType = jsNative 91 | let [] HTMLPhraseElement: HTMLPhraseElementType = jsNative 92 | let [] HTMLPreElement: HTMLPreElementType = jsNative 93 | let [] HTMLProgressElement: HTMLProgressElementType = jsNative 94 | let [] HTMLQuoteElement: HTMLQuoteElementType = jsNative 95 | let [] HTMLScriptElement: HTMLScriptElementType = jsNative 96 | let [] HTMLSelectElement: HTMLSelectElementType = jsNative 97 | let [] HTMLSourceElement: HTMLSourceElementType = jsNative 98 | let [] HTMLSpanElement: HTMLSpanElementType = jsNative 99 | let [] HTMLStyleElement: HTMLStyleElementType = jsNative 100 | let [] HTMLTableCaptionElement: HTMLTableCaptionElementType = jsNative 101 | let [] HTMLTableCellElement: HTMLTableCellElementType = jsNative 102 | let [] HTMLTableColElement: HTMLTableColElementType = jsNative 103 | let [] HTMLTableDataCellElement: HTMLTableDataCellElementType = jsNative 104 | let [] HTMLTableElement: HTMLTableElementType = jsNative 105 | let [] HTMLTableHeaderCellElement: HTMLTableHeaderCellElementType = jsNative 106 | let [] HTMLTableRowElement: HTMLTableRowElementType = jsNative 107 | let [] HTMLTableSectionElement: HTMLTableSectionElementType = jsNative 108 | let [] HTMLTextAreaElement: HTMLTextAreaElementType = jsNative 109 | let [] HTMLTitleElement: HTMLTitleElementType = jsNative 110 | let [] HTMLTrackElement: HTMLTrackElementType = jsNative 111 | let [] HTMLUListElement: HTMLUListElementType = jsNative 112 | let [] HTMLUnknownElement: HTMLUnknownElementType = jsNative 113 | let [] HTMLVideoElement: HTMLVideoElementType = jsNative 114 | let [] ImageData: ImageDataType = jsNative 115 | let [] NamedNodeMap: NamedNodeMapType = jsNative 116 | let [] Node: NodeType = jsNative 117 | let [] NodeFilter: NodeFilterType = jsNative 118 | let [] NodeIterator: NodeIteratorType = jsNative 119 | let [] NodeList: NodeListType = jsNative 120 | let [] Range: RangeType = jsNative 121 | let [] Selection: SelectionType = jsNative 122 | let [] SourceBuffer: SourceBufferType = jsNative 123 | let [] SourceBufferList: SourceBufferListType = jsNative 124 | let [] XMLDocument: XMLDocumentType = jsNative 125 | -------------------------------------------------------------------------------- /src/Dom/Browser.Dom.Ext.fs: -------------------------------------------------------------------------------- 1 | [] 2 | module Browser.DomExtensions 3 | 4 | open Fable.Core 5 | open Browser.Types 6 | 7 | type FormDataType with 8 | [] 9 | member __.Create(form: HTMLFormElement): FormData = jsNative 10 | -------------------------------------------------------------------------------- /src/Dom/Browser.Dom.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.Dom 5 | 2.19.0 6 | 2.19.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 29 | 32 | 33 | -------------------------------------------------------------------------------- /src/Dom/Browser.DomException.fs: -------------------------------------------------------------------------------- 1 | namespace Browser.Types 2 | 3 | open System 4 | open Fable.Core 5 | 6 | type [] DOMException = 7 | abstract code: float with get, set 8 | abstract message: string with get, set 9 | abstract name: string with get, set 10 | abstract ABORT_ERR: float with get, set 11 | abstract DATA_CLONE_ERR: float with get, set 12 | abstract DOMSTRING_SIZE_ERR: float with get, set 13 | abstract HIERARCHY_REQUEST_ERR: float with get, set 14 | abstract INDEX_SIZE_ERR: float with get, set 15 | abstract INUSE_ATTRIBUTE_ERR: float with get, set 16 | abstract INVALID_ACCESS_ERR: float with get, set 17 | abstract INVALID_CHARACTER_ERR: float with get, set 18 | abstract INVALID_MODIFICATION_ERR: float with get, set 19 | abstract INVALID_NODE_TYPE_ERR: float with get, set 20 | abstract INVALID_STATE_ERR: float with get, set 21 | abstract NAMESPACE_ERR: float with get, set 22 | abstract NETWORK_ERR: float with get, set 23 | abstract NOT_FOUND_ERR: float with get, set 24 | abstract NOT_SUPPORTED_ERR: float with get, set 25 | abstract NO_DATA_ALLOWED_ERR: float with get, set 26 | abstract NO_MODIFICATION_ALLOWED_ERR: float with get, set 27 | abstract PARSE_ERR: float with get, set 28 | abstract QUOTA_EXCEEDED_ERR: float with get, set 29 | abstract SECURITY_ERR: float with get, set 30 | abstract SERIALIZE_ERR: float with get, set 31 | abstract SYNTAX_ERR: float with get, set 32 | abstract TIMEOUT_ERR: float with get, set 33 | abstract TYPE_MISMATCH_ERR: float with get, set 34 | abstract URL_MISMATCH_ERR: float with get, set 35 | abstract VALIDATION_ERR: float with get, set 36 | abstract WRONG_DOCUMENT_ERR: float with get, set 37 | abstract toString: unit -> string 38 | 39 | type [] DOMExceptionType = 40 | abstract ABORT_ERR: float with get, set 41 | abstract DATA_CLONE_ERR: float with get, set 42 | abstract DOMSTRING_SIZE_ERR: float with get, set 43 | abstract HIERARCHY_REQUEST_ERR: float with get, set 44 | abstract INDEX_SIZE_ERR: float with get, set 45 | abstract INUSE_ATTRIBUTE_ERR: float with get, set 46 | abstract INVALID_ACCESS_ERR: float with get, set 47 | abstract INVALID_CHARACTER_ERR: float with get, set 48 | abstract INVALID_MODIFICATION_ERR: float with get, set 49 | abstract INVALID_NODE_TYPE_ERR: float with get, set 50 | abstract INVALID_STATE_ERR: float with get, set 51 | abstract NAMESPACE_ERR: float with get, set 52 | abstract NETWORK_ERR: float with get, set 53 | abstract NOT_FOUND_ERR: float with get, set 54 | abstract NOT_SUPPORTED_ERR: float with get, set 55 | abstract NO_DATA_ALLOWED_ERR: float with get, set 56 | abstract NO_MODIFICATION_ALLOWED_ERR: float with get, set 57 | abstract PARSE_ERR: float with get, set 58 | abstract QUOTA_EXCEEDED_ERR: float with get, set 59 | abstract SECURITY_ERR: float with get, set 60 | abstract SERIALIZE_ERR: float with get, set 61 | abstract SYNTAX_ERR: float with get, set 62 | abstract TIMEOUT_ERR: float with get, set 63 | abstract TYPE_MISMATCH_ERR: float with get, set 64 | abstract URL_MISMATCH_ERR: float with get, set 65 | abstract VALIDATION_ERR: float with get, set 66 | abstract WRONG_DOCUMENT_ERR: float with get, set 67 | [] abstract Create: unit -> DOMException 68 | -------------------------------------------------------------------------------- /src/Dom/Browser.File.fs: -------------------------------------------------------------------------------- 1 | namespace Browser.Types 2 | 3 | open System 4 | open Fable.Core 5 | open Fable.Core.JS 6 | 7 | type FileReaderState = 8 | | EMPTY = 0 9 | | LOADING = 1 10 | | DONE = 2 11 | 12 | type [] FilePropertyBag = 13 | abstract ``type``: string with get, set 14 | abstract lastModified: float with get, set 15 | 16 | type [] File = 17 | inherit Blob 18 | abstract lastModified: float 19 | abstract name: string 20 | 21 | type [] FileType = 22 | [] abstract Create: parts: obj[] * filename: string * ?properties: FilePropertyBag -> File 23 | 24 | type [] FileList = 25 | abstract length: int 26 | [] abstract Item: index: int -> File 27 | abstract item: index: int -> File 28 | 29 | type [] FileReader = 30 | inherit EventTarget 31 | // abstract error: DOMException with get, set 32 | abstract readyState: FileReaderState 33 | abstract result: obj 34 | abstract onabort: (Event->unit) with get, set 35 | abstract onerror: (Event->unit) with get, set 36 | abstract onload: (Event->unit) with get, set 37 | abstract abort: unit -> unit 38 | abstract readAsArrayBuffer: blob: Blob -> unit 39 | abstract readAsBinaryString: blob: Blob -> unit 40 | abstract readAsDataURL: blob: Blob -> unit 41 | abstract readAsText: blob: Blob * ?encoding: string -> unit 42 | 43 | type [] FileReaderType = 44 | abstract prototype: FileReader with get, set 45 | [] abstract Create: unit -> FileReader 46 | -------------------------------------------------------------------------------- /src/Dom/Browser.History.fs: -------------------------------------------------------------------------------- 1 | namespace Browser.Types 2 | 3 | open System 4 | open Fable.Core 5 | 6 | [] 7 | type ScrollRestoration = 8 | | Auto 9 | | Manual 10 | 11 | type [] History = 12 | abstract length: int 13 | abstract scrollRestoration : ScrollRestoration with get, set 14 | abstract state: obj with get, set 15 | /// Equivalent to history.go(-1) 16 | abstract back: unit -> unit 17 | /// Equivalent to history.go(1) 18 | abstract forward: unit -> unit 19 | /// Loads a page from the session history, identified by its relative location to the current page, for example -1 for the previous page or 1 for the next page. If you specify an out-of-bounds value (for instance, specifying -1 when there are no previously-visited pages in the session history), this method silently has no effect. Calling go() without parameters or a value of 0 reloads the current page. 20 | abstract go: ?delta: int -> unit 21 | /// Pushes the given data onto the session history stack with the specified title and, if provided, URL. The data is treated as opaque by the DOM; you may specify any JavaScript object that can be serialized. 22 | abstract pushState: statedata: obj * ?title: string * ?url: string -> unit 23 | /// Updates the most recent entry on the history stack to have the specified data, title, and, if provided, URL. The data is treated as opaque by the DOM; you may specify any JavaScript object that can be serialized. 24 | abstract replaceState: statedata: obj * ?title: string * ?url: string -> unit 25 | -------------------------------------------------------------------------------- /src/Dom/README.md: -------------------------------------------------------------------------------- 1 | # Browser.Dom 2 | 3 | Includes bindings for [DOM and HTML interfaces](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model), but not SVG. 4 | 5 | Also includes: 6 | 7 | - [File API](https://developer.mozilla.org/en-US/docs/Web/API/File) 8 | - [History API](https://developer.mozilla.org/en-US/docs/Web/API/History) -------------------------------------------------------------------------------- /src/Dom/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 2.19.0 2 | 3 | * Fix #151: Add HTMLDialogElement properties and methods for better dialog management. Add help comments for properties and methods. (by @slyshykO) 4 | * Add missing Node insertion methods #150 (by @BennieCopeland) 5 | 6 | ### 2.18.1 7 | 8 | * Fix #146: Replace `Browser.Dom.HTMLAudioElement` with `Browser.Dom.Audio` (by @MangelMaxime) 9 | 10 | ### 2.18.0 11 | 12 | * Better type event by replacing `Event` with things like `InputEvent` (by @Lanayx) 13 | * Add missing event properties (by @Lanayx) 14 | * Remove incorrect APIs (by @Lanayx) 15 | 16 | ### 2.17.0 17 | 18 | * Fix #137: Remove `Worker` related types, use `Fable.Browser.Worker` if needed (by @MangelMaxime) 19 | 20 | ### 2.16.0 21 | 22 | * Move `children` from `HTMLElement` to `Element` (by @chkn) 23 | 24 | ### 2.15.0 25 | 26 | * Oupsy seems like I lost that release in a black hole... 27 | 28 | ### 2.14.0 29 | 30 | * PR #114: Remove `File.text` which was defined as a getter instead of a function. Moreover the method is already available via `Blob` inheritance. (by @IanManske) 31 | 32 | ### 2.13.0 33 | 34 | * Remove `HTMLButtonElement.reportValidity` (by @aronerben) 35 | * Add `HTMLFormElement.reportValidity` (by @aronerben) 36 | * Add `HTMLInputElement.reportValidity` (by @aronerben) 37 | 38 | ### 2.12.0 39 | 40 | * Add `HTMLDialogElement` by @IanManske 41 | * Remove `HTMLDivElementType` because `HTMLDivElement` doesn't have a constructor in JS 42 | 43 | ### 2.11.0 44 | 45 | * Add `tags` to make binding displayed on Fable.Packages 46 | * Fix #106: Add missing `file.text()` 47 | 48 | ### 2.10.1 49 | 50 | * Add `CanvasRenderingContext2D.imageSmoothingEnabled` 51 | 52 | ### 2.10.0 53 | 54 | * Add Global attribute to global interfaces @chkn 55 | 56 | ### 2.9.0 57 | 58 | * PR #91: Add support for `Element.toggleAttribute` 59 | 60 | ### 2.8.0 61 | 62 | * Fix #89: Add `orientation` to `window.screen` @sumeetdas 63 | 64 | ### 2.7.0 65 | 66 | * Fix #86: Add `nextElementSibling` and `previousElementSibling` methods 67 | 68 | ### 2.6.0 69 | 70 | * Fix #78: Invalid IL @jwosty 71 | 72 | ### 2.5.0 73 | 74 | * Add shadow root types @AngelMunoz 75 | 76 | ### 2.4.4 77 | 78 | * Downgrade FSharp.Core to 4.7.2 79 | 80 | ### 2.4.3 81 | 82 | * Downgrade FSharp.Core to 4.7.2 83 | 84 | ### 2.4.2 85 | 86 | * Release a new version because one of the dependencies had the licence information missing 87 | 88 | ### 2.4.1 89 | 90 | * Add licence to Nuget package @nojaf 91 | 92 | ### 2.4.0 93 | 94 | * Add ScrollToOptions support @saboco 95 | 96 | ### 2.3.0 97 | 98 | * Add event handler properties for gamepad events to Window (by @rastreus) 99 | 100 | ### 2.2.1 101 | 102 | * Fix #56: Clipboard API event handler argument types @kodfodrasz 103 | * Add event handler properties for clipboard events to Document @kodfodrasz 104 | 105 | ### 2.2.0 106 | 107 | * Fix #52: Add decodeURI, encodeURI, decodeURIComponent, encodeURIComponent to a `window` @MNie 108 | 109 | ### 2.1.2 110 | 111 | * Fix #48: FSharp.Core dependency @forki 112 | 113 | ### 2.1.1 114 | 115 | * Fix #25: Image constructor for HTMLImageElement 116 | 117 | ### 2.1.0 118 | 119 | * Add missing APIs on CanvasRenderingContext2D 120 | 121 | ### 2.0.1 122 | 123 | * Upgrade to Fable.Browser.Dom 1.2.1 to force usage of the new overloads of addListener|removeListener 124 | 125 | ### 2.0.0 126 | 127 | * Remove `addEventListener` from `DocumentType` and `GlobalEventHandlers` (by @baronfel) 128 | * Make `DocumentType` inherit from `Node` (by @baronfel) 129 | 130 | ### 1.3.0 131 | 132 | * Fix #39: Add `event.code` and deprecate `event.keyCode` 133 | 134 | ### 1.2.0 135 | 136 | * Add getter/setter to DataTransfer related types 137 | 138 | ### 1.1.0 139 | 140 | * Add `FormData` extension constructor 141 | 142 | ### 1.0.0 143 | 144 | * First stable release 145 | 146 | ### 1.0.0-alpha-004 147 | 148 | * Add missing members to FileReader 149 | 150 | ### 1.0.0-alpha-003 151 | 152 | * Move some APIs to standalone packages 153 | 154 | ### 1.0.0-alpha-002 155 | 156 | * Add missing events 157 | 158 | ### 1.0.0-alpha-001 159 | 160 | * First release 161 | -------------------------------------------------------------------------------- /src/Event/Browser.Event.fs: -------------------------------------------------------------------------------- 1 | namespace rec Browser.Types 2 | 3 | open System 4 | open Fable.Core 5 | 6 | type [] Event = 7 | abstract bubbles: bool with get, set 8 | abstract cancelable: bool with get, set 9 | abstract composed: bool with get, set 10 | abstract currentTarget: EventTarget with get, set 11 | abstract defaultPrevented: bool with get, set 12 | abstract eventPhase: float with get, set 13 | abstract isTrusted: bool with get, set 14 | abstract returnValue: bool with get, set 15 | abstract target: EventTarget with get, set 16 | abstract timeStamp: float with get, set 17 | abstract ``type``: string with get, set 18 | abstract AT_TARGET: float with get, set 19 | abstract BUBBLING_PHASE: float with get, set 20 | abstract CAPTURING_PHASE: float with get, set 21 | abstract cancelBubble: unit -> unit 22 | abstract composedPath: unit -> EventTarget[] 23 | abstract initEvent: eventTypeArg: string * canBubbleArg: bool * cancelableArg: bool -> unit 24 | abstract preventDefault: unit -> unit 25 | abstract stopImmediatePropagation: unit -> unit 26 | abstract stopPropagation: unit -> unit 27 | 28 | type [] EventInit = 29 | abstract bubbles: bool with get, set 30 | abstract cancelable: bool with get, set 31 | abstract composed: bool with get, set 32 | 33 | type [] EventType = 34 | [] abstract Create: ``type``: string * ?eventInitDict: EventInit -> Event 35 | abstract AT_TARGET: float with get, set 36 | abstract BUBBLING_PHASE: float with get, set 37 | abstract CAPTURING_PHASE: float with get, set 38 | 39 | type [] AddEventListenerOptions = 40 | abstract capture: bool with get, set 41 | abstract once: bool with get, set 42 | abstract passive: bool with get, set 43 | 44 | type [] RemoveEventListenerOptions = 45 | abstract capture: bool with get, set 46 | 47 | type [] EventTarget = 48 | abstract addEventListener: ``type``: string * listener: (Event->unit) -> unit 49 | abstract addEventListener: ``type``: string * listener: (Event->unit) * useCapture: bool -> unit 50 | abstract addEventListener: ``type``: string * listener: (Event->unit) * options: AddEventListenerOptions -> unit 51 | abstract dispatchEvent: evt: Event -> bool 52 | abstract removeEventListener: ``type``: string * listener: (Event->unit) -> unit 53 | abstract removeEventListener: ``type``: string * listener: (Event->unit) * useCapture: bool -> unit 54 | abstract removeEventListener: ``type``: string * listener: (Event->unit) * options: RemoveEventListenerOptions -> unit 55 | 56 | type [] EventTargetType = 57 | [] abstract Create: unit -> EventTarget 58 | 59 | type [] CustomEvent = 60 | inherit Event 61 | abstract detail: obj 62 | 63 | type [] CustomEventInit = 64 | inherit EventInit 65 | abstract detail: obj with get, set 66 | 67 | type [] CustomEvent<'T> = 68 | inherit Event 69 | abstract detail: 'T option 70 | 71 | type [] CustomEventInit<'T> = 72 | inherit EventInit 73 | abstract detail: 'T option with get, set 74 | 75 | type [] CustomEventType = 76 | [] abstract Create : typeArg: string * ?eventInitDict: CustomEventInit -> CustomEvent 77 | [] abstract Create : typeArg: string * ?eventInitDict: CustomEventInit<'T> -> CustomEvent<'T> 78 | 79 | type [] ErrorEvent = 80 | inherit Event 81 | abstract colno: int 82 | abstract error: obj 83 | abstract filename: string 84 | abstract lineno: int 85 | abstract message: string 86 | 87 | // MessageEvent is used by several packages (WebSockets, Dom) 88 | type [] MessageEvent = 89 | inherit Event 90 | abstract data: obj 91 | abstract origin: string 92 | // TODO: Add it as extension in Channel Messaging API 93 | // abstract ports: MessagePort[] 94 | abstract source: obj 95 | 96 | [] 97 | type GamepadEventType = 98 | | [] GamepadConnected 99 | | [] GamepadDisconnected 100 | 101 | type [] GamepadEvent = 102 | inherit Event 103 | [] abstract Create: typeArg: GamepadEventType * ?options: Gamepad 104 | abstract gamepad: Gamepad 105 | 106 | namespace Browser 107 | 108 | open Fable.Core 109 | open Browser.Types 110 | 111 | [] 112 | module Event = 113 | let [] Event: EventType = jsNative 114 | let [] EventTarget: EventTargetType = jsNative 115 | let [] CustomEvent : CustomEventType = jsNative 116 | -------------------------------------------------------------------------------- /src/Event/Browser.Event.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.Event 5 | 1.7.0 6 | 1.7.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 25 | 26 | -------------------------------------------------------------------------------- /src/Event/README.md: -------------------------------------------------------------------------------- 1 | # Browser.Event 2 | 3 | Includes bindings for the browser [Event interface](https://developer.mozilla.org/en-US/docs/Web/API/Event). -------------------------------------------------------------------------------- /src/Event/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 1.7.0 2 | 3 | * Add `Event.compose`, `Event.cancelBubble` and `Event.composedPath` (by @Lanayx) 4 | 5 | ### 1.6.0 6 | 7 | * Align Fable.Core version to 3.2.8 for all of fable-browser packages 8 | 9 | ### 1.5.0 10 | 11 | * Add `tags` to make binding displayed on Fable.Packages 12 | 13 | ### 1.5.0 14 | 15 | * Add Global attribute to global interfaces @chkn 16 | 17 | ### 1.4.6 18 | 19 | * Fix Event and CustomEvent constructors 20 | 21 | ### 1.4.5 22 | 23 | * Fix Fable #2463 @forki 24 | * Add back non-generic CustomEvent 25 | 26 | ### 1.4.4 27 | 28 | * Downgrade FSharp.Core to 4.7.2 29 | 30 | ### 1.4.3 31 | 32 | * Downgrade FSharp.Core to 4.7.2 33 | 34 | ### 1.4.2 35 | 36 | * Upgrade to Fable.Browser.Gamepad 1.0.1 to use the version with the licence information in it 37 | 38 | ### 1.4.1 39 | 40 | * Add licence to Nuget package @nojaf 41 | 42 | ### 1.4.0 43 | 44 | * Make CustomEvent generic @AngelMunoz 45 | 46 | ### 1.3.0 47 | 48 | * Add GamepadEvent (by @rastreus) 49 | 50 | ### 1.2.1 51 | 52 | * Make explicit overloads for (add | remove)EventListener (by @Zaid-Ajaj) 53 | 54 | ### 1.2.0 55 | 56 | * Add an overload for `addEventListener` and `removeEventListener` without the third argument in order to avoid forcing the user to pass the third optional argument and helps F# compiler determine which overload to use 57 | 58 | ### 1.1.0 59 | 60 | * Add missing overload for `addEventListener` and `removeEventListener` on type `EventTarget` (by @baronfel) 61 | 62 | ### 1.0.0 63 | 64 | * First stable release 65 | 66 | ### 1.0.0-alpha-001 67 | 68 | * First release 69 | -------------------------------------------------------------------------------- /src/EventSource/Browser.EventSource.fs: -------------------------------------------------------------------------------- 1 | namespace rec Browser.Types 2 | 3 | open System 4 | open Fable.Core 5 | 6 | type EventSourceState = 7 | | CONNECTING = 0 8 | | OPEN = 1 9 | | CLOSED = 2 10 | 11 | [] 12 | type EventSource = 13 | inherit EventTarget 14 | abstract readyState: EventSourceState 15 | abstract url: string 16 | abstract withCredentials: bool 17 | 18 | abstract close: unit -> unit 19 | 20 | abstract onerror: (Event -> unit) with get, set 21 | abstract onmessage: (MessageEvent -> unit) with get, set 22 | abstract onopen: (Event -> unit) with get, set 23 | 24 | [] 25 | abstract addEventListener_error: listener: (Event -> unit) * ?useCapture: bool -> unit 26 | 27 | [] 28 | abstract addEventListener_message: listener: (MessageEvent -> unit) * ?useCapture: bool -> unit 29 | 30 | [] 31 | abstract addEventListener_open: listener: (Event -> unit) * ?useCapture: bool -> unit 32 | 33 | [] 34 | type EventSourceOptions = 35 | abstract withCredentials: bool with get, set 36 | 37 | [] 38 | type EventSourceType = 39 | [] 40 | abstract Create: url: string * ?options: EventSourceOptions -> EventSource 41 | 42 | namespace Browser 43 | 44 | open Fable.Core 45 | open Browser.Types 46 | 47 | [] 48 | module EventSource = 49 | [] 50 | let EventSource: EventSourceType = jsNative 51 | -------------------------------------------------------------------------------- /src/EventSource/Browser.EventSource.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Fable.Browser.EventSource 4 | 1.0.0 5 | 1.0.0 6 | netstandard2.0 7 | true 8 | fable;fable-binding;fable-javascript 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/EventSource/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 1.0.0 2 | 3 | * Initial release 4 | -------------------------------------------------------------------------------- /src/Gamepad/Browser.Gamepad.fs: -------------------------------------------------------------------------------- 1 | namespace Browser.Types 2 | 3 | open Fable.Core 4 | 5 | type [] GamepadButton = 6 | abstract value: float 7 | abstract pressed: bool 8 | 9 | type [] Gamepad = 10 | abstract axes: ResizeArray 11 | abstract buttons: ResizeArray 12 | abstract connected: bool 13 | abstract id: string 14 | abstract index: int 15 | abstract mapping: string 16 | abstract timestamp: float 17 | 18 | namespace Browser 19 | 20 | open Fable.Core 21 | open Browser.Types 22 | 23 | [] 24 | module Gamepad = 25 | let [] gamepad: Gamepad = jsNative 26 | -------------------------------------------------------------------------------- /src/Gamepad/Browser.Gamepad.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.Gamepad 5 | 1.3.0 6 | 1.3.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /src/Gamepad/README.md: -------------------------------------------------------------------------------- 1 | # Browser.Gamepad 2 | 3 | Includes bindings for the browser [Gamepad API](https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API). 4 | -------------------------------------------------------------------------------- /src/Gamepad/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 1.3.0 2 | 3 | * Align Fable.Core version to 3.2.8 for all of fable-browser packages 4 | 5 | ### 1.2.0 6 | 7 | * Add `tags` to make binding displayed on Fable.Packages 8 | 9 | ### 1.1.0 10 | 11 | * Add Global attribute to global interfaces @chkn 12 | 13 | ### 1.0.3 14 | 15 | * Downgrade FSharp.Core to 4.7.2 16 | 17 | ### 1.0.2 18 | 19 | * Downgrade FSharp.Core to 4.7.2 20 | 21 | ### 1.0.1 22 | 23 | * Add licence to Nuget package @nojaf 24 | 25 | ### 1.0.0 26 | 27 | * Initial release 28 | -------------------------------------------------------------------------------- /src/Geolocation/Browser.Geolocation.fs: -------------------------------------------------------------------------------- 1 | namespace Browser.Types 2 | 3 | open System 4 | open Fable.Core 5 | 6 | type Coordinates = 7 | /// Returns a double representing the position's latitude in decimal degrees. 8 | abstract latitude: float 9 | /// Returns a double representing the position's longitude in decimal degrees. 10 | abstract longitude: float 11 | /// Returns a double representing the position's altitude in meters, relative to sea level. This value can be null if the implementation cannot provide the data. 12 | abstract altitude: float option 13 | /// Returns a double representing the accuracy of the latitude and longitude properties, expressed in meters. 14 | abstract accuracy: float 15 | /// Returns a double representing the accuracy of the altitude expressed in meters. This value can be null. 16 | abstract altitudeAccuracy: float option 17 | /// Returns a double representing the direction in which the device is traveling. This value, specified in degrees, indicates how far off from heading true north the device is. 0 degrees represents true north, and the direction is determined clockwise (which means that east is 90 degrees and west is 270 degrees). If speed is 0, heading is NaN. If the device is unable to provide heading information, this value is null. 18 | abstract heading: float option 19 | /// Returns a double representing the velocity of the device in meters per second. This value can be null. 20 | abstract speed: float option 21 | 22 | type Position = 23 | abstract coords: Coordinates 24 | abstract timestamp: float 25 | 26 | type PositionErrorCode = 27 | | PERMISSION_DENIED = 1 28 | | POSITION_UNAVAILABLE = 2 29 | | TIMEOUT = 3 30 | 31 | type PositionError = 32 | abstract code: PositionErrorCode 33 | abstract message: string 34 | 35 | type PositionOptions = 36 | abstract enableHighAccuracy: bool option with get, set 37 | abstract timeout: int option with get, set 38 | abstract maximumAge: int option with get, set 39 | 40 | type [] Geolocation = 41 | abstract clearWatch: watchId: float -> unit 42 | abstract getCurrentPosition: successCallback: (Position->unit) * ?errorCallback: (PositionError->unit) * ?options: PositionOptions -> unit 43 | abstract watchPosition: successCallback: (Position->unit) * ?errorCallback: (PositionError->unit) * ?options: PositionOptions -> float 44 | -------------------------------------------------------------------------------- /src/Geolocation/Browser.Geolocation.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.Geolocation 5 | 1.3.0 6 | 1.3.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /src/Geolocation/README.md: -------------------------------------------------------------------------------- 1 | # Browser.Geolocation 2 | 3 | Includes bindings for the browser [Geolocation API](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation). 4 | -------------------------------------------------------------------------------- /src/Geolocation/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 1.3.0 2 | 3 | * Align Fable.Core version to 3.2.8 for all of fable-browser packages 4 | 5 | ### 1.2.0 6 | 7 | * Add `tags` to make binding displayed on Fable.Packages 8 | 9 | ### 1.1.0 10 | 11 | * Add Global attribute to global interfaces @chkn 12 | 13 | ### 1.0.4 14 | 15 | * Downgrade FSharp.Core to 4.7.2 16 | 17 | ### 1.0.3 18 | 19 | * Downgrade FSharp.Core to 4.7.2 20 | 21 | ### 1.0.2 22 | 23 | * Release a new version because one of the dependencies had the licence information missing 24 | 25 | ### 1.0.1 26 | 27 | * Add licence to Nuget package @nojaf 28 | 29 | ### 1.0.0 30 | 31 | * Stable release 32 | 33 | ### 1.0.0-beta-001 34 | 35 | * First release 36 | -------------------------------------------------------------------------------- /src/IndexedDB/Browser.IndexedDB.Api.fs: -------------------------------------------------------------------------------- 1 | namespace Browser 2 | 3 | open Fable.Core 4 | open Browser.Types 5 | 6 | [] 7 | module IndexedDB = 8 | let [] indexedDB: IDBFactory = jsNative 9 | 10 | -------------------------------------------------------------------------------- /src/IndexedDB/Browser.IndexedDB.Ext.fs: -------------------------------------------------------------------------------- 1 | [] 2 | module Browser.IndexedDBExtensions 3 | 4 | open Fable.Core 5 | open Browser.Types 6 | 7 | type Window with 8 | [] 9 | member __.indexedDB: IDBFactory = jsNative 10 | 11 | -------------------------------------------------------------------------------- /src/IndexedDB/Browser.IndexedDB.fs: -------------------------------------------------------------------------------- 1 | namespace rec Browser.Types 2 | 3 | open Fable.Core 4 | 5 | [] 6 | type IDBRequestSource = 7 | | Index of IDBIndex 8 | | ObjectStore of IDBObjectStore 9 | | Cursor of IDBCursor 10 | 11 | [] 12 | type IDBRequestReadyState = 13 | | Pending 14 | | Done 15 | 16 | [] 17 | type IDBTransactionMode = 18 | | Readonly 19 | | Readwrite 20 | | Versionchange 21 | 22 | [] 23 | type IDBTransactionDuarability = 24 | | Strict 25 | | Relaxed 26 | | Default 27 | 28 | [] 29 | type IDBCursorDirection = 30 | | Next 31 | | Nextunique 32 | | Prev 33 | | Prevunique 34 | 35 | type [] DatabasesType = 36 | abstract name: string 37 | abstract version: int64 38 | 39 | type [] IDBIndex = 40 | abstract isAutoLocale: bool with get 41 | abstract locale: string with get 42 | abstract name: string with get 43 | abstract objectStore: IDBObjectStore with get 44 | abstract keyPath: U2> with get 45 | abstract multiEntry: bool with get 46 | abstract unique: bool with get 47 | 48 | abstract count: ?key: obj -> IDBRequest 49 | abstract get: ?key: obj -> IDBRequest 50 | abstract getKey: ?key: obj -> IDBRequest 51 | abstract getAll: ?query: obj * ?count: int -> IDBRequest 52 | abstract getAllKeys: ?query: obj * ?count: int -> IDBRequest 53 | abstract openCursor: ?range: obj * ?direction: IDBCursorDirection -> IDBRequest 54 | abstract openKeyCursor: ?range: obj * ?direction: IDBCursorDirection -> IDBRequest 55 | 56 | type [] IDBVersionChangeEvent = 57 | inherit Event 58 | 59 | abstract oldVersion: int64 with get 60 | abstract newVersion: int64 with get 61 | 62 | type [] IDBKeyRange = 63 | abstract lower: obj with get 64 | abstract upper: obj with get 65 | abstract lowerOpen: bool with get 66 | abstract upperOpen: bool with get 67 | abstract includes: obj -> bool 68 | 69 | [] 70 | static member bound(lower: obj, upper: obj, ?lowerOpen: bool, ?upperOpen: bool) = jsNative 71 | 72 | [] 73 | static member only(only: obj) = jsNative 74 | 75 | [] 76 | static member lowerBound(lower: obj, ?``open``: bool) = jsNative 77 | 78 | [] 79 | static member upperBound(upper: obj, ?``open``: bool) = jsNative 80 | 81 | type [] IDBCursor = 82 | abstract source: IDBObjectStore with get 83 | abstract direction: IDBCursorDirection with get 84 | abstract key: obj option with get 85 | abstract primaryKey: obj option with get 86 | abstract request: IDBRequest with get 87 | 88 | abstract advance: count: int -> unit 89 | abstract ``continue``: ?key: obj -> unit 90 | abstract continuePrimaryKey: key: obj * primaryKey: obj -> unit 91 | abstract delete: unit -> IDBRequest 92 | abstract update: value: obj -> IDBRequest 93 | 94 | type [] IDBCursorWithValue = 95 | inherit IDBCursor 96 | 97 | abstract value: obj option with get 98 | 99 | type [] IDBTransaction = 100 | inherit EventTarget 101 | 102 | abstract db: IDBDatabase with get 103 | abstract durability: IDBTransactionDuarability with get 104 | abstract error: DOMException with get 105 | abstract mode: IDBTransactionMode with get 106 | abstract objectStoreNames: DOMStringList with get 107 | 108 | abstract abort: unit -> unit 109 | abstract objectStore: name: string -> IDBObjectStore 110 | abstract commit: unit -> unit 111 | 112 | abstract oncomplete: (Event -> unit) with get, set 113 | abstract onerror: (Event -> unit) with get, set 114 | abstract onabort: (Event -> unit) with get, set 115 | 116 | type [] IDBRequest = 117 | inherit EventTarget 118 | 119 | abstract error: DOMException with get 120 | abstract result: obj option with get 121 | abstract source: IDBRequestSource option with get 122 | abstract readyState: IDBRequestReadyState with get 123 | abstract transaction: IDBTransaction with get 124 | 125 | abstract onerror: (Event -> unit) with get, set 126 | abstract onsuccess: (Event -> unit) with get, set 127 | 128 | type [] IDBCreateIndexOptions = 129 | abstract unique: bool with get, set 130 | abstract multiEntry: bool with get, set 131 | 132 | type [] IDBObjectStore = 133 | abstract indexNames: DOMStringList with get 134 | abstract keyPath: U2> with get 135 | abstract name: string with get 136 | abstract transaction: IDBTransaction with get 137 | abstract autoIncrement: bool with get 138 | 139 | abstract add: value: obj * ?key: obj -> IDBRequest 140 | abstract clear: unit -> IDBRequest 141 | abstract count: ?query: IDBKeyRange -> IDBRequest 142 | abstract createIndex: indexName: string * keyPath: ResizeArray * ?options: IDBCreateIndexOptions -> IDBRequest 143 | abstract createIndex: indexName: string * keyPath: string * ?options: IDBCreateIndexOptions -> IDBRequest 144 | abstract createIndex: indexName: string * keyPath: U2> * ?options: IDBCreateIndexOptions -> IDBRequest 145 | abstract delete: key: obj -> IDBRequest 146 | abstract deleteIndex: string -> IDBRequest 147 | abstract get: key: obj -> IDBRequest 148 | abstract getKey: key: obj -> IDBRequest 149 | abstract getAll: ?query: IDBKeyRange * ?count: int -> IDBRequest 150 | abstract getAllKeys: ?query: IDBKeyRange * ?count: int -> IDBRequest 151 | abstract index: string -> IDBIndex 152 | abstract openCursor: ?range: IDBKeyRange * ?direction: IDBCursorDirection -> IDBRequest 153 | abstract openKeyCursor: ?range: IDBKeyRange * ?direction: IDBCursorDirection -> IDBRequest 154 | abstract put: item: obj * ?key: obj -> IDBRequest 155 | 156 | type [] IDBCreateStoreOptions = 157 | abstract autoIncrement: bool option with get, set 158 | abstract keyPath: U2> option with get, set 159 | 160 | type [] IDBTransactionOptions = 161 | abstract durability: IDBTransactionDuarability with get, set 162 | 163 | type [] IDBDatabase = 164 | inherit EventTarget 165 | 166 | abstract name: string with get 167 | abstract version: int64 with get 168 | abstract objectStoreNames: DOMStringList with get 169 | 170 | abstract close: unit -> unit 171 | abstract createObjectStore: name: string * ?options: IDBCreateStoreOptions -> IDBObjectStore 172 | abstract deleteObjectStore: name: string -> unit 173 | abstract transaction: storeNames: #seq * ?mode: IDBTransactionMode * ?options: IDBTransactionOptions -> IDBTransaction 174 | abstract transaction: storeNames: string * ?mode: IDBTransactionMode * ?options: IDBTransactionOptions -> IDBTransaction 175 | 176 | abstract onclose: (Event -> unit) with get, set 177 | abstract onversionchange: (Event -> unit) with get, set 178 | abstract onabort: (Event -> unit) with get, set 179 | abstract onerror: (Event -> unit) with get, set 180 | 181 | type [] IDBOpenDBRequest = 182 | inherit IDBRequest 183 | 184 | abstract blocked: (Event -> unit) with get, set 185 | abstract onupgradeneeded: (IDBVersionChangeEvent -> unit) with get, set 186 | 187 | type [] IDBFactory = 188 | abstract ``open``: name: string * ?version: int -> IDBOpenDBRequest 189 | abstract cmp: first: 'T * second: 'T -> int 190 | abstract deleteDatabase: name: string -> IDBOpenDBRequest 191 | abstract databases: unit -> JS.Promise 192 | -------------------------------------------------------------------------------- /src/IndexedDB/Browser.IndexedDB.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.IndexedDB 5 | 2.2.0 6 | 2.2.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/IndexedDB/README.md: -------------------------------------------------------------------------------- 1 | # Browser.IndexedDB 2 | 3 | Includes bindings for the browser [IndexedDB API](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API). -------------------------------------------------------------------------------- /src/IndexedDB/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 2.2.0 2 | 3 | * Add `IDBObjectStore.createIndex` overload that takes a `U2>` (by @MangelMaxime) 4 | 5 | ### 2.1.0 6 | 7 | * Add `IDBObjectStore.createIndex` overload that takes a `ResizeArray` (by @MangelMaxime) 8 | * Change `IDBObjectStore.keyPath` from `obj` `U2>` (by @MangelMaxime) 9 | * Change `IDBIndex.keyPath` from `obj` `U2>` (by @MangelMaxime) 10 | * Improves properties types of `IDBCreateStoreOptions` (by @MangelMaxime) 11 | * Change `IDBObjectStore.deleteIndex: unit -> IDBRequest` to `IDBObjectStore.deleteIndex: string -> IDBRequest` (by @kentcb) 12 | * Change `DatabasesType.version` from `string` to `uint64` (by @kentcb) 13 | 14 | ### 2.0.0 15 | 16 | * Align IndexedDB with current browser spec (by @robitar) 17 | 18 | ### 1.0.0 19 | 20 | * Add `tags` to make binding displayed on Fable.Packages 21 | * Stable release 22 | 23 | ### 1.0.0-beta-001 24 | 25 | * First beta release 26 | -------------------------------------------------------------------------------- /src/IntersectionObserver/Browser.IntersectionObserver.fs: -------------------------------------------------------------------------------- 1 | namespace Browser.Types 2 | 3 | open Fable.Core 4 | 5 | type IntersectionObserverEntry = 6 | /// A rectangle describing the smallest rectangle that contains the entire target element 7 | abstract boundingClientRect: ClientRect 8 | /// How much of the target element is currently visible within the root's intersection ratio, as a value between 0.0 and 1.0 9 | abstract intersectionRatio: float 10 | /// The smallest rectangle that contains the entire portion of the target element which is currently visible within the intersection root 11 | abstract intersectionRect: ClientRect 12 | /// True if the target element intersects with the intersection observer's root 13 | abstract isIntersecting: bool 14 | /// A rectangle corresponding to the target's root intersection rectangle, offset by the IntersectionObserver.rootMargin if one is specified 15 | abstract rootBounds: ClientRect 16 | /// Which targeted Element has changed its amount of intersection with the intersection root 17 | abstract target: Node 18 | /// The time at which the intersection change occurred relative to the time at which the document was created 19 | abstract time: System.Double // DOMHighResTimeStamp - defined in MediaRecorder 20 | 21 | type IntersectionObserverOptions = 22 | /// An Element or Document object which is an ancestor of the intended target, whose bounding rectangle will be considered the viewport 23 | abstract root: Node with get, set 24 | /// string which specifies a set of offsets to add to the root's bounding_box when calculating intersections, effectively shrinking or growing the root for calculation purposes 25 | abstract rootMargin: string with get, set 26 | /// Either a single number or an array of numbers between 0.0 and 1.0, specifying a ratio of intersection area to total bounding box area for the observed target 27 | abstract threshold: U2 with get, set 28 | 29 | 30 | type [] IntersectionObserverType = 31 | /// identifies the Element or Document whose bounds are treated as the bounding box of the viewport for the element which is the observer's target. Use null for document viewport 32 | abstract root: Node 33 | /// A string (in CSS margin format), which contains offsets for one or more sides of the root's bounding box. These offsets are added to the corresponding values in the root's bounding box before the intersection between the resulting rectangle and the target element's bounds 34 | abstract rootMargin: string 35 | /// Array of intersection thresholds that was specified when the observer was instantiated 36 | abstract thresholds: float[] 37 | // Stop watching all target elements 38 | abstract disconnect: unit -> unit 39 | // Start watching given target 40 | abstract observe: Node -> unit 41 | /// Return array of IntersectionObserverEntry records captured since last callback was invoked 42 | abstract takeRecords: Node -> unit 43 | // Stop watching given target 44 | abstract unobserve: Node -> unit 45 | 46 | type IntersectionObserverCallback = IntersectionObserverEntry[] -> IntersectionObserverType -> unit 47 | 48 | type [] IntersectionObserverCtor = 49 | [] abstract Create: url: IntersectionObserverCallback * ?options: IntersectionObserverOptions -> IntersectionObserverType 50 | 51 | namespace Browser 52 | 53 | open Fable.Core 54 | open Browser.Types 55 | 56 | [] 57 | module IntersectionObserver = 58 | let [] IntersectionObserver: IntersectionObserverCtor = jsNative 59 | -------------------------------------------------------------------------------- /src/IntersectionObserver/Browser.IntersectionObserver.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.IntersectionObserver 5 | 1.0.0 6 | 1.0.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /src/IntersectionObserver/README.md: -------------------------------------------------------------------------------- 1 | # Browser.IntersectionObserver 2 | 3 | Includes bindings for the [Intersection Observer API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API). -------------------------------------------------------------------------------- /src/IntersectionObserver/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 1.0.0 2 | 3 | * First release 4 | -------------------------------------------------------------------------------- /src/MediaQueryList/Browser.MediaQueryList.Api.fs: -------------------------------------------------------------------------------- 1 | namespace Browser 2 | 3 | open Fable.Core 4 | open Browser.Types 5 | 6 | module MediaQueryList = 7 | let [] MediaQueryList : MediaQueryListType = jsNative 8 | -------------------------------------------------------------------------------- /src/MediaQueryList/Browser.MediaQueryList.Ext.fs: -------------------------------------------------------------------------------- 1 | [] 2 | module Browser.MediaQueryListExtensions 3 | 4 | open Fable.Core 5 | open Browser.Types 6 | 7 | type Document with 8 | [] 9 | member __.matchMedia(mediaQuery : string) : MediaQueryList = jsNative 10 | 11 | type Window with 12 | [] 13 | member __.matchMedia(mediaQuery : string) : MediaQueryList = jsNative 14 | -------------------------------------------------------------------------------- /src/MediaQueryList/Browser.MediaQueryList.fs: -------------------------------------------------------------------------------- 1 | namespace rec Browser.Types 2 | 3 | open Fable.Core 4 | open Browser.Types 5 | 6 | type [] MediaQueryList = 7 | inherit EventTarget 8 | abstract matches: bool with get, set 9 | abstract media: string with get, set 10 | abstract onchange: (Event -> unit) with get, set 11 | 12 | type [] MediaQueryListType = 13 | abstract prototype: MediaQueryList with get, set 14 | [] abstract Create: unit -> MediaQueryList 15 | -------------------------------------------------------------------------------- /src/MediaQueryList/Browser.MediaQueryList.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.MediaQueryList 5 | 1.5.0 6 | 1.5.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 28 | 29 | -------------------------------------------------------------------------------- /src/MediaQueryList/README.md: -------------------------------------------------------------------------------- 1 | # Browser.MediaStream 2 | 3 | Includes bindings for the browser [Media Capture and Streams API (Media Stream)](https://developer.mozilla.org/en-US/docs/Web/API/Media_Streams_API). -------------------------------------------------------------------------------- /src/MediaQueryList/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 1.5.0 2 | 3 | * Align Fable.Core version to 3.2.8 for all of fable-browser packages 4 | 5 | ### 1.4.0 6 | 7 | * Add `tags` to make binding displayed on Fable.Packages 8 | 9 | ### 1.3.0 10 | 11 | * Add Global attribute to global interfaces @chkn 12 | 13 | ### 1.2.0 14 | 15 | * Fix #78: Invalid IL @jwosty 16 | 17 | ### 1.1.5 18 | 19 | * Downgrade FSharp.Core to 4.7.2 20 | 21 | ### 1.1.4 22 | 23 | * Downgrade FSharp.Core to 4.7.2 24 | 25 | ### 1.1.3 26 | 27 | * Release a new version because one of the dependencies had the licence information missing 28 | 29 | ### 1.1.2 30 | 31 | * Add licence to Nuget package @nojaf 32 | 33 | ### 1.1.1 34 | 35 | * Upgrade to Fable.Browser.Dom 1.2.1 to force usage of the new overloads of addListener|removeListener 36 | 37 | ### 1.1.0 38 | 39 | * Rename `Browser.CssExtensions` to `Browser.MediaQueryListExtensions` 40 | 41 | ### 1.0.0 42 | 43 | * First release 44 | -------------------------------------------------------------------------------- /src/MediaRecorder/Browser.MediaRecorder.fs: -------------------------------------------------------------------------------- 1 | namespace Browser.Types 2 | 3 | open Fable.Core 4 | open Browser.Types 5 | 6 | [] 7 | type MediaRecorderState = 8 | | Inactive 9 | | Recording 10 | | Paused 11 | 12 | type DOMHighResTimeStamp = System.Double 13 | 14 | type [] BlobEvent = 15 | inherit Event 16 | abstract data: Blob 17 | abstract timecode: DOMHighResTimeStamp 18 | 19 | type [] BlobEventType = 20 | [] abstract Create: data: Blob * ?timecode: DOMHighResTimeStamp -> BlobEvent 21 | 22 | type [] MediaRecorderErrorEvent = 23 | inherit Event 24 | abstract error: DOMException 25 | 26 | type [] MediaRecorder = 27 | abstract mimeType: string 28 | abstract state: MediaRecorderState 29 | abstract stream: MediaStream 30 | abstract videoBitsPerSecond: uint32 31 | abstract audioBitsPerSecond: uint32 32 | 33 | abstract pause: unit -> unit 34 | abstract requestData: unit -> unit 35 | abstract resume: unit -> unit 36 | abstract start: ?timeslice: float -> unit 37 | abstract stop: unit -> unit 38 | 39 | abstract isTypeSupported: string -> bool 40 | 41 | abstract ondataavailable: (BlobEvent -> unit) with get, set 42 | abstract onerror: (MediaRecorderErrorEvent -> unit) with get, set 43 | abstract onpause: (Event -> unit) with get, set 44 | abstract onresume: (Event -> unit) with get, set 45 | abstract onstart: (Event -> unit) with get, set 46 | abstract onstop: (Event -> unit) with get, set 47 | 48 | type MediaRecorderOptions = 49 | abstract mimeType: string with get, set 50 | abstract audioBitsPerSecond: uint32 with get, set 51 | abstract videoBitsPerSecond: uint32 with get, set 52 | abstract bitsPerSecond: uint32 with get, set 53 | 54 | type MediaRecorderType = 55 | [] abstract Create: stream: MediaStream * ?options: MediaRecorderOptions -> MediaRecorder 56 | abstract isTypeSupported: mimeType: string -> bool 57 | 58 | namespace Browser 59 | 60 | open Fable.Core 61 | open Browser.Types 62 | 63 | [] 64 | module MediaRecorder = 65 | let [] MediaRecorder: MediaRecorderType = jsNative 66 | -------------------------------------------------------------------------------- /src/MediaRecorder/Browser.MediaRecorder.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.MediaRecorder 5 | 2.2.0 6 | 2.2.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /src/MediaRecorder/README.md: -------------------------------------------------------------------------------- 1 | # Browser.MediaRecorder 2 | 3 | Includes bindings for the browser [MediaStream Recording API](https://developer.mozilla.org/en-US/docs/Web/API/MediaStream_Recording_API), sometimes referred to as the _Media Recording API_ or the _MediaRecorder API_. 4 | -------------------------------------------------------------------------------- /src/MediaRecorder/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 2.2.0 2 | 3 | * Align Fable.Core version to 3.2.8 for all of fable-browser packages 4 | 5 | ### 2.1.0 6 | 7 | * Fix #120: Change `MediaRecorder.start` from `unit -> unit` to `?timeslice: float -> unit` 8 | 9 | ### 2.0.0 10 | 11 | * Change `MediaRecorder.videoBitsPerSecond` from `uint64` to `uint32` kerams (by @kerams) 12 | * Change `MediaRecorder.audioBitsPerSecond` from `uint64` to `uint32` kerams (by @kerams) 13 | * Change `MediaRecorderOptions.audioBitsPerSecond` from `uint64` to `uint32` kerams (by @kerams) 14 | * Change `MediaRecorderOptions.videoBitsPerSecond` from `uint64` to `uint32` kerams (by @kerams) 15 | * Change `MediaRecorderOptions.bitsPerSecond` from `uint64` to `uint32` kerams (by @kerams) 16 | 17 | ### 1.3.0 18 | 19 | * Add `tags` to make binding displayed on Fable.Packages 20 | 21 | ### 1.2.1 22 | 23 | * Add `MediaRecorder.isTypeSupported` (by @kerams) 24 | 25 | ### 1.2.0 26 | 27 | * Unreleased because, I forgot to pulling the changes before releasing... 28 | 29 | ### 1.1.0 30 | 31 | * Add Global attribute to global interfaces @chkn 32 | 33 | ### 1.0.0 34 | 35 | * Initial release 36 | -------------------------------------------------------------------------------- /src/MediaStream/Browser.MediaStream.fs: -------------------------------------------------------------------------------- 1 | namespace Browser.Types 2 | 3 | open System 4 | open Fable.Core 5 | open Browser 6 | open Browser.Types 7 | 8 | 9 | type MediaTrackSupportedConstraints = 10 | abstract autoGainControl:bool option with get, set 11 | abstract width:bool option with get, set 12 | abstract height:bool option with get, set 13 | abstract aspectRatio:bool option with get, set 14 | abstract frameRate:bool option with get, set 15 | abstract facingMode:bool option with get, set 16 | abstract resizeMode:bool option with get, set 17 | abstract volume:bool option with get, set 18 | abstract sampleRate:bool option with get, set 19 | abstract sampleSize:bool option with get, set 20 | abstract echoCancellation:bool option with get, set 21 | abstract latency:bool option with get, set 22 | abstract noiseSuppression:bool option with get, set 23 | abstract channelCount:bool option with get, set 24 | abstract deviceId:bool option with get, set 25 | abstract groupId:bool option with get, set 26 | 27 | abstract displaySurface:bool option with get, set 28 | abstract logicalSurface:bool option with get, set 29 | abstract cursor:bool option with get, set 30 | abstract restrictOwnAudio:bool option with get, set 31 | 32 | type Range<'T> = 33 | abstract max: 'T option with get, set 34 | abstract min: 'T option with get, set 35 | 36 | type SteppedRange<'T> = 37 | abstract max: 'T option with get, set 38 | abstract min: 'T option with get, set 39 | abstract step: 'T option with get, set 40 | 41 | type ULongRange = Range 42 | type DoubleRange = Range 43 | 44 | type ConstrainRange<'T> = 45 | inherit Range<'T> 46 | abstract exact: 'T option with get, set 47 | abstract ideal: 'T option with get, set 48 | 49 | type Constrain<'T> = 50 | abstract exact: 'T option with get, set 51 | abstract ideal: 'T option with get, set 52 | 53 | [] 54 | type ConstrainOrRange<'T> = 55 | | Value of 'T 56 | | ConstrainRange of ConstrainRange<'T> 57 | 58 | type ConstrainOrRangeULong = ConstrainOrRange 59 | type ConstrainOrRangeDouble = ConstrainOrRange 60 | 61 | 62 | [] 63 | type ConstrainOrValue<'T> = 64 | | Value of 'T 65 | | Constrain of Constrain<'T> 66 | 67 | type ConstrainULong = ConstrainOrValue 68 | type ConstrainDouble = ConstrainOrValue 69 | type ConstrainBoolean = ConstrainOrValue 70 | type ConstrainString = ConstrainOrValue 71 | 72 | type MediaTrackConstraintSet = 73 | abstract deviceId: ConstrainString option with get, set 74 | abstract groupId: ConstrainString option with get, set 75 | 76 | type MediaTrackSettings = 77 | abstract deviceId: string 78 | abstract groupId: string 79 | 80 | [] 81 | type AudioConstraint = 82 | inherit MediaTrackConstraintSet 83 | abstract autoGainControl: ConstrainBoolean option with get, set 84 | abstract channelCount: ConstrainOrRangeULong option with get, set 85 | abstract echoCancellation: ConstrainBoolean option with get, set 86 | abstract latency: ConstrainOrRangeDouble option with get, set 87 | abstract noiseSuppression: ConstrainBoolean option with get, set 88 | abstract sampleRate: ConstrainOrRangeULong option with get, set 89 | abstract sampleSize: ConstrainOrRangeULong option with get, set 90 | abstract volume: ConstrainOrRangeDouble option with get, set 91 | 92 | type AudioMediaTrackConstraintSet = 93 | inherit MediaTrackConstraintSet 94 | abstract autoGainControl: ConstrainBoolean option with get, set 95 | abstract channelCount: ConstrainOrRangeULong option with get, set 96 | abstract echoCancellation: ConstrainBoolean option with get, set 97 | abstract latency: ConstrainOrRangeDouble option with get, set 98 | abstract noiseSuppression: ConstrainBoolean option with get, set 99 | abstract sampleRate: ConstrainOrRangeULong option with get, set 100 | abstract sampleSize: ConstrainOrRangeULong option with get, set 101 | abstract volume: ConstrainOrRangeDouble option with get, set 102 | 103 | type AudioMediaTrackSettings = 104 | inherit MediaTrackSettings 105 | abstract autoGainControl: bool 106 | abstract channelCount: uint32 107 | abstract echoCancellation: bool 108 | abstract latency: double 109 | abstract noiseSuppression: bool 110 | abstract sampleRate: uint32 111 | abstract sampleSize: uint32 112 | abstract volume: double 113 | 114 | [] 115 | type ShotMode = 116 | | [] None' 117 | | Manual 118 | | [] SingleShot 119 | | Continuous 120 | 121 | type ConstrainShotMode = Constrain 122 | 123 | type PointsOfInterest = 124 | abstract x:uint32 with get, set 125 | abstract y:uint32 with get, set 126 | 127 | [] 128 | type PointsOfInterestConstraint = 129 | | Point of PointsOfInterest 130 | | Points of ResizeArray 131 | 132 | type ImageMediaTrackConstraintSet = 133 | inherit MediaTrackConstraintSet 134 | abstract whiteBalanceMode: ConstrainShotMode option with get, set 135 | abstract exposureMode: ConstrainShotMode option with get, set 136 | abstract focusMode: ConstrainShotMode option with get, set 137 | abstract pointsOfInterest: PointsOfInterestConstraint option with get, set 138 | abstract exposureCompensation: ConstrainDouble option with get, set 139 | abstract colorTemperature: ConstrainDouble option with get, set 140 | abstract iso: ConstrainDouble option with get, set 141 | abstract brightness: ConstrainDouble option with get, set 142 | abstract contrast: ConstrainDouble option with get, set 143 | abstract saturation: ConstrainDouble option with get, set 144 | abstract sharpness: ConstrainDouble option with get, set 145 | abstract focusDistance: ConstrainDouble option with get, set 146 | abstract zoom: ConstrainDouble option with get, set 147 | abstract torch: ConstrainBoolean option with get, set 148 | 149 | type ImageMediaTrackSettings = 150 | inherit MediaTrackSettings 151 | abstract whiteBalanceMode: ShotMode 152 | abstract exposureMode: ShotMode 153 | abstract focusMode: ShotMode 154 | abstract pointsOfInterest: U2 option 155 | abstract exposureCompensation: double option 156 | abstract colorTemperature: double option 157 | abstract iso: double option 158 | abstract brightness: double option 159 | abstract contrast: double option 160 | abstract saturation: double option 161 | abstract sharpness: double option 162 | abstract focusDistance: double option 163 | abstract zoom: double option 164 | abstract torch: bool option 165 | 166 | [] 167 | type ResizeMode = 168 | | [] None' 169 | | [] CropAndScale 170 | 171 | type ConstrainResizeMode = Constrain 172 | 173 | 174 | [] 175 | type FacingMode = 176 | | User 177 | | Environment 178 | | Left 179 | | Right 180 | type ConstrainFacingMode = Constrain 181 | 182 | type VideoMediaTrackConstraintSet = 183 | inherit MediaTrackConstraintSet 184 | abstract aspectRatio: ConstrainOrRangeDouble option with get, set 185 | abstract facingMode: ConstrainFacingMode option with get, set 186 | abstract frameRate: ConstrainOrRangeDouble option with get, set 187 | abstract height: ConstrainOrRangeULong option with get, set 188 | abstract width: ConstrainOrRangeULong option with get, set 189 | abstract resizeMode: ConstrainResizeMode option with get, set 190 | 191 | type VideoMediaTrackSettings = 192 | inherit MediaTrackSettings 193 | inherit ImageMediaTrackSettings 194 | abstract aspectRatio: float 195 | abstract facingMode: FacingMode 196 | abstract frameRate: double 197 | abstract height: uint32 198 | abstract width: uint32 199 | abstract resizeMode: ResizeMode 200 | 201 | [] 202 | type Cursor = 203 | | Always 204 | | Motion 205 | | Never 206 | 207 | type ConstrainCursor = Constrain> 208 | 209 | [] 210 | type DisplaySurface = 211 | | Application 212 | | Browser 213 | | Monitor 214 | | Window 215 | 216 | type ConstrainDisplaySurface = Constrain> 217 | 218 | type SharedScreenMediaTrackSettings = 219 | inherit MediaTrackSettings 220 | abstract cursor: Cursor 221 | abstract displaySurface: DisplaySurface 222 | abstract logicalSurface: bool 223 | 224 | type MediaTrackConstraints = 225 | inherit MediaTrackConstraintSet 226 | abstract advanced: ResizeArray option with get, set 227 | 228 | type VideoMediaTrackConstraints = 229 | inherit VideoMediaTrackConstraintSet 230 | inherit ImageMediaTrackConstraintSet 231 | inherit MediaTrackConstraints 232 | 233 | type AudioMediaTrackConstraints = 234 | inherit AudioMediaTrackConstraintSet 235 | inherit MediaTrackConstraints 236 | 237 | type SharedScreenMediaTrackConstraintSet = 238 | inherit VideoMediaTrackConstraints 239 | abstract cursor: ConstrainCursor option with get, set 240 | abstract displaySurface: ConstrainDisplaySurface option with get, set 241 | abstract logicalSurface: ConstrainBoolean option with get, set 242 | abstract restrictOwnAudio: ConstrainBoolean option with get, set 243 | 244 | [] 245 | type StreamConstraintOrBool<'T> = 246 | | Bool of bool 247 | | Constraint of 'T 248 | 249 | type MediaStreamConstraints = 250 | abstract video:StreamConstraintOrBool with get, set 251 | abstract audio:StreamConstraintOrBool with get, set 252 | 253 | type DisplayMediaStreamConstraints = 254 | abstract video:StreamConstraintOrBool with get, set 255 | abstract audio:StreamConstraintOrBool with get, set 256 | 257 | [] 258 | type TrackKind = 259 | | Audio 260 | | Video 261 | 262 | 263 | [] 264 | type MediaStreamTrackState = 265 | | Live 266 | | Ended 267 | 268 | 269 | type MediaTrackCapabilities = 270 | abstract width: ULongRange option 271 | abstract height: ULongRange option 272 | abstract aspectRatio: DoubleRange option 273 | abstract frameRate: DoubleRange option 274 | abstract facingMode: FacingMode array option 275 | abstract resizeMode: ResizeMode array option 276 | abstract sampleRate: ULongRange option 277 | abstract sampleSize: ULongRange option 278 | abstract echoCancellation: bool array option 279 | abstract autoGainControl: bool array option 280 | abstract noiseSuppression: bool array option 281 | abstract latency: DoubleRange option 282 | abstract channelCount: ULongRange option 283 | abstract deviceId: string option 284 | abstract groupId: string option 285 | 286 | abstract colorTemperature: SteppedRange option 287 | abstract exposureMode: ShotMode array option 288 | abstract exposureCompensation: SteppedRange option 289 | abstract exposureTime: SteppedRange option 290 | abstract focusDistance: SteppedRange option 291 | abstract focusMode: ShotMode array option 292 | abstract iso: SteppedRange option 293 | abstract torch: bool option 294 | abstract whiteBalanceMode: ShotMode array option 295 | abstract zoom: SteppedRange option 296 | 297 | type [] MediaStreamTrack = 298 | inherit EventTarget 299 | abstract kind: TrackKind 300 | abstract id: string 301 | abstract label: string 302 | abstract enabled: bool with get, set 303 | abstract muted: bool 304 | abstract onmute: (Event -> unit) with get, set 305 | abstract onunmute: (Event -> unit) with get, set 306 | abstract onended: (Event -> unit) with get, set 307 | abstract readyState: MediaStreamTrackState 308 | abstract clone: unit -> MediaStreamTrack 309 | abstract stop: unit -> unit 310 | abstract getCapabilities: unit -> MediaTrackCapabilities 311 | abstract getConstraints: unit -> MediaTrackConstraints 312 | abstract getSettings: unit -> MediaTrackSettings 313 | abstract applyConstraints: constraints:#MediaTrackConstraints option -> JS.Promise 314 | 315 | type [] MediaStreamTrackEvent = 316 | abstract track: MediaStreamTrack 317 | 318 | type AudioMediaStreamTrack = 319 | inherit MediaStreamTrack 320 | abstract clone: unit -> AudioMediaStreamTrack 321 | abstract applyConstraints: constraints:AudioMediaTrackConstraints option -> JS.Promise 322 | abstract getConstraints: unit -> AudioMediaTrackConstraints 323 | abstract getSettings: unit -> AudioMediaTrackSettings 324 | 325 | type VideoMediaStreamTrack = 326 | inherit MediaStreamTrack 327 | abstract clone: unit -> VideoMediaStreamTrack 328 | abstract applyConstraints: constraints:VideoMediaTrackConstraints option -> JS.Promise 329 | abstract getConstraints: unit -> VideoMediaTrackConstraints 330 | abstract getSettings: unit -> VideoMediaTrackSettings 331 | 332 | type [] MediaStreamError = 333 | abstract constraintName: string option 334 | abstract message: string option 335 | abstract name: string 336 | 337 | type [] MediaStreamErrorType = 338 | abstract prototype: MediaStreamError with get, set 339 | [] abstract Create: unit -> obj 340 | 341 | type [] MediaStream = 342 | inherit EventTarget 343 | abstract active: bool 344 | abstract id: string 345 | abstract onaddtrack: (MediaStreamTrackEvent->unit) with get, set 346 | abstract clone: unit -> MediaStream 347 | abstract getAudioTracks: unit -> AudioMediaStreamTrack array 348 | abstract getVideoTracks: unit -> VideoMediaStreamTrack array 349 | abstract getTrackById: string option -> MediaStreamTrack option 350 | abstract getTracks: unit -> MediaStreamTrack array 351 | abstract addTrack: track:#MediaStreamTrack -> unit 352 | abstract removeTrack: track:#MediaStreamTrack -> unit 353 | abstract onremovetrack: (MediaStreamTrackEvent->unit) with get, set 354 | 355 | type MediaStreamType = 356 | [] abstract Create: ?streams: MediaStreamTrack array -> MediaStream 357 | [] abstract Create: streams: MediaStream -> MediaStream 358 | 359 | type CanvasCaptureMediaStreamTrack = 360 | inherit MediaStreamTrack 361 | abstract canvas: HTMLCanvasElement 362 | abstract requestFrame : unit -> unit 363 | 364 | [] 365 | type MediaDeviceKind = 366 | | [] VideoInput 367 | | [] AudioInput 368 | | [] AudioOutput 369 | 370 | type [] MediaDeviceInfo = 371 | abstract deviceId: string 372 | abstract groupId: string 373 | abstract kind: MediaDeviceKind 374 | abstract label: string 375 | 376 | type [] MediaDevices = 377 | inherit EventTarget 378 | abstract getSupportedConstraints: unit -> MediaTrackSupportedConstraints 379 | abstract getUserMedia: constraints: MediaStreamConstraints -> JS.Promise 380 | abstract getDisplayMedia: ?constraints: DisplayMediaStreamConstraints -> JS.Promise 381 | abstract enumerateDevices: unit -> JS.Promise> 382 | abstract ondevicechange: (Event->unit) with get, set 383 | 384 | 385 | type MediaStreamConstraintsType = 386 | [] 387 | abstract Create: video : bool * audio : bool -> MediaStreamConstraints 388 | [] 389 | abstract Create: video : VideoMediaTrackConstraints * audio : bool -> MediaStreamConstraints 390 | [] 391 | abstract Create: video : VideoMediaTrackConstraints * audio : AudioMediaTrackConstraints -> MediaStreamConstraints 392 | [] 393 | abstract Create: video : bool * audio : AudioMediaTrackConstraints -> MediaStreamConstraints 394 | 395 | type HTMLVideoElement' = 396 | inherit HTMLVideoElement 397 | abstract srcObject: MediaStream option with get, set 398 | 399 | type HTMLAudioElement' = 400 | inherit HTMLAudioElement 401 | abstract srcObject: MediaStream option with get, set 402 | 403 | namespace Browser 404 | 405 | open Fable.Core 406 | 407 | [] 408 | module MediaStreams = 409 | open Browser.Types 410 | type HTMLCanvasElement with 411 | [] 412 | member __.captureStream(?framerate:uint32) : MediaStream = failwith "" 413 | 414 | let [] mediaDevices: MediaDevices = jsNative 415 | 416 | let [] MediaStream: MediaStreamType = jsNative 417 | 418 | let [] MediaStreamConstraints: MediaStreamConstraintsType = jsNative 419 | 420 | let [] MediaStreamError : MediaStreamErrorType = jsNative 421 | -------------------------------------------------------------------------------- /src/MediaStream/Browser.MediaStream.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.MediaStream 5 | 3.4.0 6 | 3.4.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 26 | 27 | -------------------------------------------------------------------------------- /src/MediaStream/README.md: -------------------------------------------------------------------------------- 1 | # Browser.MediaStream 2 | 3 | Includes bindings for the browser [Media Capture and Streams API (Media Stream)](https://developer.mozilla.org/en-US/docs/Web/API/Media_Streams_API). -------------------------------------------------------------------------------- /src/MediaStream/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 3.4.0 2 | 3 | * Align Fable.Core version to 3.2.8 for all of fable-browser packages 4 | 5 | ### 3.3.0 6 | 7 | * Add `tags` to make binding displayed on Fable.Packages 8 | 9 | ### 3.2.0 10 | 11 | * Add Global attribute to global interfaces @chkn 12 | 13 | ### 3.1.0 14 | 15 | * Fix #70: Wrong type for MediaStreamConstraints in Browser.MediaStream (by @Nhowka) 16 | 17 | ### 3.0.4 18 | 19 | * Downgrade FSharp.Core to 4.7.2 20 | 21 | ### 3.0.3 22 | 23 | * Downgrade FSharp.Core to 4.7.2 24 | 25 | ### 3.0.2 26 | 27 | * Release a new version because one of the dependencies had the licence information missing 28 | 29 | ### 3.0.1 30 | 31 | * Add licence to Nuget package @nojaf 32 | 33 | ### 3.0.0 34 | 35 | * Add `ImageMediaTrackConstraintSet` 36 | * Fix ContrainXXX should allow single value or constrain object 37 | * Fix some bad type names 38 | * Set `MediaTrackCapabilities` properties optional 39 | * Add strongly typed methods on `AudioMediaStreamTrack` and `VideoMediaStreamTrack` 40 | * Set `MediaDeviceInfo` kind as an enum 41 | 42 | ### 2.0.1 43 | 44 | * Upgrade to Fable.Browser.Dom 1.2.1 to force usage of the new overloads of addListener|removeListener 45 | 46 | ### 2.0.0 47 | 48 | * Add `MediaStream` suffix where necessary to follow the JavaScript API 49 | * Add `MediaStreamError` 50 | 51 | ### 1.0.0 52 | 53 | * First stable release 54 | * Clone track returns track of the same type 55 | * Fix `MediaStream.create` overloads 56 | * Set framerate as optional parameter in `HTMLCanvasElement.captureStream` 57 | 58 | 59 | ### 1.0.0-beta-001 60 | 61 | * First release 62 | -------------------------------------------------------------------------------- /src/Navigator/Browser.Navigator.fs: -------------------------------------------------------------------------------- 1 | namespace Browser.Types 2 | 3 | open System 4 | open Fable.Core 5 | open Fable.Core.JS 6 | 7 | type [] MimeType = 8 | abstract description: string 9 | abstract enabledPlugin: Plugin 10 | abstract suffixes: string 11 | abstract ``type``: string 12 | 13 | and [] Plugin = 14 | abstract description: string 15 | abstract filename: string 16 | abstract length: int 17 | abstract name: string 18 | abstract version: string 19 | abstract item: index: int -> MimeType 20 | abstract namedItem: ``type``: string -> MimeType 21 | 22 | type ShareData = 23 | abstract url: string with get, set 24 | abstract text: string with get, set 25 | abstract title: string with get, set 26 | 27 | type [] Clipboard = 28 | abstract writeText: string -> Promise 29 | abstract readText: unit -> Promise 30 | 31 | type NavigatorID = 32 | abstract appName: string 33 | abstract appVersion: string 34 | abstract platform: string 35 | abstract product: string 36 | abstract productSub: string 37 | abstract userAgent: string 38 | abstract vendor: string 39 | abstract vendorSub: string 40 | 41 | type NavigatorOnLine = 42 | abstract onLine: bool 43 | 44 | type NavigatorUserMediaSuccessCallback = MediaStream -> unit 45 | type NavigatorUserMediaErrorCallback = MediaStreamError -> unit 46 | 47 | [] 48 | type PermissionState = 49 | | Granted 50 | | Denied 51 | | Prompt 52 | 53 | [] 54 | type PermissionStatus = 55 | abstract state: PermissionState 56 | abstract status: PermissionState 57 | abstract onchange: (Event -> unit) with get, set 58 | 59 | [] 60 | type PermissionName = 61 | | Geolocation 62 | | Notifications 63 | | Push 64 | | Midi 65 | | Camera 66 | | Microphone 67 | | SpeakerSelection 68 | | DeviceInfo 69 | | BackgroundFetch 70 | | BackgroundSync 71 | | Bluetooth 72 | | PersistentStorage 73 | | AmbientLightSensor 74 | | Accelerometer 75 | | Gyroscope 76 | | Magnetometer 77 | | ClipboardRead 78 | | ClipboardWrite 79 | | DisplayCapture 80 | | NFC 81 | 82 | [] 83 | type PermissionDescriptor = 84 | abstract name: PermissionName with get, set 85 | abstract userVisibleOnly: bool with get, set 86 | abstract sysex: bool with get, set 87 | 88 | type [] Permissions = 89 | abstract query: (PermissionDescriptor -> JS.Promise) 90 | // TODO, currently not supported in any browser: abstract request: unit -> unit 91 | // TODO, currently not supported in any browser: abstract requestAll: unit -> unit 92 | 93 | type [] Navigator = 94 | inherit NavigatorID 95 | inherit NavigatorOnLine 96 | // TODO: abstract activeVRDisplays 97 | abstract appCodeName: string 98 | abstract appMinorVersion: string 99 | // abstract battery // Deprecated 100 | abstract clipboard: Clipboard option 101 | // TODO: abstract connection 102 | abstract cookieEnabled: bool 103 | abstract geolocation: Geolocation option 104 | abstract hardwareConcurrency: int 105 | // TODO: abstract keyboard 106 | abstract cpuClass: string 107 | abstract language: string option 108 | abstract languages: string[] option 109 | // TODO: abstract locks 110 | // TODO: abstract mediaCapabilities 111 | abstract maxTouchPoints: int 112 | abstract mimeTypes: MimeType[] option 113 | abstract oscpu: string 114 | abstract permissions: Permissions 115 | // abstract platform: string // Not reliable 116 | abstract plugins: Plugin[] option 117 | abstract serviceWorker: ServiceWorkerContainer option 118 | // TODO: abstract storage: StorageManager 119 | abstract userAgent: string 120 | abstract webdriver: bool 121 | abstract getGamepads: unit -> ResizeArray 122 | abstract webkitGetGamepads: unit -> ResizeArray 123 | 124 | // ## Methods 125 | 126 | abstract canShare: unit -> bool 127 | // TODO: abstract getVRDisplays() 128 | 129 | // NOT TODO: Navigator.getUserMedia is deprecated in favor of navigator.mediaDevices.getUserMedia() 130 | // See: https://developer.mozilla.org/en-US/docs/Web/API/Navigator/getUserMedia 131 | // abstract getUserMedia: constraints: MediaStreamConstraints * successCallback: NavigatorUserMediaSuccessCallback * errorCallback: NavigatorUserMediaErrorCallback -> unit 132 | 133 | // TODO: abstract registerProtocolHandler() 134 | // TODO: abstract requestMediaKeySystemAccess() 135 | // TODO: abstract sendBeacon() 136 | abstract share: ShareData -> JS.Promise 137 | /// Pulses the vibration hardware on the device, if such hardware exists. If the device doesn't support vibration, this method has no effect. If a vibration pattern is already in progress when this method is called, the previous pattern is halted and the new one begins instead. 138 | /// - pattern: Provides a pattern of vibration and pause intervals. Each value indicates a number of milliseconds to vibrate or pause, in alternation. You may provide either a single value (to vibrate once for that many milliseconds) or an array of values to alternately vibrate, pause, then vibrate again. See Vibration API for details. 139 | abstract vibrate: pattern: obj -> bool 140 | 141 | namespace Browser 142 | 143 | open Fable.Core 144 | open Browser.Types 145 | 146 | [] 147 | module Navigator = 148 | let [] navigator: Navigator = jsNative 149 | -------------------------------------------------------------------------------- /src/Navigator/Browser.Navigator.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.Navigator 5 | 2.5.0 6 | 2.5.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 28 | 29 | -------------------------------------------------------------------------------- /src/Navigator/README.md: -------------------------------------------------------------------------------- 1 | # Browser.Navigator 2 | 3 | Includes bindings for the browser [Navigator object](https://developer.mozilla.org/en-US/docs/Web/API/Navigator). 4 | -------------------------------------------------------------------------------- /src/Navigator/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 2.5.0 2 | 3 | * Align Fable.Core version to 3.2.8 for all of fable-browser packages 4 | 5 | ### 2.4.0 6 | 7 | * Add `tags` to make binding displayed on Fable.Packages 8 | 9 | ### 2.3.0 10 | 11 | * Add Global attribute to global interfaces @chkn 12 | 13 | ### 2.2.0 14 | 15 | * Fix #78: Invalid IL @jwosty 16 | 17 | ### 2.1.0 18 | 19 | * Fix #67: Make all fields in `PermissionDescriptor` "settable" (by @MNie) 20 | 21 | ### 2.0.0 22 | 23 | * Fix #67: Make `PermissionDescriptor` use interface instead of a record. This is a pure binding so we don't include source files for now 24 | 25 | ### 1.3.4 26 | 27 | * Downgrade FSharp.Core to 4.7.2 28 | 29 | ### 1.3.3 30 | 31 | * Downgrade FSharp.Core to 4.7.2 32 | 33 | ### 1.3.2 34 | 35 | * Upgrade to Fable.Browser.Gamepad 1.0.1 to use the version with the licence information in it 36 | 37 | ### 1.3.1 38 | 39 | * Add licence to Nuget package @nojaf 40 | 41 | ### 1.3.0 42 | 43 | * Add Gamepad API (by @rastreus) 44 | 45 | ### 1.2.0 46 | 47 | * Add Permissions API. @MNie 48 | 49 | ### 1.1.0 50 | 51 | * Add Clipboard async API. 52 | 53 | ### 1.0.1 54 | 55 | * Add missing dependency on Fable.Browser.MediaStream 56 | 57 | ### 1.0.0 58 | 59 | * Stable release 60 | 61 | ### 1.0.0-beta-001 62 | 63 | * First release 64 | -------------------------------------------------------------------------------- /src/Performance/Browser.Performance.fs: -------------------------------------------------------------------------------- 1 | namespace Browser.Types 2 | 3 | open System 4 | open Fable.Core 5 | 6 | type [] Performance = 7 | abstract clearMarks: ?markName: string -> unit 8 | abstract clearMeasures: ?measureName: string -> unit 9 | abstract clearResourceTimings: unit -> unit 10 | // TODO: Typed overloads to get the corresponding PerformanceEntry subtype 11 | // See https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry 12 | abstract getEntries: unit -> obj 13 | abstract getEntriesByName: name: string * ?entryType: string -> obj 14 | abstract getEntriesByType: entryType: string -> obj 15 | abstract mark: markName: string -> unit 16 | abstract ``measure``: measureName: string * ?startMarkName: string * ?endMarkName: string -> unit 17 | abstract now: unit -> float 18 | abstract setResourceTimingBufferSize: maxSize: float -> unit 19 | abstract toJSON: unit -> obj 20 | 21 | namespace Browser 22 | 23 | open Fable.Core 24 | open Browser.Types 25 | 26 | [] 27 | module Performance = 28 | let [] performance: Performance = jsNative 29 | -------------------------------------------------------------------------------- /src/Performance/Browser.Performance.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.Performance 5 | 1.3.0 6 | 1.3.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /src/Performance/README.md: -------------------------------------------------------------------------------- 1 | # Browser.Performance 2 | 3 | Includes bindings for the browser [Performance API](https://developer.mozilla.org/en-US/docs/Web/API/Performance). -------------------------------------------------------------------------------- /src/Performance/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 1.3.0 2 | 3 | * Align Fable.Core version to 3.2.8 for all of fable-browser packages 4 | 5 | ### 1.2.0 6 | 7 | * Add `tags` to make binding displayed on Fable.Packages 8 | 9 | ### 1.1.0 10 | 11 | * Add Global attribute to global interfaces @chkn 12 | 13 | ### 1.0.3 14 | 15 | * Downgrade FSharp.Core to 4.7.2 16 | 17 | ### 1.0.2 18 | 19 | * Downgrade FSharp.Core to 4.7.2 20 | 21 | ### 1.0.1 22 | 23 | * Add licence to Nuget package @nojaf 24 | 25 | ### 1.0.0 26 | 27 | * First stable release 28 | 29 | ### 1.0.0-alpha-001 30 | 31 | * First release 32 | -------------------------------------------------------------------------------- /src/ResizeObserver/Browser.ResizeObserver.fs: -------------------------------------------------------------------------------- 1 | namespace Browser.Types 2 | 3 | open Fable.Core 4 | 5 | type ResizeObserverSize = 6 | abstract inlineSize: float 7 | abstract blockSize: float 8 | 9 | type ResizeObserverEntry = 10 | /// An array containing the new border box sizes of the observed element when the callback is run 11 | abstract borderBoxSize: ResizeObserverSize array 12 | 13 | /// An array containing the new content box sizes of the observed element when the callback is run 14 | abstract contentBoxSize: ResizeObserverSize array 15 | 16 | /// An array containing the new content box sizes in device pixels of the observed element when the callback is run 17 | abstract devicePixelContentBoxSize: ResizeObserverSize array 18 | 19 | /// The new size of the observed element when the callback is run 20 | abstract contentRect: ClientRect 21 | 22 | /// A reference to the Element or SVGElement being observed 23 | abstract target: Node 24 | 25 | [] 26 | type ResizeObserverBox = 27 | /// Size of the content area as defined in CSS 28 | | ContentBox 29 | 30 | /// Size of the box border area as defined in CSS 31 | | BorderBox 32 | 33 | /// The size of the content area as defined in CSS, in device pixels, before applying any CSS transforms on the element or its ancestors 34 | | DevicePixelContentBox 35 | 36 | type ResizeObserverOptions = 37 | /// Sets which box model the observer will observe changes to 38 | abstract box: ResizeObserverBox with get, set 39 | 40 | 41 | type [] ResizeObserverType = 42 | /// Unobserve all observed Element or SVGElement targets 43 | abstract disconnect: unit -> unit 44 | 45 | /// Starts observing the specified Element or SVGElement 46 | abstract observe: Node -> unit 47 | 48 | /// Starts observing the specified Element or SVGElement with the specified options 49 | abstract observe: Node * ResizeObserverOptions -> unit 50 | 51 | /// Ends the observing of a specified Element or SVGElement 52 | abstract unobserve: Node -> unit 53 | 54 | type ResizeObserverCallback = ResizeObserverEntry array -> ResizeObserverType -> unit 55 | 56 | type [] ResizeObserverCtor = 57 | [] abstract Create: callback: ResizeObserverCallback -> ResizeObserverType 58 | 59 | namespace Browser 60 | 61 | open Fable.Core 62 | open Browser.Types 63 | 64 | [] 65 | module ResizeObserver = 66 | let [] ResizeObserver: ResizeObserverCtor = jsNative 67 | -------------------------------------------------------------------------------- /src/ResizeObserver/Browser.ResizeObserver.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.ResizeObserver 5 | 1.0.0 6 | 1.0.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 24 | 25 | -------------------------------------------------------------------------------- /src/ResizeObserver/README.md: -------------------------------------------------------------------------------- 1 | # Browser.ResizeObserver 2 | 3 | Includes bindings for the [Resize Observer API] (https://developer.mozilla.org/en-US/docs/Web/API/Resize_Observer_API) 4 | -------------------------------------------------------------------------------- /src/ResizeObserver/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 1.0.0 2 | 3 | * First release 4 | -------------------------------------------------------------------------------- /src/Svg/Browser.Svg.Api.fs: -------------------------------------------------------------------------------- 1 | namespace Browser 2 | 3 | open Fable.Core 4 | open Browser.Types 5 | 6 | [] 7 | module Svg = 8 | 9 | let [] SVGAElement: SVGAElementType = jsNative 10 | let [] SVGAngle: SVGAngleType = jsNative 11 | let [] SVGAnimatedAngle: SVGAnimatedAngleType = jsNative 12 | let [] SVGAnimatedBoolean: SVGAnimatedBooleanType = jsNative 13 | let [] SVGAnimatedEnumeration: SVGAnimatedEnumerationType = jsNative 14 | let [] SVGAnimatedInteger: SVGAnimatedIntegerType = jsNative 15 | let [] SVGAnimatedLength: SVGAnimatedLengthType = jsNative 16 | let [] SVGAnimatedLengthList: SVGAnimatedLengthListType = jsNative 17 | let [] SVGAnimatedNumber: SVGAnimatedNumberType = jsNative 18 | let [] SVGAnimatedNumberList: SVGAnimatedNumberListType = jsNative 19 | let [] SVGAnimatedPreserveAspectRatio: SVGAnimatedPreserveAspectRatioType = jsNative 20 | let [] SVGAnimatedRect: SVGAnimatedRectType = jsNative 21 | let [] SVGAnimatedString: SVGAnimatedStringType = jsNative 22 | let [] SVGAnimatedTransformList: SVGAnimatedTransformListType = jsNative 23 | let [] SVGCircleElement: SVGCircleElementType = jsNative 24 | let [] SVGClipPathElement: SVGClipPathElementType = jsNative 25 | let [] SVGComponentTransferFunctionElement: SVGComponentTransferFunctionElementType = jsNative 26 | let [] SVGDefsElement: SVGDefsElementType = jsNative 27 | let [] SVGDescElement: SVGDescElementType = jsNative 28 | let [] SVGElement: SVGElementType = jsNative 29 | let [] SVGElementInstance: SVGElementInstanceType = jsNative 30 | let [] SVGElementInstanceList: SVGElementInstanceListType = jsNative 31 | let [] SVGEllipseElement: SVGEllipseElementType = jsNative 32 | let [] SVGFEBlendElement: SVGFEBlendElementType = jsNative 33 | let [] SVGFEColorMatrixElement: SVGFEColorMatrixElementType = jsNative 34 | let [] SVGFEComponentTransferElement: SVGFEComponentTransferElementType = jsNative 35 | let [] SVGFECompositeElement: SVGFECompositeElementType = jsNative 36 | let [] SVGFEConvolveMatrixElement: SVGFEConvolveMatrixElementType = jsNative 37 | let [] SVGFEDiffuseLightingElement: SVGFEDiffuseLightingElementType = jsNative 38 | let [] SVGFEDisplacementMapElement: SVGFEDisplacementMapElementType = jsNative 39 | let [] SVGFEDistantLightElement: SVGFEDistantLightElementType = jsNative 40 | let [] SVGFEFloodElement: SVGFEFloodElementType = jsNative 41 | let [] SVGFEFuncAElement: SVGFEFuncAElementType = jsNative 42 | let [] SVGFEFuncBElement: SVGFEFuncBElementType = jsNative 43 | let [] SVGFEFuncGElement: SVGFEFuncGElementType = jsNative 44 | let [] SVGFEFuncRElement: SVGFEFuncRElementType = jsNative 45 | let [] SVGFEGaussianBlurElement: SVGFEGaussianBlurElementType = jsNative 46 | let [] SVGFEImageElement: SVGFEImageElementType = jsNative 47 | let [] SVGFEMergeElement: SVGFEMergeElementType = jsNative 48 | let [] SVGFEMergeNodeElement: SVGFEMergeNodeElementType = jsNative 49 | let [] SVGFEMorphologyElement: SVGFEMorphologyElementType = jsNative 50 | let [] SVGFEOffsetElement: SVGFEOffsetElementType = jsNative 51 | let [] SVGFEPointLightElement: SVGFEPointLightElementType = jsNative 52 | let [] SVGFESpecularLightingElement: SVGFESpecularLightingElementType = jsNative 53 | let [] SVGFESpotLightElement: SVGFESpotLightElementType = jsNative 54 | let [] SVGFETileElement: SVGFETileElementType = jsNative 55 | let [] SVGFETurbulenceElement: SVGFETurbulenceElementType = jsNative 56 | let [] SVGFilterElement: SVGFilterElementType = jsNative 57 | let [] SVGForeignObjectElement: SVGForeignObjectElementType = jsNative 58 | let [] SVGGElement: SVGGElementType = jsNative 59 | let [] SVGGradientElement: SVGGradientElementType = jsNative 60 | let [] SVGImageElement: SVGImageElementType = jsNative 61 | let [] SVGLength: SVGLengthType = jsNative 62 | let [] SVGLengthList: SVGLengthListType = jsNative 63 | let [] SVGLineElement: SVGLineElementType = jsNative 64 | let [] SVGLinearGradientElement: SVGLinearGradientElementType = jsNative 65 | let [] SVGMarkerElement: SVGMarkerElementType = jsNative 66 | let [] SVGMaskElement: SVGMaskElementType = jsNative 67 | let [] SVGMatrix: SVGMatrixType = jsNative 68 | let [] SVGMetadataElement: SVGMetadataElementType = jsNative 69 | let [] SVGNumber: SVGNumberType = jsNative 70 | let [] SVGNumberList: SVGNumberListType = jsNative 71 | let [] SVGPathElement: SVGPathElementType = jsNative 72 | let [] SVGPathSeg: SVGPathSegType = jsNative 73 | let [] SVGPathSegArcAbs: SVGPathSegArcAbsType = jsNative 74 | let [] SVGPathSegArcRel: SVGPathSegArcRelType = jsNative 75 | let [] SVGPathSegClosePath: SVGPathSegClosePathType = jsNative 76 | let [] SVGPathSegCurvetoCubicAbs: SVGPathSegCurvetoCubicAbsType = jsNative 77 | let [] SVGPathSegCurvetoCubicRel: SVGPathSegCurvetoCubicRelType = jsNative 78 | let [] SVGPathSegCurvetoCubicSmoothAbs: SVGPathSegCurvetoCubicSmoothAbsType = jsNative 79 | let [] SVGPathSegCurvetoCubicSmoothRel: SVGPathSegCurvetoCubicSmoothRelType = jsNative 80 | let [] SVGPathSegCurvetoQuadraticAbs: SVGPathSegCurvetoQuadraticAbsType = jsNative 81 | let [] SVGPathSegCurvetoQuadraticRel: SVGPathSegCurvetoQuadraticRelType = jsNative 82 | let [] SVGPathSegCurvetoQuadraticSmoothAbs: SVGPathSegCurvetoQuadraticSmoothAbsType = jsNative 83 | let [] SVGPathSegCurvetoQuadraticSmoothRel: SVGPathSegCurvetoQuadraticSmoothRelType = jsNative 84 | let [] SVGPathSegLinetoAbs: SVGPathSegLinetoAbsType = jsNative 85 | let [] SVGPathSegLinetoHorizontalAbs: SVGPathSegLinetoHorizontalAbsType = jsNative 86 | let [] SVGPathSegLinetoHorizontalRel: SVGPathSegLinetoHorizontalRelType = jsNative 87 | let [] SVGPathSegLinetoRel: SVGPathSegLinetoRelType = jsNative 88 | let [] SVGPathSegLinetoVerticalAbs: SVGPathSegLinetoVerticalAbsType = jsNative 89 | let [] SVGPathSegLinetoVerticalRel: SVGPathSegLinetoVerticalRelType = jsNative 90 | let [] SVGPathSegList: SVGPathSegListType = jsNative 91 | let [] SVGPathSegMovetoAbs: SVGPathSegMovetoAbsType = jsNative 92 | let [] SVGPathSegMovetoRel: SVGPathSegMovetoRelType = jsNative 93 | let [] SVGPatternElement: SVGPatternElementType = jsNative 94 | let [] SVGPoint: SVGPointType = jsNative 95 | let [] SVGPointList: SVGPointListType = jsNative 96 | let [] SVGPolygonElement: SVGPolygonElementType = jsNative 97 | let [] SVGPolylineElement: SVGPolylineElementType = jsNative 98 | let [] SVGPreserveAspectRatio: SVGPreserveAspectRatioType = jsNative 99 | let [] SVGRadialGradientElement: SVGRadialGradientElementType = jsNative 100 | let [] SVGRect: SVGRectType = jsNative 101 | let [] SVGRectElement: SVGRectElementType = jsNative 102 | let [] SVGSVGElement: SVGSVGElementType = jsNative 103 | let [] SVGScriptElement: SVGScriptElementType = jsNative 104 | let [] SVGStopElement: SVGStopElementType = jsNative 105 | let [] SVGStringList: SVGStringListType = jsNative 106 | let [] SVGStyleElement: SVGStyleElementType = jsNative 107 | let [] SVGSwitchElement: SVGSwitchElementType = jsNative 108 | let [] SVGSymbolElement: SVGSymbolElementType = jsNative 109 | let [] SVGTSpanElement: SVGTSpanElementType = jsNative 110 | let [] SVGTextContentElement: SVGTextContentElementType = jsNative 111 | let [] SVGTextElement: SVGTextElementType = jsNative 112 | let [] SVGTextPathElement: SVGTextPathElementType = jsNative 113 | let [] SVGTextPositioningElement: SVGTextPositioningElementType = jsNative 114 | let [] SVGTitleElement: SVGTitleElementType = jsNative 115 | let [] SVGTransform: SVGTransformType = jsNative 116 | let [] SVGTransformList: SVGTransformListType = jsNative 117 | let [] SVGUnitTypes: SVGUnitTypes = jsNative 118 | let [] SVGUseElement: SVGUseElementType = jsNative 119 | let [] SVGViewElement: SVGViewElementType = jsNative 120 | let [] SVGZoomAndPan: SVGZoomAndPanType = jsNative 121 | let [] SVGZoomEvent: SVGZoomEventType = jsNative 122 | -------------------------------------------------------------------------------- /src/Svg/Browser.Svg.Ext.fs: -------------------------------------------------------------------------------- 1 | [] 2 | module Browser.SvgExtensions 3 | 4 | open Fable.Core 5 | open Browser.Types 6 | 7 | type Document with 8 | /// Gets the root svg element in the document hierarchy. 9 | [] 10 | member __.rootElement with get(): SVGSVGElement = jsNative and set(v: SVGSVGElement) = jsNative -------------------------------------------------------------------------------- /src/Svg/Browser.Svg.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.Svg 5 | 2.4.0 6 | 2.4.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 24 | 27 | 28 | -------------------------------------------------------------------------------- /src/Svg/README.md: -------------------------------------------------------------------------------- 1 | # Browser.Svg 2 | 3 | Includes bindings for [SVG interfaces](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model#SVG_interfaces) in browser's DOM. 4 | -------------------------------------------------------------------------------- /src/Svg/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 2.4.0 2 | 3 | * Align Fable.Core version to 3.2.8 for all of fable-browser packages 4 | 5 | ### 2.3.0 6 | 7 | * Add `tags` to make binding displayed on Fable.Packages 8 | 9 | ### 2.2.0 10 | 11 | * Add Global attribute to global interfaces @chkn 12 | 13 | ### 2.1.0 14 | 15 | * Fix #78: Invalid IL @jwosty 16 | 17 | ### 2.0.4 18 | 19 | * Downgrade FSharp.Core to 4.7.2 20 | 21 | ### 2.0.3 22 | 23 | * Downgrade FSharp.Core to 4.7.2 24 | 25 | ### 2.0.2 26 | 27 | * Release a new version because one of the dependencies had the licence information missing 28 | 29 | ### 2.0.1 30 | 31 | * Add licence to Nuget package @nojaf 32 | 33 | ### 2.0.0 34 | 35 | * Clean up unuseful `addEventListener` (by @baronfel) 36 | 37 | ### 1.0.0 38 | 39 | * Stable release 40 | 41 | ### 1.0.0-beta-001 42 | 43 | * First release 44 | -------------------------------------------------------------------------------- /src/Url/Browser.Url.fs: -------------------------------------------------------------------------------- 1 | namespace Browser.Types 2 | 3 | open System 4 | open Fable.Core 5 | 6 | type [] URLSearchParams = 7 | /// Appends a specified key/value pair as a new search parameter. 8 | abstract append: name: string * value: string -> unit 9 | /// Deletes the given search parameter, and its associated value, from the list of all search parameters. 10 | abstract delete: name: string -> unit 11 | /// Returns the first value associated to the given search parameter. 12 | abstract get: name: string -> string option 13 | /// Returns all the values association with a given search parameter. 14 | abstract getAll: name: string -> array 15 | /// Returns a Boolean indicating if such a search parameter exists. 16 | abstract has: name: string -> bool 17 | /// Sets the value associated to a given search parameter to the given value. If there were several values, delete the others. 18 | abstract set: name: string * value: string -> unit 19 | 20 | type [] URLSearchParamsType = 21 | [] abstract Create: arg: obj -> URLSearchParams 22 | 23 | type [] URL = 24 | abstract hash: string with get, set 25 | abstract host: string with get, set 26 | abstract hostname: string with get, set 27 | abstract href: string with get, set 28 | abstract origin: string 29 | abstract password: string with get, set 30 | abstract pathname: string with get, set 31 | abstract port: string with get, set 32 | abstract protocol: string with get, set 33 | abstract search: string with get, set 34 | abstract username: string with get, set 35 | abstract searchParams: URLSearchParams 36 | abstract toString: unit -> string 37 | abstract toJSON: unit -> string 38 | 39 | type [] URLType = 40 | [] abstract Create: url: string * ?``base``: string -> URL 41 | /// Returns a DOMString containing a unique blob URL, that is a URL with blob: as its scheme, followed by an opaque string uniquely identifying the object in the browser. 42 | abstract createObjectURL: obj -> string 43 | /// Revokes an object URL previously created using URL.createObjectURL(). 44 | abstract revokeObjectURL: string -> unit 45 | 46 | namespace Browser 47 | 48 | open Fable.Core 49 | open Browser.Types 50 | 51 | [] 52 | module Url = 53 | let [] URL: URLType = jsNative 54 | let [] URLSearchParams: URLSearchParamsType = jsNative 55 | -------------------------------------------------------------------------------- /src/Url/Browser.Url.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.Url 5 | 1.4.0 6 | 1.4.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 22 | 23 | -------------------------------------------------------------------------------- /src/Url/README.md: -------------------------------------------------------------------------------- 1 | # Browser.Url 2 | 3 | Includes bindings for the browser [Url API](https://developer.mozilla.org/en-US/docs/Web/API/URL). -------------------------------------------------------------------------------- /src/Url/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 1.4.0 2 | 3 | * Align Fable.Core version to 3.2.8 for all of fable-browser packages 4 | 5 | ### 1.3.2 6 | 7 | * Remove previous "hack" in favor of asking packages dependents on Fable.Browser.Url and that use `URL.Create` to publish a new version. 8 | 9 | ### 1.3.1 10 | 11 | * Re-add previous signature for URL constructor, to try work around F#/.NET limitations 12 | 13 | ### 1.3.0 14 | 15 | * Add optional base url parameter to URL constructor (by @IanManske) 16 | 17 | ### 1.2.0 18 | 19 | * Add `tags` to make binding displayed on Fable.Packages 20 | 21 | ### 1.1.0 22 | 23 | * Add Global attribute to global interfaces @chkn 24 | 25 | ### 1.0.3 26 | 27 | * Downgrade FSharp.Core to 4.7.2 28 | 29 | ### 1.0.2 30 | 31 | * Downgrade FSharp.Core to 4.7.2 32 | 33 | ### 1.0.1 34 | 35 | * Add licence to Nuget package @nojaf 36 | 37 | ### 1.0.0 38 | 39 | * First stable release 40 | 41 | ### 1.0.0-alpha-001 42 | 43 | * First release 44 | -------------------------------------------------------------------------------- /src/WebGL/Browser.WebGL.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.WebGL 5 | 1.3.0 6 | 1.3.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 25 | 28 | 29 | -------------------------------------------------------------------------------- /src/WebGL/README.md: -------------------------------------------------------------------------------- 1 | # Browser.WebGL 2 | 3 | Includes bindings for the browser [WebGL API](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API). -------------------------------------------------------------------------------- /src/WebGL/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 1.3.0 2 | 3 | * Align Fable.Core version to 3.2.8 for all of fable-browser packages 4 | 5 | ### 1.2.0 6 | 7 | * Add `tags` to make binding displayed on Fable.Packages 8 | 9 | ### 1.1.0 10 | 11 | * Add Global attribute to global interfaces @chkn 12 | 13 | ### 1.0.3 14 | 15 | * Downgrade FSharp.Core to 4.7.2 16 | 17 | ### 1.0.2 18 | 19 | * Release a new version because one of the dependencies had the licence information missing 20 | 21 | ### 1.0.1 22 | 23 | * Add licence to Nuget package @nojaf 24 | 25 | ### 1.0.0 26 | 27 | * First stable release 28 | 29 | ### 1.0.0-alpha-001 30 | 31 | * First release 32 | -------------------------------------------------------------------------------- /src/WebRTC/Browser.WebRTC.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.WebRTC 5 | 1.6.0 6 | 1.6.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 25 | 26 | -------------------------------------------------------------------------------- /src/WebRTC/README.md: -------------------------------------------------------------------------------- 1 | # Browser.WebRTC 2 | 3 | Includes bindings for the browser [WebRTC API](https://developer.mozilla.org/en-US/docs/Web/API/WebRTC_API). -------------------------------------------------------------------------------- /src/WebRTC/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 1.6.0 2 | 3 | * Align Fable.Core version to 3.2.8 for all of fable-browser packages 4 | 5 | ### 1.5.0 6 | 7 | * Add `tags` to make binding displayed on Fable.Packages 8 | 9 | ### 1.4.0 10 | 11 | * Add Global attribute to global interfaces @chkn 12 | 13 | ### 1.3.4 14 | 15 | * Downgrade FSharp.Core to 4.7.2 16 | 17 | ### 1.3.3 18 | 19 | * Downgrade FSharp.Core to 4.7.2 20 | 21 | ### 1.3.2 22 | 23 | * Release a new version because one of the dependencies had the licence information missing 24 | 25 | ### 1.3.1 26 | 27 | * Add licence to Nuget package @nojaf 28 | 29 | ### 1.3.0 30 | 31 | * Add more stat properties to `RTCInboundRtpStreamStats` and `RTCOutboundRtpStreamStats` 32 | * Add `SdpSemantics` enum 33 | * `RTCIceCandidateStats.relayProtocol` accepts only `tcp`/`tls` or `udp` so it could be specified as `RTCRelayProtocol` instead of a string. @MNie 34 | 35 | ### 1.2.0 36 | 37 | * update `RTCIceCredentialType` prior [RFC 7635](https://tools.ietf.org/html/rfc7635) from `token` to `oauth`. 38 | 39 | ### 1.1.0 40 | 41 | * `RTCIceCandidateStats.protocol` accepts only `udp` or `tcp` so it could be specified as `RTCIceProtocol` instead of a string. @MNie 42 | 43 | ### 1.0.1 44 | 45 | * Fix `RTCRtpReceiver.getStates` should be a `RTCRtpReceiver.getStats` 46 | 47 | ### 1.0.0 48 | 49 | * First stable release 50 | * Fix `RTCIceCandidate.ip` as string option 51 | * Fix `RTCRtpSender.setStreams` should return a promise 52 | * Fix `RTCPeerConnection.setLocalDescription` parameter is mandatory 53 | * Fix `RTCPeerConnection.setRemoteDescription` parameter is mandatory 54 | * Fix `RTCPeerConnection.addIceCandidate` parameter is mandatory 55 | * Fix `RTCPeerConnection.addTrack` stream parameter is an array of `MediaStream` 56 | * Fix `RTCPeerConnection.addTransceiver` init parameter is type of type `RTCRtpTransceiverInit` 57 | 58 | ### 1.0.0-beta-001 59 | 60 | * First release 61 | -------------------------------------------------------------------------------- /src/WebSocket/Browser.WebSocket.fs: -------------------------------------------------------------------------------- 1 | namespace rec Browser.Types 2 | 3 | open System 4 | open Fable.Core 5 | 6 | type WebSocketState = 7 | | CONNECTING = 0 8 | | OPEN = 1 9 | | CLOSING = 2 10 | | CLOSED = 3 11 | 12 | type [] CloseEvent = 13 | inherit Event 14 | abstract code: int 15 | abstract reason: string 16 | abstract wasClean: bool 17 | 18 | type [] WebSocket = 19 | inherit EventTarget 20 | abstract binaryType: string with get, set 21 | abstract bufferedAmount: float 22 | abstract extensions: string 23 | abstract onclose: (CloseEvent -> unit) with get, set 24 | abstract onerror: (Event -> unit) with get, set 25 | abstract onmessage: (MessageEvent -> unit) with get, set 26 | abstract onopen: (Event -> unit) with get, set 27 | abstract protocol: string 28 | abstract readyState: WebSocketState 29 | abstract url: string 30 | abstract close: ?code: int * ?reason: string -> unit 31 | abstract send: data: obj -> unit 32 | [] abstract addEventListener_close: listener: (CloseEvent -> unit) * ?useCapture: bool -> unit 33 | [] abstract addEventListener_error: listener: (ErrorEvent -> unit) * ?useCapture: bool -> unit 34 | [] abstract addEventListener_message: listener: (MessageEvent -> unit) * ?useCapture: bool -> unit 35 | [] abstract addEventListener_open: listener: (Event -> unit) * ?useCapture: bool -> unit 36 | 37 | type [] WebSocketType = 38 | [] abstract Create: url: string * ?protocols: U2 -> WebSocket 39 | 40 | namespace Browser 41 | 42 | open Fable.Core 43 | open Browser.Types 44 | 45 | [] 46 | module WebSocket = 47 | let [] WebSocket: WebSocketType = jsNative 48 | -------------------------------------------------------------------------------- /src/WebSocket/Browser.WebSocket.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.WebSocket 5 | 1.4.0 6 | 1.4.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 25 | 26 | -------------------------------------------------------------------------------- /src/WebSocket/README.md: -------------------------------------------------------------------------------- 1 | # Browser.WebSocket 2 | 3 | Includes bindings for the browser [WebSocket API](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API). -------------------------------------------------------------------------------- /src/WebSocket/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 1.4.0 2 | 3 | * Align Fable.Core version to 3.2.8 for all of fable-browser packages 4 | 5 | ### 1.3.0 6 | 7 | * Add `tags` to make binding displayed on Fable.Packages 8 | 9 | ### 1.2.0 10 | 11 | * Add Global attribute to global interfaces @chkn 12 | 13 | ### 1.1.0 14 | 15 | * Fix #78: Invalid IL @jwosty 16 | 17 | ### 1.0.5 18 | 19 | * Downgrade FSharp.Core to 4.7.2 20 | 21 | ### 1.0.4 22 | 23 | * Downgrade FSharp.Core to 4.7.2 24 | 25 | ### 1.0.3 26 | 27 | * Release a new version because one of the dependencies had the licence information missing 28 | 29 | ### 1.0.2 30 | 31 | * Add licence to Nuget package @nojaf 32 | 33 | ### 1.0.1 34 | 35 | * Upgrade to Fable.Browser.Dom 1.2.1 to force usage of the new overloads of addListener|removeListener 36 | 37 | ### 1.0.0 38 | 39 | * First stable release 40 | 41 | ### 1.0.0-alpha-001 42 | 43 | * First release 44 | -------------------------------------------------------------------------------- /src/WebStorage/Browser.WebStorage.fs: -------------------------------------------------------------------------------- 1 | namespace Browser.Types 2 | 3 | open System 4 | open Fable.Core 5 | 6 | type [] Storage = 7 | abstract length: int 8 | [] abstract Item: key: string -> string with get, set 9 | [] abstract Item: index: int -> string with get, set 10 | abstract clear: unit -> unit 11 | abstract getItem: key: string -> string 12 | abstract key: index: float -> string 13 | abstract removeItem: key: string -> unit 14 | abstract setItem: key: string * data: string -> unit 15 | 16 | type [] StorageEvent = 17 | inherit Event 18 | abstract url: string 19 | abstract key: string 20 | abstract oldValue: string 21 | abstract newValue: string 22 | abstract storageArea: Storage 23 | 24 | namespace Browser 25 | 26 | open Fable.Core 27 | open Browser.Types 28 | 29 | [] 30 | module WebStorage = 31 | let [] localStorage: Storage = jsNative 32 | let [] sessionStorage: Storage = jsNative 33 | -------------------------------------------------------------------------------- /src/WebStorage/Browser.WebStorage.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.WebStorage 5 | 1.3.0 6 | 1.3.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22 | 25 | 26 | -------------------------------------------------------------------------------- /src/WebStorage/README.md: -------------------------------------------------------------------------------- 1 | # Browser.WebStorage 2 | 3 | Includes bindings for the [Web Storage API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API) (`sessionStorage` and `localStorage`). -------------------------------------------------------------------------------- /src/WebStorage/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 1.3.0 2 | 3 | * Align Fable.Core version to 3.2.8 for all of fable-browser packages 4 | 5 | ### 1.2.0 6 | 7 | * Add `tags` to make binding displayed on Fable.Packages 8 | 9 | ### 1.1.0 10 | 11 | * Add Global attribute to global interfaces @chkn 12 | 13 | ### 1.0.4 14 | 15 | * Downgrade FSharp.Core to 4.7.2 16 | 17 | ### 1.0.3 18 | 19 | * Downgrade FSharp.Core to 4.7.2 20 | 21 | ### 1.0.2 22 | 23 | * Release a new version because one of the dependencies had the licence information missing 24 | 25 | ### 1.0.1 26 | 27 | * Add licence to Nuget package @nojaf 28 | 29 | ### 1.0.0 30 | 31 | * First stable release 32 | 33 | ### 1.0.0-alpha-001 34 | 35 | * First release 36 | -------------------------------------------------------------------------------- /src/Worker/Browser.Worker.fs: -------------------------------------------------------------------------------- 1 | namespace Browser.Types 2 | 3 | open System 4 | open Fable.Core 5 | 6 | type AbstractWorker = 7 | abstract onerror: (ErrorEvent -> unit) with get, set 8 | 9 | type [] Worker = 10 | inherit EventTarget 11 | inherit AbstractWorker 12 | abstract onmessage: (MessageEvent -> unit) with get, set 13 | abstract postMessage: message: obj * ?transfer: obj -> unit 14 | abstract terminate: unit -> unit 15 | 16 | [] 17 | type WorkerType = 18 | | Classic 19 | | Module 20 | 21 | [] 22 | type WorkerCredentials = 23 | | Omit 24 | | [] SameOrigin 25 | | Include 26 | 27 | type WorkerOptions = 28 | /// A DOMString specifying the type of worker to create. The value can be classic or module. If not specified, the default used is classic. 29 | abstract ``type``: WorkerType with get, set 30 | /// A DOMString specifying the type of credentials to use for the worker. The value can be omit, same-origin, or include. If not specified, or if type is classic, the default used is omit (no credentials required). 31 | abstract credentials: WorkerCredentials with get, set 32 | /// A DOMString specifying an identifying name for the DedicatedWorkerGlobalScope representing the scope of the worker, which is mainly useful for debugging purposes. 33 | abstract name: string with get, set 34 | 35 | type WorkerConstructor = 36 | [] abstract Create: url: string * ?options: WorkerOptions -> Worker 37 | 38 | [] 39 | type ServiceWorkerState = 40 | | Installing 41 | | Installed 42 | | Activating 43 | | Activated 44 | | Redundant 45 | 46 | type [] ServiceWorker = 47 | inherit Worker 48 | abstract scriptURL: string 49 | abstract state: ServiceWorkerState 50 | abstract onstatechange: (Event -> unit) option with get, set 51 | 52 | type [] ServiceWorkerRegistration = 53 | abstract scope: string 54 | abstract installing: ServiceWorker option 55 | abstract waiting: ServiceWorker option 56 | abstract active: ServiceWorker option 57 | // TODO abstract navigationPreload 58 | // TODO: abstract pushManager: PushManager 59 | abstract onupdatefound: (Event -> unit) option with get, set 60 | // TODO: abstract getNotifications: ?options: ServiceWorkerNotificationOptions -> JS.Promise 61 | // TODO: abstract showNotifications() 62 | abstract update: unit -> JS.Promise 63 | abstract unregister: unit -> JS.Promise 64 | 65 | type ServiceWorkerRegistrationOptions = 66 | /// A USVString representing a URL that defines a service worker's registration scope; that is, what range of URLs a service worker can control. This is usually a relative URL. It is relative to the base URL of the application. By default, the scope value for a service worker registration is set to the directory where the service worker script is located. 67 | abstract scope: string with get, set 68 | 69 | type [] ServiceWorkerContainer = 70 | abstract controller: ServiceWorker option 71 | abstract ready: JS.Promise 72 | abstract oncontrollerchange: (Event -> unit) with get, set 73 | abstract onerror: (Event -> unit) with get, set 74 | abstract onmessage: (Event -> unit) with get, set 75 | abstract register: url: string * ?options: ServiceWorkerRegistrationOptions -> JS.Promise 76 | abstract register: url: URL * ?options: ServiceWorkerRegistrationOptions -> JS.Promise 77 | abstract getRegistration: ?scope: string -> JS.Promise 78 | abstract getRegistrations: unit -> JS.Promise 79 | abstract startMessages: unit -> unit 80 | 81 | namespace Browser 82 | 83 | open Browser.Types 84 | open Fable.Core 85 | 86 | [] 87 | module Worker = 88 | let [] Worker: WorkerConstructor = jsNative 89 | -------------------------------------------------------------------------------- /src/Worker/Browser.Worker.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.Worker 5 | 1.4.0 6 | 1.4.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 26 | 27 | -------------------------------------------------------------------------------- /src/Worker/README.md: -------------------------------------------------------------------------------- 1 | # Browser.Worker 2 | 3 | Includes bindings for the browser [Web Workers API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API). 4 | -------------------------------------------------------------------------------- /src/Worker/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 1.4.0 2 | 3 | * Add `abstract register: url: URL * ?options: ServiceWorkerRegistrationOptions -> JS.Promise` overload to `ServiceWorkerContainer` (by @MangelMaxime) 4 | 5 | ### 1.3.0 6 | 7 | * Align Fable.Core version to 3.2.8 for all of fable-browser packages 8 | 9 | ### 1.2.0 10 | 11 | * Add `tags` to make binding displayed on Fable.Packages 12 | 13 | ### 1.1.0 14 | 15 | * Add Global attribute to global interfaces @chkn 16 | 17 | ### 1.0.5 18 | 19 | * Downgrade FSharp.Core to 4.7.2 20 | 21 | ### 1.0.4 22 | 23 | * Downgrade FSharp.Core to 4.7.2 24 | 25 | ### 1.0.3 26 | 27 | * Release a new version because one of the dependencies had the licence information missing 28 | 29 | ### 1.0.2 30 | 31 | * Add licence to Nuget package @nojaf 32 | 33 | ### 1.0.1 34 | 35 | * Upgrade to Fable.Browser.Dom 1.2.1 to force usage of the new overloads of addListener|removeListener 36 | 37 | ### 1.0.0 38 | 39 | * Stable release 40 | 41 | ### 1.0.0-beta-001 42 | 43 | * First release 44 | -------------------------------------------------------------------------------- /src/XMLHttpRequest/Browser.XMLHttpRequest.fs: -------------------------------------------------------------------------------- 1 | namespace Browser.Types 2 | 3 | open System 4 | open Fable.Core 5 | 6 | type ReadyState = 7 | /// Client has been created. `open()` was not yet called. 8 | | Unsent = 0 9 | /// `open()` has been called. 10 | | Opened = 1 11 | /// `send()` has been called, and headers and status are available. 12 | | HeadersReceived = 2 13 | /// Downloading; responseText holds partial data. 14 | | Loading = 3 15 | /// The operation is complete. 16 | | Done = 4 17 | 18 | type [] XMLHttpRequestUpload = 19 | inherit EventTarget 20 | 21 | type [] XMLHttpRequest = 22 | inherit EventTarget 23 | abstract onreadystatechange: (unit -> unit) with get, set 24 | abstract readyState: ReadyState 25 | abstract response: obj 26 | abstract responseText: string 27 | abstract responseType: string with get, set 28 | abstract responseURL: string 29 | abstract responseXML: obj 30 | abstract status: int 31 | abstract statusText: string 32 | abstract timeout: int with get, set 33 | abstract upload: XMLHttpRequestUpload 34 | abstract withCredentials: bool with get, set 35 | abstract abort: unit -> unit 36 | abstract getAllResponseHeaders: unit -> string 37 | abstract getResponseHeader: header: string -> string 38 | abstract ``open``: ``method``: string * url: string * ?async: bool * ?user: string * ?password: string -> unit 39 | abstract overrideMimeType: mime: string -> unit 40 | abstract send: ?data: obj -> unit 41 | abstract setRequestHeader: header: string * value: string -> unit 42 | 43 | type [] XMLHttpRequestType = 44 | [] abstract Create: unit -> XMLHttpRequest 45 | 46 | namespace Browser 47 | 48 | open Fable.Core 49 | open Browser.Types 50 | 51 | [] 52 | module XMLHttpRequest = 53 | let [] XMLHttpRequest: XMLHttpRequestType = jsNative 54 | -------------------------------------------------------------------------------- /src/XMLHttpRequest/Browser.XMLHttpRequest.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Fable.Browser.XMLHttpRequest 5 | 1.4.0 6 | 1.4.0 7 | netstandard2.0 8 | true 9 | fable;fable-binding;fable-javascript 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 26 | 27 | -------------------------------------------------------------------------------- /src/XMLHttpRequest/README.md: -------------------------------------------------------------------------------- 1 | # Browser.XMLHttpRequest 2 | 3 | Includes bindings for the browser [XMLHttpRequest 4 | API](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest). -------------------------------------------------------------------------------- /src/XMLHttpRequest/RELEASE_NOTES.md: -------------------------------------------------------------------------------- 1 | ### 1.4.0 2 | 3 | * Align Fable.Core version to 3.2.8 for all of fable-browser packages 4 | 5 | ### 1.3.0 6 | 7 | * Add `tags` to make binding displayed on Fable.Packages 8 | 9 | ### 1.2.0 10 | 11 | * Add Global attribute to global interfaces @chkn 12 | 13 | ### 1.1.6 14 | 15 | * Downgrade FSharp.Core to 4.7.2 16 | 17 | ### 1.1.5 18 | 19 | * Downgrade FSharp.Core to 4.7.2 20 | 21 | ### 1.1.4 22 | 23 | * Release a new version because one of the dependencies had the licence information missing 24 | 25 | ### 1.1.3 26 | 27 | * Add licence to Nuget package @nojaf 28 | 29 | ### 1.1.2 30 | 31 | * Upgrade to Fable.Browser.Dom 1.2.1 to force usage of the new overloads of addListener|removeListener 32 | 33 | ### 1.1.1 34 | 35 | * Bring back XMLHttpRequestUpload @belka-ew 36 | 37 | ### 1.1.0 38 | 39 | * Remove Browser.Dom dependency 40 | 41 | ### 1.0.1 42 | 43 | * XMLHttpRequest.timeout property should be settable 44 | 45 | ### 1.0.0 46 | 47 | * First stable release 48 | 49 | ### 1.0.0-alpha-001 50 | 51 | * First release 52 | -------------------------------------------------------------------------------- /test/EventTest.fs: -------------------------------------------------------------------------------- 1 | module EventTest 2 | 3 | open Fable.Core 4 | open Fable.Core.JsInterop 5 | open Expect 6 | open Expect.Dom 7 | open WebTestRunner 8 | open Browser 9 | open Browser.Types 10 | 11 | describe "Event" <| fun () -> 12 | it "can create events" <| fun () -> promise { 13 | use container = Container.New() 14 | 15 | let mutable sideEffect = 0 16 | container.El.addEventListener("my-event", fun _ -> 17 | sideEffect <- sideEffect + 1) 18 | 19 | let ev = Event.Create("my-event", jsOptions(fun o -> 20 | o.bubbles <- true)) 21 | container.El.appendChild().dispatchEvent(ev) |> ignore 22 | sideEffect |> Expect.equal 1 23 | 24 | // Non-bubbling events won't be detected by parent 25 | let ev = Event.Create("my-event") 26 | container.El.appendChild().dispatchEvent(ev) |> ignore 27 | sideEffect |> Expect.equal 1 28 | 29 | // But can be detected on the same element 30 | container.El.dispatchEvent(ev) |> ignore 31 | sideEffect |> Expect.equal 2 32 | } 33 | 34 | it "can create custom events" <| fun () -> promise { 35 | use container = Container.New() 36 | 37 | let mutable sideEffect = 0 38 | container.El.addEventListener("my-custom-event", fun ev -> 39 | let ev = ev :?> CustomEvent 40 | ev.detail |> Expect.some "event detail" |> fun v -> 41 | sideEffect <- sideEffect + v) 42 | 43 | let ev = CustomEvent.Create("my-custom-event", jsOptions>(fun o -> 44 | o.bubbles <- true 45 | o.detail <- Some 5)) 46 | container.El.appendChild().dispatchEvent(ev) |> ignore 47 | 48 | sideEffect |> Expect.equal 5 49 | } 50 | -------------------------------------------------------------------------------- /test/Test.fsproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | netstandard2.0 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | --------------------------------------------------------------------------------