import { Static, TSchema } from '@sidewinder/type'; import { SetOptions, Store } from '../store/index'; /** A RedisMap is analogous to a JavaScript Map. It provides asynchronous set, get, clear and key value enumeration. * There is one additional feature for RedisMap, where the set operation can be conditional based on whether the key * already exists in the map or not. */ export declare class RedisMap { #private; private readonly schema; private readonly store; private readonly keyspace; constructor(schema: T, store: Store, keyspace: string); /** Async iterator for this Map */ [Symbol.asyncIterator](): AsyncGenerator<(string | Static)[], void, unknown>; /** Clears this Map */ clear(): Promise; /** Returns true if this key exists */ has(key: string): Promise; /** * Sets the value for the given key * @param key The key to write to * @param value The value to set * @param options Optional set conditions * @returns If the operation successfully updated data */ set(key: string, value: Static, options?: SetOptions): Promise; /** Gets the value for the given key */ get(key: string): Promise | undefined>; /** Sets a key to expire after the given seconds have elapsed */ expire(key: string, seconds: number): Promise; /** Deletes the given key */ delete(key: string): Promise; /** Returns the number of entries in this Map */ size(): Promise; /** Returns an array to all entries in this Map */ entries(): Promise<[string, Static][]>; /** Returns an array to all values in this Map */ values(): Promise[]>; /** Returns an array to all keys in this map */ keys(): Promise; private encodeAllKeys; private encodeKey; private decodeKey; }