Skip to content

Commit cb30e58

Browse files
fix: add static buildDispatch method to RedirectHandler type definition (#5442)
* fix: add static buildDispatch method to RedirectHandler type definition * Fix lint * add handlers test
1 parent 0c08579 commit cb30e58

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

test/types/handlers.test-d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { expectAssignable } from 'tsd'
2+
import { Agent, Dispatcher, RedirectHandler } from '../..'
3+
4+
const dispatcher = new Agent()
5+
6+
expectAssignable<Dispatcher.Dispatch>(RedirectHandler.buildDispatch(dispatcher, 3))

types/handlers.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import Dispatcher from './dispatcher'
22

33
export declare class RedirectHandler implements Dispatcher.DispatchHandler {
4+
static buildDispatch (dispatcher: Dispatcher, maxRedirections: number): Dispatcher.Dispatch
5+
46
constructor (
57
dispatch: Dispatcher.Dispatch,
68
maxRedirections: number,

0 commit comments

Comments
 (0)