mastercache
Version:
Multi-tier cache module for Node.js. Redis, Upstash, CloudfareKV, File, in-memory and others drivers
50 lines (47 loc) • 1.83 kB
text/typescript
import { E as Emitter, e as CacheEvent } from '../../../events-BJQnbTp3.cjs';
import { Bus } from '../../bus/bus.cjs';
import { LocalCache } from '../facades/local-cache.cjs';
import { RemoteCache } from '../facades/remote-cache.cjs';
import { BaseDriver } from '../../drivers/base-driver.cjs';
import { MasterCacheOptions } from '../../mastercache-options.cjs';
import { CacheEntryOptions } from '../cache-entry/cache-entry-options.cjs';
import { d as CacheStackDrivers } from '../../../mastercache-CD6UEBYT.cjs';
import { Logger } from 'typescript-log';
import { CacheBusMessage } from '../../types/bus.cjs';
import '@boringnode/bus/types/main';
import '../cache-entry/cache-entry.cjs';
import '../../types/driver.cjs';
import '../../types/provider.cjs';
import '../../types/helpers.cjs';
import '../../types/options/methods-options.cjs';
import '../../types/options/options.cjs';
import '../../types/options/drivers-options.cjs';
import 'knex';
import 'kysely';
import '@aws-sdk/client-dynamodb';
import 'ioredis';
import 'orchid-orm';
declare class CacheStack extends BaseDriver {
#private;
name: string;
options: MasterCacheOptions;
l1?: LocalCache;
l2?: RemoteCache;
bus?: Bus;
defaultOptions: CacheEntryOptions;
logger: Logger;
constructor(name: string, options: MasterCacheOptions, drivers: CacheStackDrivers, bus?: Bus);
get emitter(): Emitter;
namespace(namespace: string): CacheStack;
/**
* Publish a message to the bus channel
*
* @returns true if the message was published, false if not
* and undefined if a bus is not part of the stack
*/
publish(message: CacheBusMessage): Promise<boolean | undefined>;
emit(event: CacheEvent): void;
serialize(value: any): string;
deserialize(value: string): any;
}
export { CacheStack };