mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
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:
Vendored
+3
-3
@@ -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();
|
||||
}
|
||||
|
||||
Vendored
+6
-6
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user