Closed adaliszk closed 6 years ago
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).
Speaking of which: Polymer/polymer#4928
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.
When I try to use the HTMLElement life-cycle callbacks then I got errors by TypeScript:
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