-
-
Notifications
You must be signed in to change notification settings - Fork 88
[types] Use @import instead of @typedef
#686
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
Conversation
To allow us to use the `@import` keyword. Also bumps TypeDoc to a version that supports TypeScript v5.5.
✅ Deploy Preview for colorjs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
bbc9812 to
7d93dd3
Compare
As of now, the latest TypeScript version has no export equivalent of `@import`, so the only way to expose a type from another file seems to be through `@typedef`s.
Mostly adding/removing whitespace that Prettier didn't change.
eac230e to
2bb6a42
Compare
|
The majority of the re-exported types here are types that would make more sense to define directly within the re-exporting files, rather than in For example: any functions that take complex options as parameters currently have their options interfaces defined in |
Semantically the same, but matches the typical way of importing ESM defaults.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with some minor nitpicks.
I did notice that these types are re-exported but not exported in index.d.ts or index-fn.ts:
AlgorithmsMethodsArgumentMetaParseFunctionReturnOKCoeffToGamutOptionsTryColorOptions
I think those could be addressed in a separate PR as I think there are additional types in types.d.ts that should be exported at the top level.
Co-Authored-By: Lloyd Kupchanko <[email protected]>
5bff377 to
9c66361
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
@LeaVerou requesting review in case you want to look at the dependency version changes in |
Closes #685
There are some files for which the
@typedefs' re-exporting behavior was deliberate (e.g. everything inindex-fn), while for most cases it was just a way of mimicking an import. For any files where the re-export behaviour was deliberate, the@typedefs have been left alone.