WXL
3 天以前 3bd962a6d7f61239c020e2dbbeb7341e5b842dd1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
declare namespace _exports {
    export {
        EventMap,
        DirectoryWatcherOptions,
        DirectoryWatcherEvents,
        FileWatcherEvents,
        Watcher,
    };
}
declare function _exports(options: DirectoryWatcherOptions): WatcherManager;
declare namespace _exports {
    export { WatcherManager };
}
export = _exports;
type EventMap = import("./index").EventMap;
type DirectoryWatcherOptions =
    import("./DirectoryWatcher").DirectoryWatcherOptions;
type DirectoryWatcherEvents =
    import("./DirectoryWatcher").DirectoryWatcherEvents;
type FileWatcherEvents = import("./DirectoryWatcher").FileWatcherEvents;
type Watcher<T extends EventMap> = import("./DirectoryWatcher").Watcher<T>;
/** @typedef {import("./index").EventMap} EventMap */
/** @typedef {import("./DirectoryWatcher").DirectoryWatcherOptions} DirectoryWatcherOptions */
/** @typedef {import("./DirectoryWatcher").DirectoryWatcherEvents} DirectoryWatcherEvents */
/** @typedef {import("./DirectoryWatcher").FileWatcherEvents} FileWatcherEvents */
/**
 * @template {EventMap} T
 * @typedef {import("./DirectoryWatcher").Watcher<T>} Watcher
 */
declare class WatcherManager {
    /**
     * @param {DirectoryWatcherOptions=} options options
     */
    constructor(options?: DirectoryWatcherOptions | undefined);
    options: DirectoryWatcher.DirectoryWatcherOptions;
    /** @type {Map<string, DirectoryWatcher>} */
    directoryWatchers: Map<string, DirectoryWatcher>;
    /**
     * @param {string} directory a directory
     * @returns {DirectoryWatcher} a directory watcher
     */
    getDirectoryWatcher(directory: string): DirectoryWatcher;
    /**
     * @param {string} file file
     * @param {number=} startTime start time
     * @returns {Watcher<FileWatcherEvents> | null} watcher or null if file has no directory
     */
    watchFile(
        file: string,
        startTime?: number | undefined,
    ): Watcher<FileWatcherEvents> | null;
    /**
     * @param {string} directory directory
     * @param {number=} startTime start time
     * @returns {Watcher<DirectoryWatcherEvents>} watcher
     */
    watchDirectory(
        directory: string,
        startTime?: number | undefined,
    ): Watcher<DirectoryWatcherEvents>;
}
import DirectoryWatcher = require("./DirectoryWatcher");