diff --git a/types/events.d.ts b/types/events.d.ts index 5c5fada3..445f9f29 100644 --- a/types/events.d.ts +++ b/types/events.d.ts @@ -10,21 +10,14 @@ interface Params { payload: Payload; } -// Consumers of this library should not care exactly what this is. Just that -// it's a lambda function which should be exported as a handler. -type LambdaFunction = unknown; - interface EventsOrQueues { publish(params: Params): Promise; publish( params: Params, callback: Callback, ): void; - subscribe( - handler: - | ((event: Event) => Promise) - | ((event: Event, callback: Callback) => void), - ): LambdaFunction; + subscribe(handler: (e: Event) => Promise): (e: Event) => Promise; + subscribe(handler: (e: Event, callback: Function) => void): (e: Event, context: any, callback: Function) => void; } export type ArcEvents = EventsOrQueues;