-
Notifications
You must be signed in to change notification settings - Fork 11
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 is missing #8
Comments
Hi @danazkari, nice that you like the project! I myself am not very familiar with TypeScript. What is necessary to support it? I thought that you could include JavaScript modules in TypeScript without any problems. |
Yup essentially you can... But since it's typed, when you want it needs to know about the types the module has, and since you create a new extendable class out of I can add on my project a file to support the lib but since I have to do it anyways, might as well do it right and contribute to the project 😉 https://github.com/DefinitelyTyped/DefinitelyTyped#how-can-i-contribute Basically there are two ways, one to add the file to your project or the better way I think, which would be to contribute to DefinitelyTyped which gives people to optionally add the typings only if needed. |
A way to start working on this is to use perhaps scaffold a TS project with open-wc/open-wc-starter-app, import gitaarik/lit-state and then complete the I could avoid using TS altogether but it would really help me to use it on this project I'm working on. |
Hey @danazkari, Looks interesting. As I said, I am not familiar with TypeScript, so I would have to learn these concepts before I understand what exactly is needed. I am interested in it, but my time is limited, and I can't promise you that I can fix this any time soon. If you are interested, you can of course maybe make a pull request to fix the issue. In the meantime, I will try to learn more about TypeScript. |
Yeah man it's all good, take ur time, I'm using the ticket as notepad, I wasn't expecting you to work on this actually, but rather I'd like to donate a bit of my time for the project with this 😁 Cheers! |
Ok cool. I'm excited to see the progress on this :). |
@danazkari Did you create the types? Can you share them with me? |
Hey! I'm really sorry mate but I wasn't able to, didn't find the time to do it |
Early preview of a TS state manager for lit: https://github.com/lit-apps/lit-app/tree/main/packages/state. Not yet released to npm |
Nice work! |
@gitaarik - Yes, thanks ; ) I will slowly transition to this new approach in our apps (for instance accessiblesurveys.com), mostly for better TS support. |
Thank you, also for your contribution :) |
Hello! I love the simplicity of this project and was about to use it, but I was trying to use typescript and it seems like
lit-element-state
does not support typescript.Can support be added? Can I help do it?
The text was updated successfully, but these errors were encountered: