Skip to content

🚀 Feature Request: RPC support in wrangler types across multiple scripts #6512

@helloimalastair

Description

@helloimalastair

Describe the solution

Would it be possible to get the wrangler types command to generate proper types for RPC-enabled bindings, when binding to a Worker/DO that is defined in a different script?
For example, Durable Object bindings pointing to a different script are always typed as

interface Env {
	DO_BINDING: DurableObjectNamespace;  /* MyDOClass from some-other-worker */;
}

which means that you cannot call any RPC methods on DO_BINDING stubs. Instead, it could be output as

interface Env {
	DO_BINDING: DurableObjectNamespace<import("../../apps/other-worker/src/index").MyDOClass>;
}

This would require a bit of work for determining the location of multiple Workers at once, and would not work when you do not have the source for all of your Workers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions