import { C as CID_ALGORITHM_NAMES, a as ComputeInterface, M as MultiHashData } from './ShaComputeWorker-CNdGUbtT.js'; export { c as CID_ALGORITHM, b as CID_ALGORITHM_CODES, S as SimpleHash } from './ShaComputeWorker-CNdGUbtT.js'; 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'; 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 ComputeHashIndexCache 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 function existsAsync(filePath: string): Promise; declare class FileIDComputer { 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; } declare class HashComputer implements ComputeInterface { private targetHash; private fileIDComputer; constructor(targetHash: CID_ALGORITHM_NAMES[], workerPath?: string); computeMissingHash(filePath: string, metadata: MultiHashData): Promise; } interface Properties { TARGET_HASHES: string; INDEX_FILE_PATH: string; } interface FileProcessorInterface { processFile(current: number, queueSize: number, nfoFilePath: string): Promise; canProcessFile(filePath: string): Promise; deleteFile(filePath: string): 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, ComputeHashIndexCache, ComputeInterface, FileIDComputer, type FileProcessorInterface, FolderWatcher, HashComputer, HashIndexManager, INDEX_HEADERS, MultiHashData, type Properties, existsAsync };