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 definitions broken for 3.2.3 release and TypeScript 3.3.3 #623
Comments
How to reproduce these errors? I don't see them. |
You need to tighten up the typescript compiler options.
In order to suppress the warnings, I added:
I see that there's much of the library that isn't really typed yet. I can help out with this, as I'm using this library a fair amount on my current project. |
When you upgraded from version 2 to 3, did you change the way you import Konva? ver2: |
@gabberr This is a fresh use, not an upgrade. From what I can tell from here: https://www.npmjs.com/package/konva, what you're suggesting is only to reduce imports, not anything to do with the version of konva at all. Using the import from konva/lib/Core fails with TypeScript completely:
|
@gabberr
|
@JOU-amjs I resolved this in my post above. |
@emlynmac Thanks!😁 |
Just published version |
Guys I am still seeing this issue on 3.4.1, I upgraded from 2 to 3.4.1 and seeing lots of type errors. Tried solutions mentioned above nothing worked out. |
@strikerdev what kind of type errors? Can you post them? |
@lavrton I am sorry for my comment, it was due to ts version mismatch, which is fixed after upgrading ts version. thanks 👍 |
|
I am still getting same error. Konva =7.2.5 and TypScript=3.8.3 |
I hope to fix it with the new |
@lavrton but so much error pop up: TS2503: Cannot find namespace 'Konva'. |
I just pulled the latest version for a new project - I've been using konva 2.x on a previous project.
First issue - types are missing for the filters in index-types.d.ts. I've got a fix for that and will make a PR for it shortly. Filters need explicit types to make things happy it seems:
Second issue is
Stage.ts redefines the children property to be of a different type.
Container
, which defineschildren
asCollection<Child extends Node>
Stage
extendsContainer
, which defineschildren
asCollection<BaseLayer>
.These two types are incompatible and so TS throws up the error message.
The text was updated successfully, but these errors were encountered: