From 89648eb96c38ffca0dbdea79ea2d0e1ed0132245 Mon Sep 17 00:00:00 2001 From: Scotland Stephenson Date: Wed, 27 Nov 2019 17:12:10 -0500 Subject: [PATCH] koa-redis add support for v4.0 (#40578) --- types/koa-redis/index.d.ts | 7 ++++--- types/koa-redis/koa-redis-tests.ts | 22 +++++++++++----------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/types/koa-redis/index.d.ts b/types/koa-redis/index.d.ts index 62706a274c..6e293699d9 100644 --- a/types/koa-redis/index.d.ts +++ b/types/koa-redis/index.d.ts @@ -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 +// Scotland Stephenson // 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; } } diff --git a/types/koa-redis/koa-redis-tests.ts b/types/koa-redis/koa-redis-tests.ts index 2cf4ca2ddb..4c184b3473 100644 --- a/types/koa-redis/koa-redis-tests.ts +++ b/types/koa-redis/koa-redis-tests.ts @@ -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);