You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
868 B

#ifndef node_events_h
#define node_events_h
#include "node.h"
#include <v8.h>
namespace node {
class EventEmitter : public ObjectWrap {
16 years ago
public:
static void Initialize (v8::Handle<v8::Object> target);
static v8::Persistent<v8::FunctionTemplate> constructor_template;
bool Emit (const char *type, int argc, v8::Handle<v8::Value> argv[]);
protected:
EventEmitter () : ObjectWrap() { }
16 years ago
};
class Promise : public EventEmitter {
public:
static void Initialize (v8::Handle<v8::Object> target);
static v8::Persistent<v8::FunctionTemplate> constructor_template;
bool EmitSuccess (int argc, v8::Handle<v8::Value> argv[]);
bool EmitError (int argc, v8::Handle<v8::Value> argv[]);
16 years ago
static Promise* Create (void);
v8::Handle<v8::Object> Handle(void) { return handle_; }
16 years ago
protected:
Promise () : EventEmitter() { }
};
} // namespace node
#endif