// Copyright © 2021-present 650 Industries, Inc. (aka Expo) #pragma once #include #include namespace jni = facebook::jni; namespace react = facebook::react; namespace expo { /** * A CPP part of the expo.modules.kotlin.jni.JNIFunctionBody class. * It represents the Kotlin's promise-less function. */ class JNIFunctionBody : public jni::JavaClass { public: static auto constexpr kJavaDescriptor = "Lexpo/modules/kotlin/jni/JNIFunctionBody;"; /** * Invokes a Kotlin's implementation of this function. * * @param args * @return result of the Kotlin function */ jni::local_ref invoke( jobjectArray args ); }; /** * A CPP part of the expo.modules.kotlin.jni.JNIAsyncFunctionBody class. * It represents the Kotlin's promise function. */ class JNIAsyncFunctionBody : public jni::JavaClass { public: static auto constexpr kJavaDescriptor = "Lexpo/modules/kotlin/jni/JNIAsyncFunctionBody;"; /** * Invokes a Kotlin's implementation of this async function. * * @param args * @param promise that will be resolve or rejected in the Kotlin's implementation */ void invoke( jobjectArray args, jobject promise ); }; } // namespace expo