What are the types of the four parameters for the error handling function when coding in Typescript?
app.use((err: ??, req: ??, res: ??, next: ??) => { }
I don't know why Typescript does not get that we are passing an error handler.
These are the solutions I found possible :
app.use((err, req, res, next) => {}) // KO
const inVariable : ErrorRequestHandler = (err, req, res, next) => {};
app.use(inVariable); // ok
app.use(((err, req, res, next) => {}) as ErrorRequestHandler); // ok