record-tuple-polyfill
record-tuple-polyfill copied to clipboard
Typescript typings
Awesome work!
Is your feature request related to a problem? Please describe. Is there ambitions to add typescript typings for this project? If so, I could maybe help you do them.
Describe the solution you'd like
The thing is, I'm not sure how we would go about implementing types for the "syntax-sugar"-mode of this, i.e. #{} and #[], maybe orta (https://github.com/orta) could chime in on this. But, the Record and Tuple constructors should be possible to do I think.
Describe alternatives you've considered I think just waiting it out would be OK for me too 👍
Additional context None that I can think of.
This worked for me https://github.com/Pyrolistical/consensus-workstation/blob/4102979a7b7f6391bd636c0051722e484185dd02/typings/@bloomberg/record-tuple-polyfill.d.ts
The current support for types in the playground is a bit (a lot) of a hack, it just intercepts the program string before it is sent to the language server and any instances of #{ or #[ are replaced with { or [`. This means that TypeScript never sees the original syntax, so it can only provide an object-based type for the value. This will certainly be improved once TypeScript proper has support for the syntax.