Summary: Refactor and introduce the Flipper module skeleton. No implementations yet. Reviewed By: passy Differential Revision: D36760620 fbshipit-source-id: 5e3f1b5abef6177f27d2c4c8e0fa8ec370364900
61 lines
1.5 KiB
C++
61 lines
1.5 KiB
C++
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <folly/dynamic.h>
|
|
#include <folly/json.h>
|
|
#include "JSValue.h"
|
|
#include "NativeModules.h"
|
|
|
|
using namespace winrt::Microsoft::ReactNative;
|
|
|
|
namespace winrt::ReactNativeFlipper {
|
|
|
|
REACT_MODULE(FlipperModule, L"Flipper")
|
|
struct FlipperModule {
|
|
REACT_INIT(Initialize)
|
|
void Initialize(ReactContext const& reactContext) noexcept {
|
|
m_reactContext = reactContext;
|
|
|
|
// Initialise flipper, etc.
|
|
}
|
|
|
|
REACT_METHOD(registerPlugin)
|
|
void registerPlugin(
|
|
std::string pluginId,
|
|
bool inBackground,
|
|
std::function<void(std::string)>&& callback) noexcept {}
|
|
|
|
REACT_METHOD(send)
|
|
void
|
|
send(std::string pluginId, std::string method, std::string data) noexcept {}
|
|
|
|
REACT_METHOD(reportErrorWithMetadata)
|
|
void reportErrorWithMetadata(
|
|
std::string pluginId,
|
|
std::string reason,
|
|
std::string stacktrace) noexcept {}
|
|
|
|
REACT_METHOD(reportError)
|
|
void reportError(std::string pluginId, std::string error) noexcept {}
|
|
|
|
REACT_METHOD(subscribe)
|
|
void subscribe(std::string pluginId, std::string method) noexcept {}
|
|
|
|
REACT_METHOD(respondSuccess)
|
|
void respondSuccess(std::string responderId, std::string data) noexcept {}
|
|
|
|
REACT_METHOD(respondError)
|
|
void respondError(std::string responderId, std::string data) noexcept {}
|
|
|
|
private:
|
|
ReactContext m_reactContext{nullptr};
|
|
};
|
|
|
|
} // namespace winrt::ReactNativeFlipper
|