Skip to content

Commit

Permalink
fix: fix type definition to work with async handler functions
Browse files Browse the repository at this point in the history
  • Loading branch information
waltjones committed May 7, 2020
1 parent 9b85887 commit 17810b0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ declare class Rollbar {
}

declare namespace Rollbar {
export type LambdaHandler<E = object> = (event: E, context: object, callback: Callback) => void;
export type LambdaHandler<TEvent = any, TResult = any> = (
event: TEvent,
context: Context,
callback: Callback<TResult>,
) => void | Promise<TResult>;
export type MaybeError = Error | undefined | null;
export type Level = "debug" | "info" | "warning" | "error" | "critical";
export interface Configuration {
Expand Down

0 comments on commit 17810b0

Please sign in to comment.