Skip to content

Commit

Permalink
Make callback the last arg for Workflow do
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthachatterjee committed Oct 10, 2024
1 parent 121f993 commit 67832e7
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions types/defines/rpc.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,22 @@ declare module "cloudflare:workers" {
};

export type WorkflowStep = {
do: <T extends Rpc.Serializable>(
name: string,
callback: () => Promise<T>,
config?: WorkflowStepConfig
) => Promise<T>;
do:
| (<T extends Rpc.Serializable>(
name: string,
callback: () => Promise<T>
) => Promise<T>)
| (<T extends Rpc.Serializable>(
name: string,
config: WorkflowStepConfig,
callback: () => Promise<T>
) => Promise<T>)
| (<T extends Rpc.Serializable>(
name: string,
config: WorkflowStepConfig | (() => Promise<T>),
callback?: () => Promise<T>
) => Promise<T>);

sleep: (name: string, duration: WorkflowSleepDuration) => Promise<void>;
};

Expand Down

0 comments on commit 67832e7

Please sign in to comment.