Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implement F# libraries for consumption by TypeScript/Javascript?

I know there are a number of projects which can compile F# to JavaScript. Does any of these projects support this use case:

  • developing an application in TypeScript
  • but writing part of the application in F#, as a library
  • consuming this F# library from the main TypeScript application, optimally in a type-safe way?
like image 436
wmeyer Avatar asked Sep 24 '26 18:09

wmeyer


2 Answers

WebSharper produces d.ts files for the compiled JS files. You can read about this in the relevant section of the documentation. However this feature is still experimental and uses an older version of TypeScript.

like image 156
qwe2 Avatar answered Sep 27 '26 12:09

qwe2


There is FunScript (https://github.com/ZachBray/FunScript) but it does not seem to be widespread, so it may take you more time than the benefits are.

like image 21
Martin Vseticka Avatar answered Sep 27 '26 10:09

Martin Vseticka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!