@ahoo-wang/fetcher-eventbus 2.8.5 → 2.8.8

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.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![npm version](https://img.shields.io/npm/v/@ahoo-wang/fetcher-eventbus.svg)](https://www.npmjs.com/package/@ahoo-wang/fetcher-eventbus)
4
4
  [![Build Status](https://github.com/Ahoo-Wang/fetcher/actions/workflows/ci.yml/badge.svg)](https://github.com/Ahoo-Wang/fetcher/actions)
5
5
  [![codecov](https://codecov.io/gh/Ahoo-Wang/fetcher/graph/badge.svg?token=JGiWZ52CvJ)](https://codecov.io/gh/Ahoo-Wang/fetcher)
6
- [![License](https://img.shields.io/npm/l/@ahoo-wang/fetcher-eventbus.svg)](https://github.com/Ahoo-Wang/fetcher/blob/main/LICENSE)
6
+ [![License](https://img.shields.io/npm/l/@ahoo-wang/fetcher.svg)](https://github.com/Ahoo-Wang/fetcher/blob/main/LICENSE)
7
7
  [![npm downloads](https://img.shields.io/npm/dm/@ahoo-wang/fetcher-eventbus.svg)](https://www.npmjs.com/package/@ahoo-wang/fetcher-eventbus)
8
8
  [![npm bundle size](https://img.shields.io/bundlephobia/minzip/%40ahoo-wang%2Ffetcher-eventbus)](https://www.npmjs.com/package/@ahoo-wang/fetcher-eventbus)
9
9
  [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/Ahoo-Wang/fetcher)
package/README.zh-CN.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![npm version](https://img.shields.io/npm/v/@ahoo-wang/fetcher-eventbus.svg)](https://www.npmjs.com/package/@ahoo-wang/fetcher-eventbus)
4
4
  [![Build Status](https://github.com/Ahoo-Wang/fetcher/actions/workflows/ci.yml/badge.svg)](https://github.com/Ahoo-Wang/fetcher/actions)
5
5
  [![codecov](https://codecov.io/gh/Ahoo-Wang/fetcher/graph/badge.svg?token=JGiWZ52CvJ)](https://codecov.io/gh/Ahoo-Wang/fetcher)
6
- [![License](https://img.shields.io/npm/l/@ahoo-wang/fetcher-eventbus.svg)](https://github.com/Ahoo-Wang/fetcher/blob/main/LICENSE)
6
+ [![License](https://img.shields.io/npm/l/@ahoo-wang/fetcher.svg)](https://github.com/Ahoo-Wang/fetcher/blob/main/LICENSE)
7
7
  [![npm downloads](https://img.shields.io/npm/dm/@ahoo-wang/fetcher-eventbus.svg)](https://www.npmjs.com/package/@ahoo-wang/fetcher-eventbus)
8
8
  [![npm bundle size](https://img.shields.io/bundlephobia/minzip/%40ahoo-wang%2Ffetcher-eventbus)](https://www.npmjs.com/package/@ahoo-wang/fetcher-eventbus)
9
9
  [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/Ahoo-Wang/fetcher)
@@ -0,0 +1,16 @@
1
+ import { TypedEventBus } from './typedEventBus';
2
+ import { EventHandler, EventType } from './types';
3
+ export declare abstract class AbstractTypedEventBus<EVENT> implements TypedEventBus<EVENT> {
4
+ protected eventHandlers: EventHandler<EVENT>[];
5
+ abstract type: EventType;
6
+ /**
7
+ * Gets a copy of all registered event handlers, sorted by order
8
+ */
9
+ get handlers(): EventHandler<EVENT>[];
10
+ destroy(): void;
11
+ protected handleEvent(handler: EventHandler<EVENT>, event: EVENT): Promise<void>;
12
+ abstract emit(event: EVENT): Promise<void>;
13
+ abstract off(name: string): boolean;
14
+ abstract on(handler: EventHandler<EVENT>): boolean;
15
+ }
16
+ //# sourceMappingURL=abstractTypedEventBus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractTypedEventBus.d.ts","sourceRoot":"","sources":["../src/abstractTypedEventBus.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAElD,8BAAsB,qBAAqB,CAAC,KAAK,CAAE,YAAW,aAAa,CAAC,KAAK,CAAC;IAChF,SAAS,CAAC,aAAa,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,CAAM;IACpD,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IAEzB;;OAEG;IACH,IAAI,QAAQ,IAAI,YAAY,CAAC,KAAK,CAAC,EAAE,CAEpC;IAED,OAAO;cAIS,WAAW,CAAC,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAQtF,QAAQ,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC;IAE1C,QAAQ,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAEnC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,CAAC,KAAK,CAAC,GAAG,OAAO;CACnD"}
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  export * from './eventBus';
2
+ export * from './abstractTypedEventBus';
2
3
  export * from './parallelTypedEventBus';
3
4
  export * from './serialTypedEventBus';
4
5
  export * from './typedEventBus';
5
6
  export * from './broadcastTypedEventBus';
6
7
  export * from './types';
8
+ export * from './nameGenerator';
7
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,YAAY,CAAC;AAC3B,cAAc,yBAAyB,CAAC;AACxC,cAAc,yBAAyB,CAAC;AACxC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC"}