@dcl/react-ecs 0.0.1-3038080345.commit-de046a3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # React ECS
@@ -0,0 +1,236 @@
1
+ export declare const CANVAS_ROOT_ENTITY = 7;
2
+
3
+ export declare type Children = any;
4
+
5
+ export declare type CommonProps = {
6
+ key: Key;
7
+ children: Children;
8
+ };
9
+
10
+ export declare function Container({ width, height, children }: ContainerPropTypes): ReactEcs.JSX.Element;
11
+
12
+ export declare type ContainerPropTypes = Partial<CommonProps> & EntityPropTypes['uiTransform'];
13
+
14
+ declare type EcsElements = {
15
+ entity: Partial<EntityComponents & CommonProps>;
16
+ };
17
+
18
+ declare type EntityComponents = {
19
+ uiTransform: PBUiTransform;
20
+ };
21
+
22
+ /**
23
+ * @public
24
+ */
25
+ export declare type EntityPropTypes = {
26
+ uiTransform?: UiTransformProps;
27
+ };
28
+
29
+ declare namespace JSX {
30
+ interface Element {
31
+ }
32
+ type IntrinsicElements = EcsElements;
33
+ interface Component {
34
+ }
35
+ }
36
+
37
+ export declare type Key = number | string;
38
+
39
+ export declare interface PBUiTransform {
40
+ parent: number;
41
+ rightOf: number;
42
+ positionType: YGPositionType;
43
+ alignContent: YGAlign;
44
+ alignItems: YGAlign;
45
+ alignSelf: YGAlign;
46
+ flexDirection: YGFlexDirection;
47
+ flexWrap: YGWrap;
48
+ justifyContent: YGJustify;
49
+ overflow: YGOverflow;
50
+ display: YGDisplay;
51
+ direction: YGDirection;
52
+ flex: number;
53
+ flexBasisUnit: YGUnit;
54
+ flexBasis: number;
55
+ flexGrow: number;
56
+ flexShrink: number;
57
+ widthUnit: YGUnit;
58
+ width: number;
59
+ heightUnit: YGUnit;
60
+ height: number;
61
+ minWidthUnit: YGUnit;
62
+ minWidth: number;
63
+ minHeightUnit: YGUnit;
64
+ minHeight: number;
65
+ maxWidthUnit: YGUnit;
66
+ maxWidth: number;
67
+ maxHeightUnit: YGUnit;
68
+ maxHeight: number;
69
+ positionLeftUnit: YGUnit;
70
+ positionLeft: number;
71
+ positionTopUnit: YGUnit;
72
+ positionTop: number;
73
+ positionRightUnit: YGUnit;
74
+ positionRight: number;
75
+ positionBottomUnit: YGUnit;
76
+ positionBottom: number;
77
+ /** margin */
78
+ marginLeftUnit: YGUnit;
79
+ marginLeft: number;
80
+ marginTopUnit: YGUnit;
81
+ marginTop: number;
82
+ marginRightUnit: YGUnit;
83
+ marginRight: number;
84
+ marginBottomUnit: YGUnit;
85
+ marginBottom: number;
86
+ paddingLeftUnit: YGUnit;
87
+ paddingLeft: number;
88
+ paddingTopUnit: YGUnit;
89
+ paddingTop: number;
90
+ paddingRightUnit: YGUnit;
91
+ paddingRight: number;
92
+ paddingBottomUnit: YGUnit;
93
+ paddingBottom: number;
94
+ borderLeft: number;
95
+ borderTop: number;
96
+ borderRight: number;
97
+ borderBottom: number;
98
+ }
99
+
100
+ /**
101
+ * @public
102
+ */
103
+ export declare type Position = {
104
+ top: number | string;
105
+ right: number | string;
106
+ bottom: number | string;
107
+ left: number | string;
108
+ };
109
+
110
+ declare namespace ReactEcs {
111
+ namespace JSX {
112
+ interface Element {
113
+ }
114
+ type IntrinsicElements = EcsElements;
115
+ interface Component {
116
+ }
117
+ }
118
+ const createElement: any;
119
+ }
120
+ export { ReactEcs }
121
+ export default ReactEcs;
122
+
123
+ export declare function removeUi(index: number): void;
124
+
125
+ export declare function renderUi(ui: UiComponent): number;
126
+
127
+ export declare type UiComponent = () => JSX.Element;
128
+
129
+ /**
130
+ * @public
131
+ */
132
+ export declare function UiEntity(props: EntityPropTypes & Partial<CommonProps>): ReactEcs.JSX.Element;
133
+
134
+ /**
135
+ * @public
136
+ */
137
+ export declare interface UiTransformProps {
138
+ display?: YGDisplay;
139
+ flex?: number;
140
+ justifyContent?: YGJustify;
141
+ positionType?: YGPositionType;
142
+ alignItems?: YGAlign;
143
+ alignSelf?: YGAlign;
144
+ alignContent?: YGAlign;
145
+ flexDirection?: YGFlexDirection;
146
+ position?: Position;
147
+ padding?: Position;
148
+ margin?: Position;
149
+ border?: Position;
150
+ direction?: YGDirection;
151
+ width?: number;
152
+ height?: number;
153
+ minWidth?: number;
154
+ maxWidth?: number;
155
+ minHeight?: number;
156
+ maxHeight?: number;
157
+ flexWrap?: YGWrap;
158
+ flexBasis?: number;
159
+ flexGrow?: number;
160
+ flexShrink?: number;
161
+ overflow?: YGOverflow;
162
+ }
163
+
164
+ export declare enum YGAlign {
165
+ YGAlignAuto = 0,
166
+ YGAlignFlexStart = 1,
167
+ YGAlignCenter = 2,
168
+ YGAlignFlexEnd = 3,
169
+ YGAlignStretch = 4,
170
+ YGAlignBaseline = 5,
171
+ YGAlignSpaceBetween = 6,
172
+ YGAlignSpaceAround = 7,
173
+ UNRECOGNIZED = -1
174
+ }
175
+
176
+ export declare enum YGDirection {
177
+ YGDirectionInherit = 0,
178
+ YGDirectionLTR = 1,
179
+ YGDirectionRTL = 2,
180
+ UNRECOGNIZED = -1
181
+ }
182
+
183
+ export declare enum YGDisplay {
184
+ YGDisplayFlex = 0,
185
+ YGDisplayNone = 1,
186
+ UNRECOGNIZED = -1
187
+ }
188
+
189
+ export declare enum YGFlexDirection {
190
+ YGFlexDirectionColumn = 0,
191
+ YGFlexDirectionColumnReverse = 1,
192
+ YGFlexDirectionRow = 2,
193
+ YGFlexDirectionRowReverse = 3,
194
+ UNRECOGNIZED = -1
195
+ }
196
+
197
+ export declare enum YGJustify {
198
+ YGJustifyFlexStart = 0,
199
+ YGJustifyCenter = 1,
200
+ YGJustifyFlexEnd = 2,
201
+ YGJustifySpaceBetween = 3,
202
+ YGJustifySpaceAround = 4,
203
+ YGJustifySpaceEvenly = 5,
204
+ UNRECOGNIZED = -1
205
+ }
206
+
207
+ export declare enum YGOverflow {
208
+ YGOverflowVisible = 0,
209
+ YGOverflowHidden = 1,
210
+ YGOverflowScroll = 2,
211
+ UNRECOGNIZED = -1
212
+ }
213
+
214
+ export declare enum YGPositionType {
215
+ YGPositionTypeStatic = 0,
216
+ YGPositionTypeRelative = 1,
217
+ YGPositionTypeAbsolute = 2,
218
+ UNRECOGNIZED = -1
219
+ }
220
+
221
+ export declare enum YGUnit {
222
+ YGUnitUndefined = 0,
223
+ YGUnitPoint = 1,
224
+ YGUnitPercent = 2,
225
+ YGUnitAuto = 3,
226
+ UNRECOGNIZED = -1
227
+ }
228
+
229
+ export declare enum YGWrap {
230
+ YGWrapNoWrap = 0,
231
+ YGWrapWrap = 1,
232
+ YGWrapWrapReverse = 2,
233
+ UNRECOGNIZED = -1
234
+ }
235
+
236
+ export { }