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

Re-exporting types - do not export individually, use * #31

Open
alanshaw opened this issue Nov 5, 2024 · 0 comments
Open

Re-exporting types - do not export individually, use * #31

alanshaw opened this issue Nov 5, 2024 · 0 comments

Comments

@alanshaw
Copy link
Member

alanshaw commented Nov 5, 2024

For example upload-api/types.ts is huge and we often miss re-exporting types when we add them.

An approach I took here was:

export type * as BlobAPI from './types/blob.js'

Which you can then use as:

import { BlobAPI as API } from '../../src/types.js'

This enables us to automatically export all existing and future types and keeps types.ts a bit more tidy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant