rescript-webapi
rescript-webapi copied to clipboard
Temporal bindings
https://tc39.es/proposal-temporal/docs
Currently incomplete, need to clean the rest up before committing them.
Couple of questions on approach:
- Is there a way to more directly type functions that type option bags? I assume no and we have to wait for this RFC
- Many modules share a lot of functions, is it worth segmenting these out into functors? Or is a more direct approach, as in this PR currently, more valuable?
I've skipped APIs that rely on bigints, I think official support need to land for these (at least in the form of a type in the stdlib) before adding bindings. See https://github.com/rescript-lang/rescript-compiler/issues/4677
I've also skipped toLocaleString bindings as I think we should add general Intl bindings first (#77)
Regarding BigInt, maybe we consider pulling in rescript-js. That might be a bit heavy-handed, though, to force webapi users to adopt the alternative Js implementation as well if they want to make use of the BigInt functions.