import Client from './client'; import { IRedisKeyOptions } from './types/redis'; export default class Transaction { private _client; private _multi; /** * Constructor */ constructor(client: Client); /** * Commit a transaction */ commit(): Promise; /** * Roll the transaction back */ rollback(): void; /** * Is a transaction still open */ readonly isOpen: boolean; /** * Set a key value */ set(key: string, value: string | number, options?: IRedisKeyOptions): Promise; /** * Increment an integer value */ incrby(key: string, value: number, options?: IRedisKeyOptions): Promise; /** * Increment a float value */ incrbyfloat(key: string, value: number, options?: IRedisKeyOptions): Promise; /** * Increment an integer value in a hash set */ hincrby(key: string, hashKey: string, value: number, options?: IRedisKeyOptions): Promise; /** * Increment a float value in a hash set */ hincrbyfloat(key: string, hashKey: string, value: number, options?: IRedisKeyOptions): Promise; /** * Hash map set */ hmset(key: string, hash: object, options?: IRedisKeyOptions): Promise; /** * Delete a key */ del(key: string): Promise; /** * Add to a set */ sadd(key: string, value: string | number, options?: IRedisKeyOptions): Promise; /** * Remove from set */ srem(key: string, value: string | number): Promise; /** * Set the expiry in seconds */ private _checkExpiry(key, options?); /** * Check to make sure this transaction is still open */ private _checkDisposed(); }