module Watch:sig
..end
type
t
type
config
val config : ?persistent:Js.boolean ->
?recursive:Js.boolean ->
?encoding:Js_string.t -> unit -> config
val watch : string -> ?config:config -> unit -> t
val on : [ `change of
([ `Arity_2 of string * Node.string_buffer ], unit) Js.Internal.fn
| `error of ([ `Arity_0 ], unit) Js.Internal.fn ] ->
t -> t
watcher
back it can register event listener there .
Currently we introduce a type string_buffer
, for the
filename
, it will be Buffer
when the encoding is `utf8.
This is dependent type which can be tracked by GADT in some way,
but to make things simple, let's just introduce an or typeval close : t -> unit