Skip to content

Commit

Permalink
Merge pull request #126 from dobesv/patch-1
Browse files Browse the repository at this point in the history
Allow failed event handler to return Promise<void> or number
  • Loading branch information
SGrondin authored Jun 8, 2019
2 parents dfcb837 + fa6e034 commit 3166fec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bottleneck.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ declare module "bottleneck" {
on(name: "queued", fn: (info: Bottleneck.EventInfoQueued) => void): void;
on(name: "scheduled", fn: (info: Bottleneck.EventInfo) => void): void;
on(name: "executing", fn: (info: Bottleneck.EventInfoRetryable) => void): void;
on(name: "failed", fn: (error: any, info: Bottleneck.EventInfoRetryable) => Promise<number> | void): void;
on(name: "failed", fn: (error: any, info: Bottleneck.EventInfoRetryable) => Promise<number | void> | number | void): void;
on(name: "retry", fn: (message: string, info: Bottleneck.EventInfoRetryable) => void): void;
on(name: "done", fn: (info: Bottleneck.EventInfoRetryable) => void): void;

Expand All @@ -511,7 +511,7 @@ declare module "bottleneck" {
once(name: "queued", fn: (info: Bottleneck.EventInfoQueued) => void): void;
once(name: "scheduled", fn: (info: Bottleneck.EventInfo) => void): void;
once(name: "executing", fn: (info: Bottleneck.EventInfoRetryable) => void): void;
once(name: "failed", fn: (error: any, info: Bottleneck.EventInfoRetryable) => Promise<number> | void): void;
once(name: "failed", fn: (error: any, info: Bottleneck.EventInfoRetryable) => Promise<number | void> | number | void): void;
once(name: "retry", fn: (message: string, info: Bottleneck.EventInfoRetryable) => void): void;
once(name: "done", fn: (info: Bottleneck.EventInfoRetryable) => void): void;

Expand Down

0 comments on commit 3166fec

Please sign in to comment.