Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importable env types, take 2 #3703

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Importable env types, take 2 #3703

wants to merge 2 commits into from

Conversation

penalosa
Copy link
Contributor

This adds a namespaced type for importable env, Cloudflare.Env. This can be provided by a user .d.ts file via something like:

declare namespace Cloudflare {
 	interface Env {
 		string: 'hello world';
 		json: { key: 'value' };
 		SECRET: string;
	}
}

This will be generated by wrangler types in the near future

@penalosa penalosa requested review from a team as code owners March 12, 2025 14:49
Copy link

github-actions bot commented Mar 12, 2025

The generated output of @cloudflare/workers-types matches the snapshot in types/generated-snapshot 🎉

Copy link
Contributor

@hoodmane hoodmane left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. What was take 1?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants