Skip to content

Commit b898c63

Browse files
committed
Add module documentation
1 parent c0efb74 commit b898c63

File tree

2 files changed

+361
-0
lines changed

2 files changed

+361
-0
lines changed

docs/React.md

Lines changed: 207 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,207 @@
1+
## Module React
2+
3+
#### `DOM`
4+
5+
``` purescript
6+
data DOM :: !
7+
```
8+
9+
#### `UI`
10+
11+
``` purescript
12+
data UI :: *
13+
```
14+
15+
#### `UIRef`
16+
17+
``` purescript
18+
data UIRef :: # ! -> *
19+
```
20+
21+
#### `EventHandler`
22+
23+
``` purescript
24+
data EventHandler :: * -> *
25+
```
26+
27+
#### `Disallowed`
28+
29+
``` purescript
30+
data Disallowed :: !
31+
```
32+
33+
#### `ReadAllowed`
34+
35+
``` purescript
36+
data ReadAllowed :: !
37+
```
38+
39+
#### `WriteAllowed`
40+
41+
``` purescript
42+
data WriteAllowed :: !
43+
```
44+
45+
#### `ReactState`
46+
47+
``` purescript
48+
data ReactState :: # ! -> * -> !
49+
```
50+
51+
#### `ReactProps`
52+
53+
``` purescript
54+
data ReactProps :: * -> !
55+
```
56+
57+
#### `ReactRefs`
58+
59+
``` purescript
60+
data ReactRefs :: * -> !
61+
```
62+
63+
#### `noop0`
64+
65+
``` purescript
66+
noop0 :: forall eff result. Eff eff result
67+
```
68+
69+
#### `noop1`
70+
71+
``` purescript
72+
noop1 :: forall a eff result. a -> Eff eff result
73+
```
74+
75+
#### `noop2`
76+
77+
``` purescript
78+
noop2 :: forall a b eff result. a -> b -> Eff eff result
79+
```
80+
81+
#### `Render`
82+
83+
``` purescript
84+
type Render props refs state eff = Eff (props :: ReactProps props, refs :: Disallowed, state :: ReactState (read :: ReadAllowed) state | eff) UI
85+
```
86+
87+
#### `UISpec`
88+
89+
``` purescript
90+
type UISpec props refs state eff1 eff2 eff3 eff4 eff5 eff6 eff7 eff8 = { getInitialState :: Eff (props :: ReactProps props, state :: Disallowed, refs :: Disallowed | eff1) state, componentWillMount :: Eff (props :: ReactProps props, state :: ReactState (read :: ReadAllowed, write :: WriteAllowed) state, refs :: Disallowed | eff2) Unit, componentDidMount :: Eff (props :: ReactProps props, state :: ReactState (read :: ReadAllowed, write :: WriteAllowed) state, refs :: ReactRefs refs | eff3) Unit, componentWillReceiveProps :: props -> Eff (props :: ReactProps props, state :: ReactState (read :: ReadAllowed, write :: WriteAllowed) state, refs :: ReactRefs refs | eff4) Unit, shouldComponentUpdate :: props -> state -> Eff (props :: ReactProps props, state :: ReactState (read :: ReadAllowed, write :: WriteAllowed) state, refs :: ReactRefs refs | eff5) Boolean, componentWillUpdate :: props -> state -> Eff (props :: ReactProps props, state :: ReactState (read :: ReadAllowed, write :: WriteAllowed) state, refs :: ReactRefs refs | eff6) Unit, componentDidUpdate :: props -> state -> Eff (props :: ReactProps props, state :: ReactState (read :: ReadAllowed) state, refs :: ReactRefs refs | eff7) Unit, componentWillUnmount :: Eff (props :: ReactProps props, state :: ReactState (read :: ReadAllowed) state, refs :: ReactRefs refs | eff8) Unit }
91+
```
92+
93+
#### `spec`
94+
95+
``` purescript
96+
spec :: forall props refs state eff1 eff2 eff3 eff4 eff5 eff6 eff7 eff8. UISpec props refs state eff1 eff2 eff3 eff4 eff5 eff6 eff7 eff8
97+
```
98+
99+
#### `getProps`
100+
101+
``` purescript
102+
getProps :: forall props eff. Eff (props :: ReactProps props | eff) props
103+
```
104+
105+
#### `getRefs`
106+
107+
``` purescript
108+
getRefs :: forall refs eff. Eff (refs :: ReactRefs refs | eff) refs
109+
```
110+
111+
#### `writeState`
112+
113+
``` purescript
114+
writeState :: forall state statePerms eff. state -> Eff (state :: ReactState (read :: ReadAllowed, write :: WriteAllowed | statePerms) state | eff) state
115+
```
116+
117+
#### `readState`
118+
119+
``` purescript
120+
readState :: forall state statePerms eff. Eff (state :: ReactState (read :: ReadAllowed | statePerms) state | eff) state
121+
```
122+
123+
#### `getSelf`
124+
125+
``` purescript
126+
getSelf :: forall eff. Eff eff (UIRef eff)
127+
```
128+
129+
#### `runUI`
130+
131+
``` purescript
132+
runUI :: forall refEff eff result. UIRef refEff -> Eff refEff result -> Eff eff result
133+
```
134+
135+
#### `mkUI`
136+
137+
``` purescript
138+
mkUI :: forall props refs state eff eff1 eff2 eff3 eff4 eff5 eff6 eff7 eff8. UISpec props refs state eff1 eff2 eff3 eff4 eff5 eff6 eff7 eff8 -> Render props refs state eff -> props -> UI
139+
```
140+
141+
#### `DOMEvent`
142+
143+
``` purescript
144+
type DOMEvent = forall attrs. { | attrs }
145+
```
146+
147+
#### `DOMEventTarget`
148+
149+
``` purescript
150+
type DOMEventTarget = forall attrs. { | attrs }
151+
```
152+
153+
#### `Event`
154+
155+
``` purescript
156+
type Event = { bubbles :: Boolean, cancelable :: Boolean, currentTarget :: DOMEventTarget, defaultPrevented :: Boolean, eventPhase :: Number, isTrusted :: Boolean, nativeEvent :: DOMEvent, preventDefault :: { } -> { }, stopPropagation :: { } -> { }, target :: DOMEventTarget, timeStamp :: Number, eventType :: String }
157+
```
158+
159+
#### `MouseEvent`
160+
161+
``` purescript
162+
type MouseEvent = { pageX :: Number, pageY :: Number }
163+
```
164+
165+
#### `KeyboardEvent`
166+
167+
``` purescript
168+
type KeyboardEvent = { altKey :: Boolean, ctrlKey :: Boolean, charCode :: Number, key :: String, keyCode :: Number, locale :: String, location :: Number, metaKey :: Boolean, repeat :: Boolean, shiftKey :: Boolean, which :: Number }
169+
```
170+
171+
#### `EventHandlerContext`
172+
173+
``` purescript
174+
type EventHandlerContext eff props refs state result = forall statePerms. Eff (props :: ReactProps props, refs :: ReactRefs refs, state :: ReactState (read :: ReadAllowed, write :: WriteAllowed | statePerms) state | eff) result
175+
```
176+
177+
#### `handle`
178+
179+
``` purescript
180+
handle :: forall eff ev props refs state result. (ev -> EventHandlerContext eff props refs state result) -> EventHandler ev
181+
```
182+
183+
#### `renderToString`
184+
185+
``` purescript
186+
renderToString :: UI -> String
187+
```
188+
189+
#### `renderToBody`
190+
191+
``` purescript
192+
renderToBody :: forall eff. UI -> Eff (dom :: DOM | eff) UI
193+
```
194+
195+
#### `renderToElementById`
196+
197+
``` purescript
198+
renderToElementById :: forall eff. String -> UI -> Eff (dom :: DOM | eff) UI
199+
```
200+
201+
#### `deferred`
202+
203+
``` purescript
204+
deferred :: forall a eff. Eff eff a -> Eff eff a
205+
```
206+
207+

