Skip to content

Commit

Permalink
Merge pull request #711 from vorks/patch-1
Browse files Browse the repository at this point in the history
Improved LambdaHandler event typing
  • Loading branch information
waltjones authored Mar 25, 2019
2 parents 0ea6f38 + b44a08a commit 8663694
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ declare class Rollbar {

public captureEvent(metadata: object, level: Rollbar.Level): Rollbar.TelemetryEvent;

public lambdaHandler(handler: Rollbar.LambdaHandler): Rollbar.LambdaHandler;
public lambdaHandler<T = object>(handler: Rollbar.LambdaHandler<T>): Rollbar.LambdaHandler<T>;

public errorHandler(): Rollbar.ExpressErrorHandler;

Expand All @@ -32,7 +32,7 @@ declare class Rollbar {
}

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

0 comments on commit 8663694

Please sign in to comment.