hariria
## Problem I want to have strong typing but currently the `Router` class' `add` function has a signature like so: ```ts export declare class Router { add<T extends RegExp>(method: Method, route: T, handler: Handler<Params>): void; ... } ``` The problem is that handler has a signature like so: ```ts export type Handler<P extends Params = Params> = (req: ServerRequest<P>, res: ServerResponse) => Promisable<Response|void>; ``` Because the Router's `add` function is `Handler<Params>` and not `Handler<P extends Params = Params>`, this prevents people from adding handlers to the Router.add function that implement a type P that extends Params ## Solution would be nice to change to something like ```ts add<T extends RegExp, P extends Params = Params>(method: Method, route: T, handler: Handler<P>): void; ``` ## Context The reason why is because atm when I do something like ```ts import { listen, Router } from 'worktop'; export interface VerifyParams extends Params { address: string; anotherParam: string; } export const verify: Handler<VerifyParams> = async ( req, res, ) => { const { address, anotherParam } = req.params; const isVerified = address === 'hi' && anotherParam === 'also hi'; res.send(200, { isVerified }, { 'cache-control': 'private,max-age=30' }); }; const API = new Router(); API.add<RegExp>('GET', /verify/, verify); ``` this throws the error ```bash Argument of type 'Handler<VerifyParams>' is not assignable to parameter of type 'Handler<Params>'. Type 'Params' is missing the following properties from type 'VerifyParams': address, anotherParam ```