Lack of Type Safety When Extending Express API with Custom Response Methods
Hi Express community,
I'm exploring the feature of extending the Express API, as documented here, to add custom response methods. While this is a powerful feature, I've encountered what appears to be a lack of type safety when implementing these custom methods, particularly when using TypeScript.
For example, I've defined a custom
AuthUser
type:
And extended the express.Response
object with a custom success method:
Now, this should provide type-safety but lack 2 (see attachment image) generic missing from express types.
so My question is that is it valid and
if yes then can someone guild me to make first OS PR to express's types.
if not then how can i archive this?.
Thanks.
0 Replies