You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
731 B
27 lines
731 B
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
import type { NextFunction, Request, Response } from 'express';
|
|
import type { User } from '../entity/User';
|
|
|
|
declare global {
|
|
namespace Express {
|
|
export interface Request {
|
|
user?: User;
|
|
locale?: string;
|
|
}
|
|
}
|
|
|
|
export type Middleware = <ParamsDictionary, any, any>(
|
|
req: Request,
|
|
res: Response,
|
|
next: NextFunction
|
|
) => Promise<void | NextFunction> | void | NextFunction;
|
|
}
|
|
|
|
// Declaration merging to apply our own types to SessionData
|
|
// See: (https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/express-session/index.d.ts#L23)
|
|
declare module 'express-session' {
|
|
export interface SessionData {
|
|
userId: number;
|
|
}
|
|
}
|