Skip to content

Commit

Permalink
fix: remove the workaround for callable types
Browse files Browse the repository at this point in the history
  • Loading branch information
rauno56 committed Apr 27, 2021
1 parent a72b8cf commit 40872a0
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,8 @@ declare namespace Router {

type RequestParamHandler = (req: IncomingRequest, res: http.ServerResponse, next: NextFunction, value: string, name: string) => void;

interface RouteHandler {
// tslint:disable-next-line callable-types (This is extended from and can't extend from a type alias in ts<2.2
(req: RoutedRequest, res: http.ServerResponse, next: NextFunction): void;
}

interface RequestHandler {
// tslint:disable-next-line callable-types (This is extended from and can't extend from a type alias in ts<2.2
(req: IncomingRequest, res: http.ServerResponse, next: NextFunction): void;
}
type RouteHandler = (req: RoutedRequest, res: http.ServerResponse, next: NextFunction) => void;
type RequestHandler = (req: IncomingRequest, res: http.ServerResponse, next: NextFunction) => void;

type NextFunction = (err?: Error | "route" | "router") => void;
type Callback = (err?: Error) => void;
Expand Down

0 comments on commit 40872a0

Please sign in to comment.