Skip to content

feat(types): export OnProxyEvent type - #1263

Merged
chimurai merged 1 commit into
chimurai:masterfrom
Netail:master
Jun 16, 2026
Merged

chimurai merged 1 commit into
chimurai:masterfrom
Netail:master

Conversation

@Netail

@Netail Netail commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

Description

Expose OnProxyEvent type

Motivation and Context

We have some OnProxyEvent handlers we build in a sperate file and now need to use NonNullable<Options<Request, Response>['on']> for the types. This would make it slightly easier

How has this been tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Summary by CodeRabbit

  • New Features
    • The OnProxyEvent type is now exported and available for public use.

@coderabbitai

coderabbitai Bot commented Jun 15, 2026 •

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The export type statement in src/index.ts is updated to include OnProxyEvent alongside the previously exported Plugin, Filter, Options, and RequestHandler types, making it part of the package's public API surface.

Changes

Public Type Export

Layer / File(s) Summary
Add OnProxyEvent to public exports
src/index.ts
OnProxyEvent is appended to the export type { ... } list re-exported from ./types.js.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • chimurai/http-proxy-middleware#1190: Modifies the OnProxyEvent.proxyRes callback return type to void | Promise<void>, directly relating to the OnProxyEvent type now being publicly re-exported here.

Poem

A bunny hopped through index land,
And added one type with a gentle hand.
OnProxyEvent joins the public queue,
No longer hidden, now fully in view! 🐇✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: exporting the OnProxyEvent type from the library's public API.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Netail Netail changed the title Add OnProxyEvent type export to index.ts Expose OnProxyEvent type Jun 15, 2026
@Netail

Netail commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor Author

Adding types per "on" event (as the types are now part of OnProxyEvent) & exposing those would even be better, but not sure if that's fine

@chimurai chimurai changed the title Expose OnProxyEvent type feat(types): export OnProxyEvent type Jun 16, 2026
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 95.238%. remained the same — Netail:master into chimurai:master

@pkg-pr-new

pkg-pr-new Bot commented Jun 16, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/http-proxy-middleware@1263

commit: 438f639

@chimurai

chimurai commented Jun 16, 2026 •

Copy link
Copy Markdown
Owner

Thanks for the PR. Makes sense to export OnProxyEvent.

If you need the individual types from the OnProxyEvent fields, you can use OnProxyEvent['error']

@chimurai
chimurai merged commit b9242af into chimurai:master Jun 16, 2026
13 checks passed
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