Repository navigation
[types] Use @import instead of @typedef - #686
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.
lloydk
left a comment
There was a problem hiding this comment.
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 <lloyd@lloydk.ca>
5bff377 to
9c66361
Compare
|
@LeaVerou requesting review in case you want to look at the dependency version changes in |
|
This PR completely broke the generated .d.ts files. See issue: #692 |
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.