diff --git a/types/connect-mongo/index.d.ts b/types/connect-mongo/index.d.ts index ee110ab6b0..ea39a13f42 100644 --- a/types/connect-mongo/index.d.ts +++ b/types/connect-mongo/index.d.ts @@ -104,12 +104,12 @@ declare namespace connectMongo { } export class MongoStore extends session.Store { - get: (sid: string, callback: (err: any, session: Express.Session | null) => void) => void; - set: (sid: string, session: Express.Session, callback?: (err: any) => void) => void; + get: (sid: string, callback: (err: any, session: Express.SessionData | null) => void) => void; + set: (sid: string, session: Express.SessionData, callback?: (err: any) => void) => void; destroy: (sid: string, callback?: (err: any) => void) => void; length: (callback: (err: any, length: number) => void) => void; clear: (callback?: (err?: any) => void) => void; - touch: (sid: string, session: Express.Session, callback?: (err: any) => void) => void; + touch: (sid: string, session: Express.SessionData, callback?: (err: any) => void) => void; } } diff --git a/types/express-session/express-session-tests.ts b/types/express-session/express-session-tests.ts index 9189db1dfb..dc52a31a73 100644 --- a/types/express-session/express-session-tests.ts +++ b/types/express-session/express-session-tests.ts @@ -54,7 +54,7 @@ class MyStore extends session.Store { callback(null, sessionData); } - set = (sid: string, session: Express.Session, callback?: (err?: any) => void): void => { + set = (sid: string, session: Express.SessionData, callback?: (err?: any) => void): void => { this.sessions[sid] = JSON.stringify(session); if (callback) callback(); } diff --git a/types/express-session/index.d.ts b/types/express-session/index.d.ts index fdceafeeea..d26fbb6af8 100644 --- a/types/express-session/index.d.ts +++ b/types/express-session/index.d.ts @@ -79,26 +79,26 @@ declare namespace session { constructor(config?: any); regenerate: (req: express.Request, fn: (err?: any) => any) => void; - load: (sid: string, fn: (err: any, session?: Express.Session | null) => any) => void; + load: (sid: string, fn: (err: any, session?: Express.SessionData | null) => any) => void; createSession: (req: express.Request, sess: Express.SessionData) => void; get: (sid: string, callback: (err: any, session?: Express.SessionData | null) => void) => void; - set: (sid: string, session: Express.Session, callback?: (err?: any) => void) => void; + set: (sid: string, session: Express.SessionData, callback?: (err?: any) => void) => void; destroy: (sid: string, callback?: (err?: any) => void) => void; all: (callback: (err: any, obj?: { [sid: string]: Express.SessionData; } | null) => void) => void; length: (callback: (err: any, length?: number | null) => void) => void; clear: (callback?: (err?: any) => void) => void; - touch: (sid: string, session: Express.Session, callback?: (err?: any) => void) => void; + touch: (sid: string, session: Express.SessionData, callback?: (err?: any) => void) => void; } class MemoryStore implements BaseMemoryStore { get: (sid: string, callback: (err: any, session?: Express.SessionData | null) => void) => void; - set: (sid: string, session: Express.Session, callback?: (err?: any) => void) => void; + set: (sid: string, session: Express.SessionData, callback?: (err?: any) => void) => void; destroy: (sid: string, callback?: (err?: any) => void) => void; - all: (callback: (err: any, obj?: { [sid: string]: Express.Session; } | null) => void) => void; + all: (callback: (err: any, obj?: { [sid: string]: Express.SessionData; } | null) => void) => void; length: (callback: (err: any, length?: number | null) => void) => void; clear: (callback?: (err?: any) => void) => void; - touch: (sid: string, session: Express.Session, callback?: (err?: any) => void) => void; + touch: (sid: string, session: Express.SessionData, callback?: (err?: any) => void) => void; } }