1 // Copyright 2022-present 650 Industries. All rights reserved.
2 
3 #pragma once
4 #ifdef __cplusplus
5 
6 #include <jsi/jsi.h>
7 
8 namespace jsi = facebook::jsi;
9 
10 namespace expo::common {
11 
12 /**
13  Converts `jsi::Array` to a vector with prop name ids (`std::vector<jsi::PropNameID>`).
14  */
15 std::vector<jsi::PropNameID> jsiArrayToPropNameIdsVector(jsi::Runtime &runtime, const jsi::Array &array);
16 
17 /**
18  Calls Object.defineProperty(jsThis, name, descriptor)`.
19  */
20 void definePropertyOnJSIObject(
21   jsi::Runtime &runtime,
22   jsi::Object *jsthis,
23   const char *name,
24   jsi::Object descriptor
25 );
26 
27 } // namespace expo::common
28 
29 #endif // __cplusplus
30