FsEvent.hx 776 B

123456789101112131415161718192021222324252627282930313233343536
  1. package eval.luv;
  2. enum abstract FsEventType(Int) {
  3. var RENAME = 0;
  4. var CHANGE = 1;
  5. }
  6. enum abstract FsEventFlag(Int) {
  7. var FS_EVENT_WATCH_ENTRY = 0;
  8. var FS_EVENT_STAT = 1;
  9. var FS_EVENT_RECURSIVE = 2;
  10. }
  11. /**
  12. Filesystem events.
  13. @see https://aantron.github.io/luv/luv/Luv/FS_event
  14. **/
  15. @:using(eval.luv.Handle)
  16. @:coreType abstract FsEvent to Handle {
  17. /**
  18. Allocates and initializes an FS event handle.
  19. **/
  20. static public function init(loop:Loop):Result<FsEvent>;
  21. /**
  22. Starts the handle and watches the given path for changes.
  23. **/
  24. public function start(path:NativeString, ?flags:Array<FsEventFlag>, callback:(result:Result<{file:NativeString,events:Array<FsEventType>}>)->Void):Void;
  25. /**
  26. Stops the handle.
  27. **/
  28. public function stop():Result<Result.NoData>;
  29. }