package html_of_jsx

  1. Overview
  2. Docs

Source file Ppx_attributes.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
(** List of attributes that bring type-safety and attribute validation based on the tag. Used at compile-time by the ppx. *)

type attributeType =
  | String
  | Int
  | Bool
  (* RooleanishString are attributes that are boolean values but represented as strings on the DOM.
     https://github.com/facebook/react/blob/a17467e7e2cd8947c595d1834889b5d184459f12/packages/react-dom-bindings/src/server/ReactFizzConfigDOM.js#L1165-L1176
  *)
  | BooleanishString
  | Style

type eventType =
  | Clipboard
  | Composition
  | Keyboard
  | Focus
  | Form
  | Mouse
  | Selection
  | Touch
  | UI
  | Wheel
  | Media
  | Image
  | Animation
  | Transition
  | Pointer
  | Inline
  | Drag

type attribute = { type_ : attributeType; name : string; jsxName : string }

type rich_attribute = {
  type_ : attributeType;
  name : string;
  jsxName : string;
  description : string;
  url : string;
}

type event = { type_ : eventType; jsxName : string }

type prop =
  | Attribute of attribute
  | Rich_attribute of rich_attribute
  | Event of event

type element = { tag : string; attributes : prop list }
OCaml

Innovation. Community. Security.