|
1 | 1 | import ioredis = require("ioredis"); |
2 | 2 |
|
3 | | -export type RedisOptions = { data?: Record<string, unknown> } & ioredis.RedisOptions; |
| 3 | +declare namespace redisMock { |
| 4 | + type RedisOptions = { data?: Record<string, unknown> } & ioredis.RedisOptions; |
4 | 5 |
|
5 | | -export type RedisClusterOptions = { |
6 | | - redisOptions: Omit< |
7 | | - RedisOptions, |
8 | | - "port" | "host" | "path" | "sentinels" | "retryStrategy" | "enableOfflineQueue" | "readOnly" |
9 | | - >; |
10 | | -} & ioredis.ClusterOptions; |
| 6 | + type RedisClusterOptions = { |
| 7 | + redisOptions: Omit< |
| 8 | + RedisOptions, |
| 9 | + "port" | "host" | "path" | "sentinels" | "retryStrategy" | "enableOfflineQueue" | "readOnly" |
| 10 | + >; |
| 11 | + } & ioredis.ClusterOptions; |
11 | 12 |
|
12 | | -export interface ClusterConstructor { |
13 | | - new(startupNodes: ioredis.ClusterNode[], options?: RedisClusterOptions): ioredis.Cluster; |
14 | | -} |
| 13 | + interface ClusterConstructor { |
| 14 | + new(startupNodes: ioredis.ClusterNode[], options?: RedisClusterOptions): ioredis.Cluster; |
| 15 | + } |
15 | 16 |
|
16 | | -export interface Constructor { |
17 | | - new(port: number, host: string, options: RedisOptions): ioredis.Redis; |
18 | | - new(path: string, options: RedisOptions): ioredis.Redis; |
19 | | - new(port: number, options: RedisOptions): ioredis.Redis; |
20 | | - new(port: number, host: string): ioredis.Redis; |
21 | | - new(options: RedisOptions): ioredis.Redis; |
22 | | - new(port: number): ioredis.Redis; |
23 | | - new(path: string): ioredis.Redis; |
24 | | - new(): ioredis.Redis; |
25 | | - Cluster: ClusterConstructor; |
| 17 | + interface Constructor { |
| 18 | + new(port: number, host: string, options: RedisOptions): ioredis.Redis; |
| 19 | + new(path: string, options: RedisOptions): ioredis.Redis; |
| 20 | + new(port: number, options: RedisOptions): ioredis.Redis; |
| 21 | + new(port: number, host: string): ioredis.Redis; |
| 22 | + new(options: RedisOptions): ioredis.Redis; |
| 23 | + new(port: number): ioredis.Redis; |
| 24 | + new(path: string): ioredis.Redis; |
| 25 | + new(): ioredis.Redis; |
| 26 | + Cluster: ClusterConstructor; |
| 27 | + } |
26 | 28 | } |
27 | 29 |
|
28 | | -export const redisMock: Constructor; |
29 | | -export { redisMock as default }; |
| 30 | +declare const redisMock: redisMock.Constructor; |
| 31 | +export = redisMock; |
0 commit comments