1
+
2
+ /*
3
+ * This file is auto-generated from a NativeModule spec file in js.
4
+ *
5
+ * This is a C++ Spec class that should be used with MakeTurboModuleProvider to register native modules
6
+ * in a way that also verifies at compile time that the native module matches the interface required
7
+ * by the TurboModule JS spec.
8
+ */
9
+ #pragma once
10
+ // clang-format off
11
+
12
+ #include < NativeModules.h>
13
+ #include < tuple>
14
+
15
+ namespace Microsoft ::ReactNativeSpecs {
16
+
17
+ struct FantomSpec_RenderFormatOptions {
18
+ bool includeRoot;
19
+ bool includeLayoutMetrics;
20
+ };
21
+
22
+
23
+ inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo (FantomSpec_RenderFormatOptions*) noexcept {
24
+ winrt::Microsoft::ReactNative::FieldMap fieldMap {
25
+ {L" includeRoot" , &FantomSpec_RenderFormatOptions::includeRoot},
26
+ {L" includeLayoutMetrics" , &FantomSpec_RenderFormatOptions::includeLayoutMetrics},
27
+ };
28
+ return fieldMap;
29
+ }
30
+
31
+ struct FantomSpec : winrt::Microsoft::ReactNative::TurboModuleSpec {
32
+ static constexpr auto methods = std::tuple{
33
+ Method<void (double , double , double , double ) noexcept >{0 , L" startSurface" },
34
+ Method<void (double ) noexcept >{1 , L" stopSurface" },
35
+ Method<void (, std::string, ) noexcept >{2 , L" dispatchNativeEvent" },
36
+ SyncMethod<std::vector<std::string>(double ) noexcept >{3 , L" getMountingManagerLogs" },
37
+ Method<void () noexcept >{4 , L" flushMessageQueue" },
38
+ Method<void () noexcept >{5 , L" flushEventQueue" },
39
+ SyncMethod<std::string (double , FantomSpec_RenderFormatOptions) noexcept >{6 , L" getRenderedOutput" },
40
+ Method<void (std::string) noexcept >{7 , L" reportTestSuiteResultsJSON" },
41
+ };
42
+
43
+ template <class TModule >
44
+ static constexpr void ValidateModule () noexcept {
45
+ constexpr auto methodCheckResults = CheckMethods<TModule, FantomSpec>();
46
+
47
+ REACT_SHOW_METHOD_SPEC_ERRORS (
48
+ 0 ,
49
+ " startSurface" ,
50
+ " REACT_METHOD(startSurface) void startSurface(double surfaceId, double viewportWidth, double viewportHeight, double devicePixelRatio) noexcept { /* implementation */ }\n "
51
+ " REACT_METHOD(startSurface) static void startSurface(double surfaceId, double viewportWidth, double viewportHeight, double devicePixelRatio) noexcept { /* implementation */ }\n " );
52
+ REACT_SHOW_METHOD_SPEC_ERRORS (
53
+ 1 ,
54
+ " stopSurface" ,
55
+ " REACT_METHOD(stopSurface) void stopSurface(double surfaceId) noexcept { /* implementation */ }\n "
56
+ " REACT_METHOD(stopSurface) static void stopSurface(double surfaceId) noexcept { /* implementation */ }\n " );
57
+ REACT_SHOW_METHOD_SPEC_ERRORS (
58
+ 2 ,
59
+ " dispatchNativeEvent" ,
60
+ " REACT_METHOD(dispatchNativeEvent) void dispatchNativeEvent( shadowNode, std::string type, payload) noexcept { /* implementation */ }\n "
61
+ " REACT_METHOD(dispatchNativeEvent) static void dispatchNativeEvent( shadowNode, std::string type, payload) noexcept { /* implementation */ }\n " );
62
+ REACT_SHOW_METHOD_SPEC_ERRORS (
63
+ 3 ,
64
+ " getMountingManagerLogs" ,
65
+ " REACT_SYNC_METHOD(getMountingManagerLogs) std::vector<std::string> getMountingManagerLogs(double surfaceId) noexcept { /* implementation */ }\n "
66
+ " REACT_SYNC_METHOD(getMountingManagerLogs) static std::vector<std::string> getMountingManagerLogs(double surfaceId) noexcept { /* implementation */ }\n " );
67
+ REACT_SHOW_METHOD_SPEC_ERRORS (
68
+ 4 ,
69
+ " flushMessageQueue" ,
70
+ " REACT_METHOD(flushMessageQueue) void flushMessageQueue() noexcept { /* implementation */ }\n "
71
+ " REACT_METHOD(flushMessageQueue) static void flushMessageQueue() noexcept { /* implementation */ }\n " );
72
+ REACT_SHOW_METHOD_SPEC_ERRORS (
73
+ 5 ,
74
+ " flushEventQueue" ,
75
+ " REACT_METHOD(flushEventQueue) void flushEventQueue() noexcept { /* implementation */ }\n "
76
+ " REACT_METHOD(flushEventQueue) static void flushEventQueue() noexcept { /* implementation */ }\n " );
77
+ REACT_SHOW_METHOD_SPEC_ERRORS (
78
+ 6 ,
79
+ " getRenderedOutput" ,
80
+ " REACT_SYNC_METHOD(getRenderedOutput) std::string getRenderedOutput(double surfaceId, FantomSpec_RenderFormatOptions && config) noexcept { /* implementation */ }\n "
81
+ " REACT_SYNC_METHOD(getRenderedOutput) static std::string getRenderedOutput(double surfaceId, FantomSpec_RenderFormatOptions && config) noexcept { /* implementation */ }\n " );
82
+ REACT_SHOW_METHOD_SPEC_ERRORS (
83
+ 7 ,
84
+ " reportTestSuiteResultsJSON" ,
85
+ " REACT_METHOD(reportTestSuiteResultsJSON) void reportTestSuiteResultsJSON(std::string results) noexcept { /* implementation */ }\n "
86
+ " REACT_METHOD(reportTestSuiteResultsJSON) static void reportTestSuiteResultsJSON(std::string results) noexcept { /* implementation */ }\n " );
87
+ }
88
+ };
89
+
90
+ } // namespace Microsoft::ReactNativeSpecs
0 commit comments