Skip to content

types: expose PendingInterceptor and PendingInterceptorsFormatter on the MockAgent namespace - #5721

Open
RaphaelFakhri wants to merge 1 commit into
nodejs:mainfrom
RaphaelFakhri:types/export-pending-interceptor
Open

types: expose PendingInterceptor and PendingInterceptorsFormatter on the MockAgent namespace#5721
RaphaelFakhri wants to merge 1 commit into
nodejs:mainfrom
RaphaelFakhri:types/export-pending-interceptor

Conversation

@RaphaelFakhri

@RaphaelFakhri RaphaelFakhri commented Aug 25, 2026

Copy link
Copy Markdown

Fixes #5563.

Both interfaces are declared at the top level of types/mock-agent.d.ts and never exported, so a consumer writing a helper around pendingInterceptors(), or a custom pendingInterceptorsFormatter, has no way to name the argument type and ends up copying the declaration into their own code, where it then drifts from this one.

They move into the MockAgent namespace, next to Options and the other public members, and the two class members now point at the namespaced names. Nothing else in types/ or index.d.ts referenced them, so this is additive for consumers and a no-op for the existing declarations.

test/types/mock-agent.test-d.ts gains an assertion that both names are reachable as MockAgent.PendingInterceptor and MockAgent.PendingInterceptorsFormatter from outside the module.

…m MockAgent

Both interfaces were declared at the top level of the module and never
exported, so a consumer typing a helper around pendingInterceptors() had no way
to name their argument and had to copy the declaration, which then drifts.
Move them under the MockAgent namespace and point the two members at the
namespaced names.
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