works fine perfectly when these are in the same file.
declare module "express-session" {
interface SessionData {
userId: number;
}
}
static async loginUser(req: Request, res: Response) {
const { email, password } = req.body;
req.session!.userId = 1;
return res.send("login");
}
However, if I seperate these files into,
index.d.ts index.ts
then it shows that userId does not exist within SessionData or Partial.
Why is this so?