import { C as CID_ALGORITHM_NAMES, a as ComputeInterface, M as MultiHashData } from './MultiHashData-B-scpa5G.cjs'; export { c as CID_ALGORITHM, b as CID_ALGORITHM_CODES } from './MultiHashData-B-scpa5G.cjs'; import * as PQueue from 'p-queue'; import PQueue__default from 'p-queue'; import * as p_queue_dist_priority_queue_js from 'p-queue/dist/priority-queue.js'; import { FileProcessorInterface } from './index-interface.cjs'; export { FileIDComputerInterface } from './index-interface.cjs'; import 'stream'; declare class FileIDComputerWorker { private piscina; constructor(workerPath?: string); /** * Compute the CIDs of a file using specific algorithms * @param filePath The path to the file * @param algorithms Array of algorithms ('sha256', 'sha1') * @returns Array of CIDs (in the order of the algorithms) */ computeCIDs(filePath: string, algorithms: CID_ALGORITHM_NAMES[]): Promise; } interface IndexLine extends Partial> { path: string; size: string; mtime: string; } declare const INDEX_HEADERS: string[]; declare class HashIndexManager { private targetHash; private cache; private intervalId; private intervalTime; private lastIndexFileSize; private lastCacheFile; private indexOpsInProgress; private hasChanged; private initialLoad; private filePaths; constructor(filePath: string, targetHash?: CID_ALGORITHM_NAMES[]); getCache(): Map; /** * After init consseutively calls to this method will not reload the index * @param autosave */ init(autosave?: boolean): Promise; private checkCSVHeaders; start(): void; stopAutoSave(): void; private startAutoSave; loadIndex(hash: CID_ALGORITHM_NAMES): Promise; private loadIndexFromCache; private readCsv; saveCacheToFile(): Promise; getCidForFileAsync(filePath: string): Promise; getCidForFile(filePath: string, fileSize: number, mtime: string): IndexLine; addFileCid(filePath: string, fileSize: number, mtime: string, hashs: Partial>): void; } declare class HashComputerIndexCache implements ComputeInterface { private targetHash; private hashIndexManager; private hashComputer; constructor(indexFilePath: string, targetHash?: CID_ALGORITHM_NAMES[], workerPath?: string); computeMissingHash(filePath: string, metadata: MultiHashData): Promise; getHashIndexManager(): Promise; } declare class HashComputerWorker implements ComputeInterface { private targetHash; private fileIDComputer; constructor(targetHash: CID_ALGORITHM_NAMES[], workerPath?: string); computeMissingHash(filePath: string, metadata: MultiHashData): Promise; } declare class FolderWatcher { private WATCH_FOLDER_LIST; private config; initialized: boolean; queue: PQueue__default; fileProcessor: FileProcessorInterface; queueSize: number; current: number; processing: Set; constructor(fileProcessor: FileProcessorInterface, WATCH_FOLDER_LIST: string, config: { interval?: number; stabilityThreshold?: number; pollInterval?: number; }); /** * Process the directory and its subdirectories * @param directory * @param promises * @private */ private processDirectory; private countFile; private processFile; /** * Process the file and its sibling file included other folder it is a recursive function * @param filePath * @private */ private processFileExtended; private chokidarWatch; watch(): Promise; } export { CID_ALGORITHM_NAMES, ComputeInterface, FileIDComputerWorker, FileProcessorInterface, FolderWatcher, HashComputerIndexCache, HashComputerWorker, HashIndexManager, INDEX_HEADERS, MultiHashData };