Egg Redis Typescript Error.
- Dominant language
- TypeScript
- Stars
- 19k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
egg-redis/index.d.ts
----------------------
```
import { Redis, RedisOptions } from "ioredis";
interface ClusterOptions extends RedisOptions {
cluster?: boolean;
nodes?: RedisOptions[];
}
interface EggRedisOptions {
Redis?: Redis;
default?: object;
app?: boolean;
agent?: boolean;
client?: ClusterOptions;
clients?: Record;
}
declare module 'egg' {
interface Application {
redis: Redis & Singleton;
}
interface EggAppConfig {
redis: EggRedisOptions;
}
}
```
This code does not resolved Instance Singleton correctly due to collision of property `get()`. Please consider
```
import {Singleton} from "egg";
```
on the top of this declaration. And/Or reverse the type
```
interface Application {
redis: Singleton & Redis;
}
```
Contributor guide
Assessment
This issue has not been assessed yet.