Skip to content

Commit df2085b

Browse files
committed
fix type error for latest typescript, and simplify some things
1 parent d5d57c0 commit df2085b

16 files changed

+328
-346
lines changed

dist/Eventful.d.ts

+4-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Constructor } from 'lowclass/dist/Constructor.js';
2+
declare const isEventful: unique symbol;
23
/**
34
* @mixin
45
* @class Eventful - An instance of Eventful emits events that code can
@@ -33,6 +34,7 @@ import type { Constructor } from 'lowclass/dist/Constructor.js';
3334
*/
3435
export declare function Eventful<T extends Constructor>(Base?: T): {
3536
new (...a: any[]): {
37+
"__#1@#eventMap": Map<string, Set<[Function, any]>> | null;
3638
/**
3739
* @method on - Register a `callback` to be executed any
3840
* 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): {
7274
* @param {data} any - The data that is passed to each callback subscribed to the event.
7375
*/
7476
emit(eventName: string, data?: any): void;
75-
"__#1@#eventMap": Map<string, Array<[Function, any]>> | null;
77+
[isEventful]: boolean;
7678
};
7779
} & 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 {};
9481
//# sourceMappingURL=Eventful.d.ts.map

dist/Eventful.d.ts.map

+1-1
Original file line numberDiff line numberDiff line change

dist/Eventful.js

+20-150
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/Eventful.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)