@signalwire/docusaurus-plugin-llms-txt
Version:
Generate Markdown versions of Docusaurus HTML pages and an llms.txt index file
49 lines • 2.17 kB
TypeScript
/**
* Simplified cache management service
* Uses focused modules for validation and I/O operations
* @internal
*/
import type { RouteConfig } from '@docusaurus/types';
import type { DocInfo, PluginOptions, CachedRouteInfo, CacheSchema } from '../types';
/**
* Simplified cache management service
* @internal
*/
export declare class CacheManager {
private pathManager;
private cacheIO;
private siteConfig?;
constructor(siteDir: string, generatedFilesDir: string, config: PluginOptions, logger: {
warn: (_msg: string) => void;
}, outDir?: string, siteConfig?: {
baseUrl: string;
trailingSlash?: boolean;
});
/** Load cache from disk */
loadCache(): Promise<CacheSchema>;
/** Save cache to disk */
saveCache(cache: CacheSchema): Promise<void>;
/** Check if cached route is still valid using focused validation */
isCachedRouteValid(cachedRoute: CachedRouteInfo, currentConfig: PluginOptions): Promise<boolean>;
/** Check if cached routes are available */
hasCachedRoutes(cache: CacheSchema): boolean;
/** Check if the cached configuration matches the current configuration */
isCacheConfigValid(cache: CacheSchema, currentConfig: PluginOptions): boolean;
/** Calculate configuration hash */
calcConfigHash(options: Partial<PluginOptions>): string;
/** Create cached route info from routes with metadata for filtering */
createCachedRouteInfo(routes: RouteConfig[]): CachedRouteInfo[];
/** Update cached route info with processing results */
updateCachedRouteWithDoc(cachedRoute: CachedRouteInfo, doc: DocInfo, hash: string, enableMarkdownFiles: boolean): CachedRouteInfo;
/** Convert cached route info to DocInfo for processing */
cachedRouteToDocInfo(cachedRoute: CachedRouteInfo): DocInfo | null;
/** Update cache with processed routes and save to disk */
updateCacheWithRoutes(config: PluginOptions, cachedRoutes: CachedRouteInfo[]): Promise<void>;
/** Get cache file information for debugging */
getCacheInfo(): {
dir: string;
path: string;
};
}
export default CacheManager;
//# sourceMappingURL=cache.d.ts.map