forked from mweibel/connect-session-sequelize
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
38 lines (31 loc) · 1.04 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { SessionData, Store } from 'express-session';
import { Sequelize, SyncOptions } from 'sequelize';
interface DefaultFields {
data: string;
expires: Date;
}
interface Data {
[column: string]: any;
}
interface SequelizeStoreOptions {
db: Sequelize;
table?: string;
tableName?: string;
extendDefaultFields?: (defaults: DefaultFields, session: any) => Data;
checkExpirationInterval?: number;
expiration?: number;
}
declare class SequelizeStore extends Store {
sync(options?: SyncOptions): void
touch: (sid: string, data: any, callback?: (err: any) => void) => void
stopExpiringSessions: () => void
get(sid: string, callback: (err: any, session?: SessionData | null) => void): void
set(sid: string, session: SessionData, callback?: (err?: any) => void): void
destroy(sid: string, callback?: (err?: any) => void): void
}
interface SequelizeStoreConstructor {
new(options: SequelizeStoreOptions): SequelizeStore;
}
declare namespace init {}
declare function init(store: typeof Store): SequelizeStoreConstructor;
export = init;