1 /*********************************************************************
2 * NAN - Native Abstractions for Node.js
4 * Copyright (c) 2017 NAN contributors
6 * MIT License <https://github.com/nodejs/nan/blob/master/LICENSE.md>
7 ********************************************************************/
9 #ifndef NAN_CALLBACKS_H_
10 #define NAN_CALLBACKS_H_
12 template<typename T> class FunctionCallbackInfo;
13 template<typename T> class PropertyCallbackInfo;
14 template<typename T> class Global;
16 typedef void(*FunctionCallback)(const FunctionCallbackInfo<v8::Value>&);
17 typedef void(*GetterCallback)
18 (v8::Local<v8::String>, const PropertyCallbackInfo<v8::Value>&);
19 typedef void(*SetterCallback)(
20 v8::Local<v8::String>,
22 const PropertyCallbackInfo<void>&);
23 typedef void(*PropertyGetterCallback)(
24 v8::Local<v8::String>,
25 const PropertyCallbackInfo<v8::Value>&);
26 typedef void(*PropertySetterCallback)(
27 v8::Local<v8::String>,
29 const PropertyCallbackInfo<v8::Value>&);
30 typedef void(*PropertyEnumeratorCallback)
31 (const PropertyCallbackInfo<v8::Array>&);
32 typedef void(*PropertyDeleterCallback)(
33 v8::Local<v8::String>,
34 const PropertyCallbackInfo<v8::Boolean>&);
35 typedef void(*PropertyQueryCallback)(
36 v8::Local<v8::String>,
37 const PropertyCallbackInfo<v8::Integer>&);
38 typedef void(*IndexGetterCallback)(
40 const PropertyCallbackInfo<v8::Value>&);
41 typedef void(*IndexSetterCallback)(
44 const PropertyCallbackInfo<v8::Value>&);
45 typedef void(*IndexEnumeratorCallback)
46 (const PropertyCallbackInfo<v8::Array>&);
47 typedef void(*IndexDeleterCallback)(
49 const PropertyCallbackInfo<v8::Boolean>&);
50 typedef void(*IndexQueryCallback)(
52 const PropertyCallbackInfo<v8::Integer>&);
55 typedef v8::Local<v8::AccessorSignature> Sig;
57 static const int kDataIndex = 0;
59 static const int kFunctionIndex = 1;
60 static const int kFunctionFieldCount = 2;
62 static const int kGetterIndex = 1;
63 static const int kSetterIndex = 2;
64 static const int kAccessorFieldCount = 3;
66 static const int kPropertyGetterIndex = 1;
67 static const int kPropertySetterIndex = 2;
68 static const int kPropertyEnumeratorIndex = 3;
69 static const int kPropertyDeleterIndex = 4;
70 static const int kPropertyQueryIndex = 5;
71 static const int kPropertyFieldCount = 6;
73 static const int kIndexPropertyGetterIndex = 1;
74 static const int kIndexPropertySetterIndex = 2;
75 static const int kIndexPropertyEnumeratorIndex = 3;
76 static const int kIndexPropertyDeleterIndex = 4;
77 static const int kIndexPropertyQueryIndex = 5;
78 static const int kIndexPropertyFieldCount = 6;
80 } // end of namespace imp
82 #if NODE_MODULE_VERSION > NODE_0_10_MODULE_VERSION
83 # include "nan_callbacks_12_inl.h" // NOLINT(build/include)
85 # include "nan_callbacks_pre_12_inl.h" // NOLINT(build/include)
88 #endif // NAN_CALLBACKS_H_