-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Fix TypeScript Definitions for making lit-element happy #46
Conversation
Thank you so much for the PR. Please see review comments. |
@bennypowers Thank you for the review. I did think about these issues before raising the PR. I just hoped to fix TypeScript issues quickly. I will work it out these comments and see how we can adhere to the design. |
1. Remove LitElement dependency from mixins package 2. Use class and interface declaration merging for extending from LitElement
So there are a couple of things:
|
I'm ok with implementing #35, although it will represent a major release. What I'd love to see would be some tests for these typings. Another option we should consider is using JSDoc inline typings instead of .d.ts files. |
Having Tests for typescript definition files is not very common. We can treat our files and run As far as JSDoc is concerned, it looks interesting but usually ends up being cumbersome to write than plain TS definitions. |
what is the status for this? I am having the same issue with TS and lit-apollo. This PR doesn't just "make lit-element happy", currently TS just doesn't compile the code because it complains that none of the apollo properties (client, query, etc.) are present on my class |
@RSWilli can you send me a repro to tinker with? My volunteer time is short this week as I just moved apartment, but I'm really hoping to solve this for you ASAP, so if you have a ready made example repo, or some changes for this PR I'll try my best to get something out. |
Repro: https://stackblitz.com/edit/typescript-hfggxi for me, editing https://github.com/apollo-elements/apollo-elements/blob/master/packages/lit-apollo/apollo-query.d.ts#L1 from @apollo-elements/mixins/apollo-mutation-mixin to @apollo-elements/mixins/apollo-query-mixin fixes it, but I don't know if it brakes anything else that my usecase does not include |
affects: @apollo-elements/lit-apollo
very nice work, thanks |
This PR fixes issue #37.