21 wiersze
602 B
OCaml
21 wiersze
602 B
OCaml
open Notty
|
|
open Nottui
|
|
|
|
type event = [
|
|
| `Key of Unescape.key
|
|
| `Mouse of Unescape.mouse
|
|
| `Paste of Unescape.paste
|
|
| `Resize of int * int
|
|
]
|
|
(** FIXME: Refactor to use [Nottui.Ui.event]? *)
|
|
|
|
val render : ?quit:unit Lwt.t -> size:int * int -> event Lwt_stream.t -> ui Lwd.t -> image Lwt_stream.t
|
|
(** Turn a stream of events into a stream of images. *)
|
|
|
|
val run : (*?term:Term.t ->*) ?quit:unit Lwt.t -> ui Lwd.t -> unit Lwt.t
|
|
(** Run mainloop in [Lwt], until the [quit] promise is fulfilled.
|
|
|
|
The ui is a normal [Lwd.t] value, but events are free to spawn asynchronous
|
|
[Lwt] threads.
|
|
*)
|