Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Typescript] RedisFlushModes aren't exported and can't be used #2411

Closed
oleksii-donoha opened this issue Feb 15, 2023 · 1 comment · Fixed by #2425
Closed

[Typescript] RedisFlushModes aren't exported and can't be used #2411

oleksii-donoha opened this issue Feb 15, 2023 · 1 comment · Fixed by #2425
Labels

Comments

@oleksii-donoha
Copy link

Description

When writing code, which flushes DB/all:

await client.flushDb()

There might be a need to flush asynchronously: https://redis.io/commands/flushdb/
client.flushDB() expects optional arg mode?: RedisFlushModes | undefined.
This enum is implemented here: https://github.com/redis/node-redis/blob/master/packages/client/lib/commands/FLUSHALL.ts
But the RedisFlushModes is not exported by redis module and cannot be referenced in the code.
Am I missing something?

Node.js Version

v16.18.1

Redis Server Version

unrelated to server

Node Redis Version

redis@4.6.4

Platform

Linux

Logs

No response

@leibale
Copy link
Contributor

leibale commented Feb 15, 2023

Until we fix it you can either import the type from the file directly

import { RedisFlushModes } from '@redis/client/dist/lib/commands/FLUSHALL.js';

or use as any

client.flushDb('SYNC' as any);

Thanks for reporting!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants