Skip to content

Commit

Permalink
Merge pull request #849 from rollbar/wj-lambda-type-definition
Browse files Browse the repository at this point in the history
Fix type definition to work with async handler functions
  • Loading branch information
waltjones authored May 12, 2020
2 parents 9b85887 + 17810b0 commit 6ed653b
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 6ed653b

Please sign in to comment.