@vidocsecurity/cli 0.1.12

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.
Files changed (67) hide show
  1. package/dist/index.js +4115 -0
  2. package/dist/markdown.css +132 -0
  3. package/dist/node_modules/@node-rs/crc32/LICENSE +21 -0
  4. package/dist/node_modules/@node-rs/crc32/README.md +61 -0
  5. package/dist/node_modules/@node-rs/crc32/browser.js +1 -0
  6. package/dist/node_modules/@node-rs/crc32/index.d.ts +5 -0
  7. package/dist/node_modules/@node-rs/crc32/index.js +368 -0
  8. package/dist/node_modules/@node-rs/crc32/package.json +97 -0
  9. package/dist/node_modules/@vidocsecurity/code-context/languages.yaml +8332 -0
  10. package/dist/node_modules/@vidocsecurity/code-context/package.json +83 -0
  11. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-c-sharp.wasm +0 -0
  12. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-c.wasm +0 -0
  13. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-cpp.wasm +0 -0
  14. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-css.wasm +0 -0
  15. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-go.wasm +0 -0
  16. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-hcl.wasm +0 -0
  17. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-ini.wasm +0 -0
  18. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-java.wasm +0 -0
  19. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-javascript.wasm +0 -0
  20. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-python.wasm +0 -0
  21. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-regex.wasm +0 -0
  22. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-ruby.wasm +0 -0
  23. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-rust.wasm +0 -0
  24. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-tsx.wasm +0 -0
  25. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter-typescript.wasm +0 -0
  26. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter.js +4074 -0
  27. package/dist/node_modules/@vidocsecurity/code-context/wasm/tree-sitter.wasm +0 -0
  28. package/dist/node_modules/@vidocsecurity/code-context/wasm/web-tree-sitter.d.ts +1027 -0
  29. package/dist/node_modules/yoga-layout/README.md +40 -0
  30. package/dist/node_modules/yoga-layout/dist/binaries/yoga-wasm-base64-esm.js +75 -0
  31. package/dist/node_modules/yoga-layout/dist/src/generated/YGEnums.d.ts +189 -0
  32. package/dist/node_modules/yoga-layout/dist/src/generated/YGEnums.js +211 -0
  33. package/dist/node_modules/yoga-layout/dist/src/generated/YGEnums.js.map +1 -0
  34. package/dist/node_modules/yoga-layout/dist/src/index.d.ts +12 -0
  35. package/dist/node_modules/yoga-layout/dist/src/index.js +16 -0
  36. package/dist/node_modules/yoga-layout/dist/src/index.js.map +1 -0
  37. package/dist/node_modules/yoga-layout/dist/src/load.d.ts +11 -0
  38. package/dist/node_modules/yoga-layout/dist/src/load.js +17 -0
  39. package/dist/node_modules/yoga-layout/dist/src/load.js.map +1 -0
  40. package/dist/node_modules/yoga-layout/dist/src/wrapAssembly.d.ts +155 -0
  41. package/dist/node_modules/yoga-layout/dist/src/wrapAssembly.js +125 -0
  42. package/dist/node_modules/yoga-layout/dist/src/wrapAssembly.js.map +1 -0
  43. package/dist/node_modules/yoga-layout/package.json +53 -0
  44. package/dist/node_modules/yoga-layout/src/Config.cpp +54 -0
  45. package/dist/node_modules/yoga-layout/src/Config.h +44 -0
  46. package/dist/node_modules/yoga-layout/src/Layout.h +19 -0
  47. package/dist/node_modules/yoga-layout/src/Node.cpp +507 -0
  48. package/dist/node_modules/yoga-layout/src/Node.h +239 -0
  49. package/dist/node_modules/yoga-layout/src/Size.h +17 -0
  50. package/dist/node_modules/yoga-layout/src/Value.h +23 -0
  51. package/dist/node_modules/yoga-layout/src/embind.cpp +207 -0
  52. package/dist/node_modules/yoga-layout/src/generated/YGEnums.ts +210 -0
  53. package/dist/node_modules/yoga-layout/src/index.ts +23 -0
  54. package/dist/node_modules/yoga-layout/src/load.ts +25 -0
  55. package/dist/node_modules/yoga-layout/src/wrapAssembly.ts +336 -0
  56. package/dist/prebuilds/android-arm/classic-level.armv7.node +0 -0
  57. package/dist/prebuilds/android-arm64/classic-level.armv8.node +0 -0
  58. package/dist/prebuilds/darwin-x64+arm64/classic-level.node +0 -0
  59. package/dist/prebuilds/linux-arm/classic-level.armv6.node +0 -0
  60. package/dist/prebuilds/linux-arm/classic-level.armv7.node +0 -0
  61. package/dist/prebuilds/linux-arm64/classic-level.armv8.node +0 -0
  62. package/dist/prebuilds/linux-x64/classic-level.musl.node +0 -0
  63. package/dist/prebuilds/linux-x64/classic-level.node +0 -0
  64. package/dist/prebuilds/win32-ia32/classic-level.node +0 -0
  65. package/dist/prebuilds/win32-x64/classic-level.node +0 -0
  66. package/dist/version.txt +1 -0
  67. package/package.json +23 -0
@@ -0,0 +1,239 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #pragma once
9
+
10
+ #include <memory>
11
+
12
+ #include <emscripten/bind.h>
13
+ #include <yoga/Yoga.h>
14
+
15
+ #include "./Config.h"
16
+ #include "./Layout.h"
17
+ #include "./Size.h"
18
+ #include "./Value.h"
19
+
20
+ class MeasureCallback {
21
+ public:
22
+ virtual ~MeasureCallback() {}
23
+ virtual Size
24
+ measure(float width, int widthMode, float height, int heightMode) = 0;
25
+ };
26
+
27
+ class MeasureCallbackWrapper : public emscripten::wrapper<MeasureCallback> {
28
+ public:
29
+ EMSCRIPTEN_WRAPPER(MeasureCallbackWrapper);
30
+ Size measure(float width, int widthMode, float height, int heightMode) {
31
+ return call<Size>("measure", width, widthMode, height, heightMode);
32
+ }
33
+ };
34
+
35
+ class DirtiedCallback {
36
+ public:
37
+ virtual ~DirtiedCallback() {}
38
+ virtual void dirtied() = 0;
39
+ };
40
+
41
+ class DirtiedCallbackWrapper : public emscripten::wrapper<DirtiedCallback> {
42
+ public:
43
+ EMSCRIPTEN_WRAPPER(DirtiedCallbackWrapper);
44
+ void dirtied() {
45
+ return call<void>("dirtied");
46
+ }
47
+ };
48
+
49
+ class Node {
50
+ public:
51
+ static Node* createDefault(void);
52
+ static Node* createWithConfig(Config* config);
53
+
54
+ static void destroy(Node* node);
55
+
56
+ public:
57
+ static Node* fromYGNode(YGNodeRef nodeRef);
58
+
59
+ private:
60
+ Node(Config* config);
61
+
62
+ public:
63
+ ~Node(void);
64
+
65
+ public: // Prevent accidental copy
66
+ Node(Node const&) = delete;
67
+
68
+ Node const& operator=(Node const&) = delete;
69
+
70
+ public:
71
+ void reset(void);
72
+
73
+ public: // Style setters
74
+ void copyStyle(Node const& other);
75
+
76
+ void setPositionType(int positionType);
77
+ void setPosition(int edge, double position);
78
+ void setPositionPercent(int edge, double position);
79
+ void setPositionAuto(int edge);
80
+
81
+ void setAlignContent(int alignContent);
82
+ void setAlignItems(int alignItems);
83
+ void setAlignSelf(int alignSelf);
84
+ void setFlexDirection(int flexDirection);
85
+ void setFlexWrap(int flexWrap);
86
+ void setJustifyContent(int justifyContent);
87
+ void setDirection(int direction);
88
+
89
+ void setMargin(int edge, double margin);
90
+ void setMarginPercent(int edge, double margin);
91
+ void setMarginAuto(int edge);
92
+
93
+ void setOverflow(int overflow);
94
+ void setDisplay(int display);
95
+
96
+ void setFlex(double flex);
97
+ void setFlexBasis(double flexBasis);
98
+ void setFlexBasisPercent(double flexBasis);
99
+ void setFlexBasisAuto();
100
+ void setFlexGrow(double flexGrow);
101
+ void setFlexShrink(double flexShrink);
102
+
103
+ void setWidth(double width);
104
+ void setWidthPercent(double width);
105
+ void setWidthAuto();
106
+ void setHeight(double height);
107
+ void setHeightPercent(double height);
108
+ void setHeightAuto();
109
+
110
+ void setMinWidth(double minWidth);
111
+ void setMinWidthPercent(double minWidth);
112
+ void setMinHeight(double minHeight);
113
+ void setMinHeightPercent(double minHeight);
114
+
115
+ void setMaxWidth(double maxWidth);
116
+ void setMaxWidthPercent(double maxWidth);
117
+ void setMaxHeight(double maxHeight);
118
+ void setMaxHeightPercent(double maxHeight);
119
+
120
+ void setAspectRatio(double aspectRatio);
121
+
122
+ void setBorder(int edge, double border);
123
+
124
+ void setPadding(int edge, double padding);
125
+ void setPaddingPercent(int edge, double padding);
126
+
127
+ void setGap(int gutter, double gapLength);
128
+ void setGapPercent(int gutter, double gapLength);
129
+
130
+ void setBoxSizing(int boxSizing);
131
+
132
+ public: // Style getters
133
+ int getPositionType(void) const;
134
+ Value getPosition(int edge) const;
135
+
136
+ int getAlignContent(void) const;
137
+ int getAlignItems(void) const;
138
+ int getAlignSelf(void) const;
139
+ int getFlexDirection(void) const;
140
+ int getFlexWrap(void) const;
141
+ int getJustifyContent(void) const;
142
+ int getDirection(void) const;
143
+
144
+ Value getMargin(int edge) const;
145
+
146
+ int getOverflow(void) const;
147
+ int getDisplay(void) const;
148
+
149
+ Value getFlexBasis(void) const;
150
+ double getFlexGrow(void) const;
151
+ double getFlexShrink(void) const;
152
+
153
+ Value getWidth(void) const;
154
+ Value getHeight(void) const;
155
+
156
+ Value getMinWidth(void) const;
157
+ Value getMinHeight(void) const;
158
+
159
+ Value getMaxWidth(void) const;
160
+ Value getMaxHeight(void) const;
161
+
162
+ double getAspectRatio(void) const;
163
+
164
+ double getBorder(int edge) const;
165
+
166
+ Value getPadding(int edge) const;
167
+
168
+ float getGap(int gutter);
169
+
170
+ int getBoxSizing(void) const;
171
+
172
+ public: // Tree hierarchy mutators
173
+ void insertChild(Node* child, unsigned index);
174
+ void removeChild(Node* child);
175
+
176
+ public: // Tree hierarchy inspectors
177
+ unsigned getChildCount(void) const;
178
+
179
+ // The following functions cannot be const because they could discard const
180
+ // qualifiers (ex: constNode->getChild(0)->getParent() wouldn't be const)
181
+
182
+ Node* getParent(void);
183
+ Node* getChild(unsigned index);
184
+
185
+ public: // Measure func mutators
186
+ void setMeasureFunc(MeasureCallback* measureFunc);
187
+ void unsetMeasureFunc(void);
188
+
189
+ public: // Measure func inspectors
190
+ Size callMeasureFunc(
191
+ double width,
192
+ int widthMode,
193
+ double height,
194
+ int heightMode) const;
195
+
196
+ public: // Dirtied func mutators
197
+ void setDirtiedFunc(DirtiedCallback* dirtiedFunc);
198
+ void unsetDirtiedFunc(void);
199
+
200
+ public: // Dirtied func inspectors
201
+ void callDirtiedFunc(void) const;
202
+
203
+ public: // Dirtiness accessors
204
+ void markDirty(void);
205
+ bool isDirty(void) const;
206
+ void markLayoutSeen();
207
+ bool hasNewLayout(void) const;
208
+
209
+ public: // Layout mutators
210
+ void calculateLayout(double width, double height, int direction);
211
+
212
+ public: // Layout inspectors
213
+ double getComputedLeft(void) const;
214
+ double getComputedRight(void) const;
215
+
216
+ double getComputedTop(void) const;
217
+ double getComputedBottom(void) const;
218
+
219
+ double getComputedWidth(void) const;
220
+ double getComputedHeight(void) const;
221
+
222
+ Layout getComputedLayout(void) const;
223
+
224
+ double getComputedMargin(int edge) const;
225
+ double getComputedBorder(int edge) const;
226
+ double getComputedPadding(int edge) const;
227
+
228
+ public:
229
+ void setIsReferenceBaseline(bool isReferenceBaseline);
230
+ bool isReferenceBaseline();
231
+
232
+ YGNodeRef m_node;
233
+
234
+ std::unique_ptr<MeasureCallback> m_measureFunc;
235
+ std::unique_ptr<DirtiedCallback> m_dirtiedFunc;
236
+
237
+ public:
238
+ void setAlwaysFormsContainingBlock(bool alwaysFormContainingBlock);
239
+ };
@@ -0,0 +1,17 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #pragma once
9
+
10
+ struct Size {
11
+ double width;
12
+ double height;
13
+
14
+ Size(void) : width(0.0), height(0.0) {}
15
+
16
+ Size(double width, double height) : width(width), height(height) {}
17
+ };
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #pragma once
9
+
10
+ #include <yoga/Yoga.h>
11
+
12
+ struct Value {
13
+ static Value fromYGValue(YGValue const& ygValue) {
14
+ return Value(static_cast<int>(ygValue.unit), ygValue.value);
15
+ }
16
+
17
+ int unit;
18
+ double value;
19
+
20
+ Value(void) : unit(YGUnitUndefined), value(0.0) {}
21
+
22
+ Value(int unit, double value) : unit(unit), value(value) {}
23
+ };
@@ -0,0 +1,207 @@
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ #include "./Config.h"
9
+ #include "./Layout.h"
10
+ #include "./Node.h"
11
+ #include "./Size.h"
12
+ #include "./Value.h"
13
+
14
+ #include <emscripten/bind.h>
15
+ #include <yoga/Yoga.h>
16
+
17
+ using namespace emscripten;
18
+
19
+ EMSCRIPTEN_BINDINGS(YOGA_LAYOUT) {
20
+ class_<MeasureCallback>("MeasureCallback")
21
+ .function("measure", &MeasureCallback::measure, pure_virtual())
22
+ .allow_subclass<MeasureCallbackWrapper>("MeasureCallbackWrapper");
23
+ class_<DirtiedCallback>("DirtiedCallback")
24
+ .function("dirtied", &DirtiedCallback::dirtied, pure_virtual())
25
+ .allow_subclass<DirtiedCallbackWrapper>("DirtiedCallbackWrapper");
26
+
27
+ class_<Config>("Config")
28
+ .constructor<>(&Config::create, allow_raw_pointers())
29
+ .class_function<>("create", &Config::create, allow_raw_pointers())
30
+ .class_function<>("destroy", &Config::destroy, allow_raw_pointers())
31
+ .function(
32
+ "setExperimentalFeatureEnabled",
33
+ &Config::setExperimentalFeatureEnabled)
34
+ .function("setPointScaleFactor", &Config::setPointScaleFactor)
35
+ .function("setErrata", &Config::setErrata)
36
+ .function("setUseWebDefaults", &Config::setUseWebDefaults)
37
+ .function(
38
+ "isExperimentalFeatureEnabled", &Config::isExperimentalFeatureEnabled)
39
+ .function("getErrata", &Config::getErrata)
40
+ .function("useWebDefaults", &Config::useWebDefaults);
41
+
42
+ value_object<Layout>("Layout")
43
+ .field("left", &Layout::left)
44
+ .field("right", &Layout::right)
45
+ .field("top", &Layout::top)
46
+ .field("bottom", &Layout::bottom)
47
+ .field("width", &Layout::width)
48
+ .field("height", &Layout::height);
49
+
50
+ value_object<Size>("Size")
51
+ .field("width", &Size::width)
52
+ .field("height", &Size::height);
53
+
54
+ value_object<Value>("Value")
55
+ .field("value", &Value::value)
56
+ .field("unit", &Value::unit);
57
+
58
+ class_<Node>("Node")
59
+ .constructor<>(&Node::createDefault, allow_raw_pointers())
60
+
61
+ .class_function<>(
62
+ "createDefault", &Node::createDefault, allow_raw_pointers())
63
+ .class_function<>(
64
+ "createWithConfig", &Node::createWithConfig, allow_raw_pointers())
65
+ .class_function<>("destroy", &Node::destroy, allow_raw_pointers())
66
+ .function("reset", &Node::reset)
67
+
68
+ .function("copyStyle", &Node::copyStyle)
69
+
70
+ .function("setPositionType", &Node::setPositionType)
71
+ .function("setPosition", &Node::setPosition)
72
+ .function("setPositionPercent", &Node::setPositionPercent)
73
+ .function("setPositionAuto", &Node::setPositionAuto)
74
+
75
+ .function("setAlignContent", &Node::setAlignContent)
76
+ .function("setAlignItems", &Node::setAlignItems)
77
+ .function("setAlignSelf", &Node::setAlignSelf)
78
+ .function("setFlexDirection", &Node::setFlexDirection)
79
+ .function("setFlexWrap", &Node::setFlexWrap)
80
+ .function("setJustifyContent", &Node::setJustifyContent)
81
+
82
+ .function("setMargin", &Node::setMargin)
83
+ .function("setMarginPercent", &Node::setMarginPercent)
84
+ .function("setMarginAuto", &Node::setMarginAuto)
85
+
86
+ .function("setOverflow", &Node::setOverflow)
87
+ .function("setDisplay", &Node::setDisplay)
88
+
89
+ .function("setFlex", &Node::setFlex)
90
+ .function("setFlexBasis", &Node::setFlexBasis)
91
+ .function("setFlexBasisPercent", &Node::setFlexBasisPercent)
92
+ .function("setFlexBasisAuto", &Node::setFlexBasisAuto)
93
+ .function("setFlexGrow", &Node::setFlexGrow)
94
+ .function("setFlexShrink", &Node::setFlexShrink)
95
+
96
+ .function("setWidth", &Node::setWidth)
97
+ .function("setWidthPercent", &Node::setWidthPercent)
98
+ .function("setWidthAuto", &Node::setWidthAuto)
99
+ .function("setHeight", &Node::setHeight)
100
+ .function("setHeightPercent", &Node::setHeightPercent)
101
+ .function("setHeightAuto", &Node::setHeightAuto)
102
+
103
+ .function("setMinWidth", &Node::setMinWidth)
104
+ .function("setMinWidthPercent", &Node::setMinWidthPercent)
105
+ .function("setMinHeight", &Node::setMinHeight)
106
+ .function("setMinHeightPercent", &Node::setMinHeightPercent)
107
+
108
+ .function("setMaxWidth", &Node::setMaxWidth)
109
+ .function("setMaxWidthPercent", &Node::setMaxWidthPercent)
110
+ .function("setMaxHeight", &Node::setMaxHeight)
111
+ .function("setMaxHeightPercent", &Node::setMaxHeightPercent)
112
+
113
+ .function("setBoxSizing", &Node::setBoxSizing)
114
+
115
+ .function("setAspectRatio", &Node::setAspectRatio)
116
+
117
+ .function("setBorder", &Node::setBorder)
118
+
119
+ .function("setPadding", &Node::setPadding)
120
+ .function("setPaddingPercent", &Node::setPaddingPercent)
121
+ .function("setGap", &Node::setGap)
122
+ .function("setGapPercent", &Node::setGapPercent)
123
+
124
+ .function("setDirection", &Node::setDirection)
125
+
126
+ .function("getPositionType", &Node::getPositionType)
127
+ .function("getPosition", &Node::getPosition)
128
+
129
+ .function("getAlignContent", &Node::getAlignContent)
130
+ .function("getAlignItems", &Node::getAlignItems)
131
+ .function("getAlignSelf", &Node::getAlignSelf)
132
+ .function("getFlexDirection", &Node::getFlexDirection)
133
+ .function("getFlexWrap", &Node::getFlexWrap)
134
+ .function("getJustifyContent", &Node::getJustifyContent)
135
+
136
+ .function("getMargin", &Node::getMargin)
137
+
138
+ .function("getFlexBasis", &Node::getFlexBasis)
139
+ .function("getFlexGrow", &Node::getFlexGrow)
140
+ .function("getFlexShrink", &Node::getFlexShrink)
141
+
142
+ .function("getWidth", &Node::getWidth)
143
+ .function("getHeight", &Node::getHeight)
144
+
145
+ .function("getMinWidth", &Node::getMinWidth)
146
+ .function("getMinHeight", &Node::getMinHeight)
147
+
148
+ .function("getMaxWidth", &Node::getMaxWidth)
149
+ .function("getMaxHeight", &Node::getMaxHeight)
150
+
151
+ .function("getBoxSizing", &Node::getBoxSizing)
152
+
153
+ .function("getAspectRatio", &Node::getAspectRatio)
154
+
155
+ .function("getBorder", &Node::getBorder)
156
+
157
+ .function("getOverflow", &Node::getOverflow)
158
+ .function("getDisplay", &Node::getDisplay)
159
+
160
+ .function("getPadding", &Node::getPadding)
161
+ .function("getGap", &Node::getGap)
162
+
163
+ .function("insertChild", &Node::insertChild, allow_raw_pointers())
164
+ .function("removeChild", &Node::removeChild, allow_raw_pointers())
165
+
166
+ .function("getChildCount", &Node::getChildCount)
167
+
168
+ .function("getParent", &Node::getParent, allow_raw_pointers())
169
+ .function("getChild", &Node::getChild, allow_raw_pointers())
170
+
171
+ .function(
172
+ "setAlwaysFormsContainingBlock", &Node::setAlwaysFormsContainingBlock)
173
+
174
+ .function("isReferenceBaseline", &Node::isReferenceBaseline)
175
+ .function("setIsReferenceBaseline", &Node::setIsReferenceBaseline)
176
+
177
+ .function("setMeasureFunc", &Node::setMeasureFunc, allow_raw_pointers())
178
+ .function("unsetMeasureFunc", &Node::unsetMeasureFunc)
179
+
180
+ .function("setDirtiedFunc", &Node::setDirtiedFunc, allow_raw_pointers())
181
+ .function("unsetDirtiedFunc", &Node::unsetDirtiedFunc)
182
+
183
+ .function("markDirty", &Node::markDirty)
184
+ .function("isDirty", &Node::isDirty)
185
+
186
+ .function("markLayoutSeen", &Node::markLayoutSeen)
187
+ .function("hasNewLayout", &Node::hasNewLayout)
188
+
189
+ .function("calculateLayout", &Node::calculateLayout)
190
+
191
+ .function("getComputedLeft", &Node::getComputedLeft)
192
+ .function("getComputedRight", &Node::getComputedRight)
193
+
194
+ .function("getComputedTop", &Node::getComputedTop)
195
+ .function("getComputedBottom", &Node::getComputedBottom)
196
+
197
+ .function("getComputedWidth", &Node::getComputedWidth)
198
+ .function("getComputedHeight", &Node::getComputedHeight)
199
+
200
+ .function("getComputedLayout", &Node::getComputedLayout)
201
+
202
+ .function("getComputedMargin", &Node::getComputedMargin)
203
+ .function("getComputedBorder", &Node::getComputedBorder)
204
+ .function("getComputedPadding", &Node::getComputedPadding)
205
+
206
+ .function("getDirection", &Node::getDirection);
207
+ }
@@ -0,0 +1,210 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+
8
+ // @generated by enums.py
9
+
10
+ export enum Align {
11
+ Auto = 0,
12
+ FlexStart = 1,
13
+ Center = 2,
14
+ FlexEnd = 3,
15
+ Stretch = 4,
16
+ Baseline = 5,
17
+ SpaceBetween = 6,
18
+ SpaceAround = 7,
19
+ SpaceEvenly = 8,
20
+ }
21
+
22
+ export enum BoxSizing {
23
+ BorderBox = 0,
24
+ ContentBox = 1,
25
+ }
26
+
27
+ export enum Dimension {
28
+ Width = 0,
29
+ Height = 1,
30
+ }
31
+
32
+ export enum Direction {
33
+ Inherit = 0,
34
+ LTR = 1,
35
+ RTL = 2,
36
+ }
37
+
38
+ export enum Display {
39
+ Flex = 0,
40
+ None = 1,
41
+ Contents = 2,
42
+ }
43
+
44
+ export enum Edge {
45
+ Left = 0,
46
+ Top = 1,
47
+ Right = 2,
48
+ Bottom = 3,
49
+ Start = 4,
50
+ End = 5,
51
+ Horizontal = 6,
52
+ Vertical = 7,
53
+ All = 8,
54
+ }
55
+
56
+ export enum Errata {
57
+ None = 0,
58
+ StretchFlexBasis = 1,
59
+ AbsolutePositionWithoutInsetsExcludesPadding = 2,
60
+ AbsolutePercentAgainstInnerSize = 4,
61
+ All = 2147483647,
62
+ Classic = 2147483646,
63
+ }
64
+
65
+ export enum ExperimentalFeature {
66
+ WebFlexBasis = 0,
67
+ }
68
+
69
+ export enum FlexDirection {
70
+ Column = 0,
71
+ ColumnReverse = 1,
72
+ Row = 2,
73
+ RowReverse = 3,
74
+ }
75
+
76
+ export enum Gutter {
77
+ Column = 0,
78
+ Row = 1,
79
+ All = 2,
80
+ }
81
+
82
+ export enum Justify {
83
+ FlexStart = 0,
84
+ Center = 1,
85
+ FlexEnd = 2,
86
+ SpaceBetween = 3,
87
+ SpaceAround = 4,
88
+ SpaceEvenly = 5,
89
+ }
90
+
91
+ export enum LogLevel {
92
+ Error = 0,
93
+ Warn = 1,
94
+ Info = 2,
95
+ Debug = 3,
96
+ Verbose = 4,
97
+ Fatal = 5,
98
+ }
99
+
100
+ export enum MeasureMode {
101
+ Undefined = 0,
102
+ Exactly = 1,
103
+ AtMost = 2,
104
+ }
105
+
106
+ export enum NodeType {
107
+ Default = 0,
108
+ Text = 1,
109
+ }
110
+
111
+ export enum Overflow {
112
+ Visible = 0,
113
+ Hidden = 1,
114
+ Scroll = 2,
115
+ }
116
+
117
+ export enum PositionType {
118
+ Static = 0,
119
+ Relative = 1,
120
+ Absolute = 2,
121
+ }
122
+
123
+ export enum Unit {
124
+ Undefined = 0,
125
+ Point = 1,
126
+ Percent = 2,
127
+ Auto = 3,
128
+ }
129
+
130
+ export enum Wrap {
131
+ NoWrap = 0,
132
+ Wrap = 1,
133
+ WrapReverse = 2,
134
+ }
135
+
136
+ const constants = {
137
+ ALIGN_AUTO: Align.Auto,
138
+ ALIGN_FLEX_START: Align.FlexStart,
139
+ ALIGN_CENTER: Align.Center,
140
+ ALIGN_FLEX_END: Align.FlexEnd,
141
+ ALIGN_STRETCH: Align.Stretch,
142
+ ALIGN_BASELINE: Align.Baseline,
143
+ ALIGN_SPACE_BETWEEN: Align.SpaceBetween,
144
+ ALIGN_SPACE_AROUND: Align.SpaceAround,
145
+ ALIGN_SPACE_EVENLY: Align.SpaceEvenly,
146
+ BOX_SIZING_BORDER_BOX: BoxSizing.BorderBox,
147
+ BOX_SIZING_CONTENT_BOX: BoxSizing.ContentBox,
148
+ DIMENSION_WIDTH: Dimension.Width,
149
+ DIMENSION_HEIGHT: Dimension.Height,
150
+ DIRECTION_INHERIT: Direction.Inherit,
151
+ DIRECTION_LTR: Direction.LTR,
152
+ DIRECTION_RTL: Direction.RTL,
153
+ DISPLAY_FLEX: Display.Flex,
154
+ DISPLAY_NONE: Display.None,
155
+ DISPLAY_CONTENTS: Display.Contents,
156
+ EDGE_LEFT: Edge.Left,
157
+ EDGE_TOP: Edge.Top,
158
+ EDGE_RIGHT: Edge.Right,
159
+ EDGE_BOTTOM: Edge.Bottom,
160
+ EDGE_START: Edge.Start,
161
+ EDGE_END: Edge.End,
162
+ EDGE_HORIZONTAL: Edge.Horizontal,
163
+ EDGE_VERTICAL: Edge.Vertical,
164
+ EDGE_ALL: Edge.All,
165
+ ERRATA_NONE: Errata.None,
166
+ ERRATA_STRETCH_FLEX_BASIS: Errata.StretchFlexBasis,
167
+ ERRATA_ABSOLUTE_POSITION_WITHOUT_INSETS_EXCLUDES_PADDING: Errata.AbsolutePositionWithoutInsetsExcludesPadding,
168
+ ERRATA_ABSOLUTE_PERCENT_AGAINST_INNER_SIZE: Errata.AbsolutePercentAgainstInnerSize,
169
+ ERRATA_ALL: Errata.All,
170
+ ERRATA_CLASSIC: Errata.Classic,
171
+ EXPERIMENTAL_FEATURE_WEB_FLEX_BASIS: ExperimentalFeature.WebFlexBasis,
172
+ FLEX_DIRECTION_COLUMN: FlexDirection.Column,
173
+ FLEX_DIRECTION_COLUMN_REVERSE: FlexDirection.ColumnReverse,
174
+ FLEX_DIRECTION_ROW: FlexDirection.Row,
175
+ FLEX_DIRECTION_ROW_REVERSE: FlexDirection.RowReverse,
176
+ GUTTER_COLUMN: Gutter.Column,
177
+ GUTTER_ROW: Gutter.Row,
178
+ GUTTER_ALL: Gutter.All,
179
+ JUSTIFY_FLEX_START: Justify.FlexStart,
180
+ JUSTIFY_CENTER: Justify.Center,
181
+ JUSTIFY_FLEX_END: Justify.FlexEnd,
182
+ JUSTIFY_SPACE_BETWEEN: Justify.SpaceBetween,
183
+ JUSTIFY_SPACE_AROUND: Justify.SpaceAround,
184
+ JUSTIFY_SPACE_EVENLY: Justify.SpaceEvenly,
185
+ LOG_LEVEL_ERROR: LogLevel.Error,
186
+ LOG_LEVEL_WARN: LogLevel.Warn,
187
+ LOG_LEVEL_INFO: LogLevel.Info,
188
+ LOG_LEVEL_DEBUG: LogLevel.Debug,
189
+ LOG_LEVEL_VERBOSE: LogLevel.Verbose,
190
+ LOG_LEVEL_FATAL: LogLevel.Fatal,
191
+ MEASURE_MODE_UNDEFINED: MeasureMode.Undefined,
192
+ MEASURE_MODE_EXACTLY: MeasureMode.Exactly,
193
+ MEASURE_MODE_AT_MOST: MeasureMode.AtMost,
194
+ NODE_TYPE_DEFAULT: NodeType.Default,
195
+ NODE_TYPE_TEXT: NodeType.Text,
196
+ OVERFLOW_VISIBLE: Overflow.Visible,
197
+ OVERFLOW_HIDDEN: Overflow.Hidden,
198
+ OVERFLOW_SCROLL: Overflow.Scroll,
199
+ POSITION_TYPE_STATIC: PositionType.Static,
200
+ POSITION_TYPE_RELATIVE: PositionType.Relative,
201
+ POSITION_TYPE_ABSOLUTE: PositionType.Absolute,
202
+ UNIT_UNDEFINED: Unit.Undefined,
203
+ UNIT_POINT: Unit.Point,
204
+ UNIT_PERCENT: Unit.Percent,
205
+ UNIT_AUTO: Unit.Auto,
206
+ WRAP_NO_WRAP: Wrap.NoWrap,
207
+ WRAP_WRAP: Wrap.Wrap,
208
+ WRAP_WRAP_REVERSE: Wrap.WrapReverse,
209
+ }
210
+ export default constants