From d2a0b73be8b0fd0a4e52e90f5bd2b645df968b0d Mon Sep 17 00:00:00 2001 From: Jack Bates Date: Thu, 11 Feb 2021 15:13:23 -0700 Subject: [PATCH] fix(typescript): infer `TTransformed` from `createEventHandler()` options (#459) --- src/event-handler/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/event-handler/index.ts b/src/event-handler/index.ts index 0150f9ee..41058912 100644 --- a/src/event-handler/index.ts +++ b/src/event-handler/index.ts @@ -14,7 +14,7 @@ import { import { receiverHandle as receive } from "./receive"; import { removeListener } from "./remove-listener"; -interface EventHandler { +interface EventHandler { on( event: E | E[], callback: HandlerFunction @@ -28,7 +28,9 @@ interface EventHandler { receive(event: EmitterWebhookEvent): Promise; } -export function createEventHandler(options: Options): EventHandler { +export function createEventHandler( + options: Options +): EventHandler { const state: State = { hooks: {}, };