UNPKG

rsxjs

Version:

Resilience Extensions for JS.

27 lines (26 loc) 1.18 kB
/** * @file src/store/redis.ts * @description Redis-powered store. * @copyright 2018-present Karim Alibhai. All rights reserved. */ import { RedisOptions } from 'ioredis'; import { Store, SetOptions } from './store'; export declare class RedisStore implements Store { private readonly redis; constructor(options: RedisOptions); get<T>(key: string): Promise<T>; set<T>(key: string, value: T, options?: SetOptions): Promise<void>; incr(key: string): Promise<void>; decr(key: string): Promise<void>; hincr(namespace: string, key: string): Promise<void>; hdecr(namespace: string, key: string): Promise<void>; del(key: string): Promise<void>; hset<T>(namespace: string, key: string, value: T): Promise<void>; hget<T>(namespace: string, key: string, defaultValue?: T): Promise<T | void>; rpush(listName: string, value: any): Promise<number>; lpush(listName: string, value: any): Promise<number>; rpop<T>(listName: string): Promise<T | void>; lpop<T>(listName: string): Promise<T | void>; brpop<T>(listName: string, timeout: number): Promise<T | void>; blpop<T>(listName: string, timeout: number): Promise<T | void>; }