Merge pull request #28582 from prsyahmi/master

Fixed Express.Session type is used instead of Express.SessionData on Store class
This commit is contained in:
Mine Starks
2018-09-07 13:32:32 -07:00
committed by GitHub
3 changed files with 10 additions and 10 deletions
+3 -3
View File
@@ -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;
}
}
@@ -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();
}
+6 -6
View File
@@ -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;
}
}