import RedisClient, { Redis } from 'ioredis'; import { Observable } from 'rxjs'; export interface JsonObject { [key: string]: Json; } export interface JsonArray extends Array { } export declare type Json = JsonObject | JsonArray | string | number | boolean | null; export declare class PublishEvent { readonly key: string; readonly value: string; constructor(key: string, value: string); } export declare class RedisEvent { readonly type: string; readonly key: string; constructor(type: string, key: string); } export interface RedisPromiseCacheOptions { resourceTag: string; ttl?: number; } export declare class RedisPromiseCache { protected readonly options: RedisPromiseCacheOptions; protected readonly clientOptions?: RedisClient.RedisOptions | undefined; client: Redis; subscriber: Redis; events: Observable; constructor(options: RedisPromiseCacheOptions, clientOptions?: RedisClient.RedisOptions | undefined); protected getKey(key: string): string; get(key: string): Promise; set(key: string, value: R | Promise, { timeout, ttl }?: { timeout?: number; ttl?: number; }): Promise; protected _get(key: string): Promise; protected _set(key: string, value: string, { ttl }: { ttl?: number; }): Promise; del(key: string): Promise; flush(): Promise<[Error | null, any][]>; keys(): Promise; values(): Promise<(Json | null)[]>; entries(): Promise<[string, Json | null][]>; getResource(id: string, resolver: () => T | Promise, options?: { noCache?: boolean; }): Promise; }