UNPKG

@yarnpkg/pnpify

Version:
23 lines (22 loc) 927 B
import { Filename, PortablePath, Watcher, WatchCallback } from '@yarnpkg/fslib'; import { EventEmitter } from 'events'; import { ResolvedPath } from './resolveNodeModulesPath'; declare class WatchEventEmitter extends EventEmitter { private dirWatchers; private watchPath; private watcherId; constructor(dirWatchers: DirectoryWatcherMap, watchPath: PortablePath, watcherId: number); close(): void; } type DirectoryWatcherMap = Map<PortablePath, DirectoryWatcher>; interface DirectoryWatcher { eventEmitters: Map<number, Watcher & EventEmitter>; dirEntries: Set<Filename>; } export declare class WatchManager extends EventEmitter { private readonly dirWatchers; private lastWatcherId; registerWatcher(watchPath: PortablePath, dirList: Set<Filename>, callback: WatchCallback): WatchEventEmitter; notifyWatchers(resolvePath: (nodePath: PortablePath) => ResolvedPath): void; } export {};