FSEventsWatcher.d.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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" />
  9. import { EventEmitter } from 'events';
  10. import anymatch from 'anymatch';
  11. import { Watcher } from 'fsevents';
  12. /**
  13. * Export `FSEventsWatcher` class.
  14. * Watches `dir`.
  15. */
  16. declare class FSEventsWatcher extends EventEmitter {
  17. readonly root: string;
  18. readonly ignored?: anymatch.Matcher;
  19. readonly glob: Array<string>;
  20. readonly dot: boolean;
  21. readonly hasIgnore: boolean;
  22. readonly doIgnore: (path: string) => boolean;
  23. readonly watcher: Watcher;
  24. private _tracked;
  25. static isSupported(): boolean;
  26. private static normalizeProxy;
  27. private static recReaddir;
  28. constructor(dir: string, opts: {
  29. root: string;
  30. ignored?: anymatch.Matcher;
  31. glob: string | Array<string>;
  32. dot: boolean;
  33. });
  34. /**
  35. * End watching.
  36. */
  37. close(callback?: () => void): void;
  38. private isFileIncluded;
  39. private handleEvent;
  40. /**
  41. * Emit events.
  42. */
  43. private _emit;
  44. }
  45. export = FSEventsWatcher;
  46. //# sourceMappingURL=FSEventsWatcher.d.ts.map