-
Notifications
You must be signed in to change notification settings - Fork 81
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
Many Typescript types are only accessible by accessing internal files #326
Comments
Other import attempts that fail:
|
Ah, I found one that works: import {ColorTypes} from 'colorjs.io/types/src/color'; At least there's a sane way to access them. Still, this seems like an accidental feature; I'd expect to be able to access the types directly from a |
When I was writing the types I guess I didn't think about re-exporting them at the top level. I could make a PR for that when I get a chance, probably today or tomorrow. |
Yeah, I agree. I've been accessing them this same way (e.g. |
There are lots of internal types that say "export type" but there's not any way to actually access them from a TypeScript import.
Example:
I'm trying to use the internal
ColorTypes
type (input to thenew Color()
constructor). These are the ways I've tried so far that don't work:Workaround
With some type system trickery it is possible to extract this type, but it's quite annoying and requires the use of a huge
OverloadParameters
helper from this comment:The text was updated successfully, but these errors were encountered: