asljs-eventful 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,11 @@
1
- import type { EventfulFn } from './types.js';
1
+ import type { EventMap, Eventful, EventfulFn, EventfulOptions } from './types.js';
2
2
  export declare const eventful: EventfulFn;
3
+ export declare class EventfulBase<E extends EventMap = EventMap> implements Eventful<E> {
4
+ on: Eventful<E>['on'];
5
+ once: Eventful<E>['once'];
6
+ off: Eventful<E>['off'];
7
+ emit: Eventful<E>['emit'];
8
+ emitAsync: Eventful<E>['emitAsync'];
9
+ has: Eventful<E>['has'];
10
+ constructor(options?: EventfulOptions);
11
+ }
package/dist/eventful.js CHANGED
@@ -146,3 +146,8 @@ const eventfulImpl = (object = Object.create(null), options = {}) => {
146
146
  };
147
147
  export const eventful = eventfulImpl;
148
148
  eventful(eventful);
149
+ export class EventfulBase {
150
+ constructor(options = {}) {
151
+ eventful(this, options);
152
+ }
153
+ }
package/eventful.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export {
2
- eventful
2
+ eventful,
3
+ type EventfulBase
3
4
  } from './dist/eventful.js';
4
5
 
5
6
  export type {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asljs-eventful",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Lightweight event helper adding on/off/emit to any object.",
5
5
  "files": [
6
6
  "dist/**",