UNPKG

@mdfriday/foundry

Version:

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

33 lines (32 loc) 1.23 kB
import { ModuleCache, ModuleMetadata } from '../type'; import { Fs } from '../../fs/type'; export declare class FsModuleCache implements ModuleCache { private fs; private cacheDir; constructor(fs: Fs, cacheDir?: string); 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>; private getCacheFilePath; getCacheDir(): string; getStats(): Promise<{ totalEntries: number; totalSize: number; }>; listCached(): Promise<string[]>; private listCacheFiles; } 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>; size(): number; keys(): string[]; } export declare function newModuleCache(fs: Fs, cacheDir?: string): ModuleCache; export declare function newMemoryModuleCache(): MemoryModuleCache;