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

HTMLElement life-cycle callbacks #121

Closed
adaliszk opened this issue Nov 29, 2017 · 3 comments
Closed

HTMLElement life-cycle callbacks #121

adaliszk opened this issue Nov 29, 2017 · 3 comments
Assignees

Comments

@adaliszk
Copy link

When I try to use the HTMLElement life-cycle callbacks then I got errors by TypeScript:

TS2339: Property 'connectedCallback' does not exist on type 'PolymerElement'.
TS2339: Property 'disconnectedCallback' does not exist on type 'PolymerElement'.

Polymer repository has a typescript definition, which might help to implement or ask to release that as a separate: https://github.com/Polymer/polymer/blob/typescript/polymer.d.ts

@Buslowicz
Copy link
Owner

This is not as simple as one would think. The types you linked to do not work out of the box, and last time I talked with the team about it, they are not (at least for now) going to do anything about those types, as they concentrate on making a generator to automatically generate types. Typings under polymer.d.ts is a copy of previous types on Polymer repo, tweaked a bit by me so they work nicely. I have also tried to fix those types and publish on @types, but they refused to merge my types as I do not own Polymer itself... Ended up with types on this repo (published on npm here). After that I had 3 months of no time for twc, and now forgot to mention that, but will update twc and how to use those types soon (after I am done with making mixins work).

@tpluscode
Copy link
Contributor

Speaking of which: Polymer/polymer#4928

@Buslowicz
Copy link
Owner

Buslowicz commented Nov 30, 2017

I am still not sure how they want to generate more complex types like mixinBehaviors. Till it's finished and working, I'll stick with separate types for Polymer core.

@Buslowicz Buslowicz self-assigned this Dec 3, 2017
Buslowicz pushed a commit that referenced this issue Dec 5, 2017
Buslowicz pushed a commit that referenced this issue Dec 5, 2017
#121: HTMLElement life-cycle callbacks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants