Skip to content
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

Revisit types exported from the SDK #2020

Open
sodic opened this issue May 8, 2024 · 0 comments
Open

Revisit types exported from the SDK #2020

sodic opened this issue May 8, 2024 · 0 comments
Labels
dx enhancement New feature or request

Comments

@sodic
Copy link
Contributor

sodic commented May 8, 2024

Item 47 of Effective Typescript says "Export all types that appear in public APIs. The reasoning is solid and goes something like this:

Users will eventually want to reference a type your library uses (e.g., it's part of a function's type signature) only to find out it isn't exported. Since TypeScript has many powerful utility types, they'll find a way to extract and use it anyway (e.g., with ReturnType, Parameters, typeof, etc.).

If a type appears in a public function declaration, it's effectively exported. Therefore, you should do your users a favor and just export them explicitly.

Our SDK doesn't currently do this, so let's make it happen :)

@sodic sodic added enhancement New feature or request dx labels May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dx enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant