Skip to content

fix(types): export MockAgent pending interceptor type#5565

Open
tianrking wants to merge 1 commit into
nodejs:mainfrom
tianrking:agent/export-pending-interceptor-type
Open

fix(types): export MockAgent pending interceptor type#5565
tianrking wants to merge 1 commit into
nodejs:mainfrom
tianrking:agent/export-pending-interceptor-type

Conversation

@tianrking

Copy link
Copy Markdown

Summary

  • expose PendingInterceptor through the MockAgent namespace
  • make pendingInterceptors() and its formatter reference the public namespaced types
  • verify the public annotation in the TypeScript declaration tests

Why

MockAgent#pendingInterceptors() returned a declaration-private interface, so consumers could inspect the values but could not name the return element type in their own TypeScript APIs. The existing mock-agent type test had to duplicate that interface locally.

Validation

  • npx tsd
  • npx tsc test/imports/undici-import.ts --typeRoots ./types --noEmit
  • npx tsc <all types/*.d.ts files> --noEmit --typeRoots ./types
  • npm run lint -- --no-cache

Fixes #5563

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.

d.ts: Export PendingInterceptor type from mock-agent.d.ts

1 participant