-
Notifications
You must be signed in to change notification settings - Fork 78
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 error for steps
and PlainColorObject
#322
Comments
For the error on TypeScript seems to prioritize the last signature of overloads when you try to get a function's type, so the line to convert it to a class method for Color causes problems (since it doesn't see As for the I'm working on a PR to fix the problems now 😄 |
Hi there, any temp fixes while this hits the npm repository? I'm a bit stuck on that type issue and would love a cleanish workaround 😄 |
I did mention a workaround at the bottom of my original post |
@jgerigmeyer There are no blockers, it's just a matter of finding the time to do it. Any chance you may be willing? 🙏🏼 (I suggest we use release-it, it has really helped in other projects of mine) |
I discovered this error while using
Color.steps
.If you paste the following into the playground on colorjs.io (without Typescript) it functions as I'd expect:
I get an array of hex codes of all the steps.
When I paste this into my Typescript project, I get the error
This expression is not callable. Type 'never' has no call signatures.
and shows(property) Color.steps: never
Additionally, if I try to make steps out of a range, I do the following:
I get an error
Property 'to' does not exist on type 'PlainColor'Object'.
My workaround has been to do
Color.steps(range, {...}).map(step => new Color(step).....)
The text was updated successfully, but these errors were encountered: