@directus/api
Version:
Directus is a real-time API and App dashboard for managing SQL database content
32 lines (31 loc) • 1.46 kB
TypeScript
import type { SchemaOverview } from '@directus/types';
import Keyv from 'keyv';
export declare function getCache(): {
cache: Keyv | null;
systemCache: Keyv;
deploymentCache: Keyv;
localSchemaCache: Keyv;
lockCache: Keyv;
};
export declare function flushCaches(forced?: boolean): Promise<void>;
export declare function clearSystemCache(opts?: {
forced?: boolean | undefined;
autoPurgeCache?: false | undefined;
}): Promise<void>;
export declare function setSystemCache(key: string, value: any, ttl?: number): Promise<void>;
export declare function getSystemCache(key: string): Promise<Record<string, any>>;
export declare function setMemorySchemaCache(schema: SchemaOverview): void;
export declare function getMemorySchemaCache(): Readonly<SchemaOverview> | undefined;
export declare function setCacheValue(cache: Keyv, key: string, value: Record<string, any> | Record<string, any>[], ttl?: number): Promise<void>;
export declare function getCacheValue(cache: Keyv, key: string): Promise<any>;
/**
* Store a value in cache with its expiration timestamp for TTL tracking
*/
export declare function setCacheValueWithExpiry(cache: Keyv, key: string, value: Record<string, any> | Record<string, any>[], ttl: number): Promise<void>;
/**
* Get a cached value along with its remaining TTL
*/
export declare function getCacheValueWithTTL(cache: Keyv, key: string): Promise<{
data: any;
remainingTTL: number;
} | undefined>;