@tsed/event-emitter 7.79.3 → 7.80.0
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/lib/types-esm/EventEmitterModule.d.ts +16 -0
- package/lib/types-esm/decorators/onAny.d.ts +1 -0
- package/lib/types-esm/decorators/onEvent.d.ts +2 -0
- package/lib/types-esm/index.d.ts +9 -0
- package/lib/types-esm/interfaces/EventEmitterStore.d.ts +12 -0
- package/lib/types-esm/interfaces/interfaces.d.ts +17 -0
- package/lib/types-esm/services/EventEmitterFactory.d.ts +3 -0
- package/package.json +17 -14
- package/vitest.config.mts +21 -0
- package/lib/cjs/package.json +0 -3
- package/lib/esm/package.json +0 -3
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { InjectorService, LOGGER } from "@tsed/di";
|
|
2
|
+
import { EventEmitterService } from "./services/EventEmitterFactory.js";
|
|
3
|
+
export declare class EventEmitterModule {
|
|
4
|
+
protected logger: LOGGER;
|
|
5
|
+
protected injector: InjectorService;
|
|
6
|
+
protected eventEmitter: EventEmitterService;
|
|
7
|
+
private disableSummary;
|
|
8
|
+
private loadEventEmitter;
|
|
9
|
+
$onInit(): void;
|
|
10
|
+
$onReady(): void;
|
|
11
|
+
printEvents(): void;
|
|
12
|
+
private bindEventListeners;
|
|
13
|
+
private getListener;
|
|
14
|
+
private bindOn;
|
|
15
|
+
private bindOnAny;
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function OnAny(): MethodDecorator;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Automatically generated by @tsed/barrels.
|
|
3
|
+
*/
|
|
4
|
+
export * from "./decorators/onAny.js";
|
|
5
|
+
export * from "./decorators/onEvent.js";
|
|
6
|
+
export * from "./EventEmitterModule.js";
|
|
7
|
+
export * from "./interfaces/EventEmitterStore.js";
|
|
8
|
+
export * from "./interfaces/interfaces.js";
|
|
9
|
+
export * from "./services/EventEmitterFactory.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { event, eventNS, OnOptions } from "eventemitter2";
|
|
2
|
+
export interface EventEmitterStore {
|
|
3
|
+
onEvent?: {
|
|
4
|
+
[propertyKey: string]: {
|
|
5
|
+
event: event | eventNS;
|
|
6
|
+
options?: boolean | OnOptions;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
onAny?: {
|
|
10
|
+
[propertyKey: string]: {};
|
|
11
|
+
};
|
|
12
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ConstructorOptions } from "eventemitter2";
|
|
2
|
+
declare global {
|
|
3
|
+
namespace TsED {
|
|
4
|
+
interface Configuration {
|
|
5
|
+
eventEmitter?: {
|
|
6
|
+
/**
|
|
7
|
+
* Enable Event Emitter. Default `false`.
|
|
8
|
+
*/
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Disable event table displayed in the logger. Default `false`.
|
|
12
|
+
*/
|
|
13
|
+
disableSummary?: boolean;
|
|
14
|
+
} & ConstructorOptions;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
package/package.json
CHANGED
|
@@ -1,39 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/event-emitter",
|
|
3
|
-
"version": "7.79.3",
|
|
4
3
|
"description": "EventEmitter package for Ts.ED framework",
|
|
4
|
+
"type": "commonjs",
|
|
5
|
+
"version": "7.80.0",
|
|
5
6
|
"source": "./src/index.ts",
|
|
6
7
|
"main": "./lib/cjs/index.js",
|
|
7
8
|
"module": "./lib/esm/index.js",
|
|
8
9
|
"typings": "./lib/types/index.d.ts",
|
|
9
10
|
"browser": "./lib/browser/event-emitter.umd.min.js",
|
|
10
11
|
"exports": {
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./lib/types/index.d.ts",
|
|
14
|
+
"browser": "./lib/browser/event-emitter.umd.min.js",
|
|
15
|
+
"import": "./lib/esm/index.js",
|
|
16
|
+
"default": "./lib/cjs/index.js"
|
|
17
|
+
}
|
|
16
18
|
},
|
|
17
19
|
"scripts": {
|
|
18
20
|
"build": "yarn barrels && yarn build:ts && yarn run build:browser",
|
|
19
21
|
"build:browser": "webpack",
|
|
20
22
|
"barrels": "barrels",
|
|
21
|
-
"test": "
|
|
22
|
-
"build:ts": "tsc --build tsconfig.json
|
|
23
|
+
"test": "vitest run",
|
|
24
|
+
"build:ts": "tsc --build tsconfig.json",
|
|
25
|
+
"test:ci": "vitest run --coverage.thresholds.autoUpdate=true"
|
|
23
26
|
},
|
|
24
27
|
"dependencies": {
|
|
25
28
|
"tslib": "2.6.1"
|
|
26
29
|
},
|
|
27
30
|
"devDependencies": {
|
|
28
|
-
"@tsed/barrels": "7.
|
|
29
|
-
"@tsed/common": "7.
|
|
30
|
-
"@tsed/core": "7.
|
|
31
|
-
"@tsed/di": "7.
|
|
32
|
-
"@tsed/typescript": "7.
|
|
31
|
+
"@tsed/barrels": "7.80.0",
|
|
32
|
+
"@tsed/common": "7.80.0",
|
|
33
|
+
"@tsed/core": "7.80.0",
|
|
34
|
+
"@tsed/di": "7.80.0",
|
|
35
|
+
"@tsed/typescript": "7.80.0",
|
|
33
36
|
"eslint": "^8.57.0",
|
|
34
37
|
"eventemitter2": "^6.4.9",
|
|
35
|
-
"jest": "^29.7.0",
|
|
36
38
|
"typescript": "4.9.5",
|
|
39
|
+
"vitest": "2.0.4",
|
|
37
40
|
"webpack": "^5.75.0"
|
|
38
41
|
},
|
|
39
42
|
"peerDependencies": {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// @ts-ignore
|
|
2
|
+
import {presets} from "@tsed/vitest/presets";
|
|
3
|
+
import {defineConfig} from "vitest/config";
|
|
4
|
+
|
|
5
|
+
export default defineConfig(
|
|
6
|
+
{
|
|
7
|
+
...presets,
|
|
8
|
+
test: {
|
|
9
|
+
...presets.test,
|
|
10
|
+
coverage: {
|
|
11
|
+
...presets.test.coverage,
|
|
12
|
+
thresholds: {
|
|
13
|
+
statements: 0,
|
|
14
|
+
branches: 0,
|
|
15
|
+
functions: 0,
|
|
16
|
+
lines: 0
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
);
|
package/lib/cjs/package.json
DELETED
package/lib/esm/package.json
DELETED