Skip to content

Stricter generated types for Workflows in worker-configuration.d.ts #9436

@alexbilbie

Description

@alexbilbie

Describe the solution

When you have durable objects defined and run wrangler types then the following strict types will be generated in worker-configuration.d.ts

declare namespace Cloudflare {
	interface Env {
		MY_DURABLE_OBJECT: DurableObjectNamespace<import("./workers/my-script").MyDurableObject>;
		...
	}
}

When a workflow is defined the generated type is:

declare namespace Cloudflare {
	interface Env {
		MY_WORKFLOW: Workflow;
		...
	}
}

It would be really helpful to have something akin to this instead:

declare namespace Cloudflare {
	interface Env {
		MY_WORKFLOW: Workflow<MyWorkflowParams>;
		// or
		MY_WORKFLOW: import("./workers/my-script").MyWorkflow;
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions