Skip to content

feat: export all types#280

Merged
pi0 merged 7 commits intounjs:mainfrom
bounoable:export-types
Oct 26, 2023
Merged

feat: export all types#280
pi0 merged 7 commits intounjs:mainfrom
bounoable:export-types

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
@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