MIRROR: javascript for 馃悳's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at type-hints-typescript 61 lines 1.3 kB view raw
1#ifndef EVENTS_H 2#define EVENTS_H 3 4#include <stdbool.h> 5#include "types.h" 6 7#define EVENTS_DEFAULT_MAX_LISTENERS 10 8 9ant_value_t events_library(ant_t *js); 10ant_value_t eventemitter_prototype(ant_t *js); 11 12void init_events_module(void); 13void js_dispatch_global_event(ant_t *js, ant_value_t event_obj); 14 15bool eventemitter_add_listener( 16 ant_t *js, 17 ant_value_t target, const char *event_type, 18 ant_value_t listener, bool once 19); 20 21bool eventemitter_add_listener_val( 22 ant_t *js, 23 ant_value_t target, ant_value_t key, 24 ant_value_t listener, bool once 25); 26 27bool eventemitter_emit_args( 28 ant_t *js, 29 ant_value_t target, const char *event_type, 30 ant_value_t *args, int nargs 31); 32 33bool eventemitter_emit_args_val( 34 ant_t *js, 35 ant_value_t target, ant_value_t key, 36 ant_value_t *args, int nargs 37); 38 39bool eventemitter_remove_listener( 40 ant_t *js, 41 ant_value_t target, const char *event_type, 42 ant_value_t listener 43); 44 45bool eventemitter_remove_listener_val( 46 ant_t *js, 47 ant_value_t target, ant_value_t key, 48 ant_value_t listener 49); 50 51ant_offset_t eventemitter_listener_count( 52 ant_t *js, 53 ant_value_t target, const char *event_type 54); 55 56ant_offset_t eventemitter_listener_count_val( 57 ant_t *js, 58 ant_value_t target, ant_value_t key 59); 60 61#endif