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

Add example to docs showing how to use with Typescript #29

Open
lukemelia opened this issue Jun 15, 2021 · 1 comment
Open

Add example to docs showing how to use with Typescript #29

lukemelia opened this issue Jun 15, 2021 · 1 comment

Comments

@lukemelia
Copy link
Contributor

I love this library for working in JS but am not sure how it should be used in Typescript. In other words, how do we type the properties defined via these decorators?

@pzuraq
Copy link
Owner

pzuraq commented Jun 15, 2021

I'm open to ideas here, I don't really use these decorators that much myself these days. They can be useful, but I also think that they're not going to really match up well with the current direction of the decorators spec. You would have to do:

@alias('foo') accessor bar;

The accessor keyword will be necessary for converting a field into a getter/setter. In some cases, this could possibly still be worth it for terseness, but I don't think it would be in many simple cases like aliasing.

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

2 participants