type-compiler
Version:
A TypeScript compiler plugin for enhanced runtime type checking and analysis with Zod validation
47 lines (46 loc) • 1.35 kB
TypeScript
import { TypeCompilerOptions } from './types';
/**
* Global cache to store computed Zod schemas across transformer invocations
*/
export declare const globalTypeCache: Map<string, string>;
/**
* File cache for tracking file modifications for incremental compilation
*/
export declare class FileCache {
private cache;
private cachePath?;
private initialized;
constructor(cachePath?: string);
/**
* Load the cache from disk if a cache path is provided
*/
private loadCache;
/**
* Save the cache to disk if a cache path is provided
*/
saveCache(): void;
/**
* Check if a file has changed since the last time it was processed
*/
hasFileChanged(filePath: string): boolean;
/**
* Update the cache entry for a file
*/
private updateFile;
/**
* Mark a file as processed without checking its content
*/
markFileProcessed(filePath: string): void;
}
/**
* Get or create a file cache based on the provided options
*/
export declare function getFileCache(options: TypeCompilerOptions): FileCache;
/**
* Check if a file has changed since the last compilation
*/
export declare function isFileUnchanged(filePath: string): boolean;
/**
* Mark a file as processed in the cache
*/
export declare function markFileAsProcessed(filePath: string): void;