@tempfix/watcher
Version:
The file system watcher that strives for perfection, with no native dependencies and optional rename detection support.
33 lines (32 loc) • 1.25 kB
TypeScript
import { TargetEvent } from './enums.js';
import type Watcher from './watcher.js';
import type { Path, LocksAdd, LocksUnlink, LocksPair, LockConfig } from './types.js';
declare class WatcherLocker {
_locksAdd: LocksAdd;
_locksAddDir: LocksAdd;
_locksUnlink: LocksUnlink;
_locksUnlinkDir: LocksUnlink;
_locksDir: LocksPair;
_locksFile: LocksPair;
_watcher: Watcher;
static DIR_EVENTS: {
readonly add: TargetEvent.ADD_DIR;
readonly rename: TargetEvent.RENAME_DIR;
readonly unlink: TargetEvent.UNLINK_DIR;
};
static FILE_EVENTS: {
readonly add: TargetEvent.ADD;
readonly change: TargetEvent.CHANGE;
readonly rename: TargetEvent.RENAME;
readonly unlink: TargetEvent.UNLINK;
};
constructor(watcher: Watcher);
getLockAdd(config: LockConfig, timeout?: number): void;
getLockUnlink(config: LockConfig, timeout?: number): void;
getLockTargetAdd(targetPath: Path, timeout?: number): void;
getLockTargetAddDir(targetPath: Path, timeout?: number): void;
getLockTargetUnlink(targetPath: Path, timeout?: number): void;
getLockTargetUnlinkDir(targetPath: Path, timeout?: number): void;
reset(): void;
}
export default WatcherLocker;