@stylable/core
Version:
CSS for Components
19 lines • 832 B
TypeScript
export type processFn<T> = (fullpath: string, content: string) => T;
export interface CacheItem<T> {
value: T;
content: string;
}
export interface MinimalFS {
readFileSync: (filePath: string, encoding: 'utf8') => string;
}
export interface FileProcessor<T> {
process: (filePath: string, invalidateCache?: boolean) => T;
add: (filePath: string, value: T) => void;
processContent: (content: string, filePath: string) => T;
cache: Record<string, CacheItem<T>>;
postProcessors: Array<(value: T, path: string) => T>;
}
export declare function cachedProcessFile<T = any>(processor: processFn<T>, readFileSync: MinimalFS['readFileSync'], postProcessors?: Array<(value: T, path: string) => T>, cache?: {
[key: string]: CacheItem<T>;
}): FileProcessor<T>;
//# sourceMappingURL=cached-process-file.d.ts.map