Typescript complain for type any of parameter, although it is not of type any

142
March 31, 2021, at 09:50 AM

I have the following code:

const getConfig: IGetConfigRequestHandler = async (req, res) => { ... };
type IGetConfigRequestHandler = express.CustomRequestHandler<{ }, {
    code: string;
    timeout: string;
    screen_timeout: string;
} | string>;
import express from 'express';
import * as core from 'express-serve-static-core';
declare module 'express' {
    type CustomRequestHandler<
        ReqBody = any, 
        ResBody = any,
        ReqQuery extends core.Query = core.Query,
    > = express.RequestHandler<core.ParamsDictionary, Readonly<ResBody>, Readonly<ReqBody>, Readonly<ReqQuery>>;
}

If I hover over req I don't see any type but

(parameter) req: Request<ParamsDictionary, string | Readonly<{
    code: string;
    timeout: string;
    screen_timeout: string;
}>, Readonly<{}>, Readonly<QueryString.ParsedQs>, Record<...>>

But when I compile my code I get an error:

Parameter 'req' implicitly has an 'any' type.

Cancel implicitAny in tsconfig.json is not optional for me.

Rent Charter Buses Company
READ ALSO
How to load and test a model in pytorch?

How to load and test a model in pytorch?

I am loading an already trained datasetMy dataset is a 3D image and i want to test that model now

171
Created a python code using the bootstrap to generate html but unable to add colours to it

Created a python code using the bootstrap to generate html but unable to add colours to it

I have written the below code to generate html report but i am failing to make it look good likewise adding colours, making borders and alphabets bold etci did try adding the tags like "table-bordered

171
Rails 6 webpacker with theme implementation error

Rails 6 webpacker with theme implementation error

I am creating one rails application with the latest version 61

134
Google Internal App sharing - Unexpected error

Google Internal App sharing - Unexpected error

Suddenly from 3 days, I am not able to use Google Internal App sharingLoading App sharing page fails with error "unexpected error"

123