1
1
import type { Constructor } from 'lowclass/dist/Constructor.js' ;
2
+ declare const isEventful : unique symbol ;
2
3
/**
3
4
* @mixin
4
5
* @class Eventful - An instance of Eventful emits events that code can
@@ -33,6 +34,7 @@ import type { Constructor } from 'lowclass/dist/Constructor.js';
33
34
*/
34
35
export declare function Eventful < T extends Constructor > ( Base ?: T ) : {
35
36
new ( ...a : any [ ] ) : {
37
+ "__#1@#eventMap" : Map < string , Set < [ Function , any ] > > | null ;
36
38
/**
37
39
* @method on - Register a `callback` to be executed any
38
40
* time an event with name `eventName` is triggered by an instance of
@@ -72,23 +74,8 @@ export declare function Eventful<T extends Constructor>(Base?: T): {
72
74
* @param {data } any - The data that is passed to each callback subscribed to the event.
73
75
*/
74
76
emit ( eventName : string , data ?: any ) : void ;
75
- "__#1@#eventMap" : Map < string , Array < [ Function , any ] > > | null ;
77
+ [ isEventful ] : boolean ;
76
78
} ;
77
79
} & T ;
78
- /**
79
- * @decorator
80
- * @function emits - This is a decorator that when used on a property in a
81
- * class definition, causes setting of that property to emit the specified
82
- * event, with the event payload being the property value. This decorator must
83
- * be used in a class that extends from Eventful, otherwise an error is thrown.
84
- *
85
- * @example
86
- * class Foo {
87
- * @emits ('propchange') foo = 123
88
- * }
89
- * const f = new Foo
90
- * f.on('propchange', value => console.log('value: ', value))
91
- * f.foo = 456 // logs "value: 456"
92
- */
93
- export declare function emits ( eventName : string ) : any ;
80
+ export { } ;
94
81
//# sourceMappingURL=Eventful.d.ts.map
0 commit comments