-
Notifications
You must be signed in to change notification settings - Fork 758
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for new bindings to wrangler types (#5089)
* Add support for new bindings to `wrangler types` * Actually Workers AI is also Fetcher * Add test * Add changeset * Format changelog * Use `unknown` for AI binding * Make bindings config type validation stricter * Fix typecheck failure as discussed
- Loading branch information
Showing
4 changed files
with
112 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
"wrangler": patch | ||
--- | ||
|
||
fix: include all currently existing bindings in `wrangler types` | ||
|
||
Add support for Email Send, Vectorize, Hyperdrive, mTLS, Browser Rendering and Workers AI bindings in `wrangler types` | ||
|
||
For example, from the following `wrangler.toml` setup: | ||
|
||
```toml | ||
[browser] | ||
binding = "BROWSER" | ||
|
||
[ai] | ||
binding = "AI" | ||
|
||
[[send_email]] | ||
name = "SEND_EMAIL" | ||
|
||
[[vectorize]] | ||
binding = "VECTORIZE" | ||
index_name = "VECTORIZE_NAME" | ||
|
||
[[hyperdrive]] | ||
binding = "HYPERDRIVE" | ||
id = "HYPERDRIVE_ID" | ||
|
||
[[mtls_certificates]] | ||
binding = "MTLS" | ||
certificate_id = "MTLS_CERTIFICATE_ID" | ||
``` | ||
|
||
Previously, nothing would have been included in the generated Environment. | ||
Now, the following will be generated: | ||
|
||
```ts | ||
interface Env { | ||
SEND_EMAIL: SendEmail; | ||
VECTORIZE: VectorizeIndex; | ||
HYPERDRIVE: Hyperdrive; | ||
MTLS: Fetcher; | ||
BROWSER: Fetcher; | ||
AI: Fetcher; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters