Source

screentime-monitor / client_common.mli

Full commit
open Core.Std
open Async.Std

module Config : sig
  type t = { server: string
           ; user: Username.t sexp_option
           } 
  with sexp
end

val load_config : unit -> Config.t Deferred.t
val get_username : unit -> Username.t Deferred.t
val setup_conn
  :  Username.t option
  -> (Username.t -> Rpc.Connection.t -> 'a Deferred.t)
  -> 'a Deferred.t

val username_spec : Username.t Command.Spec.Arg_type.t
val category_spec : Category.t Command.Spec.Arg_type.t

(** Returns a deferred which becomes determined when the term signal
    is hit *)
val on_term_signal : unit Deferred.t lazy_t
val shared_flags : unit -> (Username.t option -> 'a, 'a) Command.Spec.t
val days_flag : unit -> int Command.Spec.param
val edit_file
  : (module Core.Std.Sexpable with type t = 'a)
  -> editor:string
  -> tempfile:string
  -> 'a With_format.t option Deferred.t

val shell_run : string -> string list -> string Deferred.t
val clear_string : string Deferred.t lazy_t