import type Application from "../Foundation/Application"; import type { Store } from "express-session"; import type { SessionConfig } from "../Contracts/Config"; import type { Session } from "express-session"; import type { Request } from "../Http/Request"; interface ExtendedSession extends Partial { __old?: any; __lastAccess?: any; sessionStore?: Store; [key: string]: any; } declare class SessionManager { protected app: Application; protected session: ExtendedSession; protected request: Request; protected started: boolean; constructor(app: Application); setRequest(request: Request): this; get(key: string): any; /** * get flashed session. */ getFlashed(): any; old(key?: string): any; all(withFlashed?: boolean, withAuth?: boolean, withToken?: boolean): { [x: string]: any; __old?: any; __lastAccess?: any; sessionStore?: Store | undefined; id?: string | undefined; cookie?: import("express-session").Cookie | undefined; regenerate?: ((callback: (err: any) => void) => Session) | undefined; destroy?: ((callback: (err: any) => void) => Session) | undefined; reload?: ((callback: (err: any) => void) => Session) | undefined; resetMaxAge?: (() => Session) | undefined; save?: ((callback?: ((err: any) => void) | undefined) => Session) | undefined; touch?: (() => Session) | undefined; }; put(key: string, value: any): void; /** * flash session to view. Will be removed on next request. */ flash(key: string, value: any): void; has(key: string): boolean; exists(key: string): boolean; save(): Promise; flush(): Promise; remove(key: string): void; forget(keys: string[]): void; getDefaultDriver(): string; getStore(session: any): Promise; private getStoreConfig; getConfig(): SessionConfig; migrate(destroy?: boolean): Promise; start(): Promise; regenerateToken(): void; token(): any; isStarted(): boolean; } export default SessionManager;