mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
* Use index.d.ts only (not foo/foo.d.ts) * Convert more packages * Remove unnecessary references
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
// 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
|
|
|
|
/// <reference types="express" />
|
|
/// <reference types="express-session" />
|
|
/// <reference types="redis" />
|
|
|
|
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;
|
|
}
|