-
Notifications
You must be signed in to change notification settings - Fork 17
/
Brisk_reconciler.rei
108 lines (86 loc) · 2.81 KB
/
Brisk_reconciler.rei
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
module type OutputTree = {
type node;
let markAsStale: unit => unit;
let beginChanges: unit => unit;
let commitChanges: unit => unit;
let insertNode: (~parent: node, ~child: node, ~position: int) => node;
let deleteNode: (~parent: node, ~child: node) => node;
let moveNode: (~parent: node, ~child: node, ~from: int, ~to_: int) => node;
};
module Make:
(OutputTree: OutputTree) =>
{
module GlobalState: {
let debug: ref(bool);
let reset: unit => unit;
/**
* Use physical equality to recognize that an element was added to the list of children.
* Note: this currently does not check for pending updates on components in the list.
*/
let useTailHack: ref(bool);
};
module Key: {
type t;
let create: unit => t;
};
/** Type of element returned from render */
type syntheticElement;
/** Type of element that renders an output node */
type outputTreeElement('slots, 'nextSlots) = {
make: unit => OutputTree.node,
configureInstance:
(~isFirstRender: bool, OutputTree.node) => OutputTree.node,
children: syntheticElement,
};
type elementType('concreteElementType, 'outputNodeType, 'state, 'action);
type outputNodeGroup;
type outputNodeContainer;
type component('slots, 'nextSlots, 'elementType, 'outputNodeType);
let element:
(
~key: Key.t=?,
component('slots, 'nextSlots, 'elementType, 'hostOutputNode)
) =>
syntheticElement;
let listToElement: list(syntheticElement) => syntheticElement;
module RenderedElement: {
/** Type of a react element after rendering */
type t;
/** Render one element by creating new instances. */
let render: (OutputTree.node, syntheticElement) => t;
/** Update a rendered element when a new react element is received. */
let update:
(
~previousElement: syntheticElement,
~renderedElement: t,
syntheticElement
) =>
t;
/** Flush pending state updates (and possibly add new ones). */
let flushPendingUpdates: t => t;
let executeHostViewUpdates: t => OutputTree.node;
let executePendingEffects: t => t;
};
let component:
(
~useDynamicKey: bool=?,
string,
Hooks.t('slots, 'nextSlots) => syntheticElement
) =>
component('slots, 'nextSlots, syntheticElement, outputNodeGroup);
let nativeComponent:
(
~useDynamicKey: bool=?,
string,
Hooks.t('slots, 'nextSlots) => outputTreeElement('slots, 'nextSlots)
) =>
component(
'slots,
'nextSlots,
outputTreeElement('slots, 'nextSlots),
outputNodeContainer,
);
module Slots = Slots;
module Hooks = Hooks;
module RemoteAction = RemoteAction;
};