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

feat: export all types #280

Merged
merged 7 commits into from
Oct 26, 2023
Merged

feat: export all types #280

merged 7 commits into from
Oct 26, 2023

Conversation

bounoable
Copy link
Contributor

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

I'm building a library around ofetch that needs defines custom fetch functions with the same signature as ofetch, so ideally I would have access to these types to define the function. My current workaround is to copy-paste the types into the library but this doesn't feel quite right.

If there's a reason for these types to not be exported, just close this PR and I will stick to the workaround πŸ‘πŸΌ

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

…om utils to make them available for external usage
@AdoKevin
Copy link

AdoKevin commented Oct 9, 2023

I'm really looking forward to this PR being accepted. I've encountered the same issue myself. Directly copying the type definitions does seem a bit strange.

@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Merging #280 (ab0dcb7) into main (3a73165) will decrease coverage by 1.47%.
The diff coverage is 100.00%.

❗ Current head ab0dcb7 differs from pull request most recent head 42dd069. Consider uploading reports for the commit 42dd069 to get more accurate results

@@            Coverage Diff             @@
##             main     #280      +/-   ##
==========================================
- Coverage   93.46%   92.00%   -1.47%     
==========================================
  Files           5        5              
  Lines         551      450     -101     
  Branches      102      102              
==========================================
- Hits          515      414     -101     
  Misses         36       36              
Files Coverage Ξ”
src/error.ts 96.96% <100.00%> (-0.60%) ⬇️
src/fetch.ts 95.39% <100.00%> (-1.07%) ⬇️
src/utils.ts 95.04% <100.00%> (-0.57%) ⬇️

@pi0 pi0 changed the title feat: export ResponseType, ResponseMap, and MappedType feat: export types Oct 26, 2023
@pi0 pi0 changed the title feat: export types feat: export more types Oct 26, 2023
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I have rewrote on top of your work to export more type exports.

@pi0 pi0 changed the title feat: export more types feat: export all types Oct 26, 2023
@pi0 pi0 merged commit 3482a56 into unjs:main Oct 26, 2023
4 checks passed
@bounoable bounoable deleted the export-types branch October 27, 2023 09:07
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

Successfully merging this pull request may close these issues.

3 participants