jon.recoil.org

Source file widget_view.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
(** Serializable view descriptions for interactive widgets.

    No closures, no JS references. Event handlers are symbolic
    string identifiers resolved by the worker's handler registry. *)

type event_id = string

type attr =
  | Property of string * string
  | Style of string * string
  | Class of string
  | Handler of string * event_id  (** event name, handler id *)

type node =
  | Text of string
  | Element of { tag : string; attrs : attr list; children : node list }
  | Managed of { kind : string; config : string }

type event_msg = {
  handler_id : event_id;
  event_type : string;
  value : string option;
}