Skip to content

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

Description

@KristjanTammekivi

Allow the type to be addressable

Currently the type can't be addressed, so You can't do

const checkPendingInterceptors = (interceptors: PendingInterceptors) => {
  //
};

outside of the project

The implementation should look like...

I would move the interface declaration under the MockAgent namespace and change the internal usages to

  pendingInterceptors (): MockAgent.PendingInterceptor[]

I have also considered...

Copying the interface declaration to my project, but this could cause desync if the interface is ever changed in Undici

Additional context

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions