@daiso-tech/core
Version:
The library offers flexible, framework-agnostic solutions for modern web applications, built on adaptable components that integrate seamlessly with popular frameworks like Next Js.
25 lines (24 loc) • 1.35 kB
TypeScript
/**
* @module Cache
*/
import { type ICacheAdapter } from "../../../../cache/contracts/_module.js";
import { type IReadableContext } from "../../../../execution-context/contracts/_module.js";
import { type TimeSpan } from "../../../../time-span/implementations/_module.js";
/**
* The `NoOpCacheAdapter` will do nothing and is used for easily mocking {@link ICache | `ICache`} for testing.
*
*
* IMPORT_PATH: `"@daiso-tech/core/cache/no-op-cache-adapter"`
* @group Adapters
*/
export declare class NoOpCacheAdapter<TType = unknown> implements ICacheAdapter<TType> {
get(_context: IReadableContext, _key: string): Promise<TType | null>;
getAndRemove(_context: IReadableContext, _key: string): Promise<TType | null>;
add(_context: IReadableContext, _key: string, _value: TType, _ttl: TimeSpan | null): Promise<boolean>;
put(_context: IReadableContext, _key: string, _value: TType, _ttl: TimeSpan | null): Promise<boolean>;
update(_context: IReadableContext, _key: string, _value: TType): Promise<boolean>;
increment(_context: IReadableContext, _key: string, _value: number): Promise<boolean>;
removeMany(_context: IReadableContext, _keys: Array<string>): Promise<boolean>;
removeAll(_context: IReadableContext): Promise<void>;
removeByKeyPrefix(_context: IReadableContext, _prefix: string): Promise<void>;
}