Skip to content

Commit 27996bd

Browse files
committed
types: mark legacy function cache APIs deprecated
1 parent 6366bf0 commit 27996bd

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

types/monsqlize.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,15 @@ export default class MonSQLize implements MonSQLizeInstance {
609609
static hasExpressionInObject: typeof hasExpressionInObject;
610610
static hasExpressionInPipeline: typeof hasExpressionInPipeline;
611611
static createRedisCacheAdapter: typeof createRedisCacheAdapter;
612+
/**
613+
* @deprecated Retained for v1 compatibility. Non-database function caching is no longer a recommended monSQLize feature path;
614+
* use `cache-hub` directly or an application-owned cache layer for new generic function-cache usage.
615+
*/
612616
static withCache: typeof withCache;
617+
/**
618+
* @deprecated Retained for v1 compatibility. Non-database function caching is no longer a recommended monSQLize feature path;
619+
* use `cache-hub` directly or an application-owned cache layer for new generic function-cache usage.
620+
*/
613621
static FunctionCache: typeof FunctionCache;
614622
static adaptLegacyCacheLike: typeof adaptLegacyCacheLike;
615623
static MultiLevelCache: typeof MultiLevelCache;

types/runtime.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,19 @@ export interface FunctionCacheOptions extends HubFunctionCacheOptions {
253253
defaultTTL?: number;
254254
}
255255

256+
/**
257+
* @deprecated Retained for v1 compatibility. Non-database function caching is no longer a recommended monSQLize feature path;
258+
* use `cache-hub` directly or an application-owned cache layer for new generic function-cache usage.
259+
*/
256260
export declare function withCache<TArgs extends unknown[], TResult>(
257261
fn: (...args: TArgs) => Promise<TResult>,
258262
options?: WithCacheOptions<(...args: TArgs) => Promise<TResult>>,
259263
): CachedFunction<TArgs, TResult>;
260264

265+
/**
266+
* @deprecated Retained for v1 compatibility. Non-database function caching is no longer a recommended monSQLize feature path;
267+
* use `cache-hub` directly or an application-owned cache layer for new generic function-cache usage.
268+
*/
261269
export declare class FunctionCache {
262270
constructor(cacheOrDb?: CacheLike | { getCache(): CacheLike; }, options?: FunctionCacheOptions);
263271
register(name: string, fn: (...args: unknown[]) => Promise<unknown>, options?: {

0 commit comments

Comments
 (0)