-
Notifications
You must be signed in to change notification settings - Fork 334
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 errors (TS2416) when compiling an app in strict mode due to mismatch in interface implementations #504
Comments
This is a great find indeed, do you want to create a PR? I can help you to merge it |
@sedghi Thanks, I might try to create PRs for each of the issues I've raised. Although keep in mind that fixing all strict type check issues might be tricky as the current TS config has |
I will try to create a branch that experiment with fixing those 657 errors |
Looks good to me - simply change to allow skipping the image creation.
Hi @sedghi @StefanNedelchev , i am also facing same issue in Angular when i use latest version of Cornerstone3D Any suggestion about temporary workaround to solve it or already any permanent fix to it which you could share please ? Regards, |
Hi. Unfortunately I decided to give up trying until Cornerstone3D officially goes in strict TS mode (which is difficult to prioritize when they focus on bug fixing and features). As for a temporary solution, unfortunately I'm not aware of other way than setting the |
Yeah as Stefan mentioned, unfortunately it is not a priority at the moment, although I'm more than happy to review a PR if someone is trying to fix our types |
Hi @sedghi @StefanNedelchev , Thanks for the quick response.. for now i am proceeding with below configurations in tsconfig.json "types": ["node"], Regards, |
I have imported
@cornerstonejs/core
in an Angular app which uses strict mode in tsconfig and I implemented a simple code that should load a single image in a viewport. The build fails due to some TypeScript errors in the cornerstone type definitions:The screenshot includes only part of the errors but the others suffer from similar symptoms - some methods inside class declarations don't exactly match (in terms of return type and argument types) the methods from the interfaces they implement.
An example with

StackViewport
where the return type ofgetFrameOfReferenceUID()
includesundefined
but in the interfaceIStackViewport
andIViewport
the return type is strictly astring
. Also I'm not sure whyIStackViewport
duplicates so many things fromIViewport
given the fact it already extendsIViewport
. The latter can actually be noticed in other interfaces as well (if needed I'll create a separate issue for this).The text was updated successfully, but these errors were encountered: