Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions test/types/interceptor.test-d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import {expectAssignable} from "tsd";
import Undici from "../..";
import Dispatcher from "../../types/dispatcher";
import Interceptors from "../../types/interceptors";

expectAssignable<Dispatcher.DispatchInterceptor>(Undici.createRedirectInterceptor({ maxRedirections: 3 }))

expectAssignable<Dispatcher.ComposedDispatcher>(new Dispatcher().compose([Interceptors.dns({maxTTL: 2_000})]));

1 change: 1 addition & 0 deletions types/interceptors.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Loading