UNPKG

1.19 kBTypeScriptView Raw
1/**
2 * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 *
7 */
8/// <reference types="node" />
9import { EventEmitter } from 'events';
10import { Matcher } from 'anymatch';
11/**
12 * Export `FSEventsWatcher` class.
13 * Watches `dir`.
14 */
15declare class FSEventsWatcher extends EventEmitter {
16 readonly root: string;
17 readonly ignored?: Matcher;
18 readonly glob: Array<string>;
19 readonly dot: boolean;
20 readonly hasIgnore: boolean;
21 readonly doIgnore: (path: string) => boolean;
22 readonly fsEventsWatchStopper: () => Promise<void>;
23 private _tracked;
24 static isSupported(): boolean;
25 private static normalizeProxy;
26 private static recReaddir;
27 constructor(dir: string, opts: {
28 root: string;
29 ignored?: Matcher;
30 glob: string | Array<string>;
31 dot: boolean;
32 });
33 /**
34 * End watching.
35 */
36 close(callback?: () => void): Promise<void>;
37 private isFileIncluded;
38 private handleEvent;
39 /**
40 * Emit events.
41 */
42 private _emit;
43}
44export = FSEventsWatcher;