diff --git a/test/types/interceptor.test-d.ts b/test/types/interceptor.test-d.ts index ba242bfcadb..3a09fc290a4 100644 --- a/test/types/interceptor.test-d.ts +++ b/test/types/interceptor.test-d.ts @@ -1,5 +1,9 @@ import {expectAssignable} from "tsd"; import Undici from "../.."; import Dispatcher from "../../types/dispatcher"; +import Interceptors from "../../types/interceptors"; expectAssignable(Undici.createRedirectInterceptor({ maxRedirections: 3 })) + +expectAssignable(new Dispatcher().compose([Interceptors.dns({maxTTL: 2_000})])); + diff --git a/types/interceptors.d.ts b/types/interceptors.d.ts index 65e9397554e..9f6af128d5e 100644 --- a/types/interceptors.d.ts +++ b/types/interceptors.d.ts @@ -28,4 +28,5 @@ declare namespace Interceptors { export function retry(opts?: RetryInterceptorOpts): Dispatcher.DispatcherComposeInterceptor export function redirect(opts?: RedirectInterceptorOpts): Dispatcher.DispatcherComposeInterceptor export function responseError(opts?: ResponseErrorInterceptorOpts): Dispatcher.DispatcherComposeInterceptor + export function dns (opts?: DNSInterceptorOpts): Dispatcher.DispatcherComposeInterceptor }