UNPKG

@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.

24 lines (23 loc) 1 kB
/** * @module Cache */ import { type ICacheAdapter } from "../../../../cache/contracts/_module.js"; import { type TimeSpan } from "../../../../time-span/implementations/_module.js"; /** * This `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(_key: string): Promise<TType | null>; getAndRemove(_key: string): Promise<TType | null>; add(_key: string, _value: TType, _ttl: TimeSpan | null): Promise<boolean>; put(_key: string, _value: TType, _ttl: TimeSpan | null): Promise<boolean>; update(_key: string, _value: TType): Promise<boolean>; increment(_key: string, _value: number): Promise<boolean>; removeMany(_keys: string[]): Promise<boolean>; removeAll(): Promise<void>; removeByKeyPrefix(_prefix: string): Promise<void>; }