1 |
|
2 | import { Filename, PortablePath, Watcher, WatchCallback } from '@yarnpkg/fslib';
|
3 | import { EventEmitter } from 'events';
|
4 | import { ResolvedPath } from './resolveNodeModulesPath';
|
5 | declare class WatchEventEmitter extends EventEmitter {
|
6 | private dirWatchers;
|
7 | private watchPath;
|
8 | private watcherId;
|
9 | constructor(dirWatchers: DirectoryWatcherMap, watchPath: PortablePath, watcherId: number);
|
10 | close(): void;
|
11 | }
|
12 | type DirectoryWatcherMap = Map<PortablePath, DirectoryWatcher>;
|
13 | interface DirectoryWatcher {
|
14 | eventEmitters: Map<number, Watcher & EventEmitter>;
|
15 | dirEntries: Set<Filename>;
|
16 | }
|
17 | export declare class WatchManager extends EventEmitter {
|
18 | private readonly dirWatchers;
|
19 | private lastWatcherId;
|
20 | registerWatcher(watchPath: PortablePath, dirList: Set<Filename>, callback: WatchCallback): WatchEventEmitter;
|
21 | notifyWatchers(resolvePath: (nodePath: PortablePath) => ResolvedPath): void;
|
22 | }
|
23 | export {};
|