cloudflare / cloudflare/workerd

Extracting Ambient Module Types

Open
#3,648 1 comment 0 reactions 1 assignee Claimed by @workers-devprod View on GitHub
types
Dominant language
C++
Stars
8.7k
Forks
739
Avg merge
2d 20h
Merged PRs (30d)
174

Description

In projects where it is not feasible to add the worker types to tsconfig, but rather, import them, it works beautifully. Except there is no way to import the ambient module declarations, such as `cloudflare:email`, `cloudflare:sockets`, `cloudflare:workers`, `cloudflare:test`, etc.

It would be nice if these types were moved into a separate file so that ambient modules can be included in tsconfig without bringing in all of the other types. I'd like to import the others, but define the ambient modules globally in tsconfig, since the ambient modules are prefixed as `cloudflare:`, so they really do not come with any potential conflicts.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.