myst-cli
Version:
Command line tools for MyST
25 lines • 891 B
TypeScript
import type { ISession, ISessionWithCache } from './types.js';
/**
* Cast session to include in-memory cache
*/
export declare function castSession(session: ISession): ISessionWithCache;
export declare function cachePath(session: ISession, filename: string): string;
/**
* Write data to file on-disk cache
*/
export declare function writeToCache(session: ISession, filename: string, data: string | NodeJS.ArrayBufferView): void;
/**
* Return true if cache file exists and is not expired
*/
export declare function checkCache(session: ISession, filename: string, opts?: {
maxAge?: number;
}): boolean;
/**
* Load data from file on-disk cache
*
* If cache file is older than opts.maxAge, in days, it is ignored.
*/
export declare function loadFromCache(session: ISession, filename: string, opts?: {
maxAge?: number;
}): string | undefined;
//# sourceMappingURL=cache.d.ts.map