MethodCall.h 738 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #pragma once
  8. #include <map>
  9. #include <string>
  10. #include <vector>
  11. #include <folly/dynamic.h>
  12. namespace facebook {
  13. namespace react {
  14. struct MethodCall {
  15. int moduleId;
  16. int methodId;
  17. folly::dynamic arguments;
  18. int callId;
  19. MethodCall(int mod, int meth, folly::dynamic &&args, int cid)
  20. : moduleId(mod),
  21. methodId(meth),
  22. arguments(std::move(args)),
  23. callId(cid) {}
  24. };
  25. /// \throws std::invalid_argument
  26. std::vector<MethodCall> parseMethodCalls(folly::dynamic &&calls);
  27. } // namespace react
  28. } // namespace facebook