make EventParams typed for tidier event handling

Signed-off-by: Brian Fletcher <brian@roadie.io>
This commit is contained in:
Brian Fletcher
2023-02-02 11:45:01 +00:00
parent 98beb437a8
commit 19d4abf72c
2 changed files with 7 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-events-node': patch
---
Make `EventParams` typed for implementing tidier event handling.
+2 -2
View File
@@ -17,7 +17,7 @@
/**
* @public
*/
export interface EventParams {
export interface EventParams<PayloadType = unknown> {
/**
* Topic for which this event should be published.
*/
@@ -25,7 +25,7 @@ export interface EventParams {
/**
* Event payload.
*/
eventPayload: unknown;
eventPayload: PayloadType;
/**
* Metadata (e.g., HTTP headers and similar for events received from external).
*/