mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-02-28 19:52:53 +00:00
koa-redis add support for v4.0 (#40578)
This commit is contained in:
parent
50284197ae
commit
89648eb96c
7
types/koa-redis/index.d.ts
vendored
7
types/koa-redis/index.d.ts
vendored
@ -1,11 +1,12 @@
|
||||
// Type definitions for koa-redis 3.0
|
||||
// Type definitions for koa-redis 4.0
|
||||
// Project: https://github.com/koajs/koa-redis
|
||||
// Definitions by: Nick Simmons <https://github.com/nsimmons>
|
||||
// Scotland Stephenson <https://github.com/alsoscotland>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
import { ClientOpts } from 'redis';
|
||||
import { SessionStore } from 'koa-generic-session';
|
||||
import { stores } from 'koa-session';
|
||||
|
||||
declare namespace redisStore {
|
||||
interface RedisOptions extends ClientOpts {
|
||||
@ -13,7 +14,7 @@ declare namespace redisStore {
|
||||
client?: any;
|
||||
}
|
||||
|
||||
interface RedisSessionStore extends SessionStore {
|
||||
interface RedisSessionStore extends stores {
|
||||
client: any;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,20 +1,20 @@
|
||||
import Koa = require("koa");
|
||||
import { MemoryStore, Session } from "koa-generic-session";
|
||||
import session = require("koa-generic-session");
|
||||
import session = require("koa-session");
|
||||
import redisStore = require("koa-redis");
|
||||
|
||||
const app = new Koa();
|
||||
|
||||
app.use(session({
|
||||
store: redisStore({
|
||||
url: 'redis://url:123',
|
||||
host: 'redisHost',
|
||||
port: 123,
|
||||
path: 'redis/path',
|
||||
db: '2',
|
||||
duplicate: false,
|
||||
client: {}
|
||||
})
|
||||
}));
|
||||
url: 'redis://url:123',
|
||||
host: 'redisHost',
|
||||
port: 123,
|
||||
path: 'redis/path',
|
||||
db: '2',
|
||||
duplicate: false,
|
||||
client: {}
|
||||
})
|
||||
}, app
|
||||
));
|
||||
|
||||
app.listen(80);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user