|
1 |
| -declare module 'connect-session-sequelize' { |
| 1 | +import { Store } from 'express-session'; |
| 2 | +import { Sequelize, Model } from 'sequelize'; |
2 | 3 |
|
3 |
| - import { Store } from 'express-session'; |
4 |
| - import { Sequelize, Model } from 'sequelize'; |
| 4 | +interface DefaultFields { |
| 5 | + data: string; |
| 6 | + expires: Date; |
| 7 | +} |
5 | 8 |
|
6 |
| - interface DefaultFields { |
7 |
| - data: string; |
8 |
| - expires: Date; |
9 |
| - } |
| 9 | +interface Data { |
| 10 | + [column: string]: any; |
| 11 | +} |
10 | 12 |
|
11 |
| - interface Data { |
12 |
| - [column: string]: any; |
13 |
| - } |
| 13 | +interface SequelizeStoreOptions { |
| 14 | + db: Sequelize; |
| 15 | + table?: string; |
| 16 | + tableName?: string; |
| 17 | + extendDefaultFields?: (defaults: DefaultFields, session: any) => Data; |
| 18 | + checkExpirationInterval?: number; |
| 19 | + expiration?: number; |
| 20 | +} |
14 | 21 |
|
15 |
| - interface SequelizeStoreOptions { |
16 |
| - db: Sequelize; |
17 |
| - table?: string; |
18 |
| - extendDefaultFields?: (defaults: DefaultFields, session: any) => Data; |
19 |
| - checkExpirationInterval?: number; |
20 |
| - expiration?: number; |
21 |
| - } |
| 22 | +declare class SequelizeStore extends Store { |
| 23 | + sync(): void |
| 24 | + touch: (sid: string, data: any, callback?: (err: any) => void) => void |
| 25 | + stopExpiringSessions: () => void |
| 26 | +} |
22 | 27 |
|
23 |
| - class SequelizeStore extends Store { |
24 |
| - sync(): void |
25 |
| - touch: (sid: string, data: any, callback?: (err: any) => void) => void |
26 |
| - } |
| 28 | +interface SequelizeStoreConstructor { |
| 29 | + new(options: SequelizeStoreOptions): SequelizeStore; |
| 30 | +} |
27 | 31 |
|
28 |
| - interface SequelizeStoreConstructor { |
29 |
| - new(options: SequelizeStoreOptions): SequelizeStore; |
30 |
| - } |
| 32 | +declare namespace init {} |
| 33 | +declare function init(store: typeof Store): SequelizeStoreConstructor; |
31 | 34 |
|
32 |
| - export default function init(store: typeof Store): SequelizeStoreConstructor; |
33 |
| -} |
| 35 | +export = init; |
0 commit comments