docs/React/DOM.md

Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
## Module React.DOM
2+
3+
#### `mkDOM`
4+
5+
``` purescript
6+
mkDOM :: forall s dataAttrs ariaAttrs eff props state. String -> Array (DOMProps s dataAttrs ariaAttrs eff props state) -> Array UI -> UI
7+
```
8+
9+
#### `text`
10+
11+
``` purescript
12+
text :: String -> UI
13+
```
14+
15+
#### `DOMProps`
16+
17+
``` purescript
18+
data DOMProps s dataAttrs ariaAttrs eff props state
19+
= Accept String
20+
| AccessKey String
21+
| Action String
22+
| AllowFullScreen String
23+
| AllowTransparency String
24+
| Alt String
25+
| Aria { | ariaAttrs }
26+
| Async String
27+
| AutoComplete String
28+
| AutoFocus String
29+
| AutoPlay String
30+
| CellPadding String
31+
| CellSpacing String
32+
| CharSet String
33+
| Checked String
34+
| ClassName String
35+
| Cols String
36+
| ColSpan String
37+
| Content String
38+
| ContentEditable String
39+
| ContextMenu String
40+
| Controls String
41+
| CrossOrigin String
42+
| Data { | dataAttrs }
43+
| DateTime String
44+
| Defer String
45+
| Dir String
46+
| Disabled String
47+
| Download String
48+
| Draggable String
49+
| EncType String
50+
| Form String
51+
| FormNoValidate String
52+
| FrameBorder String
53+
| Height String
54+
| Hidden String
55+
| Href String
56+
| HrefLang String
57+
| HtmlFor String
58+
| HttpEquiv String
59+
| Icon String
60+
| Id String
61+
| Label String
62+
| Lang String
63+
| List String
64+
| Loop String
65+
| Max String
66+
| MaxLength String
67+
| MediaGroup String
68+
| Method String
69+
| Min String
70+
| Multiple String
71+
| Muted String
72+
| Name String
73+
| NoValidate String
74+
| Pattern String
75+
| Placeholder String
76+
| Poster String
77+
| Preload String
78+
| RadioGroup String
79+
| ReadOnly String
80+
| Rel String
81+
| Required String
82+
| Role String
83+
| Rows String
84+
| RowSpan String
85+
| Sandbox String
86+
| Scope String
87+
| ScrollLeft String
88+
| Scrolling String
89+
| ScrollTop String
90+
| Seamless String
91+
| Selected String
92+
| Size String
93+
| Span String
94+
| SpellCheck String
95+
| Src String
96+
| SrcDoc String
97+
| SrcSet String
98+
| Start String
99+
| Step String
100+
| Style { | s }
101+
| TabIndex String
102+
| Target String
103+
| Title String
104+
| Type String
105+
| Value String
106+
| Width String
107+
| Wmode String
108+
| AutoCapitalize String
109+
| AutoCorrect String
110+
| Property String
111+
| Ref String
112+
| Key String
113+
| DangerouslySetInnerHTML { __html :: String }
114+
| OnBlur (EventHandler Event)
115+
| OnChange (EventHandler Event)
116+
| OnContextMenu (EventHandler Event)
117+
| OnCopy (EventHandler Event)
118+
| OnCut (EventHandler Event)
119+
| OnClick (EventHandler MouseEvent)
120+
| OnDoubleClick (EventHandler MouseEvent)
121+
| OnDrag (EventHandler MouseEvent)
122+
| OnDragEnd (EventHandler MouseEvent)
123+
| OnDragEnter (EventHandler MouseEvent)
124+
| OnDragExit (EventHandler MouseEvent)
125+
| OnDragLeave (EventHandler MouseEvent)
126+
| OnDragOver (EventHandler MouseEvent)
127+
| OnDragStart (EventHandler MouseEvent)
128+
| OnDrop (EventHandler Event)
129+
| OnError (EventHandler Event)
130+
| OnFocus (EventHandler Event)
131+
| OnInput (EventHandler Event)
132+
| OnKeyDown (EventHandler KeyboardEvent)
133+
| OnKeyPress (EventHandler KeyboardEvent)
134+
| OnKeyUp (EventHandler KeyboardEvent)
135+
| OnLoad (EventHandler Event)
136+
| OnMouseEnter (EventHandler MouseEvent)
137+
| OnMouseLeave (EventHandler MouseEvent)
138+
| OnMouseDown (EventHandler MouseEvent)
139+
| OnMouseMove (EventHandler MouseEvent)
140+
| OnMouseOut (EventHandler MouseEvent)
141+
| OnMouseOver (EventHandler MouseEvent)
142+
| OnMouseUp (EventHandler MouseEvent)
143+
| OnPaste (EventHandler Event)
144+
| OnReset (EventHandler Event)
145+
| OnScroll (EventHandler Event)
146+
| OnSubmit (EventHandler Event)
147+
| OnTouchCancel (EventHandler Event)
148+
| OnTouchEnd (EventHandler Event)
149+
| OnTouchMove (EventHandler Event)
150+
| OnTouchStart (EventHandler Event)
151+
| OnWheel (EventHandler Event)
152+
```
153+
154+

0 commit comments

Comments
 (0)