UNPKG

@mdfriday/foundry

Version:

The core engine of MDFriday. Convert Markdown and shortcodes into fully themed static sites – Hugo-style, powered by TypeScript.

81 lines 2.08 kB
import { ModuleCache, ModuleMetadata } from '../type'; import { Fs } from '../../fs/type'; /** * File system based module cache implementation */ export declare class FsModuleCache implements ModuleCache { private fs; private cacheDir; constructor(fs: Fs, cacheDir?: string); /** * Get module metadata from cache */ get(modulePath: string): Promise<ModuleMetadata | null>; /** * Set module metadata in cache */ set(modulePath: string, metadata: ModuleMetadata): Promise<void>; /** * Check if module exists in cache */ has(modulePath: string): Promise<boolean>; /** * Delete module from cache */ delete(modulePath: string): Promise<void>; /** * Clear all cache */ clear(): Promise<void>; /** * Get cache file path for module */ private getCacheFilePath; /** * Get cache directory */ getCacheDir(): string; /** * Get cache stats */ getStats(): Promise<{ totalEntries: number; totalSize: number; }>; /** * List all cached modules */ listCached(): Promise<string[]>; /** * Helper to list cache files */ private listCacheFiles; } /** * In-memory module cache implementation for testing */ export declare class MemoryModuleCache implements ModuleCache { private cache; get(modulePath: string): Promise<ModuleMetadata | null>; set(modulePath: string, metadata: ModuleMetadata): Promise<void>; has(modulePath: string): Promise<boolean>; delete(modulePath: string): Promise<void>; clear(): Promise<void>; /** * Get cache size for testing */ size(): number; /** * Get all keys for testing */ keys(): string[]; } /** * Creates a new file system based module cache */ export declare function newModuleCache(fs: Fs, cacheDir?: string): ModuleCache; /** * Creates a new in-memory module cache for testing */ export declare function newMemoryModuleCache(): MemoryModuleCache; //# sourceMappingURL=cache.d.ts.map