Skip to content

Commit

Permalink
Make params optional in create function in Workflow binding types
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthachatterjee committed Oct 10, 2024
1 parent c73705a commit 7491635
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/cloudflare/internal/workflows-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ class WorkflowImpl {
return new InstanceImpl(result.instanceId, this.fetcher);
}

public async create(id: string, params: object): Promise<Instance> {
public async create(id: string, params?: unknown): Promise<Instance> {
const result = await callFetcher<{ instanceId: string }>(
this.fetcher,
'/create',
Expand Down
4 changes: 2 additions & 2 deletions src/cloudflare/internal/workflows.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ declare abstract class Workflow {
/**
* Create a new instance and return a handle to it. If a provided id exists, an error will be thrown.
* @param id Id to create the instance of this Workflow with
* @param params The payload to send over to this instance
* @param params Optional params to send over to this instance
* @returns A promise that resolves with a handle for the Instance
*/
public create(id: string, params: object): Promise<Instance>;
public create(id: string, params?: unknown): Promise<Instance>;
}

type InstanceStatus = {
Expand Down

0 comments on commit 7491635

Please sign in to comment.