react-native-windows/vnext/codegen/NativeLinkingManagerSpec.g.h

65 строки
3.2 KiB
C
Исходник Постоянная ссылка Обычный вид История

/*
* This file is auto-generated from a NativeModule spec file in js.
*
* This is a C++ Spec class that should be used with MakeTurboModuleProvider to register native modules
* in a way that also verifies at compile time that the native module matches the interface required
* by the TurboModule JS spec.
*/
#pragma once
#include <NativeModules.h>
#include <tuple>
namespace Microsoft::ReactNativeSpecs {
Integrate 11/18 RN Nightly Build 🎉 (#6572) * Integrate 11/18 RN Nightly Build 🎉 Fixes #5834 Fixes #6210 Fixes #6139 Fixes #6353 Commits Before November: https://github.com/facebook/react-native/compare/77f7658e4...0045621 Commits after November: https://github.com/facebook/react-native/compare/0045621...19d4cc2d4 Nightly builds were broken for a bit over a month, so this is a big change! This brings us a little bit past the base of 0.64-stable, but it should be easier to work backwards a week than to work forwards. https://github.com/facebook/react-native/commit/56c363e39af6488904cbfd2046314c45babeb0f4 splits some code for LinkingManager, and now only passes a native module handle to the NativeEventEmitter base class on iOS. This ends up being safe for us though, since NativeEventEmitter also only used the handle on iOS. With https://github.com/facebook/react-native/commit/d1ff2572d01a3b986bf923e5e0f7ba5c0db82f15 flow-typed npm definitions are published, and we can remove the copies in our repo. We instead copy from RN sources for validating against our fork. With https://github.com/facebook/react-native/commit/4d247fe058e3cefd557a166717a753683754f1c4 and https://github.com/facebook/react-native/commit/b5de89755d15bb9b2d5e8b350cd3c25f302ab71e, we can remove forked RNTester bits With https://github.com/facebook/react-native/commit/fb14fd42b3a35b9f587631952f5329c8ae27a4b6 upgrading detox, we can reenable macos tests https://github.com/facebook/react-native/commit/cb7f3f4499232797ce8e60b00270f30641923ddc#diff-52c4d910c19bf2495f29877042e1bbb6baa561230f3a21baa907cfce144f14e2 combined with https://github.com/facebook/react-native/commit/610dcf488ba67eace90f4847fdaeeb411e42ad09 and a couple other commits start optionally passing TurboModule schema from JS to native. From what I can tell this is only currently used for Android + JNI. https://github.com/facebook/react-native/commit/017bc911928472e20f37dd9512a2113a7d93c81b#diff-e6fd0c5b183586249abfad692ff206b7e6171057f2b31ceabf1a9d7fc96f82f3 adds a new Image method `prefetchWithMetadata` that we will want to implement. Tracked by #6571 Validated with a quick smoke test of RNTester on XAML (web debugging + in-engine) + NetUI. Plan to do some more exhaustive validation before stable branch creation. * Change files * Disable babel-plugin-codegen
2020-11-19 21:28:13 +03:00
struct LinkingManagerSpec : winrt::Microsoft::ReactNative::TurboModuleSpec {
static constexpr auto methods = std::tuple{
Method<void(Promise<std::optional<std::string>>) noexcept>{0, L"getInitialURL"},
Method<void(std::string, Promise<bool>) noexcept>{1, L"canOpenURL"},
Method<void(std::string, Promise<void>) noexcept>{2, L"openURL"},
Method<void(Promise<void>) noexcept>{3, L"openSettings"},
Integrate 11/18 RN Nightly Build 🎉 (#6572) * Integrate 11/18 RN Nightly Build 🎉 Fixes #5834 Fixes #6210 Fixes #6139 Fixes #6353 Commits Before November: https://github.com/facebook/react-native/compare/77f7658e4...0045621 Commits after November: https://github.com/facebook/react-native/compare/0045621...19d4cc2d4 Nightly builds were broken for a bit over a month, so this is a big change! This brings us a little bit past the base of 0.64-stable, but it should be easier to work backwards a week than to work forwards. https://github.com/facebook/react-native/commit/56c363e39af6488904cbfd2046314c45babeb0f4 splits some code for LinkingManager, and now only passes a native module handle to the NativeEventEmitter base class on iOS. This ends up being safe for us though, since NativeEventEmitter also only used the handle on iOS. With https://github.com/facebook/react-native/commit/d1ff2572d01a3b986bf923e5e0f7ba5c0db82f15 flow-typed npm definitions are published, and we can remove the copies in our repo. We instead copy from RN sources for validating against our fork. With https://github.com/facebook/react-native/commit/4d247fe058e3cefd557a166717a753683754f1c4 and https://github.com/facebook/react-native/commit/b5de89755d15bb9b2d5e8b350cd3c25f302ab71e, we can remove forked RNTester bits With https://github.com/facebook/react-native/commit/fb14fd42b3a35b9f587631952f5329c8ae27a4b6 upgrading detox, we can reenable macos tests https://github.com/facebook/react-native/commit/cb7f3f4499232797ce8e60b00270f30641923ddc#diff-52c4d910c19bf2495f29877042e1bbb6baa561230f3a21baa907cfce144f14e2 combined with https://github.com/facebook/react-native/commit/610dcf488ba67eace90f4847fdaeeb411e42ad09 and a couple other commits start optionally passing TurboModule schema from JS to native. From what I can tell this is only currently used for Android + JNI. https://github.com/facebook/react-native/commit/017bc911928472e20f37dd9512a2113a7d93c81b#diff-e6fd0c5b183586249abfad692ff206b7e6171057f2b31ceabf1a9d7fc96f82f3 adds a new Image method `prefetchWithMetadata` that we will want to implement. Tracked by #6571 Validated with a quick smoke test of RNTester on XAML (web debugging + in-engine) + NetUI. Plan to do some more exhaustive validation before stable branch creation. * Change files * Disable babel-plugin-codegen
2020-11-19 21:28:13 +03:00
Method<void(std::string) noexcept>{4, L"addListener"},
Method<void(double) noexcept>{5, L"removeListeners"},
};
template <class TModule>
static constexpr void ValidateModule() noexcept {
Integrate 11/18 RN Nightly Build 🎉 (#6572) * Integrate 11/18 RN Nightly Build 🎉 Fixes #5834 Fixes #6210 Fixes #6139 Fixes #6353 Commits Before November: https://github.com/facebook/react-native/compare/77f7658e4...0045621 Commits after November: https://github.com/facebook/react-native/compare/0045621...19d4cc2d4 Nightly builds were broken for a bit over a month, so this is a big change! This brings us a little bit past the base of 0.64-stable, but it should be easier to work backwards a week than to work forwards. https://github.com/facebook/react-native/commit/56c363e39af6488904cbfd2046314c45babeb0f4 splits some code for LinkingManager, and now only passes a native module handle to the NativeEventEmitter base class on iOS. This ends up being safe for us though, since NativeEventEmitter also only used the handle on iOS. With https://github.com/facebook/react-native/commit/d1ff2572d01a3b986bf923e5e0f7ba5c0db82f15 flow-typed npm definitions are published, and we can remove the copies in our repo. We instead copy from RN sources for validating against our fork. With https://github.com/facebook/react-native/commit/4d247fe058e3cefd557a166717a753683754f1c4 and https://github.com/facebook/react-native/commit/b5de89755d15bb9b2d5e8b350cd3c25f302ab71e, we can remove forked RNTester bits With https://github.com/facebook/react-native/commit/fb14fd42b3a35b9f587631952f5329c8ae27a4b6 upgrading detox, we can reenable macos tests https://github.com/facebook/react-native/commit/cb7f3f4499232797ce8e60b00270f30641923ddc#diff-52c4d910c19bf2495f29877042e1bbb6baa561230f3a21baa907cfce144f14e2 combined with https://github.com/facebook/react-native/commit/610dcf488ba67eace90f4847fdaeeb411e42ad09 and a couple other commits start optionally passing TurboModule schema from JS to native. From what I can tell this is only currently used for Android + JNI. https://github.com/facebook/react-native/commit/017bc911928472e20f37dd9512a2113a7d93c81b#diff-e6fd0c5b183586249abfad692ff206b7e6171057f2b31ceabf1a9d7fc96f82f3 adds a new Image method `prefetchWithMetadata` that we will want to implement. Tracked by #6571 Validated with a quick smoke test of RNTester on XAML (web debugging + in-engine) + NetUI. Plan to do some more exhaustive validation before stable branch creation. * Change files * Disable babel-plugin-codegen
2020-11-19 21:28:13 +03:00
constexpr auto methodCheckResults = CheckMethods<TModule, LinkingManagerSpec>();
REACT_SHOW_METHOD_SPEC_ERRORS(
0,
"getInitialURL",
" REACT_METHOD(getInitialURL) void getInitialURL(::React::ReactPromise<std::optional<std::string>> &&result) noexcept { /* implementation */ }\n"
" REACT_METHOD(getInitialURL) static void getInitialURL(::React::ReactPromise<std::optional<std::string>> &&result) noexcept { /* implementation */ }\n");
REACT_SHOW_METHOD_SPEC_ERRORS(
1,
"canOpenURL",
" REACT_METHOD(canOpenURL) void canOpenURL(std::string url, ::React::ReactPromise<bool> &&result) noexcept { /* implementation */ }\n"
" REACT_METHOD(canOpenURL) static void canOpenURL(std::string url, ::React::ReactPromise<bool> &&result) noexcept { /* implementation */ }\n");
REACT_SHOW_METHOD_SPEC_ERRORS(
2,
"openURL",
" REACT_METHOD(openURL) void openURL(std::string url, ::React::ReactPromise<void> &&result) noexcept { /* implementation */ }\n"
" REACT_METHOD(openURL) static void openURL(std::string url, ::React::ReactPromise<void> &&result) noexcept { /* implementation */ }\n");
REACT_SHOW_METHOD_SPEC_ERRORS(
3,
"openSettings",
" REACT_METHOD(openSettings) void openSettings(::React::ReactPromise<void> &&result) noexcept { /* implementation */ }\n"
" REACT_METHOD(openSettings) static void openSettings(::React::ReactPromise<void> &&result) noexcept { /* implementation */ }\n");
REACT_SHOW_METHOD_SPEC_ERRORS(
4,
"addListener",
" REACT_METHOD(addListener) void addListener(std::string eventName) noexcept { /* implementation */ }\n"
" REACT_METHOD(addListener) static void addListener(std::string eventName) noexcept { /* implementation */ }\n");
REACT_SHOW_METHOD_SPEC_ERRORS(
Integrate 11/18 RN Nightly Build 🎉 (#6572) * Integrate 11/18 RN Nightly Build 🎉 Fixes #5834 Fixes #6210 Fixes #6139 Fixes #6353 Commits Before November: https://github.com/facebook/react-native/compare/77f7658e4...0045621 Commits after November: https://github.com/facebook/react-native/compare/0045621...19d4cc2d4 Nightly builds were broken for a bit over a month, so this is a big change! This brings us a little bit past the base of 0.64-stable, but it should be easier to work backwards a week than to work forwards. https://github.com/facebook/react-native/commit/56c363e39af6488904cbfd2046314c45babeb0f4 splits some code for LinkingManager, and now only passes a native module handle to the NativeEventEmitter base class on iOS. This ends up being safe for us though, since NativeEventEmitter also only used the handle on iOS. With https://github.com/facebook/react-native/commit/d1ff2572d01a3b986bf923e5e0f7ba5c0db82f15 flow-typed npm definitions are published, and we can remove the copies in our repo. We instead copy from RN sources for validating against our fork. With https://github.com/facebook/react-native/commit/4d247fe058e3cefd557a166717a753683754f1c4 and https://github.com/facebook/react-native/commit/b5de89755d15bb9b2d5e8b350cd3c25f302ab71e, we can remove forked RNTester bits With https://github.com/facebook/react-native/commit/fb14fd42b3a35b9f587631952f5329c8ae27a4b6 upgrading detox, we can reenable macos tests https://github.com/facebook/react-native/commit/cb7f3f4499232797ce8e60b00270f30641923ddc#diff-52c4d910c19bf2495f29877042e1bbb6baa561230f3a21baa907cfce144f14e2 combined with https://github.com/facebook/react-native/commit/610dcf488ba67eace90f4847fdaeeb411e42ad09 and a couple other commits start optionally passing TurboModule schema from JS to native. From what I can tell this is only currently used for Android + JNI. https://github.com/facebook/react-native/commit/017bc911928472e20f37dd9512a2113a7d93c81b#diff-e6fd0c5b183586249abfad692ff206b7e6171057f2b31ceabf1a9d7fc96f82f3 adds a new Image method `prefetchWithMetadata` that we will want to implement. Tracked by #6571 Validated with a quick smoke test of RNTester on XAML (web debugging + in-engine) + NetUI. Plan to do some more exhaustive validation before stable branch creation. * Change files * Disable babel-plugin-codegen
2020-11-19 21:28:13 +03:00
5,
"removeListeners",
" REACT_METHOD(removeListeners) void removeListeners(double count) noexcept { /* implementation */ }\n"
" REACT_METHOD(removeListeners) static void removeListeners(double count) noexcept { /* implementation */ }\n");
}
};
} // namespace Microsoft::ReactNativeSpecs