Skip to content

Commit

Permalink
fix type error for latest typescript, and simplify some things
Browse files Browse the repository at this point in the history
  • Loading branch information
trusktr committed Sep 15, 2024
1 parent d5d57c0 commit 07049a6
Show file tree
Hide file tree
Showing 16 changed files with 327 additions and 346 deletions.
18 changes: 1 addition & 17 deletions dist/Eventful.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import type { Constructor } from 'lowclass/dist/Constructor.js';
*/
export declare function Eventful<T extends Constructor>(Base?: T): {
new (...a: any[]): {
"__#1@#eventMap": Map<string, Set<[Function, any]>> | null;
/**
* @method on - Register a `callback` to be executed any
* time an event with name `eventName` is triggered by an instance of
Expand Down Expand Up @@ -72,23 +73,6 @@ export declare function Eventful<T extends Constructor>(Base?: T): {
* @param {data} any - The data that is passed to each callback subscribed to the event.
*/
emit(eventName: string, data?: any): void;
"__#1@#eventMap": Map<string, Array<[Function, any]>> | null;
};
} & T;
/**
* @decorator
* @function emits - This is a decorator that when used on a property in a
* class definition, causes setting of that property to emit the specified
* event, with the event payload being the property value. This decorator must
* be used in a class that extends from Eventful, otherwise an error is thrown.
*
* @example
* class Foo {
* @emits('propchange') foo = 123
* }
* const f = new Foo
* f.on('propchange', value => console.log('value: ', value))
* f.foo = 456 // logs "value: 456"
*/
export declare function emits(eventName: string): any;
//# sourceMappingURL=Eventful.d.ts.map
2 changes: 1 addition & 1 deletion dist/Eventful.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

171 changes: 21 additions & 150 deletions dist/Eventful.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/Eventful.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 07049a6

Please sign in to comment.