Skip to content

Commit 8f5ed7f

Browse files
authored
Add DispatchNamespace as binding type (#3752)
* Add DispatchNamespace as binding type * Add changeset * Update type generation test with DispatchNamespace
1 parent 9d8509e commit 8f5ed7f

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.changeset/chilly-files-think.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"wrangler": patch
3+
---
4+
5+
Changed the binding type of WfP Dispatch Namespaces to `DispatchNamespace`

packages/wrangler/src/__tests__/type-generation.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ describe("generateTypes()", () => {
123123
D1_TESTING_SOMETHING: D1Database;
124124
SERVICE_BINDING: Fetcher;
125125
AE_DATASET_BINDING: AnalyticsEngineDataset;
126-
NAMESPACE_BINDING: any;
126+
NAMESPACE_BINDING: DispatchNamespace;
127127
LOGFWDR_SCHEMA: any;
128128
SOME_DATA_BLOB1: ArrayBuffer;
129129
SOME_DATA_BLOB2: ArrayBuffer;

packages/wrangler/src/type-generation.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ export async function generateTypes(
7575

7676
if (configToDTS.dispatch_namespaces) {
7777
for (const namespace of configToDTS.dispatch_namespaces) {
78-
envTypeStructure.push(`${namespace.binding}: any;`);
78+
envTypeStructure.push(`${namespace.binding}: DispatchNamespace;`);
7979
}
8080
}
8181

0 commit comments

Comments
 (0)