undici icon indicating copy to clipboard operation
undici copied to clipboard

interceptors does not have any exported type

Open acommodari opened this issue 1 year ago • 6 comments

Bug Description

when you try to import interceptors in TS it complains

Reproducible By

import {interceptors} from "undici"

within a TypeScript project

Expected Behavior

You should be able to import interceptors and use redirect/retry in TS

Logs & Screenshots

Screenshot 2024-03-18 at 4 09 13 PM

Environment

macOS Ventura 13.2.1 node 20.11.1 undici 6.9.0

Additional context

acommodari avatar Mar 18 '24 20:03 acommodari

We already have a PR for fixing that: #2967

metcoder95 avatar Mar 19 '24 08:03 metcoder95

I'm still unable to import interceptors and I'm currently on v6.13.0

npm list image

package.json image

image

filipforro avatar Apr 15 '24 07:04 filipforro

Use Dispatcher and not Interceptors.

Uzlopak avatar Apr 15 '24 15:04 Uzlopak

Hmm. You are right.

https://github.com/nodejs/undici/blob/f90c16155d8c87c0d8cc1bdf46b553e8aef144a5/index.js#L39

I dont find the corresponding types.

Uzlopak avatar Apr 16 '24 07:04 Uzlopak

This will be close with #3118

metcoder95 avatar Apr 16 '24 07:04 metcoder95