@eklabdev/blingts4
Version:
A comprehensive TypeScript decorators library implementing Stage 2 decorators for TS 4.9+
14 lines (13 loc) • 572 B
TypeScript
import { CacheOptions } from '../../types';
export type WithCache<T, K extends string> = {
[P in K as `invalidate${Capitalize<P>}`]: () => void;
};
/**
* Caches method results with optional expiration
* @param options Cache configuration options
*/
export declare function Cached(options?: CacheOptions): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
/**
* Permanently caches method results
*/
export declare function Memoize(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;