@grouparoo/core
Version:
The Grouparoo Core
28 lines (27 loc) • 804 B
TypeScript
export declare type CacheKey = {
[keyName: string]: CacheKey;
} | CacheKey[] | string | number | boolean | Date;
export interface ObjectCacheMethod {
(argument: {
objectId: string;
cacheKey: CacheKey;
cacheDurationMs?: number;
lock?: boolean;
read?: boolean;
write?: boolean;
passthru?: boolean;
}, methodToGetValue: {
(): Promise<any>;
}): Promise<any>;
}
export interface ObjectCacheInvalidateMethod {
(argument: {
objectId: string;
}): Promise<void>;
}
export declare function makeBaseCacheKey({ objectId, cacheKey, }: {
objectId: string;
cacheKey: CacheKey;
}): string;
export declare const objectCacheInvalidate: ObjectCacheInvalidateMethod;
export declare const objectCache: ObjectCacheMethod;