Skip to content

Commit

Permalink
Merge pull request #3191 from LuisDuarte1/lduarte/WOR-427-better-types
Browse files Browse the repository at this point in the history
feat: better define step retry delay and step timeout types
  • Loading branch information
sidharthachatterjee authored Nov 29, 2024
2 parents 410b59c + 5d3b5ca commit 845a262
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions types/defines/rpc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,19 @@ declare module "cloudflare:workers" {
| `${number} ${WorkflowDurationLabel}${"s" | ""}`
| number;

export type WorkflowDelayDuration = WorkflowSleepDuration;

export type WorkflowTimeoutDuration = WorkflowSleepDuration;

export type WorkflowBackoff = "constant" | "linear" | "exponential";

export type WorkflowStepConfig = {
retries?: {
limit: number;
delay: string | number;
delay: WorkflowDelayDuration | number;
backoff?: WorkflowBackoff;
};
timeout?: string | number;
timeout?: WorkflowTimeoutDuration | number;
};

export type WorkflowEvent<T> = {
Expand Down

0 comments on commit 845a262

Please sign in to comment.