• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #ifndef TEST_JS_NATIVE_API_6_OBJECT_WRAP_MYOBJECT_H_
2 #define TEST_JS_NATIVE_API_6_OBJECT_WRAP_MYOBJECT_H_
3 
4 #include <js_native_api.h>
5 
6 class MyObject {
7  public:
8   static void Init(napi_env env, napi_value exports);
9   static void Destructor(napi_env env, void* nativeObject, void* finalize_hint);
10 
11  private:
12   explicit MyObject(double value_ = 0);
13   ~MyObject();
14 
15   static napi_value New(napi_env env, napi_callback_info info);
16   static napi_value GetValue(napi_env env, napi_callback_info info);
17   static napi_value SetValue(napi_env env, napi_callback_info info);
18   static napi_value PlusOne(napi_env env, napi_callback_info info);
19   static napi_value Multiply(napi_env env, napi_callback_info info);
20   static napi_ref constructor;
21   double value_;
22   napi_env env_;
23   napi_ref wrapper_;
24 };
25 
26 #endif  // TEST_JS_NATIVE_API_6_OBJECT_WRAP_MYOBJECT_H_
27