UNPKG

reboost

Version:

A super fast dev server for rapid web development

42 lines (41 loc) 1.38 kB
import { ReboostConfig, ReboostPlugin, LogFn } from './index'; export interface CacheInfo { /** Hash of the file */ hash: string; /** Last modified time of the file */ mtime: number; /** Plugins used in the file */ plugins: string; /** Dependencies of the file */ dependencies?: { [filePath: string]: { hash: string; mtime: number; }; }; } declare type CacheInfoRecord = { [cacheID: string]: CacheInfo; }; export declare const initCache: (config: ReboostConfig, plugins: ReboostPlugin[], log: LogFn) => { getFilesDir: () => string; cacheFilePath: (cacheID: string) => string; sourceMapPath: (cacheID: string) => string; cacheInfoFilePath: (cacheID: string) => string; getCurrentPlugins: () => string; readonly version: string; readonly cacheIDs: { [filePath: string]: string; }; readonly dependentsData: { [filePath: string]: string[]; }; cacheInfo: CacheInfoRecord; saveData: () => void; removeFile: (file: string) => void; removeDependents: (dependency: string) => void; verifyFiles: () => void; hasDependenciesChanged: (file: string) => Promise<boolean>; updateDependencies: (filePath: string, dependencies: string[], firstTime?: boolean) => Promise<void>; }; export {};