TypeScript
The
@cloudflare/workers-types
package provides the Service and DurableObjectNamespace types, each of which accepts a single type parameter for the server-side WorkerEntrypoint or DurableObject types.
Using higher-order types, we automatically generate client-side stub types (e.g., forcing all methods to be async).
For example: