Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

RedisStore does not extend correctly Store #52

Open
charles-dexter-ward opened this issue Oct 21, 2022 · 1 comment
Open

RedisStore does not extend correctly Store #52

charles-dexter-ward opened this issue Oct 21, 2022 · 1 comment

Comments

@charles-dexter-ward
Copy link

charles-dexter-ward commented Oct 21, 2022

It seems the definition of RedisStore at

https://github.com/dabroek/node-cache-manager-redis-store/blob/master/dist/index.d.ts

is not compatible with the definition of Store at

https://github.com/node-cache-manager/node-cache-manager/blob/master/src/caching.ts

the methods set(), get(), keys(), reset() and ttl() have an incompatible function definitions

interface RedisStore extends Store {
    name: string;
    getClient: () => RedisClientType;
    isCacheableValue: any;
    set: (key: any, value: any, options: any, cb: any) => Promise<any>;
    get: (key: any, options: any, cb: any) => Promise<any>;
    del: (...args: any[]) => Promise<any>;
    mset: (...args: any[]) => Promise<any>;
    mget: (...args: any[]) => Promise<any>;
    mdel: (...args: any[]) => Promise<any>;
    reset: (cb: any) => Promise<any>;
    keys: (pattern: string, cb: any) => Promise<any>;
    ttl: (key: any, cb: any) => Promise<any>;
}
export type Store = {
  get<T>(key: string): Promise<T | undefined>;
  set<T>(key: string, data: T, ttl?: Ttl): Promise<void>;
  del(key: string): Promise<void>;
  reset(): Promise<void>;
  mset(args: [string, unknown][], ttl?: Ttl): Promise<void>;
  mget(...args: string[]): Promise<unknown[]>;
  mdel(...args: string[]): Promise<void>;
  keys(pattern?: string): Promise<string[]>;
  ttl(key: string): Promise<number>;
};
@slaveofcode
Copy link

Any updates?

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

No branches or pull requests

2 participants