Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript typings #51

Open
merisbahti opened this issue Jan 18, 2021 · 2 comments
Open

Typescript typings #51

merisbahti opened this issue Jan 18, 2021 · 2 comments

Comments

@merisbahti
Copy link

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.

@Pyrolistical
Copy link

Pyrolistical commented Sep 1, 2021

This worked for me https://github.com/Pyrolistical/consensus-workstation/blob/4102979a7b7f6391bd636c0051722e484185dd02/typings/@bloomberg/record-tuple-polyfill.d.ts

@rickbutton
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants