events-node: update EventParams type

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2024-05-22 14:25:31 +02:00
parent 6b148372c1
commit a90ce4aa39
4 changed files with 12 additions and 3 deletions
+4 -2
View File
@@ -14,10 +14,12 @@
* limitations under the License.
*/
import { JsonValue } from '@backstage/types';
/**
* @public
*/
export interface EventParams<TPayload = unknown> {
export interface EventParams<TPayload extends JsonValue = JsonValue> {
/**
* Topic for which this event should be published.
*/
@@ -29,5 +31,5 @@ export interface EventParams<TPayload = unknown> {
/**
* Metadata (e.g., HTTP headers and similar for events received from external).
*/
metadata?: Record<string, string | string[] | undefined>;
metadata?: { [name in string]?: string | string[] };
}