mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-15 22:40:21 +00:00
Create connect-redis definitions
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
import * as connectRedis from "connect-redis";
|
||||
import * as session from "express-session";
|
||||
|
||||
let RedisStore = connectRedis(session);
|
||||
Vendored
+38
@@ -0,0 +1,38 @@
|
||||
// Type definitions for connect-redis
|
||||
// Project: https://npmjs.com/package/connect-redis
|
||||
// Definitions by: Xavier Stouder <https://github.com/xstoudi>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare module "connect-redis" {
|
||||
import * as express from "express";
|
||||
import * as session from "express-session";
|
||||
import * as redis from "redis";
|
||||
|
||||
function s(options: (options?: session.SessionOptions) => express.RequestHandler): s.RedisStore;
|
||||
|
||||
namespace s {
|
||||
interface RedisStore extends session.Store {
|
||||
new (options: RedisStoreOptions): session.Store;
|
||||
}
|
||||
interface RedisStoreOptions {
|
||||
client?: redis.RedisClient;
|
||||
host?: string;
|
||||
port?: number;
|
||||
socket?: string;
|
||||
url?: string;
|
||||
ttl?: number;
|
||||
disableTTL?: boolean;
|
||||
db?: number;
|
||||
pass?: string;
|
||||
prefix?: string;
|
||||
unref?: boolean;
|
||||
serializer?: Serializer | JSON;
|
||||
}
|
||||
interface Serializer {
|
||||
stringify: Function;
|
||||
parse: Function;
|
||||
}
|
||||
}
|
||||
|
||||
export = s;
|
||||
}
|
||||
Reference in New Issue
Block a user