-
Notifications
You must be signed in to change notification settings - Fork 21
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 type definitions #23
Conversation
Thank you @alvivi Maybe this needs a bit more work: I'm not a TypeScript user myself so there's some syntax details I don't control. Thanks again. |
@acstll, yes, this needs more work. But IMHO, the problem is not with
The There are still problems using this library from Typescript. First I cannot use the default toHTML function because of this. Second, I think that the definition of VNode is not correct. However, that definition comes from Sanbbdom itself. The field sel is marked as required, but that is not true, because I can create valid VNodes with no sel, like |
@alvivi If/When you feel you've got decent typings here, feel free to ping me and I'll review them. I wrote them without ever actually using this library, but for supporting TypeScript and to do server-side rendering for (Motor)Cycle.js. |
@alvivi thanks for the explanation. The https://github.com/snabbdom/snabbdom-to-html/blob/master/modules/style.js#L21 and also, in theory, inside a custom module you could just call Maybe As for the problem with the VNode definition, as @TylorS suggests, there's a plan to port Snabbdom to TypeScript (snabbdom/snabbdom#150), but we don't know exactly In fact, we also wanted to port this library to TypeScript (I have a branch with a first try, maybe I could push it so you can review/test it if you feel like it), but just haven't got the time to work on that. |
@acstll I'll get into gear soon, just finished moving, and should be getting back to normal shortly :) |
@TylorS no worries, I know moving takes tons of time. It will be great to have you back to "normal" 😄 |
Typescript type declarations are broken, at least from typescript 2.0.3 (I have not tried other versions). This pull request makes this project usable from typescript.