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 support? #577

Open
IAkumaI opened this issue Feb 27, 2020 · 2 comments
Open

TypeScript support? #577

IAkumaI opened this issue Feb 27, 2020 · 2 comments

Comments

@IAkumaI
Copy link
Contributor

IAkumaI commented Feb 27, 2020

Hello,
is there any types definions for TypeScript?

@ericyhwang
Copy link
Contributor

It turns out, the trickier part of adding type definitions is the Racer Model, not Derby itself. But a lot Derby depends on Racer, so the Racer types need to be done first.

I did an initial pass at types for the Model in a fork:
https://github.com/lever/racer/blob/2eaec051b753d5793494ed7e3239bfef7d5cf6f7/lib/index.d.ts

Then, I decided that developing types in a private repo would allow for faster iteration, without worrying about breaking other people.

The private definitions are reasonably stable now, and I do want to open-source them. But I'll need to schedule some time with Nate to go over them.

@cray0000
Copy link
Member

cray0000 commented May 18, 2020

Hi @ericyhwang ! I looked at the code you have in the typescript* branches of the lever/racer fork and the progress you made there is just wonderful!

From the recent addition of multi-argument support to the model.at/model.scope it seems that you even figured out the way to get data-driven types without need to explicitly pass the generic type with each getter call 🔥

Is it possible to get the sneak peek of your latest typescript-friendly version of racer? Even if it has breaking changes I would really love to test it out on one of our production codebases and contribute to polishing it for the prime time.

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