2020-04-23 21:17:50 +03:00
|
|
|
|
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
|
2023-08-07 22:58:14 +03:00
|
|
|
#include <NativeModules.h>
|
2020-04-23 21:17:50 +03:00
|
|
|
#include <tuple>
|
|
|
|
|
|
|
|
namespace Microsoft::ReactNativeSpecs {
|
|
|
|
|
2024-01-23 00:01:09 +03:00
|
|
|
struct ImageLoaderAndroidSpec_ImageSize {
|
2023-01-10 22:19:17 +03:00
|
|
|
double width;
|
|
|
|
double height;
|
|
|
|
};
|
|
|
|
|
2023-08-07 22:58:14 +03:00
|
|
|
|
2024-01-23 00:01:09 +03:00
|
|
|
inline winrt::Microsoft::ReactNative::FieldMap GetStructInfo(ImageLoaderAndroidSpec_ImageSize*) noexcept {
|
2023-08-07 22:58:14 +03:00
|
|
|
winrt::Microsoft::ReactNative::FieldMap fieldMap {
|
2024-01-23 00:01:09 +03:00
|
|
|
{L"width", &ImageLoaderAndroidSpec_ImageSize::width},
|
|
|
|
{L"height", &ImageLoaderAndroidSpec_ImageSize::height},
|
2023-08-07 22:58:14 +03:00
|
|
|
};
|
|
|
|
return fieldMap;
|
|
|
|
}
|
|
|
|
|
2020-04-23 21:17:50 +03:00
|
|
|
struct ImageLoaderAndroidSpec : winrt::Microsoft::ReactNative::TurboModuleSpec {
|
|
|
|
static constexpr auto methods = std::tuple{
|
|
|
|
Method<void(double) noexcept>{0, L"abortRequest"},
|
2024-01-23 00:01:09 +03:00
|
|
|
Method<void(std::string, Promise<ImageLoaderAndroidSpec_ImageSize>) noexcept>{1, L"getSize"},
|
|
|
|
Method<void(std::string, ::React::JSValue, Promise<ImageLoaderAndroidSpec_ImageSize>) noexcept>{2, L"getSizeWithHeaders"},
|
2023-01-10 22:19:17 +03:00
|
|
|
Method<void(std::string, double, Promise<bool>) noexcept>{3, L"prefetchImage"},
|
2021-11-04 02:30:44 +03:00
|
|
|
Method<void(std::vector<std::string>, Promise<::React::JSValue>) noexcept>{4, L"queryCache"},
|
2020-04-23 21:17:50 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
template <class TModule>
|
|
|
|
static constexpr void ValidateModule() noexcept {
|
|
|
|
constexpr auto methodCheckResults = CheckMethods<TModule, ImageLoaderAndroidSpec>();
|
|
|
|
|
|
|
|
REACT_SHOW_METHOD_SPEC_ERRORS(
|
|
|
|
0,
|
|
|
|
"abortRequest",
|
2022-10-07 04:28:42 +03:00
|
|
|
" REACT_METHOD(abortRequest) void abortRequest(double requestId) noexcept { /* implementation */ }\n"
|
|
|
|
" REACT_METHOD(abortRequest) static void abortRequest(double requestId) noexcept { /* implementation */ }\n");
|
2020-04-23 21:17:50 +03:00
|
|
|
REACT_SHOW_METHOD_SPEC_ERRORS(
|
|
|
|
1,
|
|
|
|
"getSize",
|
2024-01-23 00:01:09 +03:00
|
|
|
" REACT_METHOD(getSize) void getSize(std::string uri, ::React::ReactPromise<ImageLoaderAndroidSpec_ImageSize> &&result) noexcept { /* implementation */ }\n"
|
|
|
|
" REACT_METHOD(getSize) static void getSize(std::string uri, ::React::ReactPromise<ImageLoaderAndroidSpec_ImageSize> &&result) noexcept { /* implementation */ }\n");
|
2020-04-23 21:17:50 +03:00
|
|
|
REACT_SHOW_METHOD_SPEC_ERRORS(
|
|
|
|
2,
|
|
|
|
"getSizeWithHeaders",
|
2024-01-23 00:01:09 +03:00
|
|
|
" REACT_METHOD(getSizeWithHeaders) void getSizeWithHeaders(std::string uri, ::React::JSValue && headers, ::React::ReactPromise<ImageLoaderAndroidSpec_ImageSize> &&result) noexcept { /* implementation */ }\n"
|
|
|
|
" REACT_METHOD(getSizeWithHeaders) static void getSizeWithHeaders(std::string uri, ::React::JSValue && headers, ::React::ReactPromise<ImageLoaderAndroidSpec_ImageSize> &&result) noexcept { /* implementation */ }\n");
|
2020-04-23 21:17:50 +03:00
|
|
|
REACT_SHOW_METHOD_SPEC_ERRORS(
|
|
|
|
3,
|
|
|
|
"prefetchImage",
|
2023-01-10 22:19:17 +03:00
|
|
|
" REACT_METHOD(prefetchImage) void prefetchImage(std::string uri, double requestId, ::React::ReactPromise<bool> &&result) noexcept { /* implementation */ }\n"
|
|
|
|
" REACT_METHOD(prefetchImage) static void prefetchImage(std::string uri, double requestId, ::React::ReactPromise<bool> &&result) noexcept { /* implementation */ }\n");
|
2020-04-23 21:17:50 +03:00
|
|
|
REACT_SHOW_METHOD_SPEC_ERRORS(
|
|
|
|
4,
|
|
|
|
"queryCache",
|
2022-10-07 04:28:42 +03:00
|
|
|
" REACT_METHOD(queryCache) void queryCache(std::vector<std::string> const & uris, ::React::ReactPromise<::React::JSValue> &&result) noexcept { /* implementation */ }\n"
|
|
|
|
" REACT_METHOD(queryCache) static void queryCache(std::vector<std::string> const & uris, ::React::ReactPromise<::React::JSValue> &&result) noexcept { /* implementation */ }\n");
|
2020-04-23 21:17:50 +03:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace Microsoft::ReactNativeSpecs
|