-
Notifications
You must be signed in to change notification settings - Fork 4.7k
/
SafeAreaContextSpec.h
209 lines (193 loc) · 7.51 KB
/
SafeAreaContextSpec.h
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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
/**
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
*
* Do not edit this file as changes may cause incorrect behavior and will be lost
* once the code is regenerated.
*
* @generated by codegen project: GenerateModuleObjCpp
*
* We create an umbrella header (and corresponding implementation) here since
* Cxx compilation in BUCK has a limitation: source-code producing genrule()s
* must have a single output. More files => more genrule()s => slower builds.
*/
#ifndef __cplusplus
#error This file must be compiled as Obj-C++. If you are importing it, you must change your file extension to .mm.
#endif
#import <Foundation/Foundation.h>
#import <RCTRequired/RCTRequired.h>
#import <RCTTypeSafety/RCTConvertHelpers.h>
#import <RCTTypeSafety/RCTTypedModuleConstants.h>
#import <React/RCTBridgeModule.h>
#import <React/RCTCxxConvert.h>
#import <React/RCTManagedPointer.h>
#import <ReactCommon/RCTTurboModule.h>
#import <optional>
#import <vector>
namespace JS {
namespace NativeSafeAreaContext {
struct ConstantsInitialWindowMetricsInsets {
struct Builder {
struct Input {
RCTRequired<double> top;
RCTRequired<double> right;
RCTRequired<double> bottom;
RCTRequired<double> left;
};
/** Initialize with a set of values */
Builder(const Input i);
/** Initialize with an existing ConstantsInitialWindowMetricsInsets */
Builder(ConstantsInitialWindowMetricsInsets i);
/** Builds the object. Generally used only by the infrastructure. */
NSDictionary *buildUnsafeRawValue() const { return _factory(); };
private:
NSDictionary *(^_factory)(void);
};
static ConstantsInitialWindowMetricsInsets fromUnsafeRawValue(NSDictionary *const v) { return {v}; }
NSDictionary *unsafeRawValue() const { return _v; }
private:
ConstantsInitialWindowMetricsInsets(NSDictionary *const v) : _v(v) {}
NSDictionary *_v;
};
}
}
namespace JS {
namespace NativeSafeAreaContext {
struct ConstantsInitialWindowMetricsFrame {
struct Builder {
struct Input {
RCTRequired<double> x;
RCTRequired<double> y;
RCTRequired<double> width;
RCTRequired<double> height;
};
/** Initialize with a set of values */
Builder(const Input i);
/** Initialize with an existing ConstantsInitialWindowMetricsFrame */
Builder(ConstantsInitialWindowMetricsFrame i);
/** Builds the object. Generally used only by the infrastructure. */
NSDictionary *buildUnsafeRawValue() const { return _factory(); };
private:
NSDictionary *(^_factory)(void);
};
static ConstantsInitialWindowMetricsFrame fromUnsafeRawValue(NSDictionary *const v) { return {v}; }
NSDictionary *unsafeRawValue() const { return _v; }
private:
ConstantsInitialWindowMetricsFrame(NSDictionary *const v) : _v(v) {}
NSDictionary *_v;
};
}
}
namespace JS {
namespace NativeSafeAreaContext {
struct ConstantsInitialWindowMetrics {
struct Builder {
struct Input {
RCTRequired<JS::NativeSafeAreaContext::ConstantsInitialWindowMetricsInsets::Builder> insets;
RCTRequired<JS::NativeSafeAreaContext::ConstantsInitialWindowMetricsFrame::Builder> frame;
};
/** Initialize with a set of values */
Builder(const Input i);
/** Initialize with an existing ConstantsInitialWindowMetrics */
Builder(ConstantsInitialWindowMetrics i);
/** Builds the object. Generally used only by the infrastructure. */
NSDictionary *buildUnsafeRawValue() const { return _factory(); };
private:
NSDictionary *(^_factory)(void);
};
static ConstantsInitialWindowMetrics fromUnsafeRawValue(NSDictionary *const v) { return {v}; }
NSDictionary *unsafeRawValue() const { return _v; }
private:
ConstantsInitialWindowMetrics(NSDictionary *const v) : _v(v) {}
NSDictionary *_v;
};
}
}
namespace JS {
namespace NativeSafeAreaContext {
struct Constants {
struct Builder {
struct Input {
std::optional<JS::NativeSafeAreaContext::ConstantsInitialWindowMetrics::Builder> initialWindowMetrics;
};
/** Initialize with a set of values */
Builder(const Input i);
/** Initialize with an existing Constants */
Builder(Constants i);
/** Builds the object. Generally used only by the infrastructure. */
NSDictionary *buildUnsafeRawValue() const { return _factory(); };
private:
NSDictionary *(^_factory)(void);
};
static Constants fromUnsafeRawValue(NSDictionary *const v) { return {v}; }
NSDictionary *unsafeRawValue() const { return _v; }
private:
Constants(NSDictionary *const v) : _v(v) {}
NSDictionary *_v;
};
}
}
@protocol NativeSafeAreaContextSpec <RCTBridgeModule, RCTTurboModule>
- (facebook::react::ModuleConstants<JS::NativeSafeAreaContext::Constants::Builder>)constantsToExport;
- (facebook::react::ModuleConstants<JS::NativeSafeAreaContext::Constants::Builder>)getConstants;
@end
namespace facebook {
namespace react {
/**
* ObjC++ class for module 'NativeSafeAreaContext'
*/
class JSI_EXPORT NativeSafeAreaContextSpecJSI : public ObjCTurboModule {
public:
NativeSafeAreaContextSpecJSI(const ObjCTurboModule::InitParams ¶ms);
};
} // namespace react
} // namespace facebook
inline JS::NativeSafeAreaContext::ConstantsInitialWindowMetricsInsets::Builder::Builder(const Input i) : _factory(^{
NSMutableDictionary *d = [NSMutableDictionary new];
auto top = i.top.get();
d[@"top"] = @(top);
auto right = i.right.get();
d[@"right"] = @(right);
auto bottom = i.bottom.get();
d[@"bottom"] = @(bottom);
auto left = i.left.get();
d[@"left"] = @(left);
return d;
}) {}
inline JS::NativeSafeAreaContext::ConstantsInitialWindowMetricsInsets::Builder::Builder(ConstantsInitialWindowMetricsInsets i) : _factory(^{
return i.unsafeRawValue();
}) {}
inline JS::NativeSafeAreaContext::ConstantsInitialWindowMetricsFrame::Builder::Builder(const Input i) : _factory(^{
NSMutableDictionary *d = [NSMutableDictionary new];
auto x = i.x.get();
d[@"x"] = @(x);
auto y = i.y.get();
d[@"y"] = @(y);
auto width = i.width.get();
d[@"width"] = @(width);
auto height = i.height.get();
d[@"height"] = @(height);
return d;
}) {}
inline JS::NativeSafeAreaContext::ConstantsInitialWindowMetricsFrame::Builder::Builder(ConstantsInitialWindowMetricsFrame i) : _factory(^{
return i.unsafeRawValue();
}) {}
inline JS::NativeSafeAreaContext::ConstantsInitialWindowMetrics::Builder::Builder(const Input i) : _factory(^{
NSMutableDictionary *d = [NSMutableDictionary new];
auto insets = i.insets.get();
d[@"insets"] = insets.buildUnsafeRawValue();
auto frame = i.frame.get();
d[@"frame"] = frame.buildUnsafeRawValue();
return d;
}) {}
inline JS::NativeSafeAreaContext::ConstantsInitialWindowMetrics::Builder::Builder(ConstantsInitialWindowMetrics i) : _factory(^{
return i.unsafeRawValue();
}) {}
inline JS::NativeSafeAreaContext::Constants::Builder::Builder(const Input i) : _factory(^{
NSMutableDictionary *d = [NSMutableDictionary new];
auto initialWindowMetrics = i.initialWindowMetrics;
d[@"initialWindowMetrics"] = initialWindowMetrics.has_value() ? initialWindowMetrics.value().buildUnsafeRawValue() : nil;
return d;
}) {}
inline JS::NativeSafeAreaContext::Constants::Builder::Builder(Constants i) : _factory(^{
return i.unsafeRawValue();
}) {}