Skip to content

Commit adf4b82

Browse files
authored
fix: add missing namespace and closeClient type (#74)
1 parent 6899a86 commit adf4b82

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

index.d.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@ declare module 'fastify' {
77
}
88
}
99

10-
export type FastifyRedisPlugin = RedisOptions & { url?: string } | { client: Redis }
10+
export type FastifyRedisPlugin = RedisOptions &
11+
{
12+
url?: string;
13+
namespace?: string;
14+
} |
15+
{
16+
client: Redis;
17+
namespace?: string;
18+
closeClient?: boolean;
19+
}
1120

1221
declare const fastifyRedis: FastifyPluginCallback<FastifyRedisPlugin>;
1322

test/types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const app = Fastify();
66
const redis = new IORedis({ host: 'localhost', port: 6379 });
77

88
app.register(fastifyRedis, { host: '127.0.0.1' });
9-
app.register(fastifyRedis, { client: redis });
9+
app.register(fastifyRedis, { client: redis, namespace: 'hello', closeClient: true });
1010
app.register(fastifyRedis, { url: 'redis://127.0.0.1:6379', keepAlive: 0 });
1111

1212
app.get('/foo', (req: FastifyRequest, reply) => {

0 commit comments

Comments
 (0)