import {Session, SessionData} from "express-session"; import {Files} from "formidable"; import {PasswordAuthProofSessionData} from "../auth/password/PasswordAuthProof.js"; import {FlashMessages} from "../components/SessionComponent.js"; import Middleware from "../Middleware.js"; import {Type} from "../Utils.js"; declare global { namespace Express { export interface Request { getSession(): Session & Partial; getSessionOptional(): Session & Partial | undefined; files: Files; middlewares: Middleware[]; as(type: Type): M; flash(): FlashMessages; flash(message: string): unknown[]; flash(event: string, message: unknown): void; getPreviousUrl(): string | null; getIntendedUrl(): string | null; } } } declare module 'express-session' { interface SessionData { id?: string; previousUrl?: string; wantsSessionPersistence?: boolean; persistent?: boolean; isAuthenticated?: boolean; authPasswordProof?: PasswordAuthProofSessionData; csrf?: string; } }