mastercache
Version:
Multi-tier cache module for Node.js. Redis, Upstash, CloudfareKV, File, in-memory and others drivers
61 lines (58 loc) • 1.88 kB
TypeScript
import { b as L2CacheDriver } from '../../../mastercache-Di19srNZ.js';
import { CacheEntryOptions } from '../cache-entry/cache-entry-options.js';
import { Logger } from 'typescript-log';
import '../../types/driver.js';
import '../../types/provider.js';
import '../../types/helpers.js';
import '../../types/options/methods-options.js';
import '../../types/options/options.js';
import '../../../events-CkqPK7En.js';
import '../../types/bus.js';
import '@boringnode/bus/types/main';
import '../../types/options/drivers-options.js';
import 'knex';
import 'kysely';
import '@aws-sdk/client-dynamodb';
import 'ioredis';
import 'orchid-orm';
/**
* RemoteCache is a wrapper around a L2 Cache Driver that provides
* some handy methods for interacting with a remote cache ( redis, database, etc )
*/
declare class RemoteCache {
#private;
constructor(driver: L2CacheDriver, logger: Logger);
/**
* Get an item from the remote cache
*/
get(key: string, options: CacheEntryOptions): Promise<any>;
/**
* Set a new item in the remote cache
*/
set(key: string, value: string, options: CacheEntryOptions): Promise<any>;
/**
* Delete an item from the remote cache
*/
delete(key: string, options: CacheEntryOptions): Promise<any>;
/**
* Delete multiple items from the remote cache
*/
deleteMany(keys: string[], options: CacheEntryOptions): Promise<any>;
/**
* Create a new namespace for the remote cache
*/
namespace(namespace: string): L2CacheDriver;
/**
* Check if an item exists in the remote cache
*/
has(key: string, options: CacheEntryOptions): Promise<any>;
/**
* Clear the remote cache
*/
clear(options: CacheEntryOptions): Promise<any>;
/**
* Disconnect from the remote cache
*/
disconnect(): Promise<void>;
}
export { RemoteCache